diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 47a0ff370d..bb8da12f57 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -819,6 +819,15 @@ static int Hook_rewrite_download_frame() { return 0; } +static int Hook_kudwafter_download_frame() { + const u32 fb_address = Memory::Read_U32(currentMIPS->r[MIPS_REG_SP]); + 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) @@ -894,6 +903,7 @@ static const ReplacementTableEntry entries[] = { { "kankabanchoutbr_download_frame", &Hook_kankabanchoutbr_download_frame, 0, REPFLAG_HOOKENTER, }, { "orenoimouto_download_frame_2", &Hook_orenoimouto_download_frame_2, 0, REPFLAG_HOOKENTER, }, { "rewrite_download_frame", &Hook_rewrite_download_frame, 0, REPFLAG_HOOKENTER, 0x98 }, + { "kudwafter_download_frame", &Hook_kudwafter_download_frame, 0, REPFLAG_HOOKENTER, 0x74 }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 0e62c11566..5aa31f8b56 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -377,6 +377,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0xc54eae62622f1e11, 164, "dl_write_bone_matrix_2", }, { 0xc6b29de7d3245198, 656, "starocean_write_stencil" }, // Star Ocean 1 { 0xc96e3a087ebf49a9, 100, "dl_write_light_color", }, + { 0xca7cb2c0b9410618, 680, "kudwafter_download_frame", }, // Kud Wafter { 0xcb7a2edd603ecfef, 48, "vtfm_p", }, { 0xcdf64d21418b2667, 24, "vzero_q", }, { 0xce1c95ee25b8e2ea, 448, "fmod", },