From 7cde4500d605674b3357e2f2abc5d2e0603d0c63 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 9 Feb 2020 14:12:50 +0200 Subject: [PATCH] Always allocate 32-bit address debug memwatch point table, even if CPU is 24-bit only. --- custom.cpp | 1 - debug.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/custom.cpp b/custom.cpp index 00431de9..07c27b79 100644 --- a/custom.cpp +++ b/custom.cpp @@ -11845,7 +11845,6 @@ void do_cycles_ce020 (unsigned long cycles) bool is_cycle_ce(uaecptr addr) { - addr &= currprefs.address_space_24 ? 0x00ffffff : 0xffffffff; addrbank *ab = get_mem_bank_real(addr); if (!ab || (ab->flags & ABFLAG_CHIPRAM) || ab == &custom_bank) { int hpos = current_hpos(); diff --git a/debug.cpp b/debug.cpp index 4f60cbd9..f0ef2412 100644 --- a/debug.cpp +++ b/debug.cpp @@ -3485,7 +3485,14 @@ static void initialize_memwatch (int mode) { membank_total = currprefs.address_space_24 ? 256 : 65536; deinitialize_memwatch (); - debug_mem_banks = xcalloc (addrbank*, membank_total); + debug_mem_banks = xcalloc (addrbank*, 65536); + if (!debug_mem_banks) + return; + if (membank_total < 65536) { + for (int i = 256; i < 65536; i++) { + debug_mem_banks[i] = &dummy_bank; + } + } debug_mem_area = xcalloc (addrbank, membank_total); membank_stores = xcalloc (struct membank_store, MEMWATCH_STORE_SLOTS); for (int i = 0; i < MEMWATCH_TOTAL; i++) { -- 2.47.3