Enhanced E7 disassembling

This commit is contained in:
thrust26 2024-06-12 14:05:43 +02:00
parent 5c0856c7a4
commit cd24689b20
3 changed files with 15 additions and 0 deletions

View File

@ -328,6 +328,8 @@ bool CartDebug::disassemble(int bank, uInt16 PC, Disassembly& disassembly,
// For example, if the list contains any $fxxx and the address space is now // For example, if the list contains any $fxxx and the address space is now
// $bxxx, it must be changed // $bxxx, it must be changed
const uInt16 offset = (PC & 0x1000) ? myConsole.cartridge().bankOrigin(bank, PC) : 0; const uInt16 offset = (PC & 0x1000) ? myConsole.cartridge().bankOrigin(bank, PC) : 0;
if (offset && info.offset == 0)
info.offset = offset;
AddressList& addresses = info.addressList; AddressList& addresses = info.addressList;
for(auto& i: addresses) for(auto& i: addresses)
i = (i & 0xFFF) + offset; i = (i & 0xFFF) + offset;

View File

@ -285,6 +285,12 @@ uInt16 CartridgeE7::getBank(uInt16 address) const
return myCurrentBank[(address & 0xFFF) >> 11]; // 2K segments return myCurrentBank[(address & 0xFFF) >> 11]; // 2K segments
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 CartridgeE7::getSegmentBank(uInt16 segment) const
{
return getBank(0x800 * segment);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeE7::patch(uInt16 address, uInt8 value) bool CartridgeE7::patch(uInt16 address, uInt8 value)
{ {

View File

@ -111,6 +111,13 @@ class CartridgeE7 : public Cartridge
*/ */
uInt16 getBank(uInt16 address = 0) const override; uInt16 getBank(uInt16 address = 0) const override;
/**
Get the current bank for a bank segment.
@param segment The segment to get the bank for
*/
uInt16 getSegmentBank(uInt16 segment = 0) const override;
/** /**
Query the number of banks supported by the cartridge. Query the number of banks supported by the cartridge.
*/ */