From de8503f83be9174ae12f685ffe863ad1a8bef5ce Mon Sep 17 00:00:00 2001 From: daniel229 Date: Sun, 3 Jan 2016 22:35:46 +0800 Subject: [PATCH] Replace function in Shinigami to Shoujo --- 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 617b173d7..1d3da8a7f 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -1070,6 +1070,15 @@ static int Hook_littlebustersce_download_frame() { return 0; } +static int Hook_shinigamitoshoujo_download_frame() { + const u32 fb_address = currentMIPS->r[MIPS_REG_S2]; + 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(ARM64) @@ -1170,6 +1179,7 @@ static const ReplacementTableEntry entries[] = { { "atvoffroadfurypro_download_frame", &Hook_atvoffroadfurypro_download_frame, 0, REPFLAG_HOOKENTER, }, { "atvoffroadfuryblazintrails_download_frame", &Hook_atvoffroadfuryblazintrails_download_frame, 0, REPFLAG_HOOKENTER, }, { "littlebustersce_download_frame", &Hook_littlebustersce_download_frame, 0, REPFLAG_HOOKENTER, }, + { "shinigamitoshoujo_download_frame", &Hook_shinigamitoshoujo_download_frame, 0, REPFLAG_HOOKENTER, 0xBC }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 73713e867..80b1bc221 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -317,6 +317,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x92c7d2de74068c9c, 32, "vcross_t", }, { 0x93d8a275ba288b26, 32, "vdot_t", }, { 0x94c7083b64a946b4, 2028, "powf", }, + { 0x94eb1e7dccca76a4, 680, "shinigamitoshoujo_download_frame", }, // Shinigami to Shoujo (JP) { 0x95a52ce1bc460108, 2036, "_malloc_r", }, { 0x95bd33ac373c019a, 24, "fabsf", }, { 0x9705934b0950d68d, 280, "dl_write_framebuffer_ptr", },