From b1d94617797859998f1c2355122b7a313d862403 Mon Sep 17 00:00:00 2001 From: daniel229 Date: Tue, 9 Sep 2014 14:33:15 +0800 Subject: [PATCH] Replace frame download in Narisokonai Eiyuutan --- 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 98dc830fc7..73073fdf49 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -616,6 +616,15 @@ static int Hook_sd_gundam_g_generation_download_frame() { return 0; } +static int Hook_narisokonai_download_frame() { + const u32 fb_address = currentMIPS->r[MIPS_REG_V0]; + if (Memory::IsVRAMAddress(fb_address)) { + gpu->PerformMemoryDownload(fb_address, 0x00044000); + CBreakPoints::ExecMemCheck(fb_address, true, 0x00044000, 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 @@ -665,6 +674,7 @@ static const ReplacementTableEntry entries[] = { { "brandish_download_frame", &Hook_brandish_download_frame, 0, REPFLAG_HOOKENTER }, { "growlanser_create_saveicon", &Hook_growlanser_create_saveicon, 0, REPFLAG_HOOKENTER, 0x7C }, { "sd_gundam_g_generation_download_frame", &Hook_sd_gundam_g_generation_download_frame, 0, REPFLAG_HOOKENTER, 0x48}, + { "narisokonai_download_frame", &Hook_narisokonai_download_frame, 0, REPFLAG_HOOKENTER, 0x14 }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 2a8d70408d..0fc438189c 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -385,6 +385,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0xe1724e6e29209d97, 24, "vector_length_t_2", }, { 0xe1a5d939cc308195, 68, "wcscmp", }, { 0xe2d9106e5b9e39e6, 80, "strnlen", }, + { 0xe3154c81a76515fa, 208, "narisokonai_download_frame", }, // Narisokonai Eiyuutan { 0xe32cb5c062d1a1c4, 700, "_strtoull_r", }, { 0xe3835fb2c9c04e59, 44, "vmmul_q", }, { 0xe527c62d8613f297, 136, "strcpy", },