diff options
author | David Guillen Fandos | 2021-04-04 18:13:15 +0200 |
---|---|---|
committer | David Guillen Fandos | 2021-04-04 18:13:15 +0200 |
commit | a5c06f62d64c03b245c14bfb86b176b6455f22aa (patch) | |
tree | 3a9436e09221a0cb67318eec1e526d92ab237f53 /psp | |
parent | 5bee4d66c2e461b3a4e804b2806bdea3938a4577 (diff) | |
download | picogpsp-a5c06f62d64c03b245c14bfb86b176b6455f22aa.tar.gz picogpsp-a5c06f62d64c03b245c14bfb86b176b6455f22aa.tar.bz2 picogpsp-a5c06f62d64c03b245c14bfb86b176b6455f22aa.zip |
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.
Diffstat (limited to 'psp')
-rw-r--r-- | psp/mips_emit.h | 7 |
1 files 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); |