From fdf3ff0cd3e701dcf001ae946c9b3f8613d99d15 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 3 Dec 2022 14:18:47 +0200 Subject: [PATCH] memwatch parameter update --- debug.cpp | 38 +++++++++++++++++--------------------- include/debug.h | 1 - 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/debug.cpp b/debug.cpp index f7c6cc78..e0689ba1 100644 --- a/debug.cpp +++ b/debug.cpp @@ -211,7 +211,7 @@ static const TCHAR help[] = { _T(" W 'string' Write into Amiga memory.\n") _T(" Wf , fill memory.\n") _T(" Wc , copy memory.\n") - _T(" w
[[.x]] (read/write/opcode) (freeze/mustchange/logonly/nobreak).\n") + _T(" w
[V[.x]] (read/write/opcode) (freeze/mustchange/logonly/nobreak).\n") _T(" Add/remove memory watchpoints.\n") _T(" wd [<0-1>] Enable illegal access logger. 1 = enable break.\n") _T(" L [] Load a block of Amiga memory.\n") @@ -1035,12 +1035,13 @@ static void converter (TCHAR **c) console_out_f (_T("0x%08X = %%%s = %u = %d\n"), v, s, v, (uae_s32)v); } -int notinrom (void) +static bool isrom(uaecptr addr) { - uaecptr pc = munge24 (m68k_getpc ()); - if (pc < 0x00e00000 || pc > 0x00ffffff) - return 1; - return 0; + addrbank *ab = &get_mem_bank(addr); + if (ab->flags & ABFLAG_ROM) { + return true; + } + return false; } static uae_u32 lastaddr (void) @@ -3738,8 +3739,6 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp, uae_u3 } return 0; } - // if (!notinrom ()) - // return 1; mwhit.addr = addr; mwhit.rwi = rwi; mwhit.size = size; @@ -4449,27 +4448,24 @@ static void memwatch (TCHAR **c) mwn->reportonly = true; if (nc == 'N') mwn->nobreak = true; - if (ncc == ' ' || ncc == 0) - break; if (nc == 'P' && ncc == 'C') { next_char(c); mwn->pc = readhex(c, NULL); } + if (_totupper(**c) == 'M') { + mwn->modval_written = 1; + } else if (_totupper(**c) == 'C') { + mwn->mustchange = 1; + } else if (_totupper(**c) == 'V') { + next_char(c); + mwn->val = readhex(c, &mwn->val_size); + mwn->val_enabled = 1; + } if (!more_params(c)) break; } ignore_ws (c); } - if (more_params (c)) { - if (_totupper (**c) == 'M') { - mwn->modval_written = 1; - } else if (_totupper (**c) == 'C') { - mwn->mustchange = 1; - } else { - mwn->val = readhex (c, &mwn->val_size); - mwn->val_enabled = 1; - } - } } } if (!mwn->access_mask) @@ -6975,7 +6971,7 @@ void debug (void) } } } - if ((processptr || processname) && notinrom()) { + if ((processptr || processname) && !isrom(m68k_getpc())) { uaecptr execbase = get_long_debug (4); uaecptr activetask = get_long_debug (execbase + 276); int process = get_byte_debug (activetask + 8) == 13 ? 1 : 0; diff --git a/include/debug.h b/include/debug.h index d69e1ef9..8fba926b 100644 --- a/include/debug.h +++ b/include/debug.h @@ -42,7 +42,6 @@ extern void activate_debugger(void); extern void activate_debugger_new(void); extern void activate_debugger_new_pc(uaecptr pc, int len); extern void deactivate_debugger (void); -extern int notinrom (void); extern const TCHAR *debuginfo (int); extern void record_copper (uaecptr addr, uaecptr nextaddr, uae_u16 word1, uae_u16 word2, int hpos, int vpos); extern void record_copper_blitwait (uaecptr addr, int hpos, int vpos); -- 2.47.3