Permalink
Browse files

Merge pull request #9919 from unknownbrackets/dlist-align

GPU: Fix alignment on signal jump/call
  • Loading branch information...
hrydgard committed Aug 20, 2017
2 parents e1f991a + b035be6 commit 97b82100b85777a57a275c0fff82c9c082145e42
Showing with 9 additions and 7 deletions.
  1. +3 −4 GPU/GPUCommon.cpp
  2. +6 −3 GPU/Null/NullGpu.cpp
View
@@ -1328,7 +1328,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 {
@@ -1343,7 +1343,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)) {
@@ -1537,8 +1537,7 @@ void GPUCommon::Execute_BoundingBox(u32 op, u32 diff) {
// Just resetting, nothing to check bounds for.
const u32 data = op & 0x00FFFFFF;
if (data == 0) {
// TODO: Should this set the bboxResult? Let's set it true for now.
currentList->bboxResult = true;
currentList->bboxResult = false;
return;
}
if (((data & 7) == 0) && data <= 64) { // Sanity check
View
@@ -96,10 +96,13 @@ void NullGPU::ExecuteOp(u32 op, u32 diff) {
break;
case GE_CMD_BOUNDINGBOX:
if (data != 0)
if (data != 0) {
DEBUG_LOG(G3D, "Unsupported bounding box: %06x", data);
// bounding box test. Let's assume the box was within the drawing region.
currentList->bboxResult = true;
// Bounding box test. Let's assume the box was within the drawing region.
currentList->bboxResult = true;
} else {
currentList->bboxResult = false;
}
break;
case GE_CMD_VERTEXTYPE:

0 comments on commit 97b8210

Please sign in to comment.