X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Flightrec%2Fplugin.c;h=22342fef94838eaf67b22d143be450fb9e0a4f7a;hb=32f5d76981fd6f225f9fd31d6ebea17a83c54a0c;hp=d3e4b33ff085561e92647640611fa0f3ece4c28a;hpb=15fdca99d6bb8e2d3346d468af163973218f0391;p=pcsx_rearmed.git diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index d3e4b33f..22342fef 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -20,7 +20,7 @@ #include "../r3000a.h" #include "../psxinterpreter.h" #include "../psxhle.h" -#include "../new_dynarec/events.h" +#include "../psxevents.h" #include "../frontend/main.h" @@ -163,7 +163,7 @@ static void lightrec_tansition_from_pcsx(struct lightrec_state *state) } static void hw_write_byte(struct lightrec_state *state, - u32 op, void *host, u32 mem, u8 val) + u32 op, void *host, u32 mem, u32 val) { lightrec_tansition_to_pcsx(state); @@ -173,7 +173,7 @@ static void hw_write_byte(struct lightrec_state *state, } static void hw_write_half(struct lightrec_state *state, - u32 op, void *host, u32 mem, u16 val) + u32 op, void *host, u32 mem, u32 val) { lightrec_tansition_to_pcsx(state); @@ -470,8 +470,6 @@ static int lightrec_plugin_init(void) lightrec_map, ARRAY_SIZE(lightrec_map), &lightrec_ops); - lightrec_set_unsafe_opt_flags(lightrec_state, lightrec_hacks); - // fprintf(stderr, "M=0x%lx, P=0x%lx, R=0x%lx, H=0x%lx\n", // (uintptr_t) psxM, // (uintptr_t) psxP, @@ -494,6 +492,9 @@ static void lightrec_plugin_execute_internal(bool block_only) regs = lightrec_get_registers(lightrec_state); gen_interupt((psxCP0Regs *)regs->cp0); + if (!block_only && stop) + return; + cycles_pcsx = next_interupt - psxRegs.cycle; assert((s32)cycles_pcsx > 0); @@ -527,6 +528,8 @@ static void lightrec_plugin_execute_internal(bool block_only) if (flags & LIGHTREC_EXIT_SYSCALL) psxException(R3000E_Syscall << 2, 0, (psxCP0Regs *)regs->cp0); + if (flags & LIGHTREC_EXIT_BREAK) + psxException(R3000E_Bp << 2, 0, (psxCP0Regs *)regs->cp0); else if (flags & LIGHTREC_EXIT_UNKNOWN_OP) { u32 op = intFakeFetch(psxRegs.pc); u32 hlec = op & 0x03ffffff; @@ -549,8 +552,6 @@ static void lightrec_plugin_execute_internal(bool block_only) static void lightrec_plugin_execute(void) { - extern int stop; - while (!stop) lightrec_plugin_execute_internal(false); } @@ -625,6 +626,8 @@ static void lightrec_plugin_reset(void) regs->cp0[12] = 0x10900000; // COP0 enabled | BEV = 1 | TS = 1 regs->cp0[15] = 0x00000002; // PRevID = Revision ID, same as R3000A + + lightrec_set_unsafe_opt_flags(lightrec_state, lightrec_hacks); } static void lightrec_plugin_sync_regs_from_pcsx(bool need_cp2)