From 0e481d53e19263f5b62533e7c595bb99f793a99f Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Sun, 26 Nov 2023 15:04:07 +0100 Subject: [PATCH] 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 --- libpcsxcore/lightrec/plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.39.2