Pulse channel waveform pointer

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Pulse channel waveform pointer
by on (#123569)
I know that certain writes to certain regs, of the pulse channel, reset the starting position of the 'playback' pointer - if you will.

If there any way 'walk' the pointer without turning off the channel or resetting the pointer position? $4003/$4007 writes reset the pointer, or do $4000/4004 writes reset it as well? Maybe something like a combination of writing to $4002/4006 (same value) and $4001/5 with SSS=0? Or $4017 rapid change abuse (though that would probably effect all channels, if it did something. I'm more interesting in advancing the pointer, without changing the period value, in one channel only)?
Re: Pulse channel waveform pointer
by on (#123584)
You mean increment it immediately? Not that I recall. As I remember, the channel timer reloads only on expiration, so you can't even immediately increment it by changing the period to the lowest value unless you previously set the period low and gave it time to be reloaded.

I'm curious as to purpose. Is this to start to pulse waves with a known phase difference, without having to start one, delay, then start the other?
Re: Pulse channel waveform pointer
by on (#123585)
If you want to explicitly control the output of a pulse channel, you can set a low frequency and continually reset a duty 3 pulse channel to make it output a constant 1 (or use duty 0-2 to output 0).

If you want a particular phase, if you can reliably time your writes to the APU you could reset the phase and then advance it by playing a carefully calculated frequency on it for a carefully calculated amount of time, I guess.

What are you trying to do with this?
Re: Pulse channel waveform pointer
by on (#123598)
I was thinking of a way to specifically control the timing between two synced pulse channels. Instead of just setting a small difference in period values between them and let the detune run its course, I thinking more a way to have complete control over the 'detune' phase of the channels. The TG16 has an undocumented feature/effect/bug? that lets you walk the channels waveform pointer by +1 - without resetting anything else on the channel (and without writing to channel waveform memory). This is a cleaner method than simply advancing the channel's waveform pointer with an period update (faster or slower) followed by an immediate write to set the period back; advancing or retarding the phase relation between the two channels. But writes to the MSB of the channel's period, on the NES, reset the wave pointer to 0 - right? Or is that only on the triangle channel?
Re: Pulse channel waveform pointer
by on (#123600)
tomaitheous wrote:
But writes to the MSB of the channel's period, on the NES, reset the wave pointer to 0 - right? Or is that only on the triangle channel?

Only on the pulse channels. It doesn't happen on the triangle channel.