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

Modify Hack for Crash Tag Team Racing to fix Gundam games #9274

Merged
merged 2 commits into from
Feb 3, 2017
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
1 change: 1 addition & 0 deletions Core/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) {
CheckSetting(iniFile, gameID, "DepthRangeHack", &flags_.DepthRangeHack);
CheckSetting(iniFile, gameID, "ClearToRAM", &flags_.ClearToRAM);
CheckSetting(iniFile, gameID, "Force04154000Download", &flags_.Force04154000Download);
CheckSetting(iniFile, gameID, "DrawSyncEatCycles", &flags_.DrawSyncEatCycles);
}

void Compatibility::CheckSetting(IniFile &iniFile, const std::string &gameID, const char *option, bool *flag) {
Expand Down
1 change: 1 addition & 0 deletions Core/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct CompatFlags {
bool DepthRangeHack;
bool ClearToRAM;
bool Force04154000Download;
bool DrawSyncEatCycles;
};

class IniFile;
Expand Down
2 changes: 2 additions & 0 deletions Core/HLE/sceGe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ int sceGeListSync(u32 displayListID, u32 mode) {

static u32 sceGeDrawSync(u32 mode) {
//wait/check entire drawing state
if (PSP_CoreParameter().compat.flags().DrawSyncEatCycles)
hleEatCycles(500000); //HACK(?) : Potential fix for Crash Tag Team Racing and a few Gundam games
DEBUG_LOG(SCEGE, "sceGeDrawSync(mode=%d) (0=wait for completion, 1=peek)", mode);
return gpu->DrawSync(mode);
}
Expand Down
5 changes: 1 addition & 4 deletions Core/HLE/scePower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,8 @@ static int sceKernelVolatileMemLock(int type, u32 paddr, u32 psize) {

switch (error) {
case 0:
// HACK: This fixes Crash Tag Team Racing.
// Should only wait 1200 cycles though according to Unknown's testing,
// and with that it's still broken. So it's not this, unfortunately.
// Leaving it in for the 0.9.8 release anyway.
hleEatCycles(500000);
hleEatCycles(1200);
DEBUG_LOG(HLE, "sceKernelVolatileMemLock(%i, %08x, %08x) - success", type, paddr, psize);
break;

Expand Down
24 changes: 24 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,27 @@ ULJS00033 = true
UCKS45022 = true
ULJS19009 = true
NPJH50141 = true


[DrawSyncEatCycles]
# This replaced Crash Tag Team Racing hack to also fix Gundam games
# It makes sceGeDrawSync eat a lot of cycles which can affect timing in lots of games,
# might be negative for others, but happens to fix games below.
# Crash Tag Team Racing needs it to pass checking memory stick screen.
ULUS10044 = true
ULES00168 = true
ULJM05036 = true
# Gundam Battle Royale might need it to avoid crashes when certain Ace enemies shows up
ULJS00083 = true
ULKS46104 = true
ULJS19015 = true
# Gundam Battle Chronicle needs it to avoid crashes after most battles
ULJS00122 = true
ULKS46158 = true
ULJS19021 = true
# Gundam Battle Universe same problem as above
ULJS00145 = true
ULKS46183 = true
ULJS00260 = true
ULJS19041 = true
NPJH50843 = true