]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Debugger updates
authorToni Wilen <twilen@winuae.net>
Mon, 13 Apr 2026 17:41:30 +0000 (20:41 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 13 Apr 2026 17:41:30 +0000 (20:41 +0300)
calc.cpp
debug.cpp
newcpu.cpp

index 0afd1b5bf64ddca6c5bcf7ceb1a6554cf0288792..db0df58283ea2f5844d57acf294208242fe2ae0c 100644 (file)
--- a/calc.cpp
+++ b/calc.cpp
@@ -47,6 +47,7 @@ static int op_preced(const TCHAR c)
     switch(c)    {
         case 0xf0: case 0xf1: case 0xf2:
         case '!':
+        case '~':
             return 4;
         case '*':  case '/': case '\\': case '%':
         case '|':  case '&': case '^':
@@ -68,7 +69,7 @@ static bool op_left_assoc(const TCHAR c)
     switch(c)    {
         // left to right
         case '*': case '/': case '%': case '+': case '-':
-        case '|': case '&': case '^':
+        case '|': case '&': case '^': case '~':
         case 0xf0: case 0xf1: case 0xf2:
             return true;
         // right to left
@@ -88,6 +89,7 @@ static unsigned int op_arg_count(const TCHAR c)
             return 2;
         case '!':
         case ':':
+        case '~':
         case 0xf0: case 0xf1: case 0xf2:
             return 1;
         default:
@@ -96,7 +98,7 @@ static unsigned int op_arg_count(const TCHAR c)
     return 0;
 }
  
-#define is_operator(c)  (c == '+' || c == '-' || c == '/' || c == '*' || c == '!' || c == '%' || c == '=' || \
+#define is_operator(c)  (c == '+' || c == '-' || c == '/' || c == '*' || c == '!' || c == '%' || c == '=' || c == '~' || \
                          c == '|' || c == '&' || c == '^' || c == '@' || c == ('@' | 0x80) || c == '>' || c == '<' || c == ('>' | 0x80) || c == ('<' | 0x80) || \
                          c == '?' || c == ':' || c == 0xf0 || c == 0xf1 || c == 0xf2)
 #define is_function(c)  (c >= 'A' && c <= 'Z')
@@ -395,6 +397,9 @@ static bool docalcx(TCHAR op, double v1, double v2, double *valp)
         case ':':
         v = v1;
         break;
+        case '~':
+               v = ~(int)v1;
+        break;
 #ifdef DEBUGGER
         case 0xf0:
         v = get_byte_debug((uaecptr)v1);
index 95f56882d584a96a90f5b89916df19be93bfefb3..b8408633fe29dcd886f6a8c90c65144c4a6fe45f 100644 (file)
--- a/debug.cpp
+++ b/debug.cpp
@@ -213,7 +213,7 @@ static const TCHAR help[] = {
        _T("  od                    Enable/disable Copper vpos/hpos tracing.\n")
        _T("  ot                    Copper single step trace.\n")
        _T("  ob <addr>             Copper breakpoint.\n")
-       _T("  H[H] <cnt>            Show PC history (HH=full CPU info) <cnt> instructions.\n")
+       _T("  H[H][s] <cnt>         Show PC history (HH=full CPU info, s=disable DMA info) <cnt> instructions.\n")
        _T("  C <value>             Search for values like energy or lifes in games.\n")
        _T("  mmu <fc>              Set current MMU translation function code for all debugging instructions.\n")
        _T("  mmud                  Dump MMU tables.\n")
@@ -520,7 +520,7 @@ static bool isoperator(TCHAR **cp)
        TCHAR c1 = c ? _totupper((*cp)[1]) : 0;
        TCHAR c2 = c1 ? _totupper((*cp)[2]) : 0;
        return c == '+' || c == '-' || c == '/' || c == '*' || c == '(' || c == ')' ||
-               c == '|' || c == '&' || c == '^' || c == '=' || c == '>' || c == '<' ||
+               c == '|' || c == '&' || c == '^' || c == '~' || c == '=' || c == '>' || c == '<' ||
                (c == 'R' && (c1 == 'L' || c1 == 'W' || c1 == 'B') && c2 == '(');
 }
 
@@ -6469,7 +6469,7 @@ static void searchmem (TCHAR **cc)
                        }
                }
        }
-       console_out_f(_T("Searching from %08X to %08X..\n"), addr + 1, endaddr - 1);
+       console_out_f(_T("Searching from %08X to %08X\n"), addr + 1, endaddr - 1);
        nextaddr_init(addr);
        bool out = false;
        int colcnt = 0;
@@ -6659,7 +6659,7 @@ static void debug_sprite (TCHAR **inptr)
                        ypos = ypos_ecs;
                        ypose = ypose_ecs;
                }
-
+               int spritey = 0;
                for (y = ypos; y < ypose; y++) {
                        int x;
                        addr += size * 4;
@@ -6716,12 +6716,13 @@ static void debug_sprite (TCHAR **inptr)
                                }
                        }
                        tmp[width] = 0;
-                       console_out_f (_T("%3d %06X %s\n"), y, addr, tmp);
+                       console_out_f (_T("%3d %3d %06X %s\n"), y, spritey, addr, tmp);
+                       spritey++;
                }
 
                console_out_f (_T("Sprite address %08X, Width=%d\n"), saddr, size * 16);
-               console_out_f (_T("OCS: StartX=%d StartY=%d EndY=%d Height=%d\n"), xpos, ypos, ypose, ypose - ypos + 1);
-               console_out_f (_T("ECS: StartX=%d (%d.%d) StartY=%d EndY=%d Height=%d %s\n"), xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs, ypose_ecs - ypos_ecs + 1, ecs ? _T(" (*)") : _T(""));
+               console_out_f (_T("OCS: StartX=%d StartY=%d EndY=%d Height=%d\n"), xpos, ypos, ypose - 1, ypose - ypos);
+               console_out_f (_T("ECS: StartX=%d (%d.%d) StartY=%d EndY=%d Height=%d %s\n"), xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs - 1, ypose_ecs - ypos_ecs + 1, ecs ? _T(" (*)") : _T(""));
                console_out_f (_T("Attach: %d. AGA SSCAN/SH10 bit: %d\n"), attach, sh10);
 
                addr += size * 4;
@@ -6856,7 +6857,7 @@ static void find_ea (TCHAR **inptr)
                        }
                }
        }
-       console_out_f (_T("Searching from %08X to %08X\n"), addr + 1, end);
+       console_out_f (_T("Searching from %08X to %08X\n"), addr + 1, end - 1);
        end2 = 0;
        nextaddr_init(addr);
        bool out = false;
@@ -6870,7 +6871,7 @@ static void find_ea (TCHAR **inptr)
                                out = true;
                                hits++;
                                if (hits > 100) {
-                                       console_out_f (_T("Too many hits. End addr = %08X\n"), addr);
+                                       console_out_f (_T("Too many hits. End addr = %08X\n"), addr - 1);
                                        break;
                                }
                        }
@@ -7476,6 +7477,7 @@ static bool debug_line (TCHAR *input)
                                uae_u32 oldpc = m68k_getpc ();
                                int lastframes, lastvpos, lasthpos;
                                struct regstruct save_regs = regs;
+                               bool dmadata = true;
 
                                badly = 0;
                                if (inptr[0] == 'H') {
@@ -7487,7 +7489,10 @@ static bool debug_line (TCHAR *input)
                                        dmadbg = 1;
                                        inptr++;
                                }
-
+                               if (inptr[0] == 's') {
+                                       dmadata = false;
+                                       inptr++;
+                               }
                                if (more_params(&inptr))
                                        count = readint(&inptr, NULL);
                                else
@@ -7517,7 +7522,7 @@ static bool debug_line (TCHAR *input)
                                                if (badly) {
                                                        m68k_dumpstate(NULL, 0xffffffff);
                                                } else {
-                                                       if (dmadbg && lastvpos >= 0) {
+                                                       if (dmadbg && lastvpos >= 0 && dmadata) {
                                                                dma_disasm(lastframes, lastvpos, lasthpos, history[temp].fp, history[temp].vpos, history[temp].hpos);
                                                        }
                                                        lastframes = history[temp].fp;
@@ -7951,11 +7956,11 @@ static bool check_breakpoint(struct breakpoint_node *bpn, uaecptr pc)
 
 static bool check_breakpoint_count(struct breakpoint_node *bpn, uaecptr pc)
 {
+       bpn->cnt--;
        if (bpn->cnt <= 0) {
                return true;
        }
        console_out_f(_T("Breakpoint %d hit: PC=%08x, count=%d.\n"), bpn - bpnodes, pc, bpn->cnt);
-       bpn->cnt--;
        return false;
 }
 
index 46a0fb87ee0af4741861f65d0006b43f886991f4..a60f42bb74b96cb5a6994f06ae59fd841a6b1611 100644 (file)
@@ -6937,6 +6937,9 @@ void m68k_dumpcache (bool dc)
        if (!currprefs.cpu_compatible)
                return;
        if (currprefs.cpu_model == 68020) {
+               if (dc) {
+                       return;
+               }
                for (int i = 0; i < CACHELINES020; i += 4) {
                        for (int j = 0; j < 4; j++) {
                                int s = i + j;