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

VU: Expand IBit hack to work for immediates on several instructions #11117

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
34 changes: 34 additions & 0 deletions bin/resources/GameIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3573,6 +3573,8 @@ SCED-52759:
region: "PAL-M5"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCED-52785:
Expand All @@ -3598,6 +3600,8 @@ SCED-52846:
region: "PAL-E"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCED-52847:
Expand Down Expand Up @@ -3667,6 +3671,8 @@ SCED-52899:
region: "PAL-M5"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCED-52932:
Expand Down Expand Up @@ -5210,6 +5216,8 @@ SCES-52004:
compat: 5
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCES-52033:
Expand Down Expand Up @@ -5552,6 +5560,8 @@ SCES-52893:
region: "PAL-E-GR-R"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCES-52930:
Expand Down Expand Up @@ -7085,6 +7095,8 @@ SCKA-20048:
region: "NTSC-K"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCKA-20049:
Expand Down Expand Up @@ -7303,6 +7315,8 @@ SCKA-20078:
region: "NTSC-K"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCKA-20079:
Expand Down Expand Up @@ -11342,6 +11356,8 @@ SCUS-97402:
compat: 5
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCUS-97403:
Expand Down Expand Up @@ -11490,13 +11506,17 @@ SCUS-97431:
region: "NTSC-U"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCUS-97432:
name: "Killzone [Regular Demo]"
region: "NTSC-U"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCUS-97436:
Expand Down Expand Up @@ -11964,6 +11984,8 @@ SCUS-97517:
region: "NTSC-U"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SCUS-97518:
Expand Down Expand Up @@ -13174,6 +13196,8 @@ SLED-52899:
region: "PAL-M5"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SLED-52929:
Expand Down Expand Up @@ -18575,13 +18599,17 @@ SLES-51981:
region: "PAL-E"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
roundSprite: 1 # Fixes slight blur.
SLES-51982:
name: "ShellShock - Nam '67"
region: "PAL-M3"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
roundSprite: 1 # Fixes slight blur.
SLES-51986:
Expand Down Expand Up @@ -44237,6 +44265,8 @@ SLPM-66151:
region: "NTSC-J"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
SLPM-66152:
Expand Down Expand Up @@ -63341,6 +63371,8 @@ SLUS-20828:
compat: 5
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
roundSprite: 1 # Fixes slight blur.
SLUS-20830:
Expand Down Expand Up @@ -70946,6 +70978,8 @@ TCES-52004:
region: "PAL-E"
clampModes:
vuClampMode: 0 # Resolves I Reg Clamping / performance impact and yellow graphics in certain areas.
gameFixes:
- IbitHack # Reduces VU recompilation.
gsHWFixes:
halfPixelOffset: 2 # Fixes blurriness.
TCES-52033:
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/x86/microVU_Analyze.inl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ __fi void mVUanalyzeIALU2(mV, int Is, int It)
__fi void mVUanalyzeIADDI(mV, int Is, int It, s16 imm)
{
mVUanalyzeIALU2(mVU, Is, It);
if (!Is)
if (!Is && !EmuConfig.Gamefixes.IbitHack)
{
setConstReg(It, imm);
}
Expand Down
17 changes: 16 additions & 1 deletion pcsx2/x86/microVU_Compile.inl
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,27 @@ void* mVUcompile(microVU& mVU, u32 startPC, uptr pState)
{
mVUsetupRange(mVU, xPC, false);
if (branch < 2)
mVUsetupRange(mVU, xPC + 8, true); // Ideally we'd do +4 but the mmx compare only works in 64bits, this should be fine
mVUsetupRange(mVU, xPC + 4, true);
}
}
else
{
incPC(-1);
if (EmuConfig.Gamefixes.IbitHack)
{
// Ignore IADDI, IADDIU and ISUBU, ILW, ISW, LQ, SQ.
// Be warned, this is a little risky as we could be ignoring subtle differences in the operations.
// 2 is too much, 1 is too little, so it gets 2. It's a hack anyways...
const u32 upper = (mVU.code >> 25);
if (upper == 0x1 || upper == 0x0 || upper == 0x4 || upper == 0x5 || upper == 0x8 || upper == 0x9 || (upper == 0x40 && (mVU.code & 0x3F) == 0x32))
{
incPC(1);
mVUsetupRange(mVU, xPC, false);
if (branch < 2)
mVUsetupRange(mVU, xPC + 2, true);
incPC(-1);
}
}
mVUopL(mVU, 0);
incPC(1);
}
Expand Down
Loading