Implementing savestate feature

Discuss any suggestions you may have here.
Post Reply
User avatar
Nacho
Posts: 66
Joined: Thu Nov 07, 2013 9:25 am

Implementing savestate feature

Post by Nacho » Thu Nov 21, 2013 10:00 am

I was wondering about the save/loadstate feature.

¿Exactly, which data structures need to be saved? On an extremely naïve approach, I though that it was only neccesary to write a CEN64Device structure on a binary file. But then I looked better at the code, and well, facepalm.

It may be useful to debug. I mean, posting a savestate file, instead of saying "Go to the Deku tree and then pause the game".
Testing CEN64 on: Intel Core i5 520M 2.4 GHz. SSE2 SSE3 SSE4.1 SSE4.2 SSSE3, but no AVX. Ubuntu Linux

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: Implementing savestate feature

Post by MarathonMan » Thu Nov 21, 2013 10:07 am

Nacho wrote:It may be useful to debug. I mean, posting a savestate file, instead of saying "Go to the Deku tree and then pause the game".
The problem is that with cycle-accurate simulators, once a bug has occured and is visible, it's highly probable that the bug occurred tens to even hundreds (or even thousands or more!) cycles ago. So taking a snapshot of the current system likely won't find bugs. :(

Anyways, to answer your question, you'd have to do reconstruct all the pointer values when loading a file. i.e., you'd have to allocate a new CEN64Device, set the bus pointers, etc. and then copy only what is relevant out of the saved state.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest