From a4d8be50232946143d68e14deac8b51ddac7e5d4 Mon Sep 17 00:00:00 2001 From: daniel229 Date: Wed, 18 Mar 2015 11:43:31 +0800 Subject: [PATCH] Fixes saveicon in Gakuen Heaven. --- Core/HLE/ReplaceTables.cpp | 10 ++++++++++ Core/MIPS/MIPSAnalyst.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 509ba0eb9d..a4c463af92 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -1001,6 +1001,15 @@ static int Hook_photokano_download_frame_2() { return 0; } +static int Hook_gakuenheaven_download_frame() { + const u32 fb_address = currentMIPS->r[MIPS_REG_A0]; + if (Memory::IsVRAMAddress(fb_address)) { + gpu->PerformMemoryDownload(fb_address, 0x00088000); + CBreakPoints::ExecMemCheck(fb_address, true, 0x00088000, currentMIPS->pc); +} + return 0; +} + #ifdef ARM #define JITFUNC(f) (&MIPSComp::ArmJit::f) #elif defined(_M_X64) || defined(_M_IX86) @@ -1090,6 +1099,7 @@ static const ReplacementTableEntry entries[] = { { "utawarerumono_download_frame", &Hook_utawarerumono_download_frame, 0, REPFLAG_HOOKENTER, }, { "photokano_download_frame", &Hook_photokano_download_frame, 0, REPFLAG_HOOKENTER, 0x2C }, { "photokano_download_frame_2", &Hook_photokano_download_frame_2, 0, REPFLAG_HOOKENTER, }, + { "gakuenheaven_download_frame", &Hook_gakuenheaven_download_frame, 0, REPFLAG_HOOKENTER, }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index ea7a6d3da8..2a56679f2f 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -347,6 +347,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0xad67add5122b8c64, 52, "matrix_q_translate_t", }, { 0xada952a1adcea4f5, 60, "vmmul_q_transp5", }, { 0xadfbf8fb8c933193, 56, "fabs", }, + { 0xae39bac51fd6e76b, 628, "gakuenheaven_download_frame", }, // Gakuen Heaven: Boy's Love Scramble! { 0xae50226363135bdd, 24, "vector_sub_t", }, { 0xae6cd7dfac82c244, 48, "vpow_s", }, { 0xaf85d47f95ad2921, 1936, "pow", },