diff --git a/Core/HLE/ReplaceTables.cpp b/Core/HLE/ReplaceTables.cpp index 147e904430..5eb2c7626a 100644 --- a/Core/HLE/ReplaceTables.cpp +++ b/Core/HLE/ReplaceTables.cpp @@ -20,6 +20,7 @@ #include "base/basictypes.h" #include "base/logging.h" +#include "Core/Config.h" #include "Core/Debugger/Breakpoints.h" #include "Core/MemMap.h" #include "Core/MIPS/JitCommon/JitCommon.h" @@ -495,6 +496,14 @@ static int Hook_hexyzforce_monoclome_thread() { return 0; } +static int Hook_starocean_write_stencil() { + u32 fb_address = currentMIPS->r[MIPS_REG_T7]; + if (Memory::IsVRAMAddress(fb_address) && !g_Config.bDisableStencilTest) { + gpu->PerformStencilUpload(fb_address, 0x00088000); + } + 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 @@ -536,6 +545,7 @@ static const ReplacementTableEntry entries[] = { { "godseaterburst_blit_texture", &Hook_godseaterburst_blit_texture, 0, REPFLAG_HOOKENTER}, { "hexyzforce_monoclome_thread", &Hook_hexyzforce_monoclome_thread, 0, REPFLAG_HOOKENTER, 0x58}, + { "starocean_write_stencil", &Hook_starocean_write_stencil, 0, REPFLAG_HOOKENTER, 0x260}, {} }; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index dd67a452c6..be49300bb6 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -347,6 +347,7 @@ static const HardHashTableEntry hardcodedHashes[] = { { 0xc51519f5dab342d4, 224, "cosf", }, { 0xc52c14b9af8c3008, 76, "memcmp", }, { 0xc54eae62622f1e11, 164, "dl_write_bone_matrix_2", }, + { 0xc6b29de7d3245198, 656, "starocean_write_stencil" }, // Star Ocean 1 { 0xc96e3a087ebf49a9, 100, "dl_write_light_color", }, { 0xcb7a2edd603ecfef, 48, "vtfm_p", }, { 0xcdf64d21418b2667, 24, "vzero_q", },