Update lightrec 20220716 (#672)
[pcsx_rearmed.git] / libpcsxcore / lightrec / plugin.c
index 00d9c55..52d37f0 100644 (file)
@@ -16,6 +16,7 @@
 #include "../frontend/main.h"
 
 #include "mem.h"
+#include "plugin.h"
 
 #if (defined(__arm__) || defined(__aarch64__)) && !defined(ALLOW_LIGHTREC_ON_ARM)
 #error "Lightrec should not be used on ARM (please specify DYNAREC=ari64 to make)"
@@ -555,11 +556,14 @@ static void lightrec_plugin_reset(void)
 {
        struct lightrec_registers *regs;
 
-       lightrec_plugin_shutdown();
-       lightrec_plugin_init();
-
        regs = lightrec_get_registers(lightrec_state);
 
+       /* Invalidate all blocks */
+       lightrec_invalidate_all(lightrec_state);
+
+       /* Reset registers */
+       memset(regs, 0, sizeof(*regs));
+
        regs->cp0[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1
        regs->cp0[15] = 0x00000002; // PRevID = Revision ID, same as R3000A