clean up switching between dynarec and interpreter
[pcsx_rearmed.git] / libpcsxcore / psxinterpreter.c
index 3d08364..036b062 100644 (file)
@@ -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_) {
@@ -1113,11 +1114,15 @@ 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;
        }
 }