It is currently Mon Dec 11, 2017 7:51 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: APU savestate restore?
PostPosted: Mon Jul 11, 2016 4:01 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
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?


Top
 Profile  
 
PostPosted: Mon Jul 11, 2016 5:16 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1311
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.


Top
 Profile  
 
PostPosted: Mon Jul 11, 2016 5:58 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
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...


Top
 Profile  
 
PostPosted: Mon Jul 11, 2016 6:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19332
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
PostPosted: Mon Jul 11, 2016 6:22 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
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.


Top
 Profile  
 
PostPosted: Mon Jul 11, 2016 6:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19332
Location: NE Indiana, USA (NTSC)
Then your saving or restoration of something in the channels' state is broken.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group