From: notaz Date: Sat, 25 Jan 2025 19:43:59 +0000 (+0200) Subject: drc: must call both callbacks in mixed mode X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87a525f07ee32e8c53295c1249dabb556e302b15;p=pcsx_rearmed.git drc: must call both callbacks in mixed mode libretro/pcsx_rearmed#871 --- diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c index 69e2bc9b..1698b9fa 100644 --- a/libpcsxcore/new_dynarec/emu_if.c +++ b/libpcsxcore/new_dynarec/emu_if.c @@ -340,6 +340,31 @@ static void clear_local_cache(void) #endif } +static void mixed_execute_block(struct psxRegisters *regs, enum blockExecCaller caller) +{ + psxInt.ExecuteBlock(regs, caller); +} + +static void mixed_clear(u32 addr, u32 size) +{ + ari64_clear(addr, size); + psxInt.Clear(addr, size); +} + +static void mixed_notify(enum R3000Anote note, void *data) +{ + ari64_notify(note, data); + psxInt.Notify(note, data); +} + +static R3000Acpu psxMixedCpu = { + NULL /* Init */, NULL /* Reset */, NULL /* Execute */, + mixed_execute_block, + mixed_clear, + mixed_notify, + NULL /* ApplyConfig */, NULL /* Shutdown */ +}; + static noinline void ari64_execute_threaded_slow(struct psxRegisters *regs, enum blockExecCaller block_caller) { @@ -353,10 +378,11 @@ static noinline void ari64_execute_threaded_slow(struct psxRegisters *regs, //ari64_notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL); psxInt.Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL); - psxCpu = &psxInt; + assert(psxCpu == &psxRec); + psxCpu = &psxMixedCpu; for (;;) { - psxInt.ExecuteBlock(regs, block_caller); + mixed_execute_block(regs, block_caller); if (ndrc_g.thread.busy_addr == ~0u) break;