Permalink
Browse files

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.
  • Loading branch information...
unknownbrackets committed Aug 20, 2017
1 parent d6506b3 commit b035be6367eea6a8b692ea088c6e86b68cf8c85b
Showing with 2 additions and 2 deletions.
  1. +2 −2 GPU/GPUCommon.cpp
View
@@ -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)) {

0 comments on commit b035be6

Please sign in to comment.