APU Reset Delay?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
APU Reset Delay?
by on (#57940)
I found this in BT's nessound.txt:

Quote:
After resetting the 2A03, the first time any sound channel(s) length counter contains a non-zero value (channel is enabled), there will be a 2048 CPU clock cycle delay before any of the sound hardware is clocked. After the 2K clock cycles go by, the NES sound hardware will be clocked normally. This phenomenon only occurs prior to a system reset, and only occurs during the first 2048 CPU clocks after the activation of any of the 4 basic sound channels.


Is this delay something that really needs to be emulated? I don't see how it would make any difference.... Haha, but then again (for some strange reason) I wouldn't be surprised if some games actually relied on this "feature" somehow. :-P

Pz!

by on (#57952)
Like I said before, don't read the old docs, because they're badly wrong in some areas.
ok
by on (#57953)
In this particular case I didn't know if I should assume it was completely wrong since there isn't even a mention of it in your doc or the Wiki at all. In other words, there was nothing to "conflict" with the statement so that doesn't necessarily mean it is wrong. But apparently it is! LOL.

So I guess I should really just delete BT's document from my machine all together considering the flak I keep getting from even mentioning it. Haha.

Pz! :)

Jonathon

by on (#57982)
My APU reference documents the NES APU, not previous and inaccurate APU documents. It'd be sort of like a scientist saying there is no Santa Claus, Easter Bunny, and Tooth Fairy in a book about the physical universe. These are figments of some people's imaginations.

I suppose it wouldn't be a bad idea to add a "Myths" section for the APU, PPU, etc. to dispel these things. It'd be helpful for people who incorporated them in their emulators, and now need them specifically debunked rather than merely not mentioned.

by on (#57987)
Well, however I think it's NOT a myth that the PPU takes time to warm up and isn't functionnal for the first 2 frames or so.
WHA???
by on (#57989)
WHAT?! There's no tooth fairy?!?!?!?!? :'(



LOL, but in all seriousness, a "Myths" section would be very useful.

by on (#57990)
blargg wrote:
It'd be sort of like a scientist saying there is no Santa Claus, Easter Bunny, and Tooth Fairy in a book about the physical universe. These are figments of some people's imaginations.

Santa Claus existed, but he died over 16 centuries ago. Tooth fairies exist, but a tooth fairy is just a DDS who happens to be gay.

Quote:
I suppose it wouldn't be a bad idea to add a "Myths" section for the APU, PPU, etc. to dispel these things.

Great idea. Start here.

Bregalad wrote:
Well, however I think it's NOT a myth that the PPU takes time to warm up and isn't functionnal for the first 2 frames or so.

Blocked writes to the PPU after reset are not a myth.
LOL
by on (#57993)
Quote:
Tooth fairies exist, but a tooth fairy is just a DDS who happens to be gay.

LOLOLOL - Tepples is too funny! :-P

by on (#57995)
tepples wrote:
Quote:
I suppose it wouldn't be a bad idea to add a "Myths" section for the APU, PPU, etc. to dispel these things.

Great idea. Start here.

Cool, can I add "You have to use $2006 in order to scroll" to the list? We get a lot of people asking about loopy's doc just because they want to do some basic scrolling. We also get lots of newbies writing 0's to $2006 in their first programs as a desperate measure to keep the screen stable.

jwdonal wrote:
LOLOLOL - Tepples is too funny! :-P

Yeah, get used to it.

by on (#58000)
tokumaru: Done, and thanks for the suggestion.

As far as I can tell, this apparent 2000 cycle delay might have had something to do with the initial values of the channels' timers.

by on (#58001)
tepples wrote:
2000 cycle delay might have had something to do with the initial values of the channels' timers.


Hmm, that would actually make a lot of sense since the timer is just a divider based off of the CPU clock and it can take quite a few CPU clock cycles before the first APU clock "tick" is ever seen depending on what the timer's period value is set to. I think tepples has got something here.

If tepples is right, it is nothing that you have to "try" to emulate. It's just going to happen by the inherent nature of the timer itself.

by on (#58009)
Excellent, tepples, I bet you're right, and the power-up value for the timer was all bits set on the NES used for writing that older doc. So I retract some of my criticism of it. And jwdonal, maybe you can continue to read the old doc if you still feel compelled to, so we can find more things to add to the myths section.
very cool
by on (#58010)
blargg wrote:
Excellent, tepples, I bet you're right,

Yes, I agree. I believe this mystery is solved.

Quote:
and the power-up value for the timer was all bits set on the NES used for writing that older doc.

So different NES' have different timer power up values then? Is it OK if my timer power up values are all zeros? Or should I make them reset to all ones just to be safe?

Quote:
And jwdonal, maybe you can continue to read the old doc if you still feel compelled to, so we can find more things to add to the myths section.

Can do.