From 07dcdc83b0ae271c67f9923d158fec51245a2739 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 30 Apr 2020 23:45:14 +0200 Subject: [PATCH] fix disassembly for segmented bankswitching types --- src/debugger/CartDebug.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index ef6924187..5192f84e8 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -71,18 +71,19 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem) } // Create bank information for each potential bank, and an extra one for ZP RAM + // ROM sizes greater than 4096 indicate multi-bank ROMs, but we handle only + // 4K pieces at a time + // ROM sizes less than 4K use the actual value + size_t romSize = 0; + myConsole.cartridge().getImage(romSize); + BankInfo info; + info.size = std::min(romSize, 4_KB); for(uInt32 i = 0; i < myConsole.cartridge().romBankCount(); ++i) - { - info.size = myConsole.cartridge().bankSize(i); myBankInfo.push_back(info); - } for(uInt32 i = 0; i < myConsole.cartridge().ramBankCount(); ++i) - { - info.size = myConsole.cartridge().bankSize(i) >> 1; myBankInfo.push_back(info); - } info.size = 128; // ZP RAM myBankInfo.push_back(info);