diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 0c27b03f46..426d7e28d7 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -765,6 +765,20 @@ static int Hook_danganronpa1_1_download_frame() { return 0; } +static int Hook_danganronpa1_2_download_frame() { + const MIPSOpcode instruction = Memory::Read_Instruction(currentMIPS->pc + 0x8, true); + const int reg_num = instruction >> 11 & 31; + const u32 fb_base = currentMIPS->r[reg_num]; + const u32 fb_offset = currentMIPS->r[MIPS_REG_V0]; + const u32 fb_offset_fix = fb_offset & 0xFFFFFFFC; + const u32 fb_address = fb_base + fb_offset_fix; + if (Memory::IsVRAMAddress(fb_address)) { + gpu->PerformMemoryDownload(fb_address, 0x00088000); + CBreakPoints::ExecMemCheck(fb_address, true, 0x00088000, currentMIPS->pc); + } + return 0; +} + // Can either replace with C functions or functions emitted in Asm/ArmAsm. static const ReplacementTableEntry entries[] = { // TODO: I think some games can be helped quite a bit by implementing the @@ -828,6 +842,7 @@ static const ReplacementTableEntry entries[] = { { "danganronpa2_1_download_frame", &Hook_danganronpa2_1_download_frame, 0, REPFLAG_HOOKENTER, 0x68 }, { "danganronpa2_2_download_frame", &Hook_danganronpa2_2_download_frame, 0, REPFLAG_HOOKENTER, 0x94 }, { "danganronpa1_1_download_frame", &Hook_danganronpa1_1_download_frame, 0, REPFLAG_HOOKENTER, 0x78 }, + { "danganronpa1_2_download_frame", &Hook_danganronpa1_2_download_frame, 0, REPFLAG_HOOKENTER, 0xA8 }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 7f2351413b..626931a650 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -245,6 +245,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x6f101c5c4311c144, 276, "floorf", }, { 0x6f1731f84bbf76c3, 116, "strcmp", }, { 0x6f4e1a1a84df1da0, 68, "dl_write_texmode", }, + { 0x6f7c9109b5b8fa47, 688, "danganronpa1_2_download_frame", }, // Danganronpa 1 { 0x70649c7211f6a8da, 16, "fabsf", }, { 0x7245b74db370ae72, 64, "vmmul_q_transp3", }, { 0x7259d52b21814a5a, 40, "vtfm_t_transp", },