Win32: Fixed some memory leaks in the GUI when pressing Escape and then manually resetting the emu or starting new games and such. Oh and ZeroGS plugin now compiles again without error on MSVC. :D

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@559 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
Jake.Stine 2009-01-07 04:49:27 +00:00 committed by Gregory Hainaut
parent c12cf3bc0a
commit b32acd4206
5 changed files with 11 additions and 18 deletions

View File

@ -398,15 +398,7 @@ static __forceinline void VSyncStart(u32 sCycle)
if ((CSRw & 0x8)) GSCSRr|= 0x8;
if (!(GSIMR&0x800)) gsIrq();
// HACK : For some inexplicable reason, having the IntcIrq(2) handled during the
// current Event Test breaks some games (Grandia 2 at bootup). I can't fathom why.
// To fix I fool the Intc handler into thinking that we're not in an event test, so
// that it schedules the handler into the future by 4 cycles. (air)
//eeEventTestIsActive = false;
hwIntcIrq(2);
//eeEventTestIsActive = true;
psxVBlankStart();
if (gates) rcntStartGate(0x8, sCycle); // Counters Start Gate code
@ -447,7 +439,7 @@ __forceinline void rcntUpdate_hScanline()
{
if( !cpuTestCycle( counters[4].sCycle, counters[4].CycleT ) ) return;
iopBranchAction = 1;
//iopBranchAction = 1;
if (counters[4].mode & MODE_HBLANK) { //HBLANK Start
rcntStartGate(0, counters[4].sCycle);
psxCheckStartGate16(0);
@ -479,7 +471,7 @@ __forceinline void rcntUpdate_vSync()
s32 diff = (cpuRegs.cycle - counters[5].sCycle);
if( diff < counters[5].CycleT ) return;
iopBranchAction = 1;
//iopBranchAction = 1;
if (counters[5].mode == MODE_VSYNC)
{
VSyncEnd(counters[5].sCycle);

View File

@ -278,7 +278,7 @@ void iopTestIntc()
if( !eeEventTestIsActive )
{
// An iop int has occured while the EE is running code.
// An iop exception has occured while the EE is running code.
// Inform the EE to branch so the IOP can handle it promptly:
cpuSetNextBranchDelta( 16 );

View File

@ -629,8 +629,8 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
case ID_FILE_RUNCD:
safe_free( g_RecoveryState );
safe_free( g_gsRecoveryState );
safe_delete( g_RecoveryState );
safe_delete( g_gsRecoveryState );
ResetPlugins();
RunExecute( NULL );
return FALSE;

View File

@ -669,6 +669,7 @@ void CALLBACK KeyEvent(keyEvent* ev)
if( Config.closeGSonEsc )
{
safe_delete( g_gsRecoveryState );
safe_delete( g_RecoveryState );
g_gsRecoveryState = new MemoryAlloc<u8>();
JustGsSavingState eddie;
eddie.FreezePlugin( "GS", GSfreeze ) ;
@ -729,8 +730,8 @@ void SysReset()
StatusBar_Notice(_("Resetting..."));
g_GameInProgress = false;
safe_free( g_RecoveryState );
safe_free( g_gsRecoveryState );
safe_delete( g_RecoveryState );
safe_delete( g_gsRecoveryState );
ResetPlugins();
StatusBar_Notice(_("Ready"));

View File

@ -124,7 +124,7 @@ void __forceinline KICK_VERTEX3()
{
/* tri fans need special processing */
if (gs.nTriFanVert == gs.primIndex)
gs.primIndex = (gs.primIndex+1)%ARRAY_SIZE(gs.gsvertex);
gs.primIndex = (gs.primIndex+1) % ARRAYSIZE(gs.gsvertex);
}
}
}
@ -136,7 +136,7 @@ void __fastcall GIFPackedRegHandlerXYZF2(u32* data)
gs.vertexregs.z = (data[2] >> 4) & 0xffffff;
gs.vertexregs.f = (data[3] >> 4) & 0xff;
gs.gsvertex[gs.primIndex] = gs.vertexregs;
gs.primIndex = (gs.primIndex+1)%ARRAYSIZE(gs.gsvertex);
gs.primIndex = (gs.primIndex+1) % ARRAYSIZE(gs.gsvertex);
if( data[3] & 0x8000 ) {
KICK_VERTEX3();
@ -152,7 +152,7 @@ void __fastcall GIFPackedRegHandlerXYZ2(u32* data)
gs.vertexregs.y = (data[1] >> 0) & 0xffff;
gs.vertexregs.z = data[2];
gs.gsvertex[gs.primIndex] = gs.vertexregs;
gs.primIndex = (gs.primIndex+1)%ARRAYSIZE(gs.gsvertex);
gs.primIndex = (gs.primIndex+1) % ARRAYSIZE(gs.gsvertex);
if( data[3] & 0x8000 ) {
KICK_VERTEX3();