diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 6e42a27aaf..51a0453032 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -570,7 +570,7 @@ void GPUCommon::SlowRunLoop(DisplayList &list) prev = 0; } GeDisassembleOp(list.pc, op, prev, temp, 256); - NOTICE_LOG(G3D, "%s", temp); + NOTICE_LOG(G3D, "%08x: %s", op, temp); } gstate.cmdmem[cmd] = op; diff --git a/GPU/GeDisasm.cpp b/GPU/GeDisasm.cpp index 549b4c3707..1e049dcba7 100644 --- a/GPU/GeDisasm.cpp +++ b/GPU/GeDisasm.cpp @@ -81,13 +81,10 @@ void GeDescribeVertexType(u32 op, char *buffer, int len) { w[-2] = '\0'; } -void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) { +void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer, int bufsize) { u32 cmd = op >> 24; u32 data = op & 0xFFFFFF; - char *buffer = origbuf + snprintf(origbuf, bufsize, "%08x: ", op); - bufsize -= (int)(buffer - origbuf); - // Handle control and drawing commands here directly. The others we delegate. switch (cmd) { @@ -254,7 +251,7 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *origbuf, int bufsize) { case GE_CMD_VERTEXTYPE: { int len = snprintf(buffer, bufsize, "SetVertexType: "); - GeDescribeVertexType(op, buffer + len, 256 - len); + GeDescribeVertexType(op, buffer + len, bufsize - len); } break;