Hook Star Ocean's function to upload stencil data.

Hurray, it seems to work properly.
This commit is contained in:
Unknown W. Brackets 2014-05-31 18:27:02 -07:00
parent b603a71281
commit f6d4be1d49
2 changed files with 11 additions and 0 deletions

View file

@ -20,6 +20,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/logging.h" #include "base/logging.h"
#include "Core/Config.h"
#include "Core/Debugger/Breakpoints.h" #include "Core/Debugger/Breakpoints.h"
#include "Core/MemMap.h" #include "Core/MemMap.h"
#include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/MIPS/JitCommon/JitCommon.h"
@ -495,6 +496,14 @@ static int Hook_hexyzforce_monoclome_thread() {
return 0; 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. // Can either replace with C functions or functions emitted in Asm/ArmAsm.
static const ReplacementTableEntry entries[] = { static const ReplacementTableEntry entries[] = {
// TODO: I think some games can be helped quite a bit by implementing the // 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}, { "godseaterburst_blit_texture", &Hook_godseaterburst_blit_texture, 0, REPFLAG_HOOKENTER},
{ "hexyzforce_monoclome_thread", &Hook_hexyzforce_monoclome_thread, 0, REPFLAG_HOOKENTER, 0x58}, { "hexyzforce_monoclome_thread", &Hook_hexyzforce_monoclome_thread, 0, REPFLAG_HOOKENTER, 0x58},
{ "starocean_write_stencil", &Hook_starocean_write_stencil, 0, REPFLAG_HOOKENTER, 0x260},
{} {}
}; };

View file

@ -347,6 +347,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0xc51519f5dab342d4, 224, "cosf", }, { 0xc51519f5dab342d4, 224, "cosf", },
{ 0xc52c14b9af8c3008, 76, "memcmp", }, { 0xc52c14b9af8c3008, 76, "memcmp", },
{ 0xc54eae62622f1e11, 164, "dl_write_bone_matrix_2", }, { 0xc54eae62622f1e11, 164, "dl_write_bone_matrix_2", },
{ 0xc6b29de7d3245198, 656, "starocean_write_stencil" }, // Star Ocean 1
{ 0xc96e3a087ebf49a9, 100, "dl_write_light_color", }, { 0xc96e3a087ebf49a9, 100, "dl_write_light_color", },
{ 0xcb7a2edd603ecfef, 48, "vtfm_p", }, { 0xcb7a2edd603ecfef, 48, "vtfm_p", },
{ 0xcdf64d21418b2667, 24, "vzero_q", }, { 0xcdf64d21418b2667, 24, "vzero_q", },