GIF Unit: Stop multiple fires of FINISH IRQ's

- Fixes Indiecar Series 2005.
- Savestate bump was required, sorry, not sorry :P
This commit is contained in:
refractionpcsx2 2015-08-12 02:16:23 +01:00
parent 98c74879bf
commit 68de5228a8
4 changed files with 16 additions and 3 deletions

View File

@ -108,7 +108,10 @@ static __fi void gsCSRwrite( const tGS_CSR& csr )
gifUnit.Execute(false, true); // Resume paused transfers gifUnit.Execute(false, true); // Resume paused transfers
} }
if(csr.FINISH) CSRreg.FINISH = false; if (csr.FINISH) {
CSRreg.FINISH = false;
gifUnit.gsFINISH.gsFINISHFired = false; //Clear the previously fired FINISH (YS, Indiecar 2005, MGS3)
}
if(csr.HSINT) CSRreg.HSINT = false; if(csr.HSINT) CSRreg.HSINT = false;
if(csr.VSINT) CSRreg.VSINT = false; if(csr.VSINT) CSRreg.VSINT = false;
if(csr.EDWINT) CSRreg.EDWINT = false; if(csr.EDWINT) CSRreg.EDWINT = false;

View File

@ -97,8 +97,9 @@ bool Gif_HandlerAD_Debug(u8* pMem) {
} }
void Gif_FinishIRQ() { void Gif_FinishIRQ() {
if (CSRreg.FINISH && !(GSIMR&0x200)) { if (CSRreg.FINISH && !(GSIMR & 0x200) && gifUnit.gsFINISH.gsFINISHFired == false) {
gsIrq(); gsIrq();
gifUnit.gsFINISH.gsFINISHFired = true;
} }
} }
@ -163,6 +164,7 @@ void SaveStateBase::gifFreeze() {
Freeze(mtvuMode); Freeze(mtvuMode);
Freeze(gifUnit.stat); Freeze(gifUnit.stat);
Freeze(gifUnit.gsSIGNAL); Freeze(gifUnit.gsSIGNAL);
Freeze(gifUnit.gsFINISH);
Freeze(gifUnit.lastTranType); Freeze(gifUnit.lastTranType);
gifPathFreeze(GIF_PATH_1); gifPathFreeze(GIF_PATH_1);
gifPathFreeze(GIF_PATH_2); gifPathFreeze(GIF_PATH_2);

View File

@ -133,6 +133,12 @@ struct GS_SIGNAL {
void Reset() { memzero(*this); } void Reset() { memzero(*this); }
}; };
struct GS_FINISH {
bool gsFINISHFired;
void Reset() { memzero(*this); }
};
static __fi void incTag(u32& offset, u32& size, u32 incAmount) { static __fi void incTag(u32& offset, u32& size, u32 incAmount) {
size += incAmount; size += incAmount;
offset += incAmount; offset += incAmount;
@ -413,6 +419,7 @@ struct Gif_Path {
struct Gif_Unit { struct Gif_Unit {
Gif_Path gifPath[3]; Gif_Path gifPath[3];
GS_SIGNAL gsSIGNAL; // Stalling Signal GS_SIGNAL gsSIGNAL; // Stalling Signal
GS_FINISH gsFINISH; // Finish Signal
tGIF_STAT& stat; tGIF_STAT& stat;
GIF_TRANSFER_TYPE lastTranType; // Last Transfer Type GIF_TRANSFER_TYPE lastTranType; // Last Transfer Type
@ -427,6 +434,7 @@ struct Gif_Unit {
GUNIT_WARN(Color_Red, "Gif Unit Reset!!! [soft=%d]", softReset); GUNIT_WARN(Color_Red, "Gif Unit Reset!!! [soft=%d]", softReset);
ResetRegs(); ResetRegs();
gsSIGNAL.Reset(); gsSIGNAL.Reset();
gsFINISH.Reset();
gifPath[0].Reset(softReset); gifPath[0].Reset(softReset);
gifPath[1].Reset(softReset); gifPath[1].Reset(softReset);
gifPath[2].Reset(softReset); gifPath[2].Reset(softReset);

View File

@ -24,7 +24,7 @@
// the lower 16 bit value. IF the change is breaking of all compatibility with old // 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. // states, increment the upper 16 bit value, and clear the lower 16 bits to 0.
static const u32 g_SaveVersion = (0x9A0A << 16) | 0x0000; static const u32 g_SaveVersion = (0x9A0B << 16) | 0x0000;
// this function is meant to be used in the place of GSfreeze, and provides a safe layer // 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. :) // between the GS saving function and the MTGS's needs. :)