X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Flightrec%2Fplugin.c;h=bb4138b90613101139ebf4b8f9397876558778c4;hb=af4a16ff4cb4cb8d0e20d70916352ba6e4e43f21;hp=79bf02153e0edabb8723fb9215e85764c2aecd0a;hpb=67b91c4b9c44f0d973d2d6a85481e3f437ccc583;p=pcsx_rearmed.git diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index 79bf0215..bb4138b9 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -37,6 +37,9 @@ # define unlikely(x) (x) #endif +psxRegisters psxRegs; +Rcnt rcnts[4]; + static struct lightrec_state *lightrec_state; static char *name = "retroarch.exe"; @@ -47,18 +50,6 @@ static bool lightrec_debug; static bool lightrec_very_debug; static u32 lightrec_begin_cycles; -int stop; -u32 cycle_multiplier; -int new_dynarec_hacks; - -/* Unused for now */ -u32 event_cycles[PSXINT_COUNT]; -u32 next_interupt; - -void new_dyna_before_save() {} -void new_dyna_after_save() {} -void new_dyna_freeze(void *f, int i) {} - enum my_cp2_opcodes { OP_CP2_RTPS = 0x01, OP_CP2_NCLIP = 0x06, @@ -401,11 +392,11 @@ static int lightrec_plugin_init(void) lightrec_map, ARRAY_SIZE(lightrec_map), &lightrec_ops); - fprintf(stderr, "M=0x%lx, P=0x%lx, R=0x%lx, H=0x%lx\n", - (uintptr_t) psxM, - (uintptr_t) psxP, - (uintptr_t) psxR, - (uintptr_t) psxH); + // fprintf(stderr, "M=0x%lx, P=0x%lx, R=0x%lx, H=0x%lx\n", + // (uintptr_t) psxM, + // (uintptr_t) psxP, + // (uintptr_t) psxR, + // (uintptr_t) psxH); #ifndef _WIN32 signal(SIGPIPE, exit); @@ -549,7 +540,7 @@ static void lightrec_plugin_execute_block(void) } if ((psxRegs.cycle & ~0xfffffff) != old_cycle_counter) { - printf("RAM usage: Lightrec %u KiB, IR %u KiB, CODE %u KiB, " + SysDLog("RAM usage: Lightrec %u KiB, IR %u KiB, CODE %u KiB, " "MIPS %u KiB, TOTAL %u KiB, avg. IPI %f\n", lightrec_get_mem_usage(MEM_FOR_LIGHTREC) / 1024, lightrec_get_mem_usage(MEM_FOR_IR) / 1024, @@ -578,6 +569,27 @@ static void lightrec_plugin_clear(u32 addr, u32 size) lightrec_invalidate(lightrec_state, addr, size * 4); } +static void lightrec_plugin_notify(int note, void *data) +{ + /* + To change once proper icache emulation is emulated + switch (note) + { + case R3000ACPU_NOTIFY_CACHE_UNISOLATED: + lightrec_plugin_clear(0, 0x200000/4); + break; + case R3000ACPU_NOTIFY_CACHE_ISOLATED: + // Sent from psxDma3(). + case R3000ACPU_NOTIFY_DMA3_EXE_LOAD: + default: + break; + }*/ +} + +static void lightrec_plugin_apply_config() +{ +} + static void lightrec_plugin_shutdown(void) { lightrec_destroy(lightrec_state); @@ -596,5 +608,7 @@ R3000Acpu psxRec = lightrec_plugin_execute, lightrec_plugin_execute_block, lightrec_plugin_clear, + lightrec_plugin_notify, + lightrec_plugin_apply_config, lightrec_plugin_shutdown, };