From a6d4b5fc99ac0d0ad3ff5acbb888ba663d2d484d Mon Sep 17 00:00:00 2001 From: Nicolas Pixel Noble Date: Sun, 8 Oct 2023 21:28:02 -0700 Subject: [PATCH] Slightly fixing debug memory map system. - Removing parallel port map. There's just no way to handle this properly right now. - Clamping better for the rom region. --- src/core/debug.cc | 12 +++++------- src/core/debug.h | 2 -- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/debug.cc b/src/core/debug.cc index 380cd1984..c313e519e 100644 --- a/src/core/debug.cc +++ b/src/core/debug.cc @@ -54,14 +54,13 @@ void PCSX::Debug::markMap(uint32_t address, int mask) { address = normalizeAddress(address); uint32_t base = (address >> 20) & 0xffc; uint32_t real = address & 0x7fffff; + uint32_t shortReal = address & 0x3fffff; if (((base == 0x000) || (base == 0x800) || (base == 0xa00)) && (real < sizeof(m_mainMemoryMap))) { m_mainMemoryMap[real] |= mask; - } else if ((base == 0x1f0) && (real < sizeof(m_parpMemoryMap))) { - m_parpMemoryMap[real] |= mask; } else if ((base == 0x1f8) && (real < sizeof(m_scratchPadMap))) { m_scratchPadMap[real] |= mask; - } else if ((base == 0xbfc) && (real < sizeof(m_biosMemoryMap))) { - m_biosMemoryMap[real] |= mask; + } else if ((base == 0xbfc) && (shortReal < sizeof(m_biosMemoryMap))) { + m_biosMemoryMap[shortReal] |= mask; } } @@ -69,13 +68,12 @@ bool PCSX::Debug::isMapMarked(uint32_t address, int mask) { address = normalizeAddress(address); uint32_t base = (address >> 20) & 0xffc; uint32_t real = address & 0x7fffff; + uint32_t shortReal = address & 0x3fffff; if (((base == 0x000) || (base == 0x800) || (base == 0xa00)) && (real < sizeof(m_mainMemoryMap))) { return m_mainMemoryMap[real] & mask; - } else if ((base == 0x1f0) && (real < sizeof(m_parpMemoryMap))) { - return m_parpMemoryMap[real] & mask; } else if ((base == 0x1f8) && (real < sizeof(m_scratchPadMap))) { return m_scratchPadMap[real] & mask; - } else if ((base == 0xbfc) && (real < sizeof(m_biosMemoryMap))) { + } else if ((base == 0xbfc) && (shortReal < sizeof(m_biosMemoryMap))) { return m_biosMemoryMap[real] & mask; } return false; diff --git a/src/core/debug.h b/src/core/debug.h index c75235a46..daccbf667 100644 --- a/src/core/debug.h +++ b/src/core/debug.h @@ -115,7 +115,6 @@ class Debug { void clearMaps() { memset(m_mainMemoryMap, 0, sizeof(m_mainMemoryMap)); memset(m_biosMemoryMap, 0, sizeof(m_biosMemoryMap)); - memset(m_parpMemoryMap, 0, sizeof(m_parpMemoryMap)); memset(m_scratchPadMap, 0, sizeof(m_scratchPadMap)); } @@ -146,7 +145,6 @@ class Debug { uint8_t m_mainMemoryMap[0x00800000] = {0}; uint8_t m_biosMemoryMap[0x00080000] = {0}; - uint8_t m_parpMemoryMap[0x00010000] = {0}; uint8_t m_scratchPadMap[0x00000400] = {0}; void markMap(uint32_t address, int mask);