Hook framebuffer readback function in Persona 2

Same as #20067, but for Persona 2.

Fixes #13079
This commit is contained in:
Henrik Rydgård 2025-03-03 11:32:00 +01:00
parent f40cd8b8e6
commit d04aa75b54
2 changed files with 6 additions and 3 deletions

View file

@ -1280,8 +1280,9 @@ static int Hook_omertachinmokunookitethelegacy_download_frame() {
return 0;
}
// Function at 0886665C in US version
static int Hook_persona1_download_frame() {
// Function at 0886665C in US version (Persona 1)
// Function at 08807DC4 in EU version (Persona 2)
static int Hook_persona_download_frame() {
const u32 fb_address = 0x04088000; // hardcoded at 088666D8
// const u32 dest_address = currentMIPS->r[MIPS_REG_A1]; // not relevant
if (Memory::IsVRAMAddress(fb_address)) {
@ -1606,7 +1607,8 @@ static const ReplacementTableEntry entries[] = {
{ "ZZT3_select_hack", &Hook_ZZT3_select_hack, 0, REPFLAG_HOOKENTER, 0xC4 },
{ "blitz_fps_hack", &Hook_blitz_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{ "brian_lara_fps_hack", &Hook_brian_lara_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{ "persona1_download_frame", &Hook_persona1_download_frame, 0, REPFLAG_HOOKENTER, 0 },
{ "persona1_download_frame", &Hook_persona_download_frame, 0, REPFLAG_HOOKENTER, 0 },
{ "persona2_download_frame", &Hook_persona_download_frame, 0, REPFLAG_HOOKENTER, 0 },
{}
};

View file

@ -515,6 +515,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0x0dc5ca84f707863c, 452, "blitz_fps_hack", }, // Blitz: Overtime
{ 0xf93d3cd093595a6c, 856, "brian_lara_fps_hack", }, // Brian Lara 2007: Pressure Play
{ 0xc1d4af42a4c8860f, 964, "persona1_download_frame", }, // Persona 1 (issue #13079)
{ 0xde4286b2e7f6d3c1, 304, "persona2_download_frame", }, // Persona 2 (issue #13079)
};
namespace MIPSAnalyst {