drc: update invalid_code for RAM when mirrors are touched
authornotaz <notasas@gmail.com>
Tue, 8 Mar 2011 13:41:55 +0000 (15:41 +0200)
committernotaz <notasas@gmail.com>
Tue, 8 Mar 2011 13:59:09 +0000 (15:59 +0200)
the memhandlers always check RAM locations, even when something
writes to the mirrors.

libpcsxcore/new_dynarec/new_dynarec.c

index edd1413..6f5ca8f 100644 (file)
@@ -1186,6 +1186,9 @@ void invalidate_block(u_int block)
   
   // Don't trap writes
   invalid_code[block]=1;
   
   // Don't trap writes
   invalid_code[block]=1;
+#ifdef PCSX
+  invalid_code[((u_int)0x80000000>>12)|page]=1;
+#endif
 #ifndef DISABLE_TLB
   // If there is a valid TLB entry for this page, remove write protect
   if(tlb_LUT_w[block]) {
 #ifndef DISABLE_TLB
   // If there is a valid TLB entry for this page, remove write protect
   if(tlb_LUT_w[block]) {
@@ -11032,6 +11035,12 @@ int new_recompile_block(int addr)
     }
 #endif
   }
     }
 #endif
   }
+#ifdef PCSX
+  // PCSX maps all RAM mirror invalid_code tests to 0x80000000..0x80000000+RAM_SIZE
+  if(get_page(start)<(RAM_SIZE>>12))
+    for(i=start>>12;i<=(start+slen*4)>>12;i++)
+      invalid_code[((u_int)0x80000000>>12)|i]=0;
+#endif
   
   /* Pass 10 - Free memory by expiring oldest blocks */
   
   
   /* Pass 10 - Free memory by expiring oldest blocks */