NintendoAge http://nintendoage.com/forum/ -Sqooner Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2016-01-23T17:54:42 -05.00 MetalSlime 12 Originally posted by: thefox
 
Originally posted by: rizz

For some reason, I have to do a write to $400F (any value) prior to my write to $400E. Any clue as to why?

I believe I've said it before, but these tutorials are fantastic.

I've also been wondering why this is (even when length counter is disabled and using the constant volume flag for the envelope). Haven't been able to find an explanation for it from any of the available APU docs. Going to answer myself here. I'm guessing that the $400F write is needed because the length counter might be initially holding a 0 value -- the $400F write will reload a non-zero value into the length counter (and the length counter's halt flag will then keep it at a non-zero value).

You don't see this problem with the pulse channels because the pulse's "length counter load" is in the same register ($4003/$4007) as the high 3 bits of period, so the length counter reload will happen as a side-effect of writing those high 3 bits.

Also, since the length counter value is read from a lookup table which doesn't contain zeros, the written value is irrelevant (if the length counter halt flag is set).

EDIT: Just as a further note, even if length counter is not used, the zero value in it is a problem because it will unconditionally silence the channel.
EDIT #2: Accidentally had written "$400E write", not "$400F write". Fixed. ]]>
Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2016-01-23T17:34:38 -05.00 MetalSlime 12 Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2011-08-29T01:05:13 -05.00 MetalSlime 12 Originally posted by: rizz

For some reason, I have to do a write to $400F (any value) prior to my write to $400E. Any clue as to why?

I believe I've said it before, but these tutorials are fantastic.
I've also been wondering why this is (even when length counter is disabled and using the constant volume flag for the envelope). Haven't been able to find an explanation for it from any of the available APU docs.
]]>
Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-06-04T02:02:34 -05.00 MetalSlime 12
I believe I've said it before, but these tutorials are fantastic. ]]>
Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-05-17T16:37:20 -05.00 MetalSlime 12 Seriously, though, good job. I can't imagine the time investment that you put into these. This is a great asset to the programming community. ]]> Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-02-08T15:34:54 -05.00 MetalSlime 12
Cheers! ]]>
Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-01-20T01:40:50 -05.00 MetalSlime 12 Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-01-20T01:17:18 -05.00 MetalSlime 12 Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-01-19T05:26:39 -05.00 MetalSlime 12 Nerdy Nights Sound: Part 10 http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=27943 2010-01-19T03:48:13 -05.00 MetalSlime 12