From cbbc4e2c9e3264afd878dcbac9f0dc4a98094bc1 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 15 Apr 2013 22:23:20 +0200 Subject: [PATCH] Reset gstate_c.offsetAddr on RET. Fixes some "CALL to illegal address" (as seen in Flatout for example). --- GPU/GPUCommon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index d13e5dea74..2bebb4876b 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -484,7 +484,6 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { case GE_CMD_OFFSETADDR: gstate_c.offsetAddr = data << 8; - // ??? break; case GE_CMD_ORIGIN: @@ -533,6 +532,9 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { ERROR_LOG_REPORT(G3D, "Invalid DL PC %08x on return", currentList->pc); gpuState = GPUSTATE_ERROR; } + + // Reset gstate_c.offsetAddr, Flatout seems to expect this. + gstate_c.offsetAddr = 0; } } break;