From b7fd4f975debde2c4683d95516a0be6626988a71 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 25 Sep 2013 00:46:47 -0700 Subject: [PATCH] Fixing ringbuffer pointers and no-op instructions. --- src/xenia/gpu/ring_buffer_worker.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/ring_buffer_worker.cc b/src/xenia/gpu/ring_buffer_worker.cc index 58a9000eb..2bf81bef0 100644 --- a/src/xenia/gpu/ring_buffer_worker.cc +++ b/src/xenia/gpu/ring_buffer_worker.cc @@ -116,6 +116,12 @@ void RingBufferWorker::ExecuteSegment(uint32_t ptr, uint32_t length) { const uint8_t* packet_base = p + ptr + n * 4; const uint32_t packet = XEGETUINT32BE(packet_base); const uint32_t packet_type = packet >> 30; + + if (packet == 0) { + n++; + continue; + } + switch (packet_type) { case 0x00: { @@ -157,6 +163,7 @@ void RingBufferWorker::ExecuteSegment(uint32_t ptr, uint32_t length) { case 0x02: // Type-2 packet. // No-op. Do nothing. + n++; break; case 0x03: { @@ -215,7 +222,7 @@ void RingBufferWorker::ExecuteSegment(uint32_t ptr, uint32_t length) { // value? uint32_t d2 = XEGETUINT32BE(packet_base + 3 * 4); XESETUINT32BE( - p + d1 + (primary_buffer_ptr_ & ~0x1FFFFFFF), d2); + p + (d1 & ~0x3) + (primary_buffer_ptr_ & ~0x1FFFFFFF), d2); } break;