diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 16b8ca7fe8..baf24e43ad 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -1238,6 +1238,17 @@ static int Hook_motorstorm_pixel_read() { return 0; } +static int Hook_worms_copy_normalize_alpha() { + // At this point in the function (0x0CC), s1 is the framebuf and a2 is the size. + u32 fb_address = currentMIPS->r[MIPS_REG_S1]; + u32 fb_size = currentMIPS->r[MIPS_REG_A2]; + if (Memory::IsVRAMAddress(fb_address) && Memory::IsValidRange(fb_address, fb_size)) { + gpu->PerformMemoryDownload(fb_address, fb_size); + CBreakPoints::ExecMemCheck(fb_address, true, fb_size, currentMIPS->pc); + } + return 0; +} + #define JITFUNC(f) (&MIPSComp::MIPSFrontendInterface::f) // Can either replace with C functions or functions emitted in Asm/ArmAsm. @@ -1350,6 +1361,7 @@ static const ReplacementTableEntry entries[] = { { "starocean_clear_framebuf", &Hook_starocean_clear_framebuf_before, 0, REPFLAG_HOOKENTER, 0 }, { "starocean_clear_framebuf", &Hook_starocean_clear_framebuf_after, 0, REPFLAG_HOOKEXIT, 0 }, { "motorstorm_pixel_read", &Hook_motorstorm_pixel_read, 0, REPFLAG_HOOKENTER, 0 }, + { "worms_copy_normalize_alpha", &Hook_worms_copy_normalize_alpha, 0, REPFLAG_HOOKENTER, 0x0CC }, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 1a39988abc..4ee8302882 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -325,6 +325,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0x8df2928848857e97, 164, "strcat", }, { 0x8e48cabd529ca6b5, 52, "vector_multiply_t", }, { 0x8e97dcb03fbaba5c, 104, "vmmul_q_transp", }, + { 0x8ecf804bbe7922e5, 572, "worms_copy_normalize_alpha" }, // Worms Battle Islands (US) { 0x8ee81b03d2eef1e7, 28, "vmul_t", }, { 0x8f09fb8693c3c49d, 992, "kirameki_school_life_download_frame", }, // Hentai Ouji To Warawanai Neko { 0x8f19c41e8b987e18, 100, "matrix_mogrify", },