nesdev.com
http://forums.nesdev.com/

APU savestate restore?
http://forums.nesdev.com/viewtopic.php?f=3&t=14523
Page 1 of 1

Author:  Zepper [ Mon Jul 11, 2016 4:01 pm ]
Post subject:  APU savestate restore?

In my emulator, a few games produce a stalled sound when a savestate is restored. After a quick check, I noticed that active time left counters (ATL, $40xF regs) must be zero on reload. It fixes the problem, but is this correct?

Author:  mikejmoffitt [ Mon Jul 11, 2016 5:16 pm ]
Post subject:  Re: APU savestate restore?

Clearing the timers would just silence a sound in progress, wouldn't it? If you aren't, then the correct solution may be to include the APU state fully in your savestates, and restore the timers based on that.

Author:  Zepper [ Mon Jul 11, 2016 5:58 pm ]
Post subject:  Re: APU savestate restore?

mikejmoffitt wrote:
Clearing the timers would just silence a sound in progress, wouldn't it? If you aren't, then the correct solution may be to include the APU state fully in your savestates, and restore the timers based on that.

No and nope. :|
My emulator already saves the complete APU state & restores it. Just to make crystal clear - if there's a music playing and I restore a savestate, there is a big chance of squares & noise channels to continue playing. The solution is clearing the current ATL values, ignoring the saved ones. I wonder if this is correct...

Author:  tepples [ Mon Jul 11, 2016 6:10 pm ]
Post subject:  Re: APU savestate restore?

If squares and noise were playing when you saved the state, you want them to resume playing in the same manner when you reload the state.

Author:  Zepper [ Mon Jul 11, 2016 6:22 pm ]
Post subject:  Re: APU savestate restore?

tepples wrote:
If squares and noise were playing when you saved the state, you want them to resume playing in the same manner when you reload the state.

If squares and noise were not playing when you saved the state, you want them to continue silenced in the same manner when you reload the state, no matter if they're currently playing before a state loading.

Author:  tepples [ Mon Jul 11, 2016 6:27 pm ]
Post subject:  Re: APU savestate restore?

Then your saving or restoration of something in the channels' state is broken.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/