Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly fixing debug memory map system. #1455

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/core/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,26 @@ 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;
}
}

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;
Expand Down
2 changes: 0 additions & 2 deletions src/core/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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);
Expand Down