From 7f6f52a9042c931dd578edfd3867d6f816712c5d Mon Sep 17 00:00:00 2001 From: daniel229 Date: Thu, 11 Sep 2014 00:18:59 +0800 Subject: [PATCH 1/2] Fixes saveicons in Kirameki School Life SP. --- 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 73073fdf49..ed08ab75db 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -625,6 +625,15 @@ static int Hook_narisokonai_download_frame() { return 0; } +static int Hook_kirameki_download_frame() { + const u32 fb_address = currentMIPS->r[MIPS_REG_S0]; + 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 @@ -675,6 +684,7 @@ static const ReplacementTableEntry entries[] = { { "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 }, + { "kirameki_download_frame", &Hook_kirameki_download_frame, 0, REPFLAG_HOOKENTER, }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 0fc438189c..acf1217c97 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -269,6 +269,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x87fe3f7e621ddebb, 212, "memcpy", }, { 0x891ca854e1c664e9, 2392, "qsort", }, { 0x8965d4b004adad28, 420, "log10f", }, + { 0x8986c3bffe0def77, 88, "kirameki_download_frame", }, // Kirameki School Life SP { 0x89e1858ba11b84e4, 52, "memset", }, { 0x8a00e7207e7dbc81, 232, "_exit", }, { 0x8a1f9daadecbaf7f, 104, "vmmul_q_transp", }, From e8efab6d2175f4497cc242efa2156440a96baabc Mon Sep 17 00:00:00 2001 From: daniel229 Date: Thu, 11 Sep 2014 00:47:06 +0800 Subject: [PATCH 2/2] Change function name --- Core/HLE/ReplaceTables.cpp | 4 ++-- Core/MIPS/MIPSAnalyst.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index ed08ab75db..61f41ffb3b 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -625,7 +625,7 @@ static int Hook_narisokonai_download_frame() { return 0; } -static int Hook_kirameki_download_frame() { +static int Hook_kirameki_school_life_download_frame() { const u32 fb_address = currentMIPS->r[MIPS_REG_S0]; if (Memory::IsVRAMAddress(fb_address)) { gpu->PerformMemoryDownload(fb_address, 0x00044000); @@ -684,7 +684,7 @@ static const ReplacementTableEntry entries[] = { { "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 }, - { "kirameki_download_frame", &Hook_kirameki_download_frame, 0, REPFLAG_HOOKENTER, }, + { "kirameki_school_life_download_frame", &Hook_kirameki_school_life_download_frame, 0, REPFLAG_HOOKENTER, }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index acf1217c97..81e803dc16 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -269,7 +269,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x87fe3f7e621ddebb, 212, "memcpy", }, { 0x891ca854e1c664e9, 2392, "qsort", }, { 0x8965d4b004adad28, 420, "log10f", }, - { 0x8986c3bffe0def77, 88, "kirameki_download_frame", }, // Kirameki School Life SP + { 0x8986c3bffe0def77, 88, "kirameki_school_life_download_frame", }, // Kirameki School Life SP { 0x89e1858ba11b84e4, 52, "memset", }, { 0x8a00e7207e7dbc81, 232, "_exit", }, { 0x8a1f9daadecbaf7f, 104, "vmmul_q_transp", },