From b035be6367eea6a8b692ea088c6e86b68cf8c85b Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 20 Aug 2017 13:30:39 -0700 Subject: [PATCH] GPU: Fix alignment on signal jump/call. It shouldn't be possible to make the pc unaligned, and this may have been causing it previously. --- GPU/GPUCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 9d1aaddda2..23e9872ec0 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1320,7 +1320,7 @@ void GPUCommon::Execute_End(u32 op, u32 diff) { trigger = false; currentList->signal = behaviour; // pc will be increased after we return, counteract that. - u32 target = ((signal << 16) | enddata) - 4; + u32 target = (((signal << 16) | enddata) & 0xFFFFFFFC) - 4; if (!Memory::IsValidAddress(target)) { ERROR_LOG_REPORT(G3D, "Signal with Jump: bad address. signal/end: %04x %04x", signal, enddata); } else { @@ -1335,7 +1335,7 @@ void GPUCommon::Execute_End(u32 op, u32 diff) { trigger = false; currentList->signal = behaviour; // pc will be increased after we return, counteract that. - u32 target = ((signal << 16) | enddata) - 4; + u32 target = (((signal << 16) | enddata) & 0xFFFFFFFC) - 4; if (currentList->stackptr == ARRAY_SIZE(currentList->stack)) { ERROR_LOG_REPORT(G3D, "Signal with Call: stack full. signal/end: %04x %04x", signal, enddata); } else if (!Memory::IsValidAddress(target)) {