From 969d4b5fe2b617f23aff4a078c10bd0afb4b665b Mon Sep 17 00:00:00 2001 From: stephena Date: Wed, 29 May 2013 16:27:12 +0000 Subject: [PATCH] Some more work on the debugger ROM UI area. Changed previous bank selection widget to a display of current bank state, taking into account the more esoteric bank schemes. Currently, some functionality is disabled/removed for now; I'll work on this for the next commit. The format for displaying disassembler GFX/PGFX (binary or hex) is now obeyed in the disassembly file output as well. Changed various comments/enums/etc referring to 'preliminary' code to 'tentative' code, matching the actual intended meaning and the current documentation. Small API change for EditTextWidget; changed method name to setText, since that's what I keep typing for some reason. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2743 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- Changes.txt | 6 +- src/cheat/CheatCodeDialog.cxx | 12 ++-- src/debugger/CartDebug.cxx | 26 +++++--- src/debugger/CartDebug.hxx | 9 +-- src/debugger/Debugger.cxx | 2 +- src/debugger/DiStella.cxx | 6 +- src/debugger/gui/Cart0840Widget.cxx | 12 ++++ src/debugger/gui/Cart0840Widget.hxx | 2 + src/debugger/gui/Cart3EWidget.cxx | 15 +++++ src/debugger/gui/Cart3EWidget.hxx | 2 + src/debugger/gui/Cart3FWidget.cxx | 10 +++ src/debugger/gui/Cart3FWidget.hxx | 2 + src/debugger/gui/Cart4A50Widget.cxx | 22 +++++++ src/debugger/gui/Cart4A50Widget.hxx | 2 + src/debugger/gui/CartARWidget.cxx | 10 +++ src/debugger/gui/CartARWidget.hxx | 2 + src/debugger/gui/CartCMWidget.cxx | 14 +++- src/debugger/gui/CartCMWidget.hxx | 2 + src/debugger/gui/CartCTYWidget.cxx | 14 ++++ src/debugger/gui/CartCTYWidget.hxx | 2 + src/debugger/gui/CartDPCPlusWidget.cxx | 14 ++++ src/debugger/gui/CartDPCPlusWidget.hxx | 6 +- src/debugger/gui/CartDPCWidget.cxx | 12 ++++ src/debugger/gui/CartDPCWidget.hxx | 2 + src/debugger/gui/CartDebugWidget.hxx | 6 ++ src/debugger/gui/CartE0Widget.cxx | 58 ++++++++-------- src/debugger/gui/CartE0Widget.hxx | 2 + src/debugger/gui/CartE7Widget.cxx | 37 +++++++---- src/debugger/gui/CartE7Widget.hxx | 2 + src/debugger/gui/CartEFSCWidget.cxx | 15 +++++ src/debugger/gui/CartEFSCWidget.hxx | 2 + src/debugger/gui/CartEFWidget.cxx | 15 +++++ src/debugger/gui/CartEFWidget.hxx | 2 + src/debugger/gui/CartF0Widget.cxx | 10 +++ src/debugger/gui/CartF0Widget.hxx | 2 + src/debugger/gui/CartF4SCWidget.cxx | 14 ++++ src/debugger/gui/CartF4SCWidget.hxx | 2 + src/debugger/gui/CartF4Widget.cxx | 14 ++++ src/debugger/gui/CartF4Widget.hxx | 2 + src/debugger/gui/CartF6SCWidget.cxx | 12 ++++ src/debugger/gui/CartF6SCWidget.hxx | 2 + src/debugger/gui/CartF6Widget.cxx | 12 ++++ src/debugger/gui/CartF6Widget.hxx | 2 + src/debugger/gui/CartF8SCWidget.cxx | 12 ++++ src/debugger/gui/CartF8SCWidget.hxx | 2 + src/debugger/gui/CartF8Widget.cxx | 12 ++++ src/debugger/gui/CartF8Widget.hxx | 2 + src/debugger/gui/CartFA2Widget.cxx | 14 ++++ src/debugger/gui/CartFA2Widget.hxx | 2 + src/debugger/gui/CartFAWidget.cxx | 12 ++++ src/debugger/gui/CartFAWidget.hxx | 2 + src/debugger/gui/CartFEWidget.cxx | 14 +++- src/debugger/gui/CartFEWidget.hxx | 5 ++ src/debugger/gui/CartMCWidget.cxx | 14 ++++ src/debugger/gui/CartMCWidget.hxx | 2 + src/debugger/gui/CartSBWidget.cxx | 11 ++++ src/debugger/gui/CartSBWidget.hxx | 2 + src/debugger/gui/CartUAWidget.cxx | 12 ++++ src/debugger/gui/CartUAWidget.hxx | 2 + src/debugger/gui/CartX07Widget.cxx | 10 +++ src/debugger/gui/CartX07Widget.hxx | 2 + src/debugger/gui/CpuWidget.cxx | 2 +- src/debugger/gui/DataGridWidget.cxx | 2 +- src/debugger/gui/DebuggerDialog.cxx | 2 +- src/debugger/gui/RamWidget.cxx | 12 ++-- src/debugger/gui/RomListWidget.cxx | 12 ++-- src/debugger/gui/RomListWidget.hxx | 7 +- src/debugger/gui/RomWidget.cxx | 91 +++++--------------------- src/debugger/gui/RomWidget.hxx | 11 +--- src/debugger/gui/TiaInfoWidget.cxx | 12 ++-- src/debugger/gui/TiaWidget.cxx | 8 +-- src/emucore/OSystem.hxx | 4 +- src/gui/BrowserDialog.cxx | 4 +- src/gui/EditTextWidget.cxx | 6 +- src/gui/EditTextWidget.hxx | 2 +- src/gui/EditableWidget.cxx | 2 +- src/gui/EditableWidget.hxx | 2 +- src/gui/EventMappingWidget.cxx | 4 +- src/gui/FileSnapDialog.cxx | 48 +++++++------- src/gui/GameInfoDialog.cxx | 14 ++-- src/gui/InputDialog.cxx | 4 +- src/gui/InputTextDialog.cxx | 4 +- src/gui/InputTextDialog.hxx | 2 +- src/gui/ListWidget.cxx | 2 +- src/gui/RomAuditDialog.cxx | 4 +- 85 files changed, 577 insertions(+), 233 deletions(-) diff --git a/Changes.txt b/Changes.txt index a5f1ff629..3cc73c2ef 100644 --- a/Changes.txt +++ b/Changes.txt @@ -36,7 +36,7 @@ - ROMS less than 2K in size (so called 'Sub2K' ROMs) now show only the actual data in the binary. This means, for example, that a 256 byte ROM will show only 256 bytes in the disassembly, instead - of padding garbage/duplicated data to 2K boundary. + of padding duplicated data to 2K boundary. - Fixed labelling in ROW directives; it wasn't accurately setting a label in the case where it occurred in the middle of the data. @@ -56,6 +56,10 @@ swapped by default, which allows one and two-player games to work correctly. + * SuperCharger/AR ROMs now ignore the 'ramrandom' setting, and start with + RAM containing all zeroes. This seems to fix issues with Dragonstomper + always starting in exactly the same state. + * Changed colour of the 'current PC indicator' in the debugger to match the one used for line selection. This makes it easier to see for those with problems seeing lighter colours. diff --git a/src/cheat/CheatCodeDialog.cxx b/src/cheat/CheatCodeDialog.cxx index 4b38b7559..09924f631 100644 --- a/src/cheat/CheatCodeDialog.cxx +++ b/src/cheat/CheatCodeDialog.cxx @@ -149,8 +149,8 @@ void CheatCodeDialog::saveConfig() void CheatCodeDialog::addCheat() { myCheatInput->show(); // Center input dialog over entire screen - myCheatInput->setEditString("", 0); - myCheatInput->setEditString("", 1); + myCheatInput->setText("", 0); + myCheatInput->setText("", 1); myCheatInput->setTitle(""); myCheatInput->setFocus(0); myCheatInput->setEmitSignal(kCheatAdded); @@ -168,8 +168,8 @@ void CheatCodeDialog::editCheat() const string& code = list[idx]->code(); myCheatInput->show(); // Center input dialog over entire screen - myCheatInput->setEditString(name, 0); - myCheatInput->setEditString(code, 1); + myCheatInput->setText(name, 0); + myCheatInput->setText(code, 1); myCheatInput->setTitle(""); myCheatInput->setFocus(1); myCheatInput->setEmitSignal(kCheatEdited); @@ -186,8 +186,8 @@ void CheatCodeDialog::removeCheat() void CheatCodeDialog::addOneShotCheat() { myCheatInput->show(); // Center input dialog over entire screen - myCheatInput->setEditString("One-shot cheat", 0); - myCheatInput->setEditString("", 1); + myCheatInput->setText("One-shot cheat", 0); + myCheatInput->setText("", 1); myCheatInput->setTitle(""); myCheatInput->setFocus(1); myCheatInput->setEmitSignal(kOneShotCheatAdded); diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index 1d5a3b94f..b6449b9b2 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -149,6 +149,9 @@ const DebuggerState& CartDebug::getState() for(uInt32 i = 0; i < myState.rport.size(); ++i) myState.ram.push_back(peek(myState.rport[i])); + if(myDebugWidget) + myState.bank = myDebugWidget->bankState(); + return myState; } @@ -160,7 +163,10 @@ void CartDebug::saveOldState() myOldState.ram.push_back(peek(myOldState.rport[i])); if(myDebugWidget) + { + myOldState.bank = myDebugWidget->bankState(); myDebugWidget->saveOldState(); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -533,13 +539,13 @@ int CartDebug::getBank() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -int CartDebug::bankCount() +int CartDebug::bankCount() const { return myConsole.cartridge().bankCount(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -string CartDebug::getCartType() +string CartDebug::getCartType() const { return myConsole.cartridge().name(); } @@ -996,7 +1002,8 @@ string CartDebug::saveDisassembly() } case CartDebug::GFX: { - buf << tag.disasm.substr(0, 9) << " ; |"; + buf << ".byte " << (settings.gfx_format == kBASE_2 ? "%" : "$") + << tag.bytes << " ; |"; for(int i = 12; i < 20; ++i) buf << ((tag.disasm[i] == '\x1e') ? "#" : " "); buf << "| $" << HEX4 << tag.address << " (G)\n"; @@ -1004,7 +1011,8 @@ string CartDebug::saveDisassembly() } case CartDebug::PGFX: { - buf << tag.disasm.substr(0, 9) << " ; |"; + buf << ".byte " << (settings.gfx_format == kBASE_2 ? "%" : "$") + << tag.bytes << " ; |"; for(int i = 12; i < 20; ++i) buf << ((tag.disasm[i] == '\x1f') ? "*" : " "); buf << "| $" << HEX4 << tag.address << " (P)\n"; @@ -1033,7 +1041,7 @@ string CartDebug::saveDisassembly() << "; ROM properties name : " << myConsole.properties().get(Cartridge_Name) << "\n" << "; ROM properties MD5 : " << myConsole.properties().get(Cartridge_MD5) << "\n" << "; Bankswitch type : " << myConsole.cartridge().about() << "\n;\n" - << "; Legend: * = CODE not yet run (preliminary code)\n" + << "; Legend: * = CODE not yet run (tentative code)\n" << "; D = DATA directive (referenced in some way)\n" << "; G = GFX directive, shown as '#' (stored in player, missile, ball)\n" << "; P = PGFX directive, shown as '*' (stored in playfield)\n\n" @@ -1301,7 +1309,7 @@ CartDebug::DisasmType CartDebug::disasmTypeAbsolute(uInt8 flags) const { if(flags & CartDebug::CODE) return CartDebug::CODE; - else if(flags & CartDebug::PCODE) + else if(flags & CartDebug::TCODE) return CartDebug::CODE; // TODO - should this be separate?? else if(flags & CartDebug::GFX) return CartDebug::GFX; @@ -1321,7 +1329,7 @@ void CartDebug::disasmTypeAsString(ostream& buf, DisasmType type) const switch(type) { case CartDebug::CODE: buf << "CODE"; break; - case CartDebug::PCODE: buf << "PCODE"; break; + case CartDebug::TCODE: buf << "TCODE"; break; case CartDebug::GFX: buf << "GFX"; break; case CartDebug::PGFX: buf << "PGFX"; break; case CartDebug::DATA: buf << "DATA"; break; @@ -1339,8 +1347,8 @@ void CartDebug::disasmTypeAsString(ostream& buf, uInt8 flags) const { if(flags & CartDebug::CODE) buf << "CODE "; - if(flags & CartDebug::PCODE) - buf << "PCODE "; + if(flags & CartDebug::TCODE) + buf << "TCODE "; if(flags & CartDebug::GFX) buf << "GFX "; if(flags & CartDebug::PGFX) diff --git a/src/debugger/CartDebug.hxx b/src/debugger/CartDebug.hxx index f7fc6e19b..e163d3aad 100644 --- a/src/debugger/CartDebug.hxx +++ b/src/debugger/CartDebug.hxx @@ -46,6 +46,7 @@ class CartState : public DebuggerState IntArray ram; // The actual data values IntArray rport; // Address for reading from RAM IntArray wport; // Address for writing to RAM + string bank; // Current banking layout }; class CartDebug : public DebuggerSystem @@ -68,7 +69,7 @@ class CartDebug : public DebuggerSystem // of decreasing hierarchy // CODE = 1 << 7, // disassemble-able code segments - PCODE = 1 << 6, // (preliminary) disassemble-able code segments + TCODE = 1 << 6, // (tentative) disassemble-able code segments GFX = 1 << 5, // addresses loaded into GRPx registers PGFX = 1 << 4, // addresses loaded into PFx registers DATA = 1 << 3, // addresses loaded into registers other than GRPx / PFx @@ -193,17 +194,17 @@ class CartDebug : public DebuggerSystem /** Get the current bank in use by the cartridge. */ - int getBank(); + int getBank(); // non-const because of use in YaccParser /** Get the total number of banks supported by the cartridge. */ - int bankCount(); + int bankCount() const; /** Get the name/type of the cartridge. */ - string getCartType(); + string getCartType() const; /** Add a label and associated address. diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 71c21cb9d..e8efad173 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -205,7 +205,7 @@ bool Debugger::start(const string& message, int address) if(address > -1) buf << valueToString(address); - myDialog->message().setEditString(buf.str()); + myDialog->message().setText(buf.str()); return true; } return false; diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index ca8cd4d58..d8bbd0a4e 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -175,12 +175,12 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list, } for (int k = 0; k <= myAppData.end; k++) { - // Let the emulation core know about preliminary code + // Let the emulation core know about tentative code if(check_bit(k, CartDebug::CODE) && !(Debugger::debugger().getAccessFlags(k+myOffset) & CartDebug::CODE) && myOffset != 0) { - Debugger::debugger().setAccessFlags(k+myOffset, CartDebug::PCODE); + Debugger::debugger().setAccessFlags(k+myOffset, CartDebug::TCODE); } // Must be ROW / unused bytes @@ -1023,7 +1023,7 @@ void DiStella::addEntry(CartDebug::DisasmType type) && myOffset != 0) { tag.ccount += " *"; - Debugger::debugger().setAccessFlags(tag.address, CartDebug::PCODE); + Debugger::debugger().setAccessFlags(tag.address, CartDebug::TCODE); } break; case CartDebug::GFX: diff --git a/src/debugger/gui/Cart0840Widget.cxx b/src/debugger/gui/Cart0840Widget.cxx index 5fd82967f..09a35b390 100644 --- a/src/debugger/gui/Cart0840Widget.cxx +++ b/src/debugger/gui/Cart0840Widget.cxx @@ -78,3 +78,15 @@ void Cartridge0840Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string Cartridge0840Widget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$800", "$840" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/Cart0840Widget.hxx b/src/debugger/gui/Cart0840Widget.hxx index 6c73f15a0..b91c6feba 100644 --- a/src/debugger/gui/Cart0840Widget.hxx +++ b/src/debugger/gui/Cart0840Widget.hxx @@ -36,6 +36,8 @@ class Cartridge0840Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: Cartridge0840& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/Cart3EWidget.cxx b/src/debugger/gui/Cart3EWidget.cxx index d684e3b7e..777d817e7 100644 --- a/src/debugger/gui/Cart3EWidget.cxx +++ b/src/debugger/gui/Cart3EWidget.cxx @@ -141,3 +141,18 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender, myCart.lockBank(); invalidate(); } + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string Cartridge3EWidget::bankState() +{ + ostringstream& buf = buffer(); + + uInt16& bank = myCart.myCurrentBank; + if(bank < 256) + buf << "ROM bank " << bank % myNumRomBanks << ", RAM inactive"; + else + buf << "ROM inactive, RAM bank " << bank % myNumRomBanks; + + return buf.str(); +} diff --git a/src/debugger/gui/Cart3EWidget.hxx b/src/debugger/gui/Cart3EWidget.hxx index a0dbf81ac..d64d8c6b9 100644 --- a/src/debugger/gui/Cart3EWidget.hxx +++ b/src/debugger/gui/Cart3EWidget.hxx @@ -36,6 +36,8 @@ class Cartridge3EWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: Cartridge3E& myCart; const uInt32 myNumRomBanks; diff --git a/src/debugger/gui/Cart3FWidget.cxx b/src/debugger/gui/Cart3FWidget.cxx index 1b3382dab..1a1590799 100644 --- a/src/debugger/gui/Cart3FWidget.cxx +++ b/src/debugger/gui/Cart3FWidget.cxx @@ -80,3 +80,13 @@ void Cartridge3FWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string Cartridge3FWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $3F"; + + return buf.str(); +} diff --git a/src/debugger/gui/Cart3FWidget.hxx b/src/debugger/gui/Cart3FWidget.hxx index 77fbb6b93..cfd1a5db7 100644 --- a/src/debugger/gui/Cart3FWidget.hxx +++ b/src/debugger/gui/Cart3FWidget.hxx @@ -36,6 +36,8 @@ class Cartridge3FWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: Cartridge3F& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/Cart4A50Widget.cxx b/src/debugger/gui/Cart4A50Widget.cxx index 7518feb66..f061a497c 100644 --- a/src/debugger/gui/Cart4A50Widget.cxx +++ b/src/debugger/gui/Cart4A50Widget.cxx @@ -263,3 +263,25 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender, myCart.lockBank(); invalidate(); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string Cartridge4A50Widget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "L/M/H = "; + if(myCart.myIsRomLow) + buf << "ROM bank " << ((myCart.mySliceLow >> 11) & 0x1F) << " / "; + else + buf << "RAM bank " << ((myCart.mySliceLow >> 11) & 0x0F) << " / "; + if(myCart.myIsRomMiddle) + buf << "ROM bank " << ((myCart.mySliceMiddle >> 11) & 0x1F) << " / "; + else + buf << "RAM bank " << ((myCart.mySliceMiddle >> 11) & 0x0F) << " / "; + if(myCart.myIsRomHigh) + buf << "ROM bank " << ((myCart.mySliceHigh >> 11) & 0xFF); + else + buf << "RAM bank " << ((myCart.mySliceHigh >> 11) & 0x7F); + + return buf.str(); +} diff --git a/src/debugger/gui/Cart4A50Widget.hxx b/src/debugger/gui/Cart4A50Widget.hxx index 75a513a6a..944d7aed6 100644 --- a/src/debugger/gui/Cart4A50Widget.hxx +++ b/src/debugger/gui/Cart4A50Widget.hxx @@ -36,6 +36,8 @@ class Cartridge4A50Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: Cartridge4A50& myCart; PopUpWidget *myROMLower, *myRAMLower; diff --git a/src/debugger/gui/CartARWidget.cxx b/src/debugger/gui/CartARWidget.cxx index 8a2f5fd4e..b69757b78 100644 --- a/src/debugger/gui/CartARWidget.cxx +++ b/src/debugger/gui/CartARWidget.cxx @@ -98,3 +98,13 @@ void CartridgeARWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeARWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank; + + return buf.str(); +} diff --git a/src/debugger/gui/CartARWidget.hxx b/src/debugger/gui/CartARWidget.hxx index e786fa8f6..ecd9dbb4f 100644 --- a/src/debugger/gui/CartARWidget.hxx +++ b/src/debugger/gui/CartARWidget.hxx @@ -36,6 +36,8 @@ class CartridgeARWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeAR& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartCMWidget.cxx b/src/debugger/gui/CartCMWidget.cxx index 1d9baed64..d2a775d64 100644 --- a/src/debugger/gui/CartCMWidget.cxx +++ b/src/debugger/gui/CartCMWidget.cxx @@ -192,7 +192,7 @@ void CartridgeCMWidget::loadConfig() // RAM state (several bits from SWCHA) const string& ram = swcha & 0x10 ? " Inactive" : swcha & 0x20 ? " Read-only" : " Write-only"; - myRAM->setEditString(ram, (swcha & 0x30) != (myOldState.swcha & 0x30)); + myRAM->setText(ram, (swcha & 0x30) != (myOldState.swcha & 0x30)); CartDebugWidget::loadConfig(); } @@ -211,3 +211,15 @@ void CartridgeCMWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeCMWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank + << ", RAM is" << (myCart.mySWCHA & 0x10 ? " Inactive" : + myCart.mySWCHA & 0x20 ? " Read-only" : " Write-only"); + + return buf.str(); +} diff --git a/src/debugger/gui/CartCMWidget.hxx b/src/debugger/gui/CartCMWidget.hxx index 683c8f625..a1582516a 100644 --- a/src/debugger/gui/CartCMWidget.hxx +++ b/src/debugger/gui/CartCMWidget.hxx @@ -42,6 +42,8 @@ class CartridgeCMWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: struct CartState { uInt8 swcha; diff --git a/src/debugger/gui/CartCTYWidget.cxx b/src/debugger/gui/CartCTYWidget.cxx index 0a8d1f325..f739a81bc 100644 --- a/src/debugger/gui/CartCTYWidget.cxx +++ b/src/debugger/gui/CartCTYWidget.cxx @@ -75,3 +75,17 @@ void CartridgeCTYWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeCTYWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" + }; + uInt16 bank = myCart.bank(); + buf << "Bank = " << bank << ", hotspot = " << spot[bank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartCTYWidget.hxx b/src/debugger/gui/CartCTYWidget.hxx index 439eba542..d624113eb 100644 --- a/src/debugger/gui/CartCTYWidget.hxx +++ b/src/debugger/gui/CartCTYWidget.hxx @@ -36,6 +36,8 @@ class CartridgeCTYWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeCTY& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx index ecfc6b2c8..8cc02d104 100644 --- a/src/debugger/gui/CartDPCPlusWidget.cxx +++ b/src/debugger/gui/CartDPCPlusWidget.cxx @@ -316,3 +316,17 @@ void CartridgeDPCPlusWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeDPCPlusWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartDPCPlusWidget.hxx b/src/debugger/gui/CartDPCPlusWidget.hxx index f3f7e49e3..de1e07d32 100644 --- a/src/debugger/gui/CartDPCPlusWidget.hxx +++ b/src/debugger/gui/CartDPCPlusWidget.hxx @@ -17,8 +17,8 @@ // $Id$ //============================================================================ -#ifndef CARTRIDGEDPCPlus_WIDGET_HXX -#define CARTRIDGEDPCPlus_WIDGET_HXX +#ifndef CARTRIDGEDPCPLUS_WIDGET_HXX +#define CARTRIDGEDPCPLUS_WIDGET_HXX class CartridgeDPCPlus; class PopUpWidget; @@ -40,6 +40,8 @@ class CartridgeDPCPlusWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: struct CartState { ByteArray tops; diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx index 216226dde..2bc5b992d 100644 --- a/src/debugger/gui/CartDPCWidget.cxx +++ b/src/debugger/gui/CartDPCWidget.cxx @@ -222,3 +222,15 @@ void CartridgeDPCWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeDPCWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF8", "$FF9" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartDPCWidget.hxx b/src/debugger/gui/CartDPCWidget.hxx index e204e51f5..9ea868df5 100644 --- a/src/debugger/gui/CartDPCWidget.hxx +++ b/src/debugger/gui/CartDPCWidget.hxx @@ -39,6 +39,8 @@ class CartridgeDPCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: struct CartState { ByteArray tops; diff --git a/src/debugger/gui/CartDebugWidget.hxx b/src/debugger/gui/CartDebugWidget.hxx index 60288de67..63c8bebc0 100644 --- a/src/debugger/gui/CartDebugWidget.hxx +++ b/src/debugger/gui/CartDebugWidget.hxx @@ -110,13 +110,19 @@ class CartDebugWidget : public Widget, public CommandSender virtual void loadConfig() { myDesc->setSelected(0); } virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) { }; + // Query internal state of the cart (usually just bankswitching info) + virtual string bankState() { return "0 (non-bankswitched)"; } + protected: // These will be needed by most of the child classes; // we may as well make them protected variables int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; + ostringstream& buffer() { myBuffer.str(""); return myBuffer; } + private: StringListWidget* myDesc; + ostringstream myBuffer; }; #endif diff --git a/src/debugger/gui/CartE0Widget.cxx b/src/debugger/gui/CartE0Widget.cxx index 155f0f3d5..dbdbc6a73 100644 --- a/src/debugger/gui/CartE0Widget.cxx +++ b/src/debugger/gui/CartE0Widget.cxx @@ -21,6 +21,19 @@ #include "PopUpWidget.hxx" #include "CartE0Widget.hxx" +static const char* seg0[] = { + "0 ($FE0)", "1 ($FE1)", "2 ($FE2)", "3 ($FE3)", + "4 ($FE4)", "5 ($FE5)", "6 ($FE6)", "7 ($FE7)" +}; +static const char* seg1[] = { + "0 ($FE8)", "1 ($FE9)", "2 ($FEA)", "3 ($FEB)", + "4 ($FEC)", "5 ($FED)", "6 ($FEE)", "7 ($FEF)" +}; +static const char* seg2[] = { + "0 ($FF0)", "1 ($FF1)", "2 ($FF2)", "3 ($FF3)", + "4 ($FF4)", "5 ($FF5)", "6 ($FF6)", "7 ($FF7)" +}; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeE0Widget::CartridgeE0Widget( GuiObject* boss, const GUI::Font& font, @@ -52,32 +65,12 @@ CartridgeE0Widget::CartridgeE0Widget( ypos = addBaseInformation(size, "Parker Brothers", info) + myLineHeight; VariantList items0, items1, items2; - items0.push_back("0 ($FE0)"); - items0.push_back("1 ($FE1)"); - items0.push_back("2 ($FE2)"); - items0.push_back("3 ($FE3)"); - items0.push_back("4 ($FE4)"); - items0.push_back("5 ($FE5)"); - items0.push_back("6 ($FE6)"); - items0.push_back("7 ($FE7)"); - - items1.push_back("0 ($FE8)"); - items1.push_back("1 ($FE9)"); - items1.push_back("2 ($FEA)"); - items1.push_back("3 ($FEB)"); - items1.push_back("4 ($FEC)"); - items1.push_back("5 ($FED)"); - items1.push_back("6 ($FEE)"); - items1.push_back("7 ($FEF)"); - - items2.push_back("0 ($FF0)"); - items2.push_back("1 ($FF1)"); - items2.push_back("2 ($FF2)"); - items2.push_back("3 ($FF3)"); - items2.push_back("4 ($FF4)"); - items2.push_back("5 ($FF5)"); - items2.push_back("6 ($FF6)"); - items2.push_back("7 ($FF7)"); + for(int i = 0; i < 8; ++i) + { + items0.push_back(seg0[i]); + items1.push_back(seg1[i]); + items2.push_back(seg2[i]); + } const int lwidth = font.getStringWidth("Set slice for segment X: "); mySlice0 = @@ -136,3 +129,16 @@ void CartridgeE0Widget::handleCommand(CommandSender* sender, myCart.lockBank(); invalidate(); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeE0Widget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Slices: " + << seg0[myCart.myCurrentSlice[0]] << " / " + << seg1[myCart.myCurrentSlice[1]] << " / " + << seg2[myCart.myCurrentSlice[2]]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartE0Widget.hxx b/src/debugger/gui/CartE0Widget.hxx index fd02fe57d..604f1970c 100644 --- a/src/debugger/gui/CartE0Widget.hxx +++ b/src/debugger/gui/CartE0Widget.hxx @@ -36,6 +36,8 @@ class CartridgeE0Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeE0& myCart; PopUpWidget *mySlice0, *mySlice1, *mySlice2; diff --git a/src/debugger/gui/CartE7Widget.cxx b/src/debugger/gui/CartE7Widget.cxx index 3bec49b74..8371ae755 100644 --- a/src/debugger/gui/CartE7Widget.cxx +++ b/src/debugger/gui/CartE7Widget.cxx @@ -21,6 +21,14 @@ #include "PopUpWidget.hxx" #include "CartE7Widget.hxx" +static const char* spot_lower[] = { + "0 - ROM ($FE0)", "1 - ROM ($FE1)", "2 - ROM ($FE2)", "3 - ROM ($FE3)", + "4 - ROM ($FE4)", "5 - ROM ($FE5)", "6 - ROM ($FE6)", "7 - RAM ($FE7)" +}; +static const char* spot_upper[] = { + "0 - RAM ($FE8)", "1 - RAM ($FE9)", "2 - RAM ($FEA)", "3 - RAM ($FEB)" +}; + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CartridgeE7Widget::CartridgeE7Widget( GuiObject* boss, const GUI::Font& font, @@ -54,19 +62,10 @@ CartridgeE7Widget::CartridgeE7Widget( myLineHeight; VariantList items0, items1; - items0.push_back("0 - ROM ($FE0)"); - items0.push_back("1 - ROM ($FE1)"); - items0.push_back("2 - ROM ($FE2)"); - items0.push_back("3 - ROM ($FE3)"); - items0.push_back("4 - ROM ($FE4)"); - items0.push_back("5 - ROM ($FE5)"); - items0.push_back("6 - ROM ($FE6)"); - items0.push_back("7 - RAM ($FE7)"); - - items1.push_back("0 - RAM ($FE8)"); - items1.push_back("1 - RAM ($FE9)"); - items1.push_back("2 - RAM ($FEA)"); - items1.push_back("3 - RAM ($FEB)"); + for(int i = 0; i < 8; ++i) + items0.push_back(spot_lower[i]); + for(int i = 0; i < 4; ++i) + items1.push_back(spot_upper[i]); const int lwidth = font.getStringWidth("Set slice for upper 256B: "), fwidth = font.getStringWidth("3 - RAM ($FEB)"); @@ -112,3 +111,15 @@ void CartridgeE7Widget::handleCommand(CommandSender* sender, myCart.lockBank(); invalidate(); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeE7Widget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Slices: " + << spot_lower[myCart.myCurrentSlice[0]] << " / " + << spot_upper[myCart.myCurrentRAM]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartE7Widget.hxx b/src/debugger/gui/CartE7Widget.hxx index bdc58084b..a0357f556 100644 --- a/src/debugger/gui/CartE7Widget.hxx +++ b/src/debugger/gui/CartE7Widget.hxx @@ -36,6 +36,8 @@ class CartridgeE7Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeE7& myCart; PopUpWidget *myLower2K, *myUpper256B; diff --git a/src/debugger/gui/CartEFSCWidget.cxx b/src/debugger/gui/CartEFSCWidget.cxx index d28ef093a..8bc44c48c 100644 --- a/src/debugger/gui/CartEFSCWidget.cxx +++ b/src/debugger/gui/CartEFSCWidget.cxx @@ -94,3 +94,18 @@ void CartridgeEFSCWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeEFSCWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7", + "$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartEFSCWidget.hxx b/src/debugger/gui/CartEFSCWidget.hxx index 05d3b28f7..3fbcf315f 100644 --- a/src/debugger/gui/CartEFSCWidget.hxx +++ b/src/debugger/gui/CartEFSCWidget.hxx @@ -36,6 +36,8 @@ class CartridgeEFSCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeEFSC& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartEFWidget.cxx b/src/debugger/gui/CartEFWidget.cxx index 74ed8475a..aecc3f6da 100644 --- a/src/debugger/gui/CartEFWidget.cxx +++ b/src/debugger/gui/CartEFWidget.cxx @@ -92,3 +92,18 @@ void CartridgeEFWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeEFWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7", + "$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartEFWidget.hxx b/src/debugger/gui/CartEFWidget.hxx index 39b37d8ad..05604f11e 100644 --- a/src/debugger/gui/CartEFWidget.hxx +++ b/src/debugger/gui/CartEFWidget.hxx @@ -36,6 +36,8 @@ class CartridgeEFWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeEF& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF0Widget.cxx b/src/debugger/gui/CartF0Widget.cxx index 78b3b2fc9..63a6c4431 100644 --- a/src/debugger/gui/CartF0Widget.cxx +++ b/src/debugger/gui/CartF0Widget.cxx @@ -93,3 +93,13 @@ void CartridgeF0Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF0Widget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $FF0"; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF0Widget.hxx b/src/debugger/gui/CartF0Widget.hxx index dd894c492..89786a587 100644 --- a/src/debugger/gui/CartF0Widget.hxx +++ b/src/debugger/gui/CartF0Widget.hxx @@ -36,6 +36,8 @@ class CartridgeF0Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF0& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF4SCWidget.cxx b/src/debugger/gui/CartF4SCWidget.cxx index 3971ecb29..937c31594 100644 --- a/src/debugger/gui/CartF4SCWidget.cxx +++ b/src/debugger/gui/CartF4SCWidget.cxx @@ -85,3 +85,17 @@ void CartridgeF4SCWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF4SCWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF4SCWidget.hxx b/src/debugger/gui/CartF4SCWidget.hxx index 57e6aa602..c9712ccab 100644 --- a/src/debugger/gui/CartF4SCWidget.hxx +++ b/src/debugger/gui/CartF4SCWidget.hxx @@ -36,6 +36,8 @@ class CartridgeF4SCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF4SC& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF4Widget.cxx b/src/debugger/gui/CartF4Widget.cxx index 986f418a6..102853aab 100644 --- a/src/debugger/gui/CartF4Widget.cxx +++ b/src/debugger/gui/CartF4Widget.cxx @@ -83,3 +83,17 @@ void CartridgeF4Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF4Widget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF4Widget.hxx b/src/debugger/gui/CartF4Widget.hxx index 2533208bb..da78eea3a 100644 --- a/src/debugger/gui/CartF4Widget.hxx +++ b/src/debugger/gui/CartF4Widget.hxx @@ -36,6 +36,8 @@ class CartridgeF4Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF4& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF6SCWidget.cxx b/src/debugger/gui/CartF6SCWidget.cxx index 0072c74ca..5c2820abc 100644 --- a/src/debugger/gui/CartF6SCWidget.cxx +++ b/src/debugger/gui/CartF6SCWidget.cxx @@ -81,3 +81,15 @@ void CartridgeF6SCWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF6SCWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF6SCWidget.hxx b/src/debugger/gui/CartF6SCWidget.hxx index e98f5d01f..7563fd38d 100644 --- a/src/debugger/gui/CartF6SCWidget.hxx +++ b/src/debugger/gui/CartF6SCWidget.hxx @@ -36,6 +36,8 @@ class CartridgeF6SCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF6SC& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF6Widget.cxx b/src/debugger/gui/CartF6Widget.cxx index 5884a7b05..a247bf883 100644 --- a/src/debugger/gui/CartF6Widget.cxx +++ b/src/debugger/gui/CartF6Widget.cxx @@ -79,3 +79,15 @@ void CartridgeF6Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF6Widget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF6Widget.hxx b/src/debugger/gui/CartF6Widget.hxx index e12d8392c..9d2a4abe5 100644 --- a/src/debugger/gui/CartF6Widget.hxx +++ b/src/debugger/gui/CartF6Widget.hxx @@ -36,6 +36,8 @@ class CartridgeF6Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF6& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF8SCWidget.cxx b/src/debugger/gui/CartF8SCWidget.cxx index d65400443..37f4a2fa7 100644 --- a/src/debugger/gui/CartF8SCWidget.cxx +++ b/src/debugger/gui/CartF8SCWidget.cxx @@ -79,3 +79,15 @@ void CartridgeF8SCWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF8SCWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF8", "$FF9" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF8SCWidget.hxx b/src/debugger/gui/CartF8SCWidget.hxx index 80feb0af9..b8d2ef479 100644 --- a/src/debugger/gui/CartF8SCWidget.hxx +++ b/src/debugger/gui/CartF8SCWidget.hxx @@ -36,6 +36,8 @@ class CartridgeF8SCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF8SC& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartF8Widget.cxx b/src/debugger/gui/CartF8Widget.cxx index 315516d9a..ab385ae59 100644 --- a/src/debugger/gui/CartF8Widget.cxx +++ b/src/debugger/gui/CartF8Widget.cxx @@ -77,3 +77,15 @@ void CartridgeF8Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeF8Widget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF8", "$FF9" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartF8Widget.hxx b/src/debugger/gui/CartF8Widget.hxx index cd3abf3cc..f4af9a64d 100644 --- a/src/debugger/gui/CartF8Widget.hxx +++ b/src/debugger/gui/CartF8Widget.hxx @@ -36,6 +36,8 @@ class CartridgeF8Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeF8& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartFA2Widget.cxx b/src/debugger/gui/CartFA2Widget.cxx index 5dd0013e3..c417ece20 100644 --- a/src/debugger/gui/CartFA2Widget.cxx +++ b/src/debugger/gui/CartFA2Widget.cxx @@ -131,3 +131,17 @@ void CartridgeFA2Widget::handleCommand(CommandSender* sender, break; } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeFA2Widget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { + "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB" + }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartFA2Widget.hxx b/src/debugger/gui/CartFA2Widget.hxx index be22aaee9..94da82b86 100644 --- a/src/debugger/gui/CartFA2Widget.hxx +++ b/src/debugger/gui/CartFA2Widget.hxx @@ -37,6 +37,8 @@ class CartridgeFA2Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeFA2& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartFAWidget.cxx b/src/debugger/gui/CartFAWidget.cxx index cf9b322ed..1b5d0f8dc 100644 --- a/src/debugger/gui/CartFAWidget.cxx +++ b/src/debugger/gui/CartFAWidget.cxx @@ -80,3 +80,15 @@ void CartridgeFAWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeFAWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$FF8", "$FF9", "$FFA" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartFAWidget.hxx b/src/debugger/gui/CartFAWidget.hxx index cefe8e153..aef7e7f8a 100644 --- a/src/debugger/gui/CartFAWidget.hxx +++ b/src/debugger/gui/CartFAWidget.hxx @@ -36,6 +36,8 @@ class CartridgeFAWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeFA& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartFEWidget.cxx b/src/debugger/gui/CartFEWidget.cxx index 16ed9bbfc..736d82fdb 100644 --- a/src/debugger/gui/CartFEWidget.cxx +++ b/src/debugger/gui/CartFEWidget.cxx @@ -24,7 +24,8 @@ CartridgeFEWidget::CartridgeFEWidget( GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, CartridgeFE& cart) - : CartDebugWidget(boss, font, x, y, w, h) + : CartDebugWidget(boss, font, x, y, w, h), + myCart(cart) { string info = "FE cartridge, two 4K banks\n" @@ -38,3 +39,14 @@ CartridgeFEWidget::CartridgeFEWidget( addBaseInformation(2 * 4096, "Activision", info); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeFEWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* range[] = { "$F000", "$D000" }; + buf << "Bank = " << myCart.bank() << ", address range = " << range[myCart.bank()]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartFEWidget.hxx b/src/debugger/gui/CartFEWidget.hxx index 24d6d3648..be6d274e8 100644 --- a/src/debugger/gui/CartFEWidget.hxx +++ b/src/debugger/gui/CartFEWidget.hxx @@ -34,6 +34,11 @@ class CartridgeFEWidget : public CartDebugWidget // No implementation for non-bankswitched ROMs void loadConfig() { } void handleCommand(CommandSender* sender, int cmd, int data, int id) { } + + string bankState(); + + private: + CartridgeFE& myCart; }; #endif diff --git a/src/debugger/gui/CartMCWidget.cxx b/src/debugger/gui/CartMCWidget.cxx index 2da160d97..09528ab60 100644 --- a/src/debugger/gui/CartMCWidget.cxx +++ b/src/debugger/gui/CartMCWidget.cxx @@ -131,3 +131,17 @@ void CartridgeMCWidget::handleCommand(CommandSender* sender, myCart.lockBank(); invalidate(); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeMCWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Slices: " + << myCart.myCurrentBlock[0] << " / " + << myCart.myCurrentBlock[1] << " / " + << myCart.myCurrentBlock[2] << " / " + << myCart.myCurrentBlock[3]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartMCWidget.hxx b/src/debugger/gui/CartMCWidget.hxx index 340d22d8b..d6be2804e 100644 --- a/src/debugger/gui/CartMCWidget.hxx +++ b/src/debugger/gui/CartMCWidget.hxx @@ -36,6 +36,8 @@ class CartridgeMCWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeMC& myCart; PopUpWidget *mySlice0, *mySlice1, *mySlice2, *mySlice3; diff --git a/src/debugger/gui/CartSBWidget.cxx b/src/debugger/gui/CartSBWidget.cxx index 24867d12d..8b540dba7 100644 --- a/src/debugger/gui/CartSBWidget.cxx +++ b/src/debugger/gui/CartSBWidget.cxx @@ -83,3 +83,14 @@ void CartridgeSBWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeSBWidget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = $" << HEX2 << (myCart.myCurrentBank + 0x800); + + return buf.str(); +} diff --git a/src/debugger/gui/CartSBWidget.hxx b/src/debugger/gui/CartSBWidget.hxx index 6f75afd3f..482e7ca48 100644 --- a/src/debugger/gui/CartSBWidget.hxx +++ b/src/debugger/gui/CartSBWidget.hxx @@ -36,6 +36,8 @@ class CartridgeSBWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeSB& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartUAWidget.cxx b/src/debugger/gui/CartUAWidget.cxx index bd9f787b2..d885dd48e 100644 --- a/src/debugger/gui/CartUAWidget.cxx +++ b/src/debugger/gui/CartUAWidget.cxx @@ -78,3 +78,15 @@ void CartridgeUAWidget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeUAWidget::bankState() +{ + ostringstream& buf = buffer(); + + static const char* spot[] = { "$200", "$240" }; + buf << "Bank = " << myCart.myCurrentBank + << ", hotspot = " << spot[myCart.myCurrentBank]; + + return buf.str(); +} diff --git a/src/debugger/gui/CartUAWidget.hxx b/src/debugger/gui/CartUAWidget.hxx index 179365978..c083c8116 100644 --- a/src/debugger/gui/CartUAWidget.hxx +++ b/src/debugger/gui/CartUAWidget.hxx @@ -36,6 +36,8 @@ class CartridgeUAWidget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeUA& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CartX07Widget.cxx b/src/debugger/gui/CartX07Widget.cxx index cfc2db5f7..c74af9693 100644 --- a/src/debugger/gui/CartX07Widget.cxx +++ b/src/debugger/gui/CartX07Widget.cxx @@ -94,3 +94,13 @@ void CartridgeX07Widget::handleCommand(CommandSender* sender, invalidate(); } } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeX07Widget::bankState() +{ + ostringstream& buf = buffer(); + + buf << "Bank = " << myCart.myCurrentBank; + + return buf.str(); +} diff --git a/src/debugger/gui/CartX07Widget.hxx b/src/debugger/gui/CartX07Widget.hxx index 4d8812abf..0175d1b79 100644 --- a/src/debugger/gui/CartX07Widget.hxx +++ b/src/debugger/gui/CartX07Widget.hxx @@ -36,6 +36,8 @@ class CartridgeX07Widget : public CartDebugWidget void loadConfig(); void handleCommand(CommandSender* sender, int cmd, int data, int id); + string bankState(); + private: CartridgeX07& myCart; PopUpWidget* myBank; diff --git a/src/debugger/gui/CpuWidget.cxx b/src/debugger/gui/CpuWidget.cxx index b00b257e5..f638a4027 100644 --- a/src/debugger/gui/CpuWidget.cxx +++ b/src/debugger/gui/CpuWidget.cxx @@ -309,5 +309,5 @@ void CpuWidget::fillGrid() changed.push_back(state.PSbits[i] != oldstate.PSbits[i]); myPSRegister->setState(state.PSbits, changed); - myPCLabel->setEditString(dbg.cartDebug().getLabel(state.PC, true)); + myPCLabel->setText(dbg.cartDebug().getLabel(state.PC, true)); } diff --git a/src/debugger/gui/DataGridWidget.cxx b/src/debugger/gui/DataGridWidget.cxx index c30e49728..be99d7003 100644 --- a/src/debugger/gui/DataGridWidget.cxx +++ b/src/debugger/gui/DataGridWidget.cxx @@ -642,7 +642,7 @@ void DataGridWidget::startEditMode() if (_editable && !_editMode && _selectedItem >= 0) { _editMode = true; - setEditString("", true ); // Erase current entry when starting editing + setText("", true ); // Erase current entry when starting editing } } diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 09abe0efd..9e3fe9eab 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -76,7 +76,7 @@ void DebuggerDialog::loadConfig() myRam->loadConfig(); myRomTab->loadConfig(); - myMessageBox->setEditString(""); + myMessageBox->setText(""); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/RamWidget.cxx b/src/debugger/gui/RamWidget.cxx index ddcfc92d6..f1d8c64f3 100644 --- a/src/debugger/gui/RamWidget.cxx +++ b/src/debugger/gui/RamWidget.cxx @@ -182,8 +182,8 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) myUndoAddress = addr; myUndoValue = oldval; - myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10)); - myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2)); + myDecValue->setText(instance().debugger().valueToString(value, kBASE_10)); + myBinValue->setText(instance().debugger().valueToString(value, kBASE_2)); myRevertButton->setEnabled(true); myUndoButton->setEnabled(true); break; @@ -194,9 +194,9 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) addr = myRamGrid->getSelectedAddr(); value = myRamGrid->getSelectedValue(); - myLabel->setEditString(dbg.getLabel(state.rport[addr], true)); - myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10)); - myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2)); + myLabel->setText(dbg.getLabel(state.rport[addr], true)); + myDecValue->setText(instance().debugger().valueToString(value, kBASE_10)); + myBinValue->setText(instance().debugger().valueToString(value, kBASE_2)); break; } @@ -320,7 +320,7 @@ void RamWidget::showInputBox(int cmd) uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1); uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1); myInputBox->show(x, y); - myInputBox->setEditString(""); + myInputBox->setText(""); myInputBox->setTitle(""); myInputBox->setFocus(0); myInputBox->setEmitSignal(cmd); diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx index 3abeeb548..b7ac78183 100644 --- a/src/debugger/gui/RomListWidget.cxx +++ b/src/debugger/gui/RomListWidget.cxx @@ -62,14 +62,14 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& font, // Add context menu VariantList l; // l.push_back("Add bookmark"); - l.push_back("Save ROM", "saverom"); l.push_back("Set PC", "setpc"); l.push_back("RunTo PC", "runtopc"); - l.push_back("-------------------------", ""); - l.push_back("Toggle PC addresses", "pcaddr"); - l.push_back("Toggle GFX binary/hex", "gfx"); - l.push_back("Toggle address relocation", "relocate"); l.push_back("Re-disassemble", "disasm"); + l.push_back("-------------------------", ""); + l.push_back("Show tentative code", "code"); + l.push_back("Show PC addresses", "pcaddr"); + l.push_back("Show GFX as binary", "gfx"); + l.push_back("Use address relocation", "relocate"); myMenu = new ContextMenu(this, font, l); // Take advantage of a wide debugger window when possible @@ -585,7 +585,7 @@ void RomListWidget::startEditMode() // Widget gets raw data while editing EditableWidget::startEditMode(); - setEditString(myDisasm->list[_selectedItem].bytes); + setText(myDisasm->list[_selectedItem].bytes); } } diff --git a/src/debugger/gui/RomListWidget.hxx b/src/debugger/gui/RomListWidget.hxx index e94b46f6b..be017b2c8 100644 --- a/src/debugger/gui/RomListWidget.hxx +++ b/src/debugger/gui/RomListWidget.hxx @@ -35,13 +35,12 @@ class CheckListWidget; /** RomListWidget */ class RomListWidget : public EditableWidget { - friend class RomWidget; +// friend class RomWidget; public: enum { - kBreakpointChangedCmd = 'RLbp', // click on the checkbox for a breakpoint - kRomChangedCmd = 'RLpr' // ROM item data changed - 'data' will be - // item index + kBreakpointChangedCmd = 'RLbp', // click on the checkbox for a breakpoint + kRomChangedCmd = 'RLpr' // ROM item data changed - 'data' will be item index }; public: diff --git a/src/debugger/gui/RomWidget.cxx b/src/debugger/gui/RomWidget.cxx index 6e8d82514..50032e410 100644 --- a/src/debugger/gui/RomWidget.cxx +++ b/src/debugger/gui/RomWidget.cxx @@ -28,7 +28,6 @@ #include "DiStella.hxx" #include "CpuDebug.hxx" #include "GuiObject.hxx" -#include "InputTextDialog.hxx" #include "DataGridWidget.hxx" #include "EditTextWidget.hxx" #include "PopUpWidget.hxx" @@ -42,8 +41,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : Widget(boss, font, x, y, w, h), CommandSender(boss), - myListIsDirty(true), - myCurrentBank(-1) + myListIsDirty(true) { _type = kRomWidget; @@ -51,62 +49,27 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, StaticTextWidget* t; WidgetArray wid; - // Show current bank + // Show current bank state xpos = x; ypos = y + 7; - ostringstream buf; - buf << "Current bank (" << dec - << instance().debugger().cartDebug().bankCount() << " total):"; t = new StaticTextWidget(boss, font, xpos, ypos, - font.getStringWidth(buf.str()), + font.getStringWidth("Bank state: "), font.getFontHeight(), - buf.str(), kTextAlignLeft); + "Bank state: ", kTextAlignLeft); xpos += t->getWidth() + 5; - myBank = new DataGridWidget(boss, font, xpos, ypos-2, - 1, 1, 4, 8, kBASE_10); - myBank->setTarget(this); - myBank->setRange(0, instance().debugger().cartDebug().bankCount()); - if(instance().debugger().cartDebug().bankCount() <= 1) - myBank->setEditable(false); - addFocusWidget(myBank); - - // 'resolvedata' setting for Distella - xpos += myBank->getWidth() + 20; - VariantList items; - items.push_back("Never", "never"); - items.push_back("Always", "always"); - items.push_back("Automatic", "auto"); - myResolveData = - new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("Automatic"), - font.getLineHeight(), items, - "Resolve data: ", font.getStringWidth("Resolve data: "), - kResolveDataChanged); - myResolveData->setTarget(this); - addFocusWidget(myResolveData); + myBank = new EditTextWidget(boss, font, xpos, ypos, + _w - 2 - xpos, font.getFontHeight()); // Create rom listing xpos = x; ypos += myBank->getHeight() + 4; myRomList = new RomListWidget(boss, font, xpos, ypos, _w - 4, _h - ypos - 2); - myRomList->setTarget(this); - myRomList->myMenu->setTarget(this); addFocusWidget(myRomList); - - // Create dialog box for save ROM (get name) - StringList label; - label.push_back("Filename: "); - mySaveRom = new InputTextDialog(boss, font, label); - mySaveRom->setTarget(this); - - // By default, we try to automatically determine code vs. data sections - myResolveData->setSelected( - instance().settings().getString("dis.resolvedata"), "auto"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RomWidget::~RomWidget() { - delete mySaveRom; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -114,11 +77,11 @@ void RomWidget::loadConfig() { Debugger& dbg = instance().debugger(); CartDebug& cart = dbg.cartDebug(); - bool bankChanged = myCurrentBank != cart.getBank(); - myCurrentBank = cart.getBank(); + const CartState& state = (CartState&) cart.getState(); + const CartState& oldstate = (CartState&) cart.getOldState(); // Fill romlist the current bank of source or disassembly - myListIsDirty |= cart.disassemble(myResolveData->getSelectedTag().toString(), + myListIsDirty |= cart.disassemble("always", /*FIXME myResolveData->getSelectedTag().toString(),*/ myListIsDirty); if(myListIsDirty) { @@ -131,13 +94,14 @@ void RomWidget::loadConfig() if(pcline >= 0 && pcline != myRomList->getHighlighted()) myRomList->setHighlighted(pcline); - // Set current bank and number of banks - myBank->setList(-1, myCurrentBank, bankChanged); + // Set current bank state + myBank->setText(state.bank, state.bank != oldstate.bank); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) { +cerr << cmd << " " << data << " " << id << endl; switch(cmd) { case RomListWidget::kBreakpointChangedCmd: @@ -155,18 +119,12 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) patchROM(data, myRomList->getEditString()); break; +#if 0 case ContextMenu::kItemSelectedCmd: { const string& rmb = myRomList->myMenu->getSelectedTag().toString(); - if(rmb == "saverom") - { - mySaveRom->show(_x + 50, _y + 80); - mySaveRom->setEditString(""); - mySaveRom->setTitle(""); - mySaveRom->setEmitSignal(kRomNameEntered); - } - else if(rmb == "setpc") + if(rmb == "setpc") setPC(myRomList->getSelected()); else if(rmb == "runtopc") runtoPC(myRomList->getSelected()); @@ -203,10 +161,6 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) break; // kCMenuItemSelectedCmd } - case DataGridWidget::kItemDataChangedCmd: - setBank(myBank->getSelectedValue()); - break; - case kResolveDataChanged: instance().settings().setValue("dis.resolvedata", myResolveData->getSelectedTag()); invalidate(); @@ -225,17 +179,10 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) } break; } +#endif } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RomWidget::setBank(uInt16 bank) -{ - ostringstream command; - command << "bank #" << bank; - instance().debugger().run(command.str()); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomWidget::setBreak(int disasm_line, bool state) { @@ -303,11 +250,3 @@ void RomWidget::patchROM(int disasm_line, const string& bytes) instance().debugger().parser().setBase(oldbase); } } - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void RomWidget::saveROM(const string& rom) -{ - ostringstream command; - command << "saverom " << rom; - instance().debugger().run(command.str()); -} diff --git a/src/debugger/gui/RomWidget.hxx b/src/debugger/gui/RomWidget.hxx index 3cf1509fb..3ef50fcda 100644 --- a/src/debugger/gui/RomWidget.hxx +++ b/src/debugger/gui/RomWidget.hxx @@ -24,11 +24,7 @@ #define ROM_WIDGET_HXX class GuiObject; -class DataGridWidget; class EditTextWidget; -class InputTextDialog; -class PopUpWidget; -class StringList; #include "Array.hxx" #include "Widget.hxx" @@ -61,21 +57,16 @@ class RomWidget : public Widget, public CommandSender kRomNameEntered = 'RWrn' }; - void setBank(uInt16 bank); void setBreak(int disasm_line, bool state); void setPC(int disasm_line); void runtoPC(int disasm_line); void patchROM(int disasm_line, const string& bytes); - void saveROM(const string& rom); private: RomListWidget* myRomList; - DataGridWidget* myBank; - PopUpWidget* myResolveData; - InputTextDialog* mySaveRom; + EditTextWidget* myBank; bool myListIsDirty; - int myCurrentBank; }; #endif diff --git a/src/debugger/gui/TiaInfoWidget.cxx b/src/debugger/gui/TiaInfoWidget.cxx index 1da259e54..2a0fd178f 100644 --- a/src/debugger/gui/TiaInfoWidget.cxx +++ b/src/debugger/gui/TiaInfoWidget.cxx @@ -125,15 +125,15 @@ void TiaInfoWidget::loadConfig() Debugger& dbg = instance().debugger(); TIADebug& tia = dbg.tiaDebug(); - myFrameCount->setEditString(dbg.valueToString(tia.frameCount(), kBASE_10)); - myFrameCycles->setEditString(dbg.valueToString(dbg.cycles(), kBASE_10)); + myFrameCount->setText(dbg.valueToString(tia.frameCount(), kBASE_10)); + myFrameCycles->setText(dbg.valueToString(dbg.cycles(), kBASE_10)); myVSync->setState(tia.vsync()); myVBlank->setState(tia.vblank()); int clk = tia.clocksThisLine(); - myScanlineCount->setEditString(dbg.valueToString(tia.scanlines(), kBASE_10)); - myScanlineCycles->setEditString(dbg.valueToString(clk/3, kBASE_10)); - myPixelPosition->setEditString(dbg.valueToString(clk-68, kBASE_10)); - myColorClocks->setEditString(dbg.valueToString(clk, kBASE_10)); + myScanlineCount->setText(dbg.valueToString(tia.scanlines(), kBASE_10)); + myScanlineCycles->setText(dbg.valueToString(clk/3, kBASE_10)); + myPixelPosition->setText(dbg.valueToString(clk-68, kBASE_10)); + myColorClocks->setText(dbg.valueToString(clk, kBASE_10)); } diff --git a/src/debugger/gui/TiaWidget.cxx b/src/debugger/gui/TiaWidget.cxx index cc8cd1731..47eac935f 100644 --- a/src/debugger/gui/TiaWidget.cxx +++ b/src/debugger/gui/TiaWidget.cxx @@ -634,12 +634,12 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) case kNusizP0ID: tia.nusizP0(myNusizP0->getSelectedValue()); - myNusizP0Text->setEditString(tia.nusizP0String()); + myNusizP0Text->setText(tia.nusizP0String()); break; case kNusizP1ID: tia.nusizP1(myNusizP1->getSelectedValue()); - myNusizP1Text->setEditString(tia.nusizP1String()); + myNusizP1Text->setText(tia.nusizP1String()); break; case kNusizM0ID: @@ -865,7 +865,7 @@ void TiaWidget::fillGrid() // NUSIZ0 (player portion) bool nusiz0changed = state.size[P0] != oldstate.size[P0]; myNusizP0->setList(0, state.size[P0], nusiz0changed); - myNusizP0Text->setEditString(tia.nusizP0String(), nusiz0changed); + myNusizP0Text->setText(tia.nusizP0String(), nusiz0changed); //////////////////////////// // P1 register info @@ -887,7 +887,7 @@ void TiaWidget::fillGrid() // NUSIZ1 (player portion) bool nusiz1changed = state.size[P1] != oldstate.size[P1]; myNusizP1->setList(0, state.size[P1], nusiz1changed); - myNusizP1Text->setEditString(tia.nusizP1String(), nusiz1changed); + myNusizP1Text->setText(tia.nusizP1String(), nusiz1changed); //////////////////////////// // M0 register info diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 551ee5aa1..aa9f579b5 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -516,8 +516,8 @@ class OSystem that usually isn't user-modifiable), we create a special method for it. */ - virtual string defaultSnapSaveDir() { return "~"; } - virtual string defaultSnapLoadDir() { return "~"; } + virtual string defaultSnapSaveDir() { return "~" BSPF_PATH_SEPARATOR; } + virtual string defaultSnapLoadDir() { return "~" BSPF_PATH_SEPARATOR; } /** Set the position of the application window, generally using diff --git a/src/gui/BrowserDialog.cxx b/src/gui/BrowserDialog.cxx index 38c696d79..66050c085 100644 --- a/src/gui/BrowserDialog.cxx +++ b/src/gui/BrowserDialog.cxx @@ -182,9 +182,9 @@ void BrowserDialog::updateUI() _okWidget->setEnabled(enable); if(!_fileList->selected().isDirectory()) - _selected->setEditString(_fileList->getSelectedString()); + _selected->setText(_fileList->getSelectedString()); else - _selected->setEditString(""); + _selected->setText(""); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/EditTextWidget.cxx b/src/gui/EditTextWidget.cxx index 6ebd6ca67..732055fb2 100644 --- a/src/gui/EditTextWidget.cxx +++ b/src/gui/EditTextWidget.cxx @@ -42,9 +42,9 @@ EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font, } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EditTextWidget::setEditString(const string& str, bool changed) +void EditTextWidget::setText(const string& str, bool changed) { - EditableWidget::setEditString(str, changed); + EditableWidget::setText(str, changed); _backupString = str; _changed = changed; } @@ -129,5 +129,5 @@ void EditTextWidget::endEditMode() void EditTextWidget::abortEditMode() { // Editing is always enabled - setEditString(_backupString); + setText(_backupString); } diff --git a/src/gui/EditTextWidget.hxx b/src/gui/EditTextWidget.hxx index 1eecd7f9a..74e184388 100644 --- a/src/gui/EditTextWidget.hxx +++ b/src/gui/EditTextWidget.hxx @@ -34,7 +34,7 @@ class EditTextWidget : public EditableWidget EditTextWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& text = ""); - void setEditString(const string& str, bool changed = false); + void setText(const string& str, bool changed = false); void handleMouseDown(int x, int y, int button, int clickCount); diff --git a/src/gui/EditableWidget.cxx b/src/gui/EditableWidget.cxx index 0e02b7e0c..2bf6a6acf 100644 --- a/src/gui/EditableWidget.cxx +++ b/src/gui/EditableWidget.cxx @@ -51,7 +51,7 @@ EditableWidget::~EditableWidget() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EditableWidget::setEditString(const string& str, bool) +void EditableWidget::setText(const string& str, bool) { // TODO: We probably should filter the input string here, // e.g. using tryInsertChar. diff --git a/src/gui/EditableWidget.hxx b/src/gui/EditableWidget.hxx index 74b19c034..27bb06001 100644 --- a/src/gui/EditableWidget.hxx +++ b/src/gui/EditableWidget.hxx @@ -44,7 +44,7 @@ class EditableWidget : public Widget, public CommandSender int x, int y, int w, int h, const string& str = ""); virtual ~EditableWidget(); - virtual void setEditString(const string& str, bool changed = false); + virtual void setText(const string& str, bool changed = false); virtual const string& getEditString() const { return _editString; } bool isEditable() const { return _editable; } diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index 96a6c421a..94b6f27b3 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -170,7 +170,7 @@ void EventMappingWidget::startRemapping() << instance().eventHandler().actionAtIndex(myActionSelected, myEventMode) << "' event"; myKeyMapping->setTextColor(kTextColorEm); - myKeyMapping->setEditString(buf.str()); + myKeyMapping->setText(buf.str()); // Make sure that this widget receives all raw data, before any // pre-processing occurs @@ -228,7 +228,7 @@ void EventMappingWidget::drawKeyMapping() if(myActionSelected >= 0) { myKeyMapping->setTextColor(kTextColor); - myKeyMapping->setEditString(instance().eventHandler().keyAtIndex(myActionSelected, myEventMode)); + myKeyMapping->setText(instance().eventHandler().keyAtIndex(myActionSelected, myEventMode)); } } diff --git a/src/gui/FileSnapDialog.cxx b/src/gui/FileSnapDialog.cxx index ec86578eb..43945a687 100644 --- a/src/gui/FileSnapDialog.cxx +++ b/src/gui/FileSnapDialog.cxx @@ -197,14 +197,14 @@ FileSnapDialog::~FileSnapDialog() void FileSnapDialog::loadConfig() { const Settings& settings = instance().settings(); - myRomPath->setEditString(settings.getString("romdir")); - mySnapSavePath->setEditString(settings.getString("snapsavedir")); - mySnapLoadPath->setEditString(settings.getString("snaploaddir")); - myCheatFile->setEditString(settings.getString("cheatfile")); - myPaletteFile->setEditString(settings.getString("palettefile")); - myPropsFile->setEditString(settings.getString("propsfile")); - myNVRamPath->setEditString(settings.getString("nvramdir")); - myStatePath->setEditString(settings.getString("statedir")); + myRomPath->setText(settings.getString("romdir")); + mySnapSavePath->setText(settings.getString("snapsavedir")); + mySnapLoadPath->setText(settings.getString("snaploaddir")); + myCheatFile->setText(settings.getString("cheatfile")); + myPaletteFile->setText(settings.getString("palettefile")); + myPropsFile->setText(settings.getString("propsfile")); + myNVRamPath->setText(settings.getString("nvramdir")); + myStatePath->setText(settings.getString("statedir")); mySnapSingle->setState(settings.getBool("sssingle")); mySnap1x->setState(settings.getBool("ss1x")); mySnapInterval->setSelected(instance().settings().getString("ssinterval"), "2"); @@ -238,30 +238,30 @@ void FileSnapDialog::setDefaults() const string& basedir = instance().baseDir(); node = FilesystemNode("~"); - myRomPath->setEditString(node.getShortPath()); + myRomPath->setText(node.getShortPath()); - mySnapSavePath->setEditString(instance().defaultSnapSaveDir()); - mySnapLoadPath->setEditString(instance().defaultSnapLoadDir()); + mySnapSavePath->setText(instance().defaultSnapSaveDir()); + mySnapLoadPath->setText(instance().defaultSnapLoadDir()); const string& cheatfile = basedir + "stella.cht"; node = FilesystemNode(cheatfile); - myCheatFile->setEditString(node.getShortPath()); + myCheatFile->setText(node.getShortPath()); const string& palettefile = basedir + "stella.pal"; node = FilesystemNode(palettefile); - myPaletteFile->setEditString(node.getShortPath()); + myPaletteFile->setText(node.getShortPath()); const string& propsfile = basedir + "stella.pro"; node = FilesystemNode(propsfile); - myPropsFile->setEditString(node.getShortPath()); + myPropsFile->setText(node.getShortPath()); const string& nvramdir = basedir + "nvram"; node = FilesystemNode(nvramdir); - myNVRamPath->setEditString(node.getShortPath()); + myNVRamPath->setText(node.getShortPath()); const string& statedir = basedir + "state"; node = FilesystemNode(statedir); - myStatePath->setEditString(node.getShortPath()); + myStatePath->setText(node.getShortPath()); mySnapSingle->setState(false); mySnap1x->setState(false); @@ -327,49 +327,49 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd, case kRomDirChosenCmd: { - myRomPath->setEditString(myBrowser->getResult().getShortPath()); + myRomPath->setText(myBrowser->getResult().getShortPath()); break; } case kSnapSaveDirChosenCmd: { - mySnapSavePath->setEditString(myBrowser->getResult().getShortPath()); + mySnapSavePath->setText(myBrowser->getResult().getShortPath()); break; } case kSnapLoadDirChosenCmd: { - mySnapLoadPath->setEditString(myBrowser->getResult().getShortPath()); + mySnapLoadPath->setText(myBrowser->getResult().getShortPath()); break; } case kCheatFileChosenCmd: { - myCheatFile->setEditString(myBrowser->getResult().getShortPath()); + myCheatFile->setText(myBrowser->getResult().getShortPath()); break; } case kPaletteFileChosenCmd: { - myPaletteFile->setEditString(myBrowser->getResult().getShortPath()); + myPaletteFile->setText(myBrowser->getResult().getShortPath()); break; } case kPropsFileChosenCmd: { - myPropsFile->setEditString(myBrowser->getResult().getShortPath()); + myPropsFile->setText(myBrowser->getResult().getShortPath()); break; } case kNVRamDirChosenCmd: { - myNVRamPath->setEditString(myBrowser->getResult().getShortPath()); + myNVRamPath->setText(myBrowser->getResult().getShortPath()); break; } case kStateDirChosenCmd: { - myStatePath->setEditString(myBrowser->getResult().getShortPath()); + myStatePath->setText(myBrowser->getResult().getShortPath()); break; } diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index edf582125..c1e577d56 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -447,12 +447,12 @@ void GameInfoDialog::loadView() return; // Cartridge properties - myName->setEditString(myGameProperties.get(Cartridge_Name)); + myName->setText(myGameProperties.get(Cartridge_Name)); myMD5->setLabel(myGameProperties.get(Cartridge_MD5)); - myManufacturer->setEditString(myGameProperties.get(Cartridge_Manufacturer)); - myModelNo->setEditString(myGameProperties.get(Cartridge_ModelNo)); - myRarity->setEditString(myGameProperties.get(Cartridge_Rarity)); - myNote->setEditString(myGameProperties.get(Cartridge_Note)); + myManufacturer->setText(myGameProperties.get(Cartridge_Manufacturer)); + myModelNo->setText(myGameProperties.get(Cartridge_ModelNo)); + myRarity->setText(myGameProperties.get(Cartridge_Rarity)); + myNote->setText(myGameProperties.get(Cartridge_Note)); mySound->setSelected(myGameProperties.get(Cartridge_Sound), "MONO"); myType->setSelected(myGameProperties.get(Cartridge_Type), "AUTO"); @@ -488,8 +488,8 @@ void GameInfoDialog::loadView() // Display properties myFormat->setSelected(myGameProperties.get(Display_Format), "AUTO"); - myYStart->setEditString(myGameProperties.get(Display_YStart)); - myHeight->setEditString(myGameProperties.get(Display_Height)); + myYStart->setText(myGameProperties.get(Display_YStart)); + myHeight->setText(myGameProperties.get(Display_Height)); const string& phos = myGameProperties.get(Display_Phosphor); myPhosphor->setSelected(phos, "NO"); diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 8b0e0f01c..d6ebc156e 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -219,7 +219,7 @@ void InputDialog::loadConfig() myMPaddleLabel->setLabel(instance().settings().getString("msense")); // AtariVox serial port - myAVoxPort->setEditString(instance().settings().getString("avoxport")); + myAVoxPort->setText(instance().settings().getString("avoxport")); // Allow all 4 joystick directions myAllowAll4->setState(instance().settings().getBool("joyallow4")); @@ -299,7 +299,7 @@ void InputDialog::setDefaults() myMPaddleLabel->setLabel("6"); // AtariVox serial port - myAVoxPort->setEditString(""); + myAVoxPort->setText(""); // Allow all 4 joystick directions myAllowAll4->setState(false); diff --git a/src/gui/InputTextDialog.cxx b/src/gui/InputTextDialog.cxx index cdd8e5d44..83d84c43d 100644 --- a/src/gui/InputTextDialog.cxx +++ b/src/gui/InputTextDialog.cxx @@ -153,10 +153,10 @@ const string& InputTextDialog::getResult(int idx) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void InputTextDialog::setEditString(const string& str, int idx) +void InputTextDialog::setText(const string& str, int idx) { if((unsigned int)idx < myInput.size()) - myInput[idx]->setEditString(str); + myInput[idx]->setText(str); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/InputTextDialog.hxx b/src/gui/InputTextDialog.hxx index 5a33df887..f12817ca2 100644 --- a/src/gui/InputTextDialog.hxx +++ b/src/gui/InputTextDialog.hxx @@ -45,7 +45,7 @@ class InputTextDialog : public Dialog, public CommandSender const string& getResult(int idx = 0); - void setEditString(const string& str, int idx = 0); + void setText(const string& str, int idx = 0); void setEmitSignal(int cmd) { myCmd = cmd; } void setTitle(const string& title); diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index 48fb34258..5857a2df9 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -461,7 +461,7 @@ void ListWidget::startEditMode() if (_editable && !_editMode && _selectedItem >= 0) { _editMode = true; - setEditString(_list[_selectedItem]); + setText(_list[_selectedItem]); // Widget gets raw data while editing EditableWidget::startEditMode(); diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index b2b4428ba..f29b8703a 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -113,7 +113,7 @@ void RomAuditDialog::loadConfig() const string& path = currentdir == "" ? instance().settings().getString("romdir") : currentdir; - myRomPath->setEditString(path); + myRomPath->setText(path); myResults1->setLabel(""); myResults2->setLabel(""); } @@ -210,7 +210,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd, case kAuditDirChosenCmd: { FilesystemNode dir(myBrowser->getResult()); - myRomPath->setEditString(dir.getShortPath()); + myRomPath->setText(dir.getShortPath()); myResults1->setLabel(""); myResults2->setLabel(""); break;