This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that we no longer have the daily Nightly builds putting a gun over our heads I can finally do what my heart always desired, nuke save states to the shadow realm 😄
Why do this?
It turns out boost serialization is quite terrible choice for serializing complex HLE emulator internals:
citra/src/core/core.cpp
Lines 761 to 765 in 8433057
With all these in mind, I have completely removed boost serialization from the codebase for the time being. That will allow us to be much more flexible with rewrites and improvements to core, without worrying about how to reconcile save-state support. In the future we should employ a completely custom solution, could be either as a library or in the common library (I'm leaning towards the latter for now). Such a solution should:
If this were to be a library something like blobify can be considered as its interface is quite easy to use, though it seems to lack the ability to pick and chose which members to serialize. For a in-house system, Dolphin's ChunkFile is a good reference, it's simple, fast and lightweight. Objects implement the Do method for serialization. I feel a combination of these approaches might be best
In addition utilizing a custom implementation we can be much smarter about how we serialize structures and in what order. boost enforced strict order before which required a few hacki-sh behaviors like "locking" the VMManager during deserialization. Especially the kernel, after we refactor it to use the slab heap we could make it way faster
When will save states be back?
Idk, first the kernel needs to be refactored and then I might also add fastmem support so we already have the features the old system blocked, before fully designing and implementing the new system. There are still a few remnants of save states even after this PR, but I want to think of how to better abstract them. The BackingMem abstraction uses shared_ptr and are quite heavy, given their purpose is to just hold some memory