From: Paul Cercueil Date: Sun, 26 Nov 2023 14:04:07 +0000 (+0100) Subject: lightrec: Improve hack around icache emulation X-Git-Tag: r24l~44 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e481d53e19263f5b62533e7c595bb99f793a99f;p=pcsx_rearmed.git lightrec: Improve hack around icache emulation Invalidate the whole code buffer on each call to the .clear callback. This fixes a crash after finishing a race in F1 Arcade, and does not seem to cause issues with the other F1 games. Signed-off-by: Paul Cercueil --- diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index 70d01bfe..27fdc476 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -571,7 +571,8 @@ static void lightrec_plugin_execute_block(enum blockExecCaller caller) static void lightrec_plugin_clear(u32 addr, u32 size) { - if (addr == 0 && size == UINT32_MAX) + if ((addr == 0 && size == UINT32_MAX) + || (lightrec_hacks & LIGHTREC_OPT_INV_DMA_ONLY)) lightrec_invalidate_all(lightrec_state); else /* size * 4: PCSX uses DMA units */