How to clear APU sweep unit reload flag

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
Boolean
Posts: 87
Joined: Thu Jan 02, 2014 7:58 am

How to clear APU sweep unit reload flag

Post by Boolean »

wiki says(Sorry,I'm not sure it should be says or say or said) Each sweep unit contains the following: divider, reload flag.
The reload flag is set when write $4001 or $4005.
But when clear it?
Thanks for your answer.
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Re: How to clear APU sweep unit reload flag

Post by Disch »

It gets reset (cleared) when the Sweep Unit is clocked by the Frame Sequencer.
Boolean
Posts: 87
Joined: Thu Jan 02, 2014 7:58 am

Re: How to clear APU sweep unit reload flag

Post by Boolean »

Disch wrote:It gets reset (cleared) when the Sweep Unit is clocked by the Frame Sequencer.
It seems no. wiki describes SET only. Please see the pic.
Attachments
Noname.png
lidnariq
Posts: 10677
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: How to clear APU sweep unit reload flag

Post by lidnariq »

nesdevwiki wrote:If the reload flag is set, the divider's counter is set to the period P. If the divider's counter was zero before the reload and the sweep is enabled, the pulse's period is also adjusted (if the target period is in range; see below).
I think there is a missing "The reload flag is then cleared" after the above quoted text, but I am not familiar with the mechanism of the sweep units.
Boolean
Posts: 87
Joined: Thu Jan 02, 2014 7:58 am

Re: How to clear APU sweep unit reload flag

Post by Boolean »

Thanks to everyone. I decide to read neswiki, 2A03 technical reference and apu_ref simultaneously to seek the result.
User avatar
rainwarrior
Posts: 8062
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: How to clear APU sweep unit reload flag

Post by rainwarrior »

Yes, the reload flag is cleared when the sweep unit is clocked. I will add that to the text.

If you want to clear the reload flag, you can manually clock the APU frame sequencer by writing $4017 with bit 7 set.
Boolean
Posts: 87
Joined: Thu Jan 02, 2014 7:58 am

Re: How to clear APU sweep unit reload flag

Post by Boolean »

rainwarrior wrote:Yes, the reload flag is cleared when the sweep unit is clocked. I will add that to the text.

If you want to clear the reload flag, you can manually clock the APU frame sequencer by writing $4017 with bit 7 set.
Thank you. Recently, I am implementing APU for my emulator, so I try my best to confirm any info about APU.
Post Reply