diff --git a/pcsx2/Counters.cpp b/pcsx2/Counters.cpp index 789dea70e5..635160a936 100644 --- a/pcsx2/Counters.cpp +++ b/pcsx2/Counters.cpp @@ -809,8 +809,6 @@ void SaveStateBase::rcntFreeze() if( IsLoading() ) { - UpdateVSyncRate(); - // make sure the gate flags are set based on the counter modes... for( int i=0; i<4; i++ ) _rcntSetGate( i ); diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 0b2c224cdf..83de52a93a 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -142,9 +142,9 @@ void SysMtgsThread::ResetGS() struct RingCmdPacket_Vsync { - u8 regset1[0x100]; - u32 csr; - u32 imr; + u8 regset1[0x0f0]; + u32 csr; + u32 imr; GSRegSIGBLID siglblid; }; @@ -157,10 +157,12 @@ void SysMtgsThread::PostVsyncEnd() PrepDataPacket(GS_RINGTYPE_VSYNC, sizeof(RingCmdPacket_Vsync)); RingCmdPacket_Vsync& local( *(RingCmdPacket_Vsync*)GetDataPacketPtr() ); + memcpy_fast( local.regset1, PS2MEM_GS, sizeof(local.regset1) ); local.csr = GSCSRr; local.imr = GSIMR; local.siglblid = GSSIGLBLID; + SendDataPacket(); // Alter-frame flushing! Restarts the ringbuffer (wraps) on every other frame. This is a @@ -382,13 +384,13 @@ void SysMtgsThread::ExecuteTaskInThread() // Mail in the important GS registers. RingCmdPacket_Vsync& local((RingCmdPacket_Vsync&)RingBuffer[m_RingPos+1]); - memcpy_fast( RingBuffer.Regs, local.regset1, sizeof(local.regset1)); ((u32&)RingBuffer.Regs[0x1000]) = local.csr; ((u32&)RingBuffer.Regs[0x1010]) = local.imr; ((GSRegSIGBLID&)RingBuffer.Regs[0x1080]) = local.siglblid; - GSvsync(!(local.csr & 0x2000)); + // CSR & 0x2000; is the pageflip id. + GSvsync(((u32&)RingBuffer.Regs[0x1000]) & 0x2000); gsFrameSkip(); // if we're not using GSOpen2, then the GS window is on this thread (MTGS thread), diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 2a8d2a4fa5..e41d8edaf4 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -24,6 +24,7 @@ #include "AppConfig.h" #include "Elfheader.h" +#include "Counters.h" using namespace R5900; @@ -38,6 +39,8 @@ static void PostLoadPrep() memzero(pCache); // WriteCP0Status(cpuRegs.CP0.n.Status.val); for(int i=0; i<48; i++) MapTLB(i); + + UpdateVSyncRate(); } wxString SaveStateBase::GetFilename( int slot ) diff --git a/pcsx2/SaveState.h b/pcsx2/SaveState.h index 6ead46c27f..b353701861 100644 --- a/pcsx2/SaveState.h +++ b/pcsx2/SaveState.h @@ -24,7 +24,7 @@ // the lower 16 bit value. IF the change is breaking of all compatibility with old // states, increment the upper 16 bit value, and clear the lower 16 bits to 0. -static const u32 g_SaveVersion = 0x8b460000; +static const u32 g_SaveVersion = 0x8b460001; // this function is meant to be used in the place of GSfreeze, and provides a safe layer // between the GS saving function and the MTGS's needs. :)