From a5c06f62d64c03b245c14bfb86b176b6455f22aa Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Sun, 4 Apr 2021 18:13:15 +0200 Subject: Fix palette writes in MIPS Was not writing to the right address (but decoded memory was working). Most game worked well except those that depend on modifying the existing palette bits (instead of copying from ROM/RAM). Fixes several games. --- psp/mips_emit.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/psp/mips_emit.h b/psp/mips_emit.h index a435e63..73f589a 100644 --- a/psp/mips_emit.h +++ b/psp/mips_emit.h @@ -2950,13 +2950,14 @@ static void emit_palette_hdl( } mips_emit_addu(reg_rv, reg_rv, reg_base); - // Store the data (delay slot from the SMC branch) + // Store the data in real palette memory if (realsize == 2) { - mips_emit_sw(reg_a1, reg_base, 0x100); + mips_emit_sw(reg_a1, reg_rv, 0x100); } else if (realsize == 1) { - mips_emit_sh(reg_a1, reg_base, 0x100); + mips_emit_sh(reg_a1, reg_rv, 0x100); } + // Convert and store in mirror memory palette_convert(); mips_emit_sh(reg_temp, reg_rv, 0x500); -- cgit v1.2.3