Another replace frame download in danganronpa 1

This commit is contained in:
daniel229 2014-10-05 13:46:47 +08:00
parent ef1484da65
commit 5ff098efb9
2 changed files with 16 additions and 0 deletions

View file

@ -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 },
{}
};

View file

@ -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", },