Merge pull request #578 from gameblabla/counters_lib
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / backends / psx / emu_if.c
index 6dc48e2..e9fa607 100644 (file)
 #include "../../../mdec.h"
 #include "../../../gte_arm.h"
 #include "../../../gte_neon.h"
+
+#include "../../../gte.h"
+
 #define FLAGLESS
 #include "../../../gte.h"
+#undef  FLAGLESS
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
 
@@ -331,6 +335,7 @@ static int ari64_init()
 #ifdef DRC_DBG
        memcpy(gte_handlers_nf, gte_handlers, sizeof(gte_handlers_nf));
 #endif
+   
        psxH_ptr = psxH;
        zeromem_ptr = zero_mem;
        scratch_buf_ptr = scratch_buf;
@@ -393,6 +398,24 @@ static void ari64_clear(u32 addr, u32 size)
                        invalidate_block(start);
 }
 
+#ifdef ICACHE_EMULATION
+static void ari64_notify(int note, void *data) {
+       /*
+       To change once we have proper icache emulation
+       switch (note)
+       {
+               case R3000ACPU_NOTIFY_CACHE_UNISOLATED:
+                       ari64_clear(0, 0x200000/4);
+                       break;
+               case R3000ACPU_NOTIFY_CACHE_ISOLATED:
+               // Sent from psxDma3().
+               case R3000ACPU_NOTIFY_DMA3_EXE_LOAD:
+               default:
+                       break;
+       }*/
+}
+#endif
+
 static void ari64_shutdown()
 {
        new_dynarec_cleanup();
@@ -419,6 +442,9 @@ R3000Acpu psxRec = {
        intExecuteBlockT,
 #endif
        ari64_clear,
+#ifdef ICACHE_EMULATION
+       ari64_notify,
+#endif
        ari64_shutdown
 };