Hello!
I've got some questions about the Length Counter that I can't seem to resolve by reading PanDocs, GBSSOUND.txt, http://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware(Wiki) and other sources.
Q1: Is the "enabled flag" that's mentioned in the Wiki the same as the length enable flag in bit 6 of NRx4?
Q2: I currently have the following logic for outputting the current waveform. Is this logic correct?
(I have removed other details such as duty, LFSR, DAC power, etc. to make it simple.)
Q2.5: I'm using the same logic for NR52's status bits. (1 if length != 0 || !length_enable, 0 otherwise.) Is this also correct?
Q3: The Wiki mentioned that when a channel is triggered it becomes enabled. Does this mean enabling length_enable (bit 6 of NRx4) OR the "enabled flag" that's mentioned in the Wiki?
EDIT: Add Q4.
Q4: During a trigger event, if the length counter is 0, it is set to either 64(square and noise) or 256(wave). Aren't 63 or 255 the correct values?
Thank you!
I've got some questions about the Length Counter that I can't seem to resolve by reading PanDocs, GBSSOUND.txt, http://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware(Wiki) and other sources.
Q1: Is the "enabled flag" that's mentioned in the Wiki the same as the length enable flag in bit 6 of NRx4?
Q2: I currently have the following logic for outputting the current waveform. Is this logic correct?
(I have removed other details such as duty, LFSR, DAC power, etc. to make it simple.)
Code:
if (length != 0 || !length_enable)
output current_volume
else
output 0
output current_volume
else
output 0
Q2.5: I'm using the same logic for NR52's status bits. (1 if length != 0 || !length_enable, 0 otherwise.) Is this also correct?
Q3: The Wiki mentioned that when a channel is triggered it becomes enabled. Does this mean enabling length_enable (bit 6 of NRx4) OR the "enabled flag" that's mentioned in the Wiki?
EDIT: Add Q4.
Q4: During a trigger event, if the length counter is 0, it is set to either 64(square and noise) or 256(wave). Aren't 63 or 255 the correct values?
Thank you!