In Brad Taylor's NESSOUND document http://nesdev.com/NESSOUND.txt it states:
"During count sequences 0..3, the linear (triangle) and envelope decay (square & noise) counters recieve a clock for each count. This means that both these counters are clocked once immediately after $4017.7 is written with a value of 1."
And in Blargg's APU reference doc http://nesdev.com/apu_ref.txt it states:
"If the mode flag is clear, the 4-step sequence is selected, otherwise the
5-step sequence is selected and the sequencer is immediately clocked once."
It seems like there is something "special" about the 5-step sequence (mode 1) and ensuring that it is clocked *immediately*, but I can't figure out what it is. If you look at the following diagram in Blargg's document, the envelope and linear counters (specified with the 'e') get updated in both 4-step mode and 5-step mode *immediately* in step 0. What is so special about the 5-step mode??
In other words, as I understand it, if I write a 0 to $4017.7, then the envelope and linear counters will be immediately updated for the 4-step mode (as shown above). And if I write a 1 to $4017.7, then the envelope, linear counters, length and sweep units will all be immediately updated for the 5-step mode (as shown above). So whether you write a 0 or a 1 to 4017.7, both modes have some "immediate" effect......so what's the big deal about stressing the 5-step mode?
------
And one more question while I'm at it - this might have something to do with the above question but I can't be sure. Does anyone know why Brad Taylor specifies the following counter sequence for mode 0?
It seems like Brad is trying to say that you should not clock the envelope or linear counters when you initially write 0 to $4017.7 (since a step #4 in mode 0 doesn't even exist). Funny thing about this is that Blargg doesn't mention anything about this 1 cycle "delay" for mode 0 in his document, which is adding to my confusion.
Thanks for the help!!
P.S. My website is finally back up now! https://rm-rfroot.net/nes_fpga/
"During count sequences 0..3, the linear (triangle) and envelope decay (square & noise) counters recieve a clock for each count. This means that both these counters are clocked once immediately after $4017.7 is written with a value of 1."
And in Blargg's APU reference doc http://nesdev.com/apu_ref.txt it states:
"If the mode flag is clear, the 4-step sequence is selected, otherwise the
5-step sequence is selected and the sequencer is immediately clocked once."
It seems like there is something "special" about the 5-step sequence (mode 1) and ensuring that it is clocked *immediately*, but I can't figure out what it is. If you look at the following diagram in Blargg's document, the envelope and linear counters (specified with the 'e') get updated in both 4-step mode and 5-step mode *immediately* in step 0. What is so special about the 5-step mode??
Code:
f = set interrupt flag
l = clock length counters and sweep units
e = clock envelopes and triangle's linear counter
mode 0: 4-step effective rate (approx)
---------------------------------------
- - - f 60 Hz
- l - l 120 Hz
e e e e 240 Hz
mode 1: 5-step effective rate (approx)
---------------------------------------
- - - - - (interrupt flag never set)
l - l - - 96 Hz
e e e e - 192 Hz
l = clock length counters and sweep units
e = clock envelopes and triangle's linear counter
mode 0: 4-step effective rate (approx)
---------------------------------------
- - - f 60 Hz
- l - l 120 Hz
e e e e 240 Hz
mode 1: 5-step effective rate (approx)
---------------------------------------
- - - - - (interrupt flag never set)
l - l - - 96 Hz
e e e e - 192 Hz
In other words, as I understand it, if I write a 0 to $4017.7, then the envelope and linear counters will be immediately updated for the 4-step mode (as shown above). And if I write a 1 to $4017.7, then the envelope, linear counters, length and sweep units will all be immediately updated for the 5-step mode (as shown above). So whether you write a 0 or a 1 to 4017.7, both modes have some "immediate" effect......so what's the big deal about stressing the 5-step mode?
------
And one more question while I'm at it - this might have something to do with the above question but I can't be sure. Does anyone know why Brad Taylor specifies the following counter sequence for mode 0?
Code:
$4017.7 sequence
------- --------
0 4, 0,1,2,3, 0,1,2,3,..., etc.
1 0,1,2,3,4, 0,1,2,3,4,..., etc.
------- --------
0 4, 0,1,2,3, 0,1,2,3,..., etc.
1 0,1,2,3,4, 0,1,2,3,4,..., etc.
It seems like Brad is trying to say that you should not clock the envelope or linear counters when you initially write 0 to $4017.7 (since a step #4 in mode 0 doesn't even exist). Funny thing about this is that Blargg doesn't mention anything about this 1 cycle "delay" for mode 0 in his document, which is adding to my confusion.

Thanks for the help!!
P.S. My website is finally back up now! https://rm-rfroot.net/nes_fpga/