From 91995c92dbe147267e73de1a98fe15cfd23e8145 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 26 Dec 2020 16:48:22 +1000 Subject: [PATCH] Qt/Debugger: Use Bus helper functions for getting region pointers --- src/duckstation-qt/debuggerwindow.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/src/duckstation-qt/debuggerwindow.cpp b/src/duckstation-qt/debuggerwindow.cpp index 44c37282d..03e0ec55e 100644 --- a/src/duckstation-qt/debuggerwindow.cpp +++ b/src/duckstation-qt/debuggerwindow.cpp @@ -453,29 +453,9 @@ void DebuggerWindow::setMemoryViewRegion(Bus::MemoryRegion region) m_active_memory_region = region; - switch (region) - { - case Bus::MemoryRegion::RAM: - case Bus::MemoryRegion::RAMMirror1: - case Bus::MemoryRegion::RAMMirror2: - case Bus::MemoryRegion::RAMMirror3: - m_ui.memoryView->setData(Bus::GetMemoryRegionStart(region), Bus::g_ram, Bus::RAM_SIZE); - break; - - case Bus::MemoryRegion::Scratchpad: - m_ui.memoryView->setData(CPU::DCACHE_LOCATION, CPU::g_state.dcache.data(), CPU::DCACHE_SIZE); - break; - - case Bus::MemoryRegion::BIOS: - m_ui.memoryView->setData(Bus::BIOS_BASE, Bus::g_bios, Bus::BIOS_SIZE); - break; - - case Bus::MemoryRegion::EXP1: - default: - // TODO - m_ui.memoryView->setData(Bus::EXP1_BASE, nullptr, 0); - break; - } + const PhysicalMemoryAddress start = Bus::GetMemoryRegionStart(region); + const PhysicalMemoryAddress end = Bus::GetMemoryRegionEnd(region); + m_ui.memoryView->setData(start, Bus::GetMemoryRegionPointer(region), end - start); #define SET_REGION_RADIO_BUTTON(name, rb_region) \ do \