Modified how the GS interrupts work, solves the issue of the picture flashing on and off in some games (Street Fighter EX3). Needs some testing possibly, but should be better.

Developer note: The reason for this is the event can only generate an interrupt if it is enabled (via CSRw). the CSRw has to also reflect the IMR status else it could give false readings.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1380 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2009-06-17 20:58:03 +00:00
parent 43dbbb050f
commit 78746f0d3a
3 changed files with 24 additions and 12 deletions

View File

@ -336,8 +336,12 @@ static __forceinline void VSyncStart(u32 sCycle)
EECNT_LOG( "///////// EE COUNTER VSYNC START \\\\\\\\\\\\\\\\\\\\ (frame: %d)", iFrame );
vSyncDebugStuff( iFrame ); // EE Profiling and Debug code
if ((CSRw & 0x8)) GSCSRr|= 0x8;
if (!(GSIMR&0x800)) gsIrq();
if ((CSRw & 0x8))
{
CSRw &= ~0x8;
GSCSRr|= 0x8;
if (!(GSIMR&0x800)) gsIrq();
}
hwIntcIrq(INTC_VBLANK_S);
psxVBlankStart();
@ -404,8 +408,12 @@ __forceinline void rcntUpdate_hScanline()
hsyncCounter.Mode = MODE_HRENDER;
}
else { //HBLANK END / HRENDER Begin
if (CSRw & 0x4) GSCSRr |= 4; // signal
if (!(GSIMR&0x400)) gsIrq();
if (CSRw & 0x4)
{
CSRw &= ~0x4;
GSCSRr |= 4; // signal
if (!(GSIMR&0x400)) gsIrq();
}
if (gates) rcntEndGate(false, hsyncCounter.sCycle);
if (psxhblankgate) psxCheckEndGate16(0);

View File

@ -243,6 +243,7 @@ void gsReset()
memzero_obj(g_RealGSMem);
CSRw = 0;
GSCSRr = 0x551B400F; // Set the FINISH bit to 1 for now
GSIMR = 0x7f00;
psHu32(GIF_STAT) = 0;
@ -323,7 +324,7 @@ void gsCSRwrite(u32 value)
static void IMRwrite(u32 value)
{
GSIMR = (value & 0x1f00)|0x6000;
CSRw |= (GSIMR >> 8) & 0x1f;
// don't update mtgs mem
}

View File

@ -142,10 +142,12 @@ static void RegHandlerSIGNAL(const u32* data)
GSSIGLBLID->SIGID = (GSSIGLBLID->SIGID&~data[1])|(data[0]&data[1]);
if ((CSRw & 0x1))
{
CSRw &= ~0x1;
GSCSRr |= 1; // signal
if (!(GSIMR&0x100) )
gsIrq();
if (!(GSIMR&0x100) )
gsIrq();
}
}
static void RegHandlerFINISH(const u32* data)
@ -153,11 +155,12 @@ static void RegHandlerFINISH(const u32* data)
MTGS_LOG("MTGS FINISH data %x_%x CSRw %x\n",data[0], data[1], CSRw);
if ((CSRw & 0x2))
{
GSCSRr |= 2; // finish
if (!(GSIMR&0x200) )
gsIrq();
CSRw &= ~0x2;
if (!(GSIMR&0x200) )
gsIrq();
}
}
static void RegHandlerLABEL(const u32* data)