X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxinterpreter.c;h=8e0aafed790baa265eee282c508d41cfbc20b895;hb=da65071fd7ceac663bb951b13da2563d7b16431d;hp=4ae9417a8748c3e38cb3b9ae18cb5d4e66d31645;hpb=d5aeda23720ba9374312f8d387f299024fedb7e6;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index 4ae9417a..8e0aafed 100644 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -750,19 +750,19 @@ OP(psxMTLO) { _rLo_ = _rRs_; } // Lo = Rs *********************************************************/ OP(psxBREAK) { regs_->pc -= 4; - psxException(0x24, branch); + psxException(0x24, branch, ®s_->CP0); } OP(psxSYSCALL) { regs_->pc -= 4; - psxException(0x20, branch); + psxException(0x20, branch, ®s_->CP0); } static inline void psxTestSWInts(psxRegisters *regs_) { if (regs_->CP0.n.Cause & regs_->CP0.n.Status & 0x0300 && regs_->CP0.n.Status & 0x1) { regs_->CP0.n.Cause &= ~0x7c; - psxException(regs_->CP0.n.Cause, branch); + psxException(regs_->CP0.n.Cause, branch, ®s_->CP0); } } @@ -911,7 +911,9 @@ void MTC0(psxRegisters *regs_, int reg, u32 val) { // SysPrintf("MTC0 %d: %x\n", reg, val); switch (reg) { case 12: // Status - regs_->CP0.r[12] = val; + if ((regs_->CP0.n.Status ^ val) & (1 << 16)) + psxMemOnIsolate((val >> 16) & 1); + regs_->CP0.n.Status = val; psxTestSWInts(regs_); break; @@ -1076,7 +1078,6 @@ static int intInit() { } static void intReset() { - memset(&ICache, 0xff, sizeof(ICache)); } static inline void execI_(u8 **memRLUT, psxRegisters *regs_) { @@ -1101,7 +1102,7 @@ static void intExecute() { execI_(memRLUT, regs_); } -static void intExecuteBlock() { +void intExecuteBlock(enum blockExecCaller caller) { psxRegisters *regs_ = &psxRegs; u8 **memRLUT = psxMemRLUT; @@ -1113,11 +1114,15 @@ static void intExecuteBlock() { static void intClear(u32 Addr, u32 Size) { } -void intNotify (int note, void *data) { - /* Gameblabla - Only clear the icache if it's isolated */ - if (note == R3000ACPU_NOTIFY_CACHE_ISOLATED) - { +static void intNotify(enum R3000Anote note, void *data) { + switch (note) { + case R3000ACPU_NOTIFY_CACHE_ISOLATED: // Armored Core? + case R3000ACPU_NOTIFY_AFTER_LOAD: memset(&ICache, 0xff, sizeof(ICache)); + break; + case R3000ACPU_NOTIFY_CACHE_UNISOLATED: + case R3000ACPU_NOTIFY_BEFORE_SAVE: + break; } }