]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/jaguar.cpp
Initial gamepad support.
[virtualjaguar] / src / jaguar.cpp
index e80b356b199edbe6567e83da278923c957c429bb..f930c9a31e5b2a6965457b7dacc3d4956dd10758 100644 (file)
@@ -376,15 +376,15 @@ CD_switch::       -> $306C
                WriteLog("\nM68K encountered an illegal instruction at %08X!!!\n\nAborting!\n", m68kPC);
                uint32 topOfStack = m68k_get_reg(NULL, M68K_REG_A7);
                WriteLog("M68K: Top of stack: %08X. Stack trace:\n", JaguarReadLong(topOfStack));
-               uint32 address = topOfStack - (8 * 4 * 3);
+               uint32 address = topOfStack - (4 * 4 * 3);
 
                for(int i=0; i<10; i++)
                {
                        WriteLog("%06X:", address);
 
-                       for(int j=0; j<8; j++)
+                       for(int j=0; j<4; j++)
                        {
-                               WriteLog(" %08X", JaguarReadLong(address);
+                               WriteLog(" %08X", JaguarReadLong(address));
                                address += 4;
                        }
 
@@ -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);
@@ -1990,7 +2007,7 @@ void JaguarExecuteNew(void)
 // it will be half this number for a half frame. BUT, since we're counting
 // HALF lines, we double this number and we're back at 525 for NTSC, 625 for PAL.
 //
-// Scanline times are 63.5555... \0s in NTSC and 64 \0s in PAL
+// Scanline times are 63.5555... μs in NTSC and 64 μs in PAL
 // Half line times are, naturally, half of this. :-P
 void HalflineCallback(void)
 {