mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
SaveState: add a reader for the legacy 0x9A2C/0x9A34 blob layouts
Savestates written by the AetherSX2/NetherSX2 era of upstream PCSX2 use two internal-structures layouts that today's reader cannot parse: 0x9A2C (upstream0312e902) and 0x9A34 (upstream7e939b75). Add a load-only deserializer that consumes those layouts field-by-field into live emulator state. Old struct layouts are declared in an OldState namespace, each cited to the upstream sha it was taken from and guarded by a static_assert of the byte-exact size. A second assert group pins the sizes of the CURRENT types the legacy layout depends on, so upstream drift breaks the build rather than desyncing a load mid-blob. Blocks that are byte-identical across eras reuse the existing freeze functions. The two era gaps that need real work: 32-bit cycle counters widen relative to their domain base so wrap-straddling deltas survive, and fields that moved between the cpuRegs and Cycles blocks at 0x9A31 are staged and committed once, after the disc identity check, so a wrong-game state cannot half-apply. Not yet wired into the load path; that follows.
This commit is contained in: