]> Shamusworld >> Repos - stargem2/blobdiff - src/dis6809.cpp
Virtual 6809 is close to being 100% at this point; at least StarGem works
[stargem2] / src / dis6809.cpp
index 7205dc0815a1af2861d41ba461f5ef24603ee0fc..dbeeedab774006091318b3ac7fc95131433f5d5f 100755 (executable)
@@ -193,20 +193,21 @@ iregs[4][2] = {"X", "Y", "U", "S" };
 //
 static void DisplayBytes(uint16 src, uint32 dst)
 {
+       char buf[20], buf2[20];
+
+       buf[0] = 0;
        WriteLog("%04X: ", src);
-       uint8 cnt = 0;                                                                          // Init counter...
 
        if (src > dst)
                dst += 0x10000;                                                                 // That should fix the FFFF bug...
 
        for(uint32 i=src; i<dst; i++)
        {
-               WriteLog("%02X ", mainCPU.RdMem(i));
-               cnt++;                                                                                  // Bump counter...
+               sprintf(buf2, "%02X ", mainCPU.RdMem(i));
+               strcat(buf, buf2);
        }
 
-       for(int i=cnt; i<5; i++)                                                        // Pad the leftover spaces...
-               WriteLog("   ");
+       WriteLog("%-12s", buf);                                                         // WAS: 15
 }
 
 //
@@ -386,7 +387,7 @@ int Decode6809(uint16 pc)
        }
 
        DisplayBytes(pc, addr);                                                         // Show bytes
-       WriteLog("%s", outbuf);                                                         // Display opcode & addressing, etc.
+       WriteLog("%-17s", outbuf);                                                      // Display opcode & addressing, etc.
 
        return addr - pc;
 }