Skip to content

Commit

Permalink
Crazy Taxi workaround. See #19894
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 20, 2025
1 parent 42f8b49 commit 7d852b4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,18 +748,20 @@ DLResult GPUCommon::ProcessDLQueue() {
for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) {
DisplayList &list = dls[listIndex];

if (!Memory::IsValidAddress(list.pc)) {
ERROR_LOG(Log::G3D, "DL PC = %08x WTF!!!!", list.pc);
return DLResult::Error;
if (list.state == PSP_GE_DL_STATE_PAUSED) {
return DLResult::Done;
}

DEBUG_LOG(Log::G3D, "%s DL execution at %08x - stall = %08x (startingTicks=%lld)",
list.pc == list.startpc ? "Starting" : "Resuming", list.pc, list.stall, startingTicks);

if (list.state == PSP_GE_DL_STATE_PAUSED) {
// Temporary workaround for Crazy Taxi, see #19894
if (list.state == PSP_GE_DL_STATE_NONE) {
WARN_LOG(Log::G3D, "Discarding display list with state NONE (pc=%08x). This is odd.", list.pc);
dlQueue.erase(std::remove(dlQueue.begin(), dlQueue.end(), listIndex), dlQueue.end());
return DLResult::Done;
}

DEBUG_LOG(Log::G3D, "%s DL execution at %08x - stall = %08x (startingTicks=%lld)",
list.pc == list.startpc ? "Starting" : "Resuming", list.pc, list.stall, startingTicks);

if (!resumingFromDebugBreak_) {
// TODO: Need to be careful when *resuming* a list (when it wasn't from a stall...)
currentList = &list;
Expand All @@ -771,6 +773,11 @@ DLResult GPUCommon::ProcessDLQueue() {

gstate_c.offsetAddr = list.offsetAddr;

if (!Memory::IsValidAddress(list.pc)) {
ERROR_LOG(Log::G3D, "DL PC = %08x WTF!!!!", list.pc);
return DLResult::Done;
}

cycleLastPC = list.pc;
cyclesExecuted += 60;
downcount = list.stall == 0 ? 0x0FFFFFFF : (list.stall - list.pc) / 4;
Expand Down Expand Up @@ -842,6 +849,7 @@ DLResult GPUCommon::ProcessDLQueue() {
// don't do anything - though dunno about error...
break;
case GPUSTATE_STALL:
// Resume work on this same display list later.
return DLResult::Done;
default:
return DLResult::Error;
Expand Down

0 comments on commit 7d852b4

Please sign in to comment.