Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU: Hook Sol Trigger func to flush texture #15549

Merged
merged 1 commit into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,19 @@ static int Hook_openseason_data_decode() {
return 0;
}

static int Hook_soltrigger_render_ucschar() {
u32 targetInfoPtrPtr = currentMIPS->r[MIPS_REG_A2];
u32 targetInfoPtr = Memory::IsValidRange(targetInfoPtrPtr, 4) ? Memory::ReadUnchecked_U32(targetInfoPtrPtr) : 0;
if (Memory::IsValidRange(targetInfoPtr, 32)) {
u32 targetPtr = Memory::Read_U32(targetInfoPtr + 8);
u32 targetByteStride = Memory::Read_U32(targetInfoPtr + 16);

// We don't know the height specifically.
gpu->InvalidateCache(targetPtr, targetByteStride * 512, GPU_INVALIDATE_HINT);
}
return 0;
}

#define JITFUNC(f) (&MIPSComp::MIPSFrontendInterface::f)

// Can either replace with C functions or functions emitted in Asm/ArmAsm.
Expand Down Expand Up @@ -1440,6 +1453,7 @@ static const ReplacementTableEntry entries[] = {
{ "motorstorm_pixel_read", &Hook_motorstorm_pixel_read, 0, REPFLAG_HOOKENTER, 0 },
{ "worms_copy_normalize_alpha", &Hook_worms_copy_normalize_alpha, 0, REPFLAG_HOOKENTER, 0x0CC },
{ "openseason_data_decode", &Hook_openseason_data_decode, 0, REPFLAG_HOOKENTER, 0x2F0 },
{ "soltrigger_render_ucschar", &Hook_soltrigger_render_ucschar, 0, REPFLAG_HOOKENTER, 0 },
{}
};

Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0x1f53eac122f96b37, 224, "cosf", },
{ 0x2097a8b75c8fe651, 436, "atan2", },
{ 0x21411b3c860822c0, 36, "matrix_scale_q_t", },
{ 0x2161ea81a06bcacd, 1032, "soltrigger_render_ucschar", }, // Sol Trigger
{ 0x24d82a8675800808, 220, "ceilf", },
{ 0x26cc90cb25af9d27, 476, "log10", },
{ 0x275c79791a2bab83, 116, "rezel_cross_download_frame", }, // Rezel Cross
Expand Down