From f1024dad9129c0d588e2cf2401645555169871d0 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sun, 7 Nov 2010 00:04:53 +0000 Subject: [PATCH] newHostVM: Fix for savestates! git-svn-id: http://pcsx2.googlecode.com/svn/branches/newHostVM@4004 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/src/Utilities/VirtualMemory.cpp | 20 ++++++++++++++++++-- common/src/Utilities/Windows/WinHostSys.cpp | 8 ++++++-- pcsx2/x86/iR3000A.cpp | 4 +++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/common/src/Utilities/VirtualMemory.cpp b/common/src/Utilities/VirtualMemory.cpp index 63f8eae822..3ce141004d 100644 --- a/common/src/Utilities/VirtualMemory.cpp +++ b/common/src/Utilities/VirtualMemory.cpp @@ -264,7 +264,20 @@ void* SpatialArrayReserve::Reserve( uint size, uptr base, uptr upper_bounds ) // Resets/clears the spatial array, reducing the memory commit pool overhead to zero (0). void SpatialArrayReserve::Reset() { - __parent::Reset(); + if (m_commited) + { + u8* curptr = GetPtr(); + const uint blockBytes = m_blocksize * __pagesize; + for (uint i=0; i 0x%08X (mode=%s)", baseaddr, (uptr)baseaddr + size, mode.ToString().c_str() )); + + pxFailDev( apiError.FormatDiagnosticMessage() ); } } diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 757b49a4f7..795f671f28 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -125,7 +125,7 @@ static void recEventTest() // stackframe setup code in this function) static void __fastcall StackFrameCheckFailed( int espORebp, int regval ) { - pxFailDev( wxsFormat( L"(R3000A Recompiler Stackframe) Sanity check failed on %s\n\tCurrent=%d; Saved=%d", + pxFailDev( pxsFmt( L"(R3000A Recompiler Stackframe) Sanity check failed on %s\n\tCurrent=%d; Saved=%d", (espORebp==0) ? L"ESP" : L"EBP", regval, (espORebp==0) ? s_store_esp : s_store_ebp ) ); @@ -827,6 +827,7 @@ void recResetIOP() for (int i = 0; i < 0x10000; i++) recLUT_SetPage(psxRecLUT, 0, 0, 0, i, 0); + // IOP knows 64k pages, hence for the 0x10000's // The bottom 2 bits of PC are always zero, so we <<14 to "compress" @@ -834,6 +835,7 @@ void recResetIOP() // We're only mapping 20 pages here in 4 places. // 0x80 comes from : (Ps2MemSize::IopRam / 0x10000) * 4 + for (int i=0; i<0x80; i++) { recLUT_SetPage(psxRecLUT, psxhwLUT, recRAM, 0x0000, i, i & 0x1f);