mirror of https://github.com/PCSX2/pcsx2.git
Gamefix: Add Scarface - The World is Yours Gamefix, might help other games that do constant VU recompilation.
This commit is contained in:
parent
3c528f0fdd
commit
22de865582
|
@ -58,6 +58,7 @@ enum GamefixId
|
||||||
Fix_GIFReverse,
|
Fix_GIFReverse,
|
||||||
Fix_FMVinSoftware,
|
Fix_FMVinSoftware,
|
||||||
Fix_GoemonTlbMiss,
|
Fix_GoemonTlbMiss,
|
||||||
|
Fix_ScarfaceIbit,
|
||||||
|
|
||||||
GamefixId_COUNT
|
GamefixId_COUNT
|
||||||
};
|
};
|
||||||
|
@ -350,7 +351,8 @@ struct Pcsx2Config
|
||||||
VIF1StallHack :1, // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
|
VIF1StallHack :1, // Like above, processes FIFO data before the stall is allowed (to make sure data goes over).
|
||||||
GIFReverseHack :1, // Allows PATH3 to continue even if the FIFO is reversed.
|
GIFReverseHack :1, // Allows PATH3 to continue even if the FIFO is reversed.
|
||||||
FMVinSoftwareHack:1, // Toggle in and out of software rendering when an FMV runs.
|
FMVinSoftwareHack:1, // Toggle in and out of software rendering when an FMV runs.
|
||||||
GoemonTlbHack:1; // Gomeon tlb miss hack. The game need to access unmapped virtual address. Instead to handle it as exception, tlb are preloaded at startup
|
GoemonTlbHack :1, // Gomeon tlb miss hack. The game need to access unmapped virtual address. Instead to handle it as exception, tlb are preloaded at startup
|
||||||
|
ScarfaceIbit :1; // Scarface I bit hack. Needed to stop constant VU recompilation
|
||||||
BITFIELD_END
|
BITFIELD_END
|
||||||
|
|
||||||
GamefixOptions();
|
GamefixOptions();
|
||||||
|
|
|
@ -319,7 +319,7 @@ void Pcsx2Config::GamefixOptions::Set( GamefixId id, bool enabled )
|
||||||
case Fix_GIFReverse: GIFReverseHack = enabled; break;
|
case Fix_GIFReverse: GIFReverseHack = enabled; break;
|
||||||
case Fix_FMVinSoftware: FMVinSoftwareHack = enabled; break;
|
case Fix_FMVinSoftware: FMVinSoftwareHack = enabled; break;
|
||||||
case Fix_GoemonTlbMiss: GoemonTlbHack = enabled; break;
|
case Fix_GoemonTlbMiss: GoemonTlbHack = enabled; break;
|
||||||
|
case Fix_ScarfaceIbit: ScarfaceIbit = enabled; break;
|
||||||
jNO_DEFAULT;
|
jNO_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ bool Pcsx2Config::GamefixOptions::Get( GamefixId id ) const
|
||||||
case Fix_GIFReverse: return GIFReverseHack;
|
case Fix_GIFReverse: return GIFReverseHack;
|
||||||
case Fix_FMVinSoftware: return FMVinSoftwareHack;
|
case Fix_FMVinSoftware: return FMVinSoftwareHack;
|
||||||
case Fix_GoemonTlbMiss: return GoemonTlbHack;
|
case Fix_GoemonTlbMiss: return GoemonTlbHack;
|
||||||
|
case Fix_ScarfaceIbit: return ScarfaceIbit;
|
||||||
jNO_DEFAULT;
|
jNO_DEFAULT;
|
||||||
}
|
}
|
||||||
return false; // unreachable, but we still need to suppress warnings >_<
|
return false; // unreachable, but we still need to suppress warnings >_<
|
||||||
|
@ -371,6 +371,7 @@ void Pcsx2Config::GamefixOptions::LoadSave( IniInterface& ini )
|
||||||
IniBitBool( GIFReverseHack );
|
IniBitBool( GIFReverseHack );
|
||||||
IniBitBool( FMVinSoftwareHack );
|
IniBitBool( FMVinSoftwareHack );
|
||||||
IniBitBool( GoemonTlbHack );
|
IniBitBool( GoemonTlbHack );
|
||||||
|
IniBitBool( ScarfaceIbit );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,10 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow* parent )
|
||||||
{
|
{
|
||||||
_("Preload TLB hack to avoid tlb miss on Goemon"),
|
_("Preload TLB hack to avoid tlb miss on Goemon"),
|
||||||
wxEmptyString
|
wxEmptyString
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_("VU I bit Hack avoid constant recompilation (Scarface The World Is Yours)"),
|
||||||
|
wxEmptyString
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,16 @@ _mVUt __fi void* mVUsearchProg(u32 startPC, uptr pState) {
|
||||||
if(!quick.prog) { // If null, we need to search for new program
|
if(!quick.prog) { // If null, we need to search for new program
|
||||||
std::deque<microProgram*>::iterator it(list->begin());
|
std::deque<microProgram*>::iterator it(list->begin());
|
||||||
for ( ; it != list->end(); ++it) {
|
for ( ; it != list->end(); ++it) {
|
||||||
if (mVUcmpProg(mVU, *it[0], 0)) {
|
bool b = mVUcmpProg(mVU, *it[0], 0);
|
||||||
|
if (EmuConfig.Gamefixes.ScarfaceIbit) {
|
||||||
|
if (isVU1 && ((((u32*)mVU.regs().Micro)[startPC / 4 + 1]) == 0x80200118) && ((((u32*)mVU.regs().Micro)[startPC / 4 + 3]) == 0x81000062)) {
|
||||||
|
b = true;
|
||||||
|
mVU.prog.cleared = 0;
|
||||||
|
mVU.prog.cur = it[0];
|
||||||
|
mVU.prog.isSame = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (b) {
|
||||||
quick.block = it[0]->block[startPC/8];
|
quick.block = it[0]->block[startPC/8];
|
||||||
quick.prog = it[0];
|
quick.prog = it[0];
|
||||||
list->erase(it);
|
list->erase(it);
|
||||||
|
|
|
@ -107,16 +107,21 @@ __ri void flushRegs(mV) { if (!doRegAlloc) mVU.regAlloc->flushAll(); }
|
||||||
void doIbit(mV) {
|
void doIbit(mV) {
|
||||||
if (mVUup.iBit) {
|
if (mVUup.iBit) {
|
||||||
incPC(-1);
|
incPC(-1);
|
||||||
u32 tempI;
|
|
||||||
mVU.regAlloc->clearRegVF(33);
|
mVU.regAlloc->clearRegVF(33);
|
||||||
|
if (EmuConfig.Gamefixes.ScarfaceIbit) {
|
||||||
if (CHECK_VU_OVERFLOW && ((curI & 0x7fffffff) >= 0x7f800000)) {
|
xMOV(gprT1, ptr32[&curI]);
|
||||||
DevCon.WriteLn(Color_Green,"microVU%d: Clamping I Reg", mVU.index);
|
xMOV(ptr32[&mVU.getVI(REG_I)], gprT1);
|
||||||
tempI = (0x80000000 & curI) | 0x7f7fffff; // Clamp I Reg
|
|
||||||
}
|
}
|
||||||
else tempI = curI;
|
else {
|
||||||
|
u32 tempI;
|
||||||
|
if (CHECK_VU_OVERFLOW && ((curI & 0x7fffffff) >= 0x7f800000)) {
|
||||||
|
DevCon.WriteLn(Color_Green, "microVU%d: Clamping I Reg", mVU.index);
|
||||||
|
tempI = (0x80000000 & curI) | 0x7f7fffff; // Clamp I Reg
|
||||||
|
}
|
||||||
|
else tempI = curI;
|
||||||
|
|
||||||
xMOV(ptr32[&mVU.getVI(REG_I)], tempI);
|
xMOV(ptr32[&mVU.getVI(REG_I)], tempI);
|
||||||
|
}
|
||||||
incPC(1);
|
incPC(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue