mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
EE: record why recRAMCopy is sized to MainRam, not ExposedRam
Upstream x86 sizes the snapshot buffer, its guard and its LUT to Ps2MemSize::ExposedRam, which follows the 128MB devkit mapping; ours uses MainRam. That looks like a portable one-line divergence and is not: this rec is MainRam-only throughout — recLutEntries and the recRAM advance in recReserveRAM, the (MainRam / _64kb) alias mask in recResetRaw that folds all guest RAM into a 32MB LUT window, and the manual_page / manual_counter arrays. Widening the buffer on its own would hand two blocks aliased to the same LUT entry two distinct snapshots, which is worse than the coverage it buys. Note the constraint at the allocation so the next reader does not try it. The real gap — that this rec does not support the 128MB mapping at all — stands, and needs the LUT, the mask and the manual-page arrays converted together. Comment only, no behaviour change. recompiler_tests 1439/1439.
This commit is contained in:
@@ -2970,6 +2970,11 @@ static void recReserveRAM()
|
||||
recROM2 = curpos;
|
||||
curpos += (Ps2MemSize::Rom2 / 4);
|
||||
|
||||
// MainRam, deliberately — this whole rec is MainRam-only: recLutEntries and
|
||||
// the recRAM advance above, the (MainRam / _64kb) alias mask in recResetRaw,
|
||||
// and manual_page / manual_counter. Upstream x86 uses ExposedRam throughout
|
||||
// instead (iR5900.cpp:564-577). Widening this buffer alone would desync the
|
||||
// snapshots from a LUT that aliases high RAM back into the low 32 MB.
|
||||
if (recRAMCopy.size() != Ps2MemSize::MainRam)
|
||||
recRAMCopy.resize(Ps2MemSize::MainRam);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user