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.
This commit is contained in:
Unknown W. Brackets 2017-08-20 13:30:39 -07:00
parent d6506b3d59
commit b035be6367

View file

@ -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)) {