Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In NSF export, DPCM notes reset Vxx duty cycle of Pulse 1 #311

Open
nyanpasu64 opened this issue Dec 24, 2024 · 3 comments · May be fixed by #262
Open

In NSF export, DPCM notes reset Vxx duty cycle of Pulse 1 #311

nyanpasu64 opened this issue Dec 24, 2024 · 3 comments · May be fixed by #262
Assignees
Labels
bug Something isn't working nsf-driver sound engine used in NSF/assembly file export

Comments

@nyanpasu64
Copy link
Collaborator

In NSF export, after playing a DPCM note, the Vxx value of Pulse 1 resets to V00 for the next pulse note. The Vxx of Pulse 2 is not corrupted.

Test case: nsf Vxx dpcm bug.zip

The NSF export bug happens in both main, and #262 rebased on main.

@Gumball2415 Gumball2415 self-assigned this Dec 25, 2024
@Gumball2415 Gumball2415 added bug Something isn't working nsf-driver sound engine used in NSF/assembly file export labels Dec 25, 2024
@Gumball2415
Copy link
Collaborator

Gumball2415 commented Dec 25, 2024

there is a stray F volume next to the DPCM note, thus being exported as a volume command. for some reason this is not rendered in the pattern editor.

volume commands affect volume slide channel arrays var_ch_VolSlide and var_ch_VolSlideTarget. they get reset to #$00 and #$80 respectively upon a new volume command.

var_ch_VolSlide and var_ch_VolSlideTarget is reserved with size EFF_CHANS (pulse 1 and 2, triangle, noise in this case).

in processing the stray volume command on the DPCM channel, this causes var_ch_VolSlideTarget+4 to be written with #$80, which is where var_ch_DutyDefault is.

setting var_ch_DutyDefault to this value effectively resets the duty cycle back to 0 (since #$80 & #$03 is being written as pulse 1 duty cycle).

@Gumball2415
Copy link
Collaborator

can you test if this build fixes the issue?
https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker/actions/runs/12496933751

@Gumball2415 Gumball2415 linked a pull request Dec 25, 2024 that will close this issue
@nyanpasu64
Copy link
Collaborator Author

can you test if this build fixes the issue? https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker/actions/runs/12496933751

Bug seems to not occur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nsf-driver sound engine used in NSF/assembly file export
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants