From f0b6826d67fcb59ec20527e5df86a2d9bcbcab3f Mon Sep 17 00:00:00 2001 From: daniel229 Date: Tue, 6 Jan 2015 15:22:44 +0800 Subject: [PATCH] Replace frame download in To Heart 2 Portable --- 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 31480e97dd..16e32e8427 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -864,6 +864,15 @@ static int Hook_kokoroconnect_download_frame() { return 0; } +static int Hook_toheart2_download_frame() { + const u32 fb_address = currentMIPS->r[MIPS_REG_T2]; + if (Memory::IsVRAMAddress(fb_address)) { + gpu->PerformMemoryDownload(fb_address, 0x00044000); + CBreakPoints::ExecMemCheck(fb_address, true, 0x00044000, currentMIPS->pc); +} + return 0; +} + #ifdef ARM #define JITFUNC(f) (&MIPSComp::ArmJit::f) #elif defined(_M_X64) || defined(_M_IX86) @@ -944,6 +953,7 @@ static const ReplacementTableEntry entries[] = { { "otomenoheihou_download_frame", &Hook_otomenoheihou_download_frame, 0, REPFLAG_HOOKENTER, 0x14 }, { "grisaianokajitsu_download_frame", &Hook_grisaianokajitsu_download_frame, 0, REPFLAG_HOOKENTER, 0x14 }, { "kokoroconnect_download_frame", &Hook_kokoroconnect_download_frame, 0, REPFLAG_HOOKENTER, 0x60 }, + { "toheart2_download_frame", &Hook_toheart2_download_frame, 0, REPFLAG_HOOKENTER, 0x14 }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 282c945d01..84ed91b0c1 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -90,6 +90,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x0558ad5c5be00ca1, 76, "vtfm_t", }, { 0x05aedd0c04b451a1, 356, "sqrt", }, { 0x0654fc8adbe16ef7, 28, "vmul_q", }, + { 0x06628f6052cda3c1, 1776, "toheart2_download_frame", }, // To Heart 2 Portable { 0x06b243c926fa6ab5, 24, "vf2in_q", }, { 0x06e2826e02056114, 56, "wcslen", }, { 0x073cf0b61d3b875a, 416, "hexyzforce_monoclome_thread", }, // Hexyz Force