Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save states #2

Open
hcs64 opened this issue Jul 13, 2020 · 0 comments
Open

Save states #2

hcs64 opened this issue Jul 13, 2020 · 0 comments

Comments

@hcs64
Copy link
Owner

hcs64 commented Jul 13, 2020

Save states are going to be tricky for a few reasons. First, there needs to be a way to stop all the tasks and collect info, and then to get everything loaded up again. There's probably a natural point for this when the CPU takes an NMI: the PPU won't be busy, and the CPU will just be fetching an instruction. Second, state is scattered around in the various registers, memories, and caches and would need to be tracked down to store and then reconstitute on reload. In particular mapper state is sometimes only in the TLB, though I've tried to make efforts in later mapper implementations to save that for reload. This is all going to get out of sync very easily as code changes.

A simpler approach, for memory-resident saves, is to have an exception handler copy all RDRAM (the stock 4MB), DMEM, and registers into the expansion memory, which is currently unused. It ought to even be possible to fit this in SRAM; a lot of buffers and the ROM don't need to be saved. It'd be unstable across versions, I'd probably include the N64 ROM checksum to check compatibility.

@hcs64 hcs64 mentioned this issue Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant