From 22bdd1fbec2e5583fb5556b516ebcbbbebae7664 Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Wed, 6 Jun 2012 22:04:39 +0000 Subject: [PATCH] GS/GIF: only raise interrupts on IMR writes on falling edges, i.e. if the interrupt was previously masked. Also remove a block about queued signals from IMR writes which makes no sense to me given that the CSR write to clear the previous SIGNAL should be setting CSR.SIGNAL already, which will trigger the interrupt by the standard mechanism. tl;dr: fixes realta nua and probably other stuff. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5273 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/GS.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pcsx2/GS.cpp b/pcsx2/GS.cpp index b04744dac0..2731da3301 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -121,23 +121,12 @@ static __fi void gsCSRwrite( const tGS_CSR& csr ) static __fi void IMRwrite(u32 value) { - GSIMR = (value & 0x1f00)|0x6000; - - if(CSRreg.GetInterruptMask() & (~(GSIMR >> 8) & 0x1f)) - gsIrq(); - GUNIT_LOG("IMRwrite()"); - if (gifUnit.gsSIGNAL.queued && !(GSIMR & 0x100)) { - // Note: PS2 apps are expected to write a successive 1 and 0 to the IMR in order to - // trigger the gsInt and clear the second pending SIGNAL interrupt -- if they fail - // to do so, the GS will freeze again upon the very next SIGNAL). - // - // What's not known here is whether or not the SIGID register should be updated - // here or when the GS is resumed during CSR write (above). - CSRreg.SIGNAL = true; + if (CSRreg.GetInterruptMask() & (~value & GSIMR) >> 8) gsIrq(); - } + + GSIMR = (value & 0x1f00)|0x6000; } __fi void gsWrite8(u32 mem, u8 value)