]> Shamusworld >> Repos - virtualjaguar/commitdiff
Changed some formatting on the stack trace and OP list dump.
authorShamus Hammons <jlhamm@acm.org>
Sat, 1 Dec 2012 22:14:42 +0000 (16:14 -0600)
committerShamus Hammons <jlhamm@acm.org>
Sat, 1 Dec 2012 22:14:42 +0000 (16:14 -0600)
src/jaguar.cpp
src/op.cpp

index e868b32e59ca13b367ab207f297e0cf713fc6a8a..191630423107e7ac26c74d5adc975c0dadb65842 100644 (file)
@@ -1830,9 +1830,26 @@ void JaguarDone(void)
 //     for(int i=M68K_REG_A0; i<=M68K_REG_A7; i++)
 //             WriteLog("\tA%i = 0x%.8x\n", i-M68K_REG_A0, m68k_get_reg(NULL, (m68k_register_t)i));
        int32 topOfStack = m68k_get_reg(NULL, M68K_REG_A7);
-       WriteLog("M68K: Top of stack: %08X. Stack trace:\n", JaguarReadLong(topOfStack));
+       WriteLog("M68K: Top of stack: %08X -> (%08X). Stack trace:\n", topOfStack, JaguarReadLong(topOfStack));
+#if 0
        for(int i=-2; i<9; i++)
                WriteLog("%06X: %08X\n", topOfStack + (i * 4), JaguarReadLong(topOfStack + (i * 4)));
+#else
+       uint32 address = topOfStack - (4 * 4 * 3);
+
+       for(int i=0; i<10; i++)
+       {
+               WriteLog("%06X:", address);
+
+               for(int j=0; j<4; j++)
+               {
+                       WriteLog(" %08X", JaguarReadLong(address));
+                       address += 4;
+               }
+
+               WriteLog("\n");
+       }
+#endif
 
 /*     WriteLog("\nM68000 disassembly at $802288...\n");
        jaguar_dasm(0x802288, 3);
index 25322c91c6109b280bb2fbf01763924bce537e90..516af695527d98d1011d8c68ce9d5fb41fbd57f7 100644 (file)
@@ -141,7 +141,7 @@ void OPReset(void)
 static const char * opType[8] =
 { "(BITMAP)", "(SCALED BITMAP)", "(GPU INT)", "(BRANCH)", "(STOP)", "???", "???", "???" };
 static const char * ccType[8] =
-       { "\"==\"", "\"<\"", "\">\"", "(opflag set)", "(second half line)", "?", "?", "?" };
+       { "==", "<", ">", "(opflag set)", "(second half line)", "?", "?", "?" };
 static uint32 object[8192];
 static uint32 numberOfObjects;
 //static uint32 objectLink[8192];
@@ -190,9 +190,7 @@ void OPDone(void)
 //return;
 
        numberOfObjects = 0;
-//printf("OPDiscoverObjects...\n");
        OPDiscoverObjects(olp);
-//printf("OPDumpObjectList...\n");
        OPDumpObjectList();
 #endif
 }
@@ -254,13 +252,13 @@ void OPDumpObjectList(void)
                uint32 lo = JaguarReadLong(address + 4, OP);
                uint8 objectType = lo & 0x07;
                uint32 link = ((hi << 11) | (lo >> 21)) & 0x3FFFF8;
-               WriteLog("%08X: %08X %08X %s", address, hi, lo, opType[objectType]);
+               WriteLog("%08X: %08X %08X %s -> $08X", address, hi, lo, opType[objectType], link);
 
                if (objectType == 3)
                {
                        uint16 ypos = (lo >> 3) & 0x7FF;
                        uint8  cc   = (lo >> 14) & 0x07;        // Proper # of bits == 3
-                       WriteLog(" YPOS=%u, CC=%s, link=$%08X", ypos, ccType[cc], link);
+                       WriteLog(" YPOS %s %u", ccType[cc], ypos);
                }
 
                WriteLog("\n");
@@ -428,9 +426,9 @@ void DumpBitmapCore(uint64 p0, uint64 p1)
        uint8 flags = (p1 >> 45) & 0x0F;
        uint8 idx = (p1 >> 38) & 0x7F;
        uint32 pitch = (p1 >> 15) & 0x07;
-       WriteLog("    [%u x %u @ (%i, %u) (iw:%u, dw:%u) (%u bpp), l:%08X, p:%08X fp:%02X, fl:%s%s%s%s, idx:%02X, pt:%02X]\n",
+       WriteLog("    [%u x %u @ (%i, %u) (iw:%u, dw:%u) (%u bpp), p:%08X fp:%02X, fl:%s%s%s%s, idx:%02X, pt:%02X]\n",
                iwidth * bdMultiplier[bitdepth],
-               height, xpos, ypos, iwidth, dwidth, op_bitmap_bit_depth[bitdepth], link,
+               height, xpos, ypos, iwidth, dwidth, op_bitmap_bit_depth[bitdepth],
                ptr, firstPix, (flags&OPFLAG_REFLECT ? "REFLECT " : ""),
                (flags&OPFLAG_RMW ? "RMW " : ""), (flags&OPFLAG_TRANS ? "TRANS " : ""),
                (flags&OPFLAG_RELEASE ? "RELEASE" : ""), idx, pitch);
@@ -443,7 +441,7 @@ void DumpBitmapCore(uint64 p0, uint64 p1)
 #warning "Need to fix this so that when an GPU object IRQ happens, we can pick up OP processing where we left off. !!! FIX !!!"
 void OPProcessList(int halfline, bool render)
 {
-#warning "!!! NEED TO HANDLE MULTIPLE FIELDS PROPERLY !!!
+#warning "!!! NEED TO HANDLE MULTIPLE FIELDS PROPERLY !!!"
 // We ignore them, for now; not good
        halfline &= 0x7FF;