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
This commit is contained in:
stephena 2013-05-29 16:27:12 +00:00
parent e76066c051
commit 969d4b5fe2
85 changed files with 577 additions and 233 deletions

View File

@ -36,7 +36,7 @@
- ROMS less than 2K in size (so called 'Sub2K' ROMs) now show only - 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 the actual data in the binary. This means, for example, that a
256 byte ROM will show only 256 bytes in the disassembly, instead 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 - Fixed labelling in ROW directives; it wasn't accurately setting
a label in the case where it occurred in the middle of the data. 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 swapped by default, which allows one and two-player games to work
correctly. 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 * Changed colour of the 'current PC indicator' in the debugger to
match the one used for line selection. This makes it easier to match the one used for line selection. This makes it easier to
see for those with problems seeing lighter colours. see for those with problems seeing lighter colours.

View File

@ -149,8 +149,8 @@ void CheatCodeDialog::saveConfig()
void CheatCodeDialog::addCheat() void CheatCodeDialog::addCheat()
{ {
myCheatInput->show(); // Center input dialog over entire screen myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setEditString("", 0); myCheatInput->setText("", 0);
myCheatInput->setEditString("", 1); myCheatInput->setText("", 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(0); myCheatInput->setFocus(0);
myCheatInput->setEmitSignal(kCheatAdded); myCheatInput->setEmitSignal(kCheatAdded);
@ -168,8 +168,8 @@ void CheatCodeDialog::editCheat()
const string& code = list[idx]->code(); const string& code = list[idx]->code();
myCheatInput->show(); // Center input dialog over entire screen myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setEditString(name, 0); myCheatInput->setText(name, 0);
myCheatInput->setEditString(code, 1); myCheatInput->setText(code, 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(1); myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kCheatEdited); myCheatInput->setEmitSignal(kCheatEdited);
@ -186,8 +186,8 @@ void CheatCodeDialog::removeCheat()
void CheatCodeDialog::addOneShotCheat() void CheatCodeDialog::addOneShotCheat()
{ {
myCheatInput->show(); // Center input dialog over entire screen myCheatInput->show(); // Center input dialog over entire screen
myCheatInput->setEditString("One-shot cheat", 0); myCheatInput->setText("One-shot cheat", 0);
myCheatInput->setEditString("", 1); myCheatInput->setText("", 1);
myCheatInput->setTitle(""); myCheatInput->setTitle("");
myCheatInput->setFocus(1); myCheatInput->setFocus(1);
myCheatInput->setEmitSignal(kOneShotCheatAdded); myCheatInput->setEmitSignal(kOneShotCheatAdded);

View File

@ -149,6 +149,9 @@ const DebuggerState& CartDebug::getState()
for(uInt32 i = 0; i < myState.rport.size(); ++i) for(uInt32 i = 0; i < myState.rport.size(); ++i)
myState.ram.push_back(peek(myState.rport[i])); myState.ram.push_back(peek(myState.rport[i]));
if(myDebugWidget)
myState.bank = myDebugWidget->bankState();
return myState; return myState;
} }
@ -160,7 +163,10 @@ void CartDebug::saveOldState()
myOldState.ram.push_back(peek(myOldState.rport[i])); myOldState.ram.push_back(peek(myOldState.rport[i]));
if(myDebugWidget) if(myDebugWidget)
{
myOldState.bank = myDebugWidget->bankState();
myDebugWidget->saveOldState(); myDebugWidget->saveOldState();
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -533,13 +539,13 @@ int CartDebug::getBank()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int CartDebug::bankCount() int CartDebug::bankCount() const
{ {
return myConsole.cartridge().bankCount(); return myConsole.cartridge().bankCount();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartDebug::getCartType() string CartDebug::getCartType() const
{ {
return myConsole.cartridge().name(); return myConsole.cartridge().name();
} }
@ -996,7 +1002,8 @@ string CartDebug::saveDisassembly()
} }
case CartDebug::GFX: 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) for(int i = 12; i < 20; ++i)
buf << ((tag.disasm[i] == '\x1e') ? "#" : " "); buf << ((tag.disasm[i] == '\x1e') ? "#" : " ");
buf << "| $" << HEX4 << tag.address << " (G)\n"; buf << "| $" << HEX4 << tag.address << " (G)\n";
@ -1004,7 +1011,8 @@ string CartDebug::saveDisassembly()
} }
case CartDebug::PGFX: 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) for(int i = 12; i < 20; ++i)
buf << ((tag.disasm[i] == '\x1f') ? "*" : " "); buf << ((tag.disasm[i] == '\x1f') ? "*" : " ");
buf << "| $" << HEX4 << tag.address << " (P)\n"; buf << "| $" << HEX4 << tag.address << " (P)\n";
@ -1033,7 +1041,7 @@ string CartDebug::saveDisassembly()
<< "; ROM properties name : " << myConsole.properties().get(Cartridge_Name) << "\n" << "; ROM properties name : " << myConsole.properties().get(Cartridge_Name) << "\n"
<< "; ROM properties MD5 : " << myConsole.properties().get(Cartridge_MD5) << "\n" << "; ROM properties MD5 : " << myConsole.properties().get(Cartridge_MD5) << "\n"
<< "; Bankswitch type : " << myConsole.cartridge().about() << "\n;\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" << "; D = DATA directive (referenced in some way)\n"
<< "; G = GFX directive, shown as '#' (stored in player, missile, ball)\n" << "; G = GFX directive, shown as '#' (stored in player, missile, ball)\n"
<< "; P = PGFX directive, shown as '*' (stored in playfield)\n\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) if(flags & CartDebug::CODE)
return CartDebug::CODE; return CartDebug::CODE;
else if(flags & CartDebug::PCODE) else if(flags & CartDebug::TCODE)
return CartDebug::CODE; // TODO - should this be separate?? return CartDebug::CODE; // TODO - should this be separate??
else if(flags & CartDebug::GFX) else if(flags & CartDebug::GFX)
return CartDebug::GFX; return CartDebug::GFX;
@ -1321,7 +1329,7 @@ void CartDebug::disasmTypeAsString(ostream& buf, DisasmType type) const
switch(type) switch(type)
{ {
case CartDebug::CODE: buf << "CODE"; break; 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::GFX: buf << "GFX"; break;
case CartDebug::PGFX: buf << "PGFX"; break; case CartDebug::PGFX: buf << "PGFX"; break;
case CartDebug::DATA: buf << "DATA"; break; case CartDebug::DATA: buf << "DATA"; break;
@ -1339,8 +1347,8 @@ void CartDebug::disasmTypeAsString(ostream& buf, uInt8 flags) const
{ {
if(flags & CartDebug::CODE) if(flags & CartDebug::CODE)
buf << "CODE "; buf << "CODE ";
if(flags & CartDebug::PCODE) if(flags & CartDebug::TCODE)
buf << "PCODE "; buf << "TCODE ";
if(flags & CartDebug::GFX) if(flags & CartDebug::GFX)
buf << "GFX "; buf << "GFX ";
if(flags & CartDebug::PGFX) if(flags & CartDebug::PGFX)

View File

@ -46,6 +46,7 @@ class CartState : public DebuggerState
IntArray ram; // The actual data values IntArray ram; // The actual data values
IntArray rport; // Address for reading from RAM IntArray rport; // Address for reading from RAM
IntArray wport; // Address for writing to RAM IntArray wport; // Address for writing to RAM
string bank; // Current banking layout
}; };
class CartDebug : public DebuggerSystem class CartDebug : public DebuggerSystem
@ -68,7 +69,7 @@ class CartDebug : public DebuggerSystem
// of decreasing hierarchy // of decreasing hierarchy
// //
CODE = 1 << 7, // disassemble-able code segments 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 GFX = 1 << 5, // addresses loaded into GRPx registers
PGFX = 1 << 4, // addresses loaded into PFx registers PGFX = 1 << 4, // addresses loaded into PFx registers
DATA = 1 << 3, // addresses loaded into registers other than GRPx / PFx 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. 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. Get the total number of banks supported by the cartridge.
*/ */
int bankCount(); int bankCount() const;
/** /**
Get the name/type of the cartridge. Get the name/type of the cartridge.
*/ */
string getCartType(); string getCartType() const;
/** /**
Add a label and associated address. Add a label and associated address.

View File

@ -205,7 +205,7 @@ bool Debugger::start(const string& message, int address)
if(address > -1) if(address > -1)
buf << valueToString(address); buf << valueToString(address);
myDialog->message().setEditString(buf.str()); myDialog->message().setText(buf.str());
return true; return true;
} }
return false; return false;

View File

@ -175,12 +175,12 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
} }
for (int k = 0; k <= myAppData.end; k++) 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) && if(check_bit(k, CartDebug::CODE) &&
!(Debugger::debugger().getAccessFlags(k+myOffset) & CartDebug::CODE) !(Debugger::debugger().getAccessFlags(k+myOffset) & CartDebug::CODE)
&& myOffset != 0) && myOffset != 0)
{ {
Debugger::debugger().setAccessFlags(k+myOffset, CartDebug::PCODE); Debugger::debugger().setAccessFlags(k+myOffset, CartDebug::TCODE);
} }
// Must be ROW / unused bytes // Must be ROW / unused bytes
@ -1023,7 +1023,7 @@ void DiStella::addEntry(CartDebug::DisasmType type)
&& myOffset != 0) && myOffset != 0)
{ {
tag.ccount += " *"; tag.ccount += " *";
Debugger::debugger().setAccessFlags(tag.address, CartDebug::PCODE); Debugger::debugger().setAccessFlags(tag.address, CartDebug::TCODE);
} }
break; break;
case CartDebug::GFX: case CartDebug::GFX:

View File

@ -78,3 +78,15 @@ void Cartridge0840Widget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge0840Widget::bankState()
{
ostringstream& buf = buffer();
static const char* spot[] = { "$800", "$840" };
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class Cartridge0840Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
Cartridge0840& myCart; Cartridge0840& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -141,3 +141,18 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender,
myCart.lockBank(); myCart.lockBank();
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class Cartridge3EWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
Cartridge3E& myCart; Cartridge3E& myCart;
const uInt32 myNumRomBanks; const uInt32 myNumRomBanks;

View File

@ -80,3 +80,13 @@ void Cartridge3FWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Cartridge3FWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $3F";
return buf.str();
}

View File

@ -36,6 +36,8 @@ class Cartridge3FWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
Cartridge3F& myCart; Cartridge3F& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -263,3 +263,25 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
myCart.lockBank(); myCart.lockBank();
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class Cartridge4A50Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
Cartridge4A50& myCart; Cartridge4A50& myCart;
PopUpWidget *myROMLower, *myRAMLower; PopUpWidget *myROMLower, *myRAMLower;

View File

@ -98,3 +98,13 @@ void CartridgeARWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeARWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank;
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeARWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeAR& myCart; CartridgeAR& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -192,7 +192,7 @@ void CartridgeCMWidget::loadConfig()
// RAM state (several bits from SWCHA) // RAM state (several bits from SWCHA)
const string& ram = swcha & 0x10 ? " Inactive" : const string& ram = swcha & 0x10 ? " Inactive" :
swcha & 0x20 ? " Read-only" : " Write-only"; swcha & 0x20 ? " Read-only" : " Write-only";
myRAM->setEditString(ram, (swcha & 0x30) != (myOldState.swcha & 0x30)); myRAM->setText(ram, (swcha & 0x30) != (myOldState.swcha & 0x30));
CartDebugWidget::loadConfig(); CartDebugWidget::loadConfig();
} }
@ -211,3 +211,15 @@ void CartridgeCMWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -42,6 +42,8 @@ class CartridgeCMWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
struct CartState { struct CartState {
uInt8 swcha; uInt8 swcha;

View File

@ -75,3 +75,17 @@ void CartridgeCTYWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeCTYWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeCTY& myCart; CartridgeCTY& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -316,3 +316,17 @@ void CartridgeDPCPlusWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -17,8 +17,8 @@
// $Id$ // $Id$
//============================================================================ //============================================================================
#ifndef CARTRIDGEDPCPlus_WIDGET_HXX #ifndef CARTRIDGEDPCPLUS_WIDGET_HXX
#define CARTRIDGEDPCPlus_WIDGET_HXX #define CARTRIDGEDPCPLUS_WIDGET_HXX
class CartridgeDPCPlus; class CartridgeDPCPlus;
class PopUpWidget; class PopUpWidget;
@ -40,6 +40,8 @@ class CartridgeDPCPlusWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
struct CartState { struct CartState {
ByteArray tops; ByteArray tops;

View File

@ -222,3 +222,15 @@ void CartridgeDPCWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeDPCWidget::bankState()
{
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
}

View File

@ -39,6 +39,8 @@ class CartridgeDPCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
struct CartState { struct CartState {
ByteArray tops; ByteArray tops;

View File

@ -110,13 +110,19 @@ class CartDebugWidget : public Widget, public CommandSender
virtual void loadConfig() { myDesc->setSelected(0); } virtual void loadConfig() { myDesc->setSelected(0); }
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) { }; 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: protected:
// These will be needed by most of the child classes; // These will be needed by most of the child classes;
// we may as well make them protected variables // we may as well make them protected variables
int myFontWidth, myFontHeight, myLineHeight, myButtonHeight; int myFontWidth, myFontHeight, myLineHeight, myButtonHeight;
ostringstream& buffer() { myBuffer.str(""); return myBuffer; }
private: private:
StringListWidget* myDesc; StringListWidget* myDesc;
ostringstream myBuffer;
}; };
#endif #endif

View File

@ -21,6 +21,19 @@
#include "PopUpWidget.hxx" #include "PopUpWidget.hxx"
#include "CartE0Widget.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( CartridgeE0Widget::CartridgeE0Widget(
GuiObject* boss, const GUI::Font& font, GuiObject* boss, const GUI::Font& font,
@ -52,32 +65,12 @@ CartridgeE0Widget::CartridgeE0Widget(
ypos = addBaseInformation(size, "Parker Brothers", info) + myLineHeight; ypos = addBaseInformation(size, "Parker Brothers", info) + myLineHeight;
VariantList items0, items1, items2; VariantList items0, items1, items2;
items0.push_back("0 ($FE0)"); for(int i = 0; i < 8; ++i)
items0.push_back("1 ($FE1)"); {
items0.push_back("2 ($FE2)"); items0.push_back(seg0[i]);
items0.push_back("3 ($FE3)"); items1.push_back(seg1[i]);
items0.push_back("4 ($FE4)"); items2.push_back(seg2[i]);
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)");
const int lwidth = font.getStringWidth("Set slice for segment X: "); const int lwidth = font.getStringWidth("Set slice for segment X: ");
mySlice0 = mySlice0 =
@ -136,3 +129,16 @@ void CartridgeE0Widget::handleCommand(CommandSender* sender,
myCart.lockBank(); myCart.lockBank();
invalidate(); invalidate();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeE0Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
<< seg0[myCart.myCurrentSlice[0]] << " / "
<< seg1[myCart.myCurrentSlice[1]] << " / "
<< seg2[myCart.myCurrentSlice[2]];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeE0Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeE0& myCart; CartridgeE0& myCart;
PopUpWidget *mySlice0, *mySlice1, *mySlice2; PopUpWidget *mySlice0, *mySlice1, *mySlice2;

View File

@ -21,6 +21,14 @@
#include "PopUpWidget.hxx" #include "PopUpWidget.hxx"
#include "CartE7Widget.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( CartridgeE7Widget::CartridgeE7Widget(
GuiObject* boss, const GUI::Font& font, GuiObject* boss, const GUI::Font& font,
@ -54,19 +62,10 @@ CartridgeE7Widget::CartridgeE7Widget(
myLineHeight; myLineHeight;
VariantList items0, items1; VariantList items0, items1;
items0.push_back("0 - ROM ($FE0)"); for(int i = 0; i < 8; ++i)
items0.push_back("1 - ROM ($FE1)"); items0.push_back(spot_lower[i]);
items0.push_back("2 - ROM ($FE2)"); for(int i = 0; i < 4; ++i)
items0.push_back("3 - ROM ($FE3)"); items1.push_back(spot_upper[i]);
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)");
const int lwidth = font.getStringWidth("Set slice for upper 256B: "), const int lwidth = font.getStringWidth("Set slice for upper 256B: "),
fwidth = font.getStringWidth("3 - RAM ($FEB)"); fwidth = font.getStringWidth("3 - RAM ($FEB)");
@ -112,3 +111,15 @@ void CartridgeE7Widget::handleCommand(CommandSender* sender,
myCart.lockBank(); myCart.lockBank();
invalidate(); invalidate();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeE7Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
<< spot_lower[myCart.myCurrentSlice[0]] << " / "
<< spot_upper[myCart.myCurrentRAM];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeE7Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeE7& myCart; CartridgeE7& myCart;
PopUpWidget *myLower2K, *myUpper256B; PopUpWidget *myLower2K, *myUpper256B;

View File

@ -94,3 +94,18 @@ void CartridgeEFSCWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeEFSCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeEFSC& myCart; CartridgeEFSC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -92,3 +92,18 @@ void CartridgeEFWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeEFWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeEF& myCart; CartridgeEF& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -93,3 +93,13 @@ void CartridgeF0Widget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF0Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $FF0";
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeF0Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF0& myCart; CartridgeF0& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -85,3 +85,17 @@ void CartridgeF4SCWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeF4SCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF4SC& myCart; CartridgeF4SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -83,3 +83,17 @@ void CartridgeF4Widget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeF4Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF4& myCart; CartridgeF4& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -81,3 +81,15 @@ void CartridgeF6SCWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeF6SCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF6SC& myCart; CartridgeF6SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -79,3 +79,15 @@ void CartridgeF6Widget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeF6Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF6& myCart; CartridgeF6& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -79,3 +79,15 @@ void CartridgeF8SCWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF8SCWidget::bankState()
{
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeF8SCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF8SC& myCart; CartridgeF8SC& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -77,3 +77,15 @@ void CartridgeF8Widget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeF8Widget::bankState()
{
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeF8Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeF8& myCart; CartridgeF8& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -131,3 +131,17 @@ void CartridgeFA2Widget::handleCommand(CommandSender* sender,
break; 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();
}

View File

@ -37,6 +37,8 @@ class CartridgeFA2Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeFA2& myCart; CartridgeFA2& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -80,3 +80,15 @@ void CartridgeFAWidget::handleCommand(CommandSender* sender,
invalidate(); 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();
}

View File

@ -36,6 +36,8 @@ class CartridgeFAWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeFA& myCart; CartridgeFA& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -24,7 +24,8 @@
CartridgeFEWidget::CartridgeFEWidget( CartridgeFEWidget::CartridgeFEWidget(
GuiObject* boss, const GUI::Font& font, GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, CartridgeFE& cart) 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 = string info =
"FE cartridge, two 4K banks\n" "FE cartridge, two 4K banks\n"
@ -38,3 +39,14 @@ CartridgeFEWidget::CartridgeFEWidget(
addBaseInformation(2 * 4096, "Activision", info); 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();
}

View File

@ -34,6 +34,11 @@ class CartridgeFEWidget : public CartDebugWidget
// No implementation for non-bankswitched ROMs // No implementation for non-bankswitched ROMs
void loadConfig() { } void loadConfig() { }
void handleCommand(CommandSender* sender, int cmd, int data, int id) { } void handleCommand(CommandSender* sender, int cmd, int data, int id) { }
string bankState();
private:
CartridgeFE& myCart;
}; };
#endif #endif

View File

@ -131,3 +131,17 @@ void CartridgeMCWidget::handleCommand(CommandSender* sender,
myCart.lockBank(); myCart.lockBank();
invalidate(); invalidate();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeMCWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
<< myCart.myCurrentBlock[0] << " / "
<< myCart.myCurrentBlock[1] << " / "
<< myCart.myCurrentBlock[2] << " / "
<< myCart.myCurrentBlock[3];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeMCWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeMC& myCart; CartridgeMC& myCart;
PopUpWidget *mySlice0, *mySlice1, *mySlice2, *mySlice3; PopUpWidget *mySlice0, *mySlice1, *mySlice2, *mySlice3;

View File

@ -83,3 +83,14 @@ void CartridgeSBWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeSBWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = $" << HEX2 << (myCart.myCurrentBank + 0x800);
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeSBWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeSB& myCart; CartridgeSB& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -78,3 +78,15 @@ void CartridgeUAWidget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeUAWidget::bankState()
{
ostringstream& buf = buffer();
static const char* spot[] = { "$200", "$240" };
buf << "Bank = " << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeUAWidget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeUA& myCart; CartridgeUA& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -94,3 +94,13 @@ void CartridgeX07Widget::handleCommand(CommandSender* sender,
invalidate(); invalidate();
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string CartridgeX07Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank;
return buf.str();
}

View File

@ -36,6 +36,8 @@ class CartridgeX07Widget : public CartDebugWidget
void loadConfig(); void loadConfig();
void handleCommand(CommandSender* sender, int cmd, int data, int id); void handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private: private:
CartridgeX07& myCart; CartridgeX07& myCart;
PopUpWidget* myBank; PopUpWidget* myBank;

View File

@ -309,5 +309,5 @@ void CpuWidget::fillGrid()
changed.push_back(state.PSbits[i] != oldstate.PSbits[i]); changed.push_back(state.PSbits[i] != oldstate.PSbits[i]);
myPSRegister->setState(state.PSbits, changed); myPSRegister->setState(state.PSbits, changed);
myPCLabel->setEditString(dbg.cartDebug().getLabel(state.PC, true)); myPCLabel->setText(dbg.cartDebug().getLabel(state.PC, true));
} }

View File

@ -642,7 +642,7 @@ void DataGridWidget::startEditMode()
if (_editable && !_editMode && _selectedItem >= 0) if (_editable && !_editMode && _selectedItem >= 0)
{ {
_editMode = true; _editMode = true;
setEditString("", true ); // Erase current entry when starting editing setText("", true ); // Erase current entry when starting editing
} }
} }

View File

@ -76,7 +76,7 @@ void DebuggerDialog::loadConfig()
myRam->loadConfig(); myRam->loadConfig();
myRomTab->loadConfig(); myRomTab->loadConfig();
myMessageBox->setEditString(""); myMessageBox->setText("");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -182,8 +182,8 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
myUndoAddress = addr; myUndoAddress = addr;
myUndoValue = oldval; myUndoValue = oldval;
myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10)); myDecValue->setText(instance().debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2)); myBinValue->setText(instance().debugger().valueToString(value, kBASE_2));
myRevertButton->setEnabled(true); myRevertButton->setEnabled(true);
myUndoButton->setEnabled(true); myUndoButton->setEnabled(true);
break; break;
@ -194,9 +194,9 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
addr = myRamGrid->getSelectedAddr(); addr = myRamGrid->getSelectedAddr();
value = myRamGrid->getSelectedValue(); value = myRamGrid->getSelectedValue();
myLabel->setEditString(dbg.getLabel(state.rport[addr], true)); myLabel->setText(dbg.getLabel(state.rport[addr], true));
myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10)); myDecValue->setText(instance().debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2)); myBinValue->setText(instance().debugger().valueToString(value, kBASE_2));
break; break;
} }
@ -320,7 +320,7 @@ void RamWidget::showInputBox(int cmd)
uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1); uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1);
uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1); uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1);
myInputBox->show(x, y); myInputBox->show(x, y);
myInputBox->setEditString(""); myInputBox->setText("");
myInputBox->setTitle(""); myInputBox->setTitle("");
myInputBox->setFocus(0); myInputBox->setFocus(0);
myInputBox->setEmitSignal(cmd); myInputBox->setEmitSignal(cmd);

View File

@ -62,14 +62,14 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& font,
// Add context menu // Add context menu
VariantList l; VariantList l;
// l.push_back("Add bookmark"); // l.push_back("Add bookmark");
l.push_back("Save ROM", "saverom");
l.push_back("Set PC", "setpc"); l.push_back("Set PC", "setpc");
l.push_back("RunTo PC", "runtopc"); 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("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); myMenu = new ContextMenu(this, font, l);
// Take advantage of a wide debugger window when possible // Take advantage of a wide debugger window when possible
@ -585,7 +585,7 @@ void RomListWidget::startEditMode()
// Widget gets raw data while editing // Widget gets raw data while editing
EditableWidget::startEditMode(); EditableWidget::startEditMode();
setEditString(myDisasm->list[_selectedItem].bytes); setText(myDisasm->list[_selectedItem].bytes);
} }
} }

View File

@ -35,13 +35,12 @@ class CheckListWidget;
/** RomListWidget */ /** RomListWidget */
class RomListWidget : public EditableWidget class RomListWidget : public EditableWidget
{ {
friend class RomWidget; // friend class RomWidget;
public: public:
enum { enum {
kBreakpointChangedCmd = 'RLbp', // click on the checkbox for a breakpoint kBreakpointChangedCmd = 'RLbp', // click on the checkbox for a breakpoint
kRomChangedCmd = 'RLpr' // ROM item data changed - 'data' will be kRomChangedCmd = 'RLpr' // ROM item data changed - 'data' will be item index
// item index
}; };
public: public:

View File

@ -28,7 +28,6 @@
#include "DiStella.hxx" #include "DiStella.hxx"
#include "CpuDebug.hxx" #include "CpuDebug.hxx"
#include "GuiObject.hxx" #include "GuiObject.hxx"
#include "InputTextDialog.hxx"
#include "DataGridWidget.hxx" #include "DataGridWidget.hxx"
#include "EditTextWidget.hxx" #include "EditTextWidget.hxx"
#include "PopUpWidget.hxx" #include "PopUpWidget.hxx"
@ -42,8 +41,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h) int x, int y, int w, int h)
: Widget(boss, font, x, y, w, h), : Widget(boss, font, x, y, w, h),
CommandSender(boss), CommandSender(boss),
myListIsDirty(true), myListIsDirty(true)
myCurrentBank(-1)
{ {
_type = kRomWidget; _type = kRomWidget;
@ -51,62 +49,27 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font,
StaticTextWidget* t; StaticTextWidget* t;
WidgetArray wid; WidgetArray wid;
// Show current bank // Show current bank state
xpos = x; ypos = y + 7; xpos = x; ypos = y + 7;
ostringstream buf;
buf << "Current bank (" << dec
<< instance().debugger().cartDebug().bankCount() << " total):";
t = new StaticTextWidget(boss, font, xpos, ypos, t = new StaticTextWidget(boss, font, xpos, ypos,
font.getStringWidth(buf.str()), font.getStringWidth("Bank state: "),
font.getFontHeight(), font.getFontHeight(),
buf.str(), kTextAlignLeft); "Bank state: ", kTextAlignLeft);
xpos += t->getWidth() + 5; xpos += t->getWidth() + 5;
myBank = new DataGridWidget(boss, font, xpos, ypos-2, myBank = new EditTextWidget(boss, font, xpos, ypos,
1, 1, 4, 8, kBASE_10); _w - 2 - xpos, font.getFontHeight());
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);
// Create rom listing // Create rom listing
xpos = x; ypos += myBank->getHeight() + 4; xpos = x; ypos += myBank->getHeight() + 4;
myRomList = new RomListWidget(boss, font, xpos, ypos, _w - 4, _h - ypos - 2); myRomList = new RomListWidget(boss, font, xpos, ypos, _w - 4, _h - ypos - 2);
myRomList->setTarget(this);
myRomList->myMenu->setTarget(this);
addFocusWidget(myRomList); 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() RomWidget::~RomWidget()
{ {
delete mySaveRom;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -114,11 +77,11 @@ void RomWidget::loadConfig()
{ {
Debugger& dbg = instance().debugger(); Debugger& dbg = instance().debugger();
CartDebug& cart = dbg.cartDebug(); CartDebug& cart = dbg.cartDebug();
bool bankChanged = myCurrentBank != cart.getBank(); const CartState& state = (CartState&) cart.getState();
myCurrentBank = cart.getBank(); const CartState& oldstate = (CartState&) cart.getOldState();
// Fill romlist the current bank of source or disassembly // Fill romlist the current bank of source or disassembly
myListIsDirty |= cart.disassemble(myResolveData->getSelectedTag().toString(), myListIsDirty |= cart.disassemble("always", /*FIXME myResolveData->getSelectedTag().toString(),*/
myListIsDirty); myListIsDirty);
if(myListIsDirty) if(myListIsDirty)
{ {
@ -131,13 +94,14 @@ void RomWidget::loadConfig()
if(pcline >= 0 && pcline != myRomList->getHighlighted()) if(pcline >= 0 && pcline != myRomList->getHighlighted())
myRomList->setHighlighted(pcline); myRomList->setHighlighted(pcline);
// Set current bank and number of banks // Set current bank state
myBank->setList(-1, myCurrentBank, bankChanged); myBank->setText(state.bank, state.bank != oldstate.bank);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
{ {
cerr << cmd << " " << data << " " << id << endl;
switch(cmd) switch(cmd)
{ {
case RomListWidget::kBreakpointChangedCmd: case RomListWidget::kBreakpointChangedCmd:
@ -155,18 +119,12 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
patchROM(data, myRomList->getEditString()); patchROM(data, myRomList->getEditString());
break; break;
#if 0
case ContextMenu::kItemSelectedCmd: case ContextMenu::kItemSelectedCmd:
{ {
const string& rmb = myRomList->myMenu->getSelectedTag().toString(); const string& rmb = myRomList->myMenu->getSelectedTag().toString();
if(rmb == "saverom") if(rmb == "setpc")
{
mySaveRom->show(_x + 50, _y + 80);
mySaveRom->setEditString("");
mySaveRom->setTitle("");
mySaveRom->setEmitSignal(kRomNameEntered);
}
else if(rmb == "setpc")
setPC(myRomList->getSelected()); setPC(myRomList->getSelected());
else if(rmb == "runtopc") else if(rmb == "runtopc")
runtoPC(myRomList->getSelected()); runtoPC(myRomList->getSelected());
@ -203,10 +161,6 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break; // kCMenuItemSelectedCmd break; // kCMenuItemSelectedCmd
} }
case DataGridWidget::kItemDataChangedCmd:
setBank(myBank->getSelectedValue());
break;
case kResolveDataChanged: case kResolveDataChanged:
instance().settings().setValue("dis.resolvedata", myResolveData->getSelectedTag()); instance().settings().setValue("dis.resolvedata", myResolveData->getSelectedTag());
invalidate(); invalidate();
@ -225,17 +179,10 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
} }
break; 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) 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); instance().debugger().parser().setBase(oldbase);
} }
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void RomWidget::saveROM(const string& rom)
{
ostringstream command;
command << "saverom " << rom;
instance().debugger().run(command.str());
}

View File

@ -24,11 +24,7 @@
#define ROM_WIDGET_HXX #define ROM_WIDGET_HXX
class GuiObject; class GuiObject;
class DataGridWidget;
class EditTextWidget; class EditTextWidget;
class InputTextDialog;
class PopUpWidget;
class StringList;
#include "Array.hxx" #include "Array.hxx"
#include "Widget.hxx" #include "Widget.hxx"
@ -61,21 +57,16 @@ class RomWidget : public Widget, public CommandSender
kRomNameEntered = 'RWrn' kRomNameEntered = 'RWrn'
}; };
void setBank(uInt16 bank);
void setBreak(int disasm_line, bool state); void setBreak(int disasm_line, bool state);
void setPC(int disasm_line); void setPC(int disasm_line);
void runtoPC(int disasm_line); void runtoPC(int disasm_line);
void patchROM(int disasm_line, const string& bytes); void patchROM(int disasm_line, const string& bytes);
void saveROM(const string& rom);
private: private:
RomListWidget* myRomList; RomListWidget* myRomList;
DataGridWidget* myBank; EditTextWidget* myBank;
PopUpWidget* myResolveData;
InputTextDialog* mySaveRom;
bool myListIsDirty; bool myListIsDirty;
int myCurrentBank;
}; };
#endif #endif

View File

@ -125,15 +125,15 @@ void TiaInfoWidget::loadConfig()
Debugger& dbg = instance().debugger(); Debugger& dbg = instance().debugger();
TIADebug& tia = dbg.tiaDebug(); TIADebug& tia = dbg.tiaDebug();
myFrameCount->setEditString(dbg.valueToString(tia.frameCount(), kBASE_10)); myFrameCount->setText(dbg.valueToString(tia.frameCount(), kBASE_10));
myFrameCycles->setEditString(dbg.valueToString(dbg.cycles(), kBASE_10)); myFrameCycles->setText(dbg.valueToString(dbg.cycles(), kBASE_10));
myVSync->setState(tia.vsync()); myVSync->setState(tia.vsync());
myVBlank->setState(tia.vblank()); myVBlank->setState(tia.vblank());
int clk = tia.clocksThisLine(); int clk = tia.clocksThisLine();
myScanlineCount->setEditString(dbg.valueToString(tia.scanlines(), kBASE_10)); myScanlineCount->setText(dbg.valueToString(tia.scanlines(), kBASE_10));
myScanlineCycles->setEditString(dbg.valueToString(clk/3, kBASE_10)); myScanlineCycles->setText(dbg.valueToString(clk/3, kBASE_10));
myPixelPosition->setEditString(dbg.valueToString(clk-68, kBASE_10)); myPixelPosition->setText(dbg.valueToString(clk-68, kBASE_10));
myColorClocks->setEditString(dbg.valueToString(clk, kBASE_10)); myColorClocks->setText(dbg.valueToString(clk, kBASE_10));
} }

View File

@ -634,12 +634,12 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
case kNusizP0ID: case kNusizP0ID:
tia.nusizP0(myNusizP0->getSelectedValue()); tia.nusizP0(myNusizP0->getSelectedValue());
myNusizP0Text->setEditString(tia.nusizP0String()); myNusizP0Text->setText(tia.nusizP0String());
break; break;
case kNusizP1ID: case kNusizP1ID:
tia.nusizP1(myNusizP1->getSelectedValue()); tia.nusizP1(myNusizP1->getSelectedValue());
myNusizP1Text->setEditString(tia.nusizP1String()); myNusizP1Text->setText(tia.nusizP1String());
break; break;
case kNusizM0ID: case kNusizM0ID:
@ -865,7 +865,7 @@ void TiaWidget::fillGrid()
// NUSIZ0 (player portion) // NUSIZ0 (player portion)
bool nusiz0changed = state.size[P0] != oldstate.size[P0]; bool nusiz0changed = state.size[P0] != oldstate.size[P0];
myNusizP0->setList(0, state.size[P0], nusiz0changed); myNusizP0->setList(0, state.size[P0], nusiz0changed);
myNusizP0Text->setEditString(tia.nusizP0String(), nusiz0changed); myNusizP0Text->setText(tia.nusizP0String(), nusiz0changed);
//////////////////////////// ////////////////////////////
// P1 register info // P1 register info
@ -887,7 +887,7 @@ void TiaWidget::fillGrid()
// NUSIZ1 (player portion) // NUSIZ1 (player portion)
bool nusiz1changed = state.size[P1] != oldstate.size[P1]; bool nusiz1changed = state.size[P1] != oldstate.size[P1];
myNusizP1->setList(0, state.size[P1], nusiz1changed); myNusizP1->setList(0, state.size[P1], nusiz1changed);
myNusizP1Text->setEditString(tia.nusizP1String(), nusiz1changed); myNusizP1Text->setText(tia.nusizP1String(), nusiz1changed);
//////////////////////////// ////////////////////////////
// M0 register info // M0 register info

View File

@ -516,8 +516,8 @@ class OSystem
that usually isn't user-modifiable), we create a special method that usually isn't user-modifiable), we create a special method
for it. for it.
*/ */
virtual string defaultSnapSaveDir() { return "~"; } virtual string defaultSnapSaveDir() { return "~" BSPF_PATH_SEPARATOR; }
virtual string defaultSnapLoadDir() { return "~"; } virtual string defaultSnapLoadDir() { return "~" BSPF_PATH_SEPARATOR; }
/** /**
Set the position of the application window, generally using Set the position of the application window, generally using

View File

@ -182,9 +182,9 @@ void BrowserDialog::updateUI()
_okWidget->setEnabled(enable); _okWidget->setEnabled(enable);
if(!_fileList->selected().isDirectory()) if(!_fileList->selected().isDirectory())
_selected->setEditString(_fileList->getSelectedString()); _selected->setText(_fileList->getSelectedString());
else else
_selected->setEditString(""); _selected->setText("");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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; _backupString = str;
_changed = changed; _changed = changed;
} }
@ -129,5 +129,5 @@ void EditTextWidget::endEditMode()
void EditTextWidget::abortEditMode() void EditTextWidget::abortEditMode()
{ {
// Editing is always enabled // Editing is always enabled
setEditString(_backupString); setText(_backupString);
} }

View File

@ -34,7 +34,7 @@ class EditTextWidget : public EditableWidget
EditTextWidget(GuiObject* boss, const GUI::Font& font, EditTextWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h, const string& text = ""); 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); void handleMouseDown(int x, int y, int button, int clickCount);

View File

@ -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, // TODO: We probably should filter the input string here,
// e.g. using tryInsertChar. // e.g. using tryInsertChar.

View File

@ -44,7 +44,7 @@ class EditableWidget : public Widget, public CommandSender
int x, int y, int w, int h, const string& str = ""); int x, int y, int w, int h, const string& str = "");
virtual ~EditableWidget(); 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; } virtual const string& getEditString() const { return _editString; }
bool isEditable() const { return _editable; } bool isEditable() const { return _editable; }

View File

@ -170,7 +170,7 @@ void EventMappingWidget::startRemapping()
<< instance().eventHandler().actionAtIndex(myActionSelected, myEventMode) << instance().eventHandler().actionAtIndex(myActionSelected, myEventMode)
<< "' event"; << "' event";
myKeyMapping->setTextColor(kTextColorEm); myKeyMapping->setTextColor(kTextColorEm);
myKeyMapping->setEditString(buf.str()); myKeyMapping->setText(buf.str());
// Make sure that this widget receives all raw data, before any // Make sure that this widget receives all raw data, before any
// pre-processing occurs // pre-processing occurs
@ -228,7 +228,7 @@ void EventMappingWidget::drawKeyMapping()
if(myActionSelected >= 0) if(myActionSelected >= 0)
{ {
myKeyMapping->setTextColor(kTextColor); myKeyMapping->setTextColor(kTextColor);
myKeyMapping->setEditString(instance().eventHandler().keyAtIndex(myActionSelected, myEventMode)); myKeyMapping->setText(instance().eventHandler().keyAtIndex(myActionSelected, myEventMode));
} }
} }

View File

@ -197,14 +197,14 @@ FileSnapDialog::~FileSnapDialog()
void FileSnapDialog::loadConfig() void FileSnapDialog::loadConfig()
{ {
const Settings& settings = instance().settings(); const Settings& settings = instance().settings();
myRomPath->setEditString(settings.getString("romdir")); myRomPath->setText(settings.getString("romdir"));
mySnapSavePath->setEditString(settings.getString("snapsavedir")); mySnapSavePath->setText(settings.getString("snapsavedir"));
mySnapLoadPath->setEditString(settings.getString("snaploaddir")); mySnapLoadPath->setText(settings.getString("snaploaddir"));
myCheatFile->setEditString(settings.getString("cheatfile")); myCheatFile->setText(settings.getString("cheatfile"));
myPaletteFile->setEditString(settings.getString("palettefile")); myPaletteFile->setText(settings.getString("palettefile"));
myPropsFile->setEditString(settings.getString("propsfile")); myPropsFile->setText(settings.getString("propsfile"));
myNVRamPath->setEditString(settings.getString("nvramdir")); myNVRamPath->setText(settings.getString("nvramdir"));
myStatePath->setEditString(settings.getString("statedir")); myStatePath->setText(settings.getString("statedir"));
mySnapSingle->setState(settings.getBool("sssingle")); mySnapSingle->setState(settings.getBool("sssingle"));
mySnap1x->setState(settings.getBool("ss1x")); mySnap1x->setState(settings.getBool("ss1x"));
mySnapInterval->setSelected(instance().settings().getString("ssinterval"), "2"); mySnapInterval->setSelected(instance().settings().getString("ssinterval"), "2");
@ -238,30 +238,30 @@ void FileSnapDialog::setDefaults()
const string& basedir = instance().baseDir(); const string& basedir = instance().baseDir();
node = FilesystemNode("~"); node = FilesystemNode("~");
myRomPath->setEditString(node.getShortPath()); myRomPath->setText(node.getShortPath());
mySnapSavePath->setEditString(instance().defaultSnapSaveDir()); mySnapSavePath->setText(instance().defaultSnapSaveDir());
mySnapLoadPath->setEditString(instance().defaultSnapLoadDir()); mySnapLoadPath->setText(instance().defaultSnapLoadDir());
const string& cheatfile = basedir + "stella.cht"; const string& cheatfile = basedir + "stella.cht";
node = FilesystemNode(cheatfile); node = FilesystemNode(cheatfile);
myCheatFile->setEditString(node.getShortPath()); myCheatFile->setText(node.getShortPath());
const string& palettefile = basedir + "stella.pal"; const string& palettefile = basedir + "stella.pal";
node = FilesystemNode(palettefile); node = FilesystemNode(palettefile);
myPaletteFile->setEditString(node.getShortPath()); myPaletteFile->setText(node.getShortPath());
const string& propsfile = basedir + "stella.pro"; const string& propsfile = basedir + "stella.pro";
node = FilesystemNode(propsfile); node = FilesystemNode(propsfile);
myPropsFile->setEditString(node.getShortPath()); myPropsFile->setText(node.getShortPath());
const string& nvramdir = basedir + "nvram"; const string& nvramdir = basedir + "nvram";
node = FilesystemNode(nvramdir); node = FilesystemNode(nvramdir);
myNVRamPath->setEditString(node.getShortPath()); myNVRamPath->setText(node.getShortPath());
const string& statedir = basedir + "state"; const string& statedir = basedir + "state";
node = FilesystemNode(statedir); node = FilesystemNode(statedir);
myStatePath->setEditString(node.getShortPath()); myStatePath->setText(node.getShortPath());
mySnapSingle->setState(false); mySnapSingle->setState(false);
mySnap1x->setState(false); mySnap1x->setState(false);
@ -327,49 +327,49 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
case kRomDirChosenCmd: case kRomDirChosenCmd:
{ {
myRomPath->setEditString(myBrowser->getResult().getShortPath()); myRomPath->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kSnapSaveDirChosenCmd: case kSnapSaveDirChosenCmd:
{ {
mySnapSavePath->setEditString(myBrowser->getResult().getShortPath()); mySnapSavePath->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kSnapLoadDirChosenCmd: case kSnapLoadDirChosenCmd:
{ {
mySnapLoadPath->setEditString(myBrowser->getResult().getShortPath()); mySnapLoadPath->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kCheatFileChosenCmd: case kCheatFileChosenCmd:
{ {
myCheatFile->setEditString(myBrowser->getResult().getShortPath()); myCheatFile->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kPaletteFileChosenCmd: case kPaletteFileChosenCmd:
{ {
myPaletteFile->setEditString(myBrowser->getResult().getShortPath()); myPaletteFile->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kPropsFileChosenCmd: case kPropsFileChosenCmd:
{ {
myPropsFile->setEditString(myBrowser->getResult().getShortPath()); myPropsFile->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kNVRamDirChosenCmd: case kNVRamDirChosenCmd:
{ {
myNVRamPath->setEditString(myBrowser->getResult().getShortPath()); myNVRamPath->setText(myBrowser->getResult().getShortPath());
break; break;
} }
case kStateDirChosenCmd: case kStateDirChosenCmd:
{ {
myStatePath->setEditString(myBrowser->getResult().getShortPath()); myStatePath->setText(myBrowser->getResult().getShortPath());
break; break;
} }

View File

@ -447,12 +447,12 @@ void GameInfoDialog::loadView()
return; return;
// Cartridge properties // Cartridge properties
myName->setEditString(myGameProperties.get(Cartridge_Name)); myName->setText(myGameProperties.get(Cartridge_Name));
myMD5->setLabel(myGameProperties.get(Cartridge_MD5)); myMD5->setLabel(myGameProperties.get(Cartridge_MD5));
myManufacturer->setEditString(myGameProperties.get(Cartridge_Manufacturer)); myManufacturer->setText(myGameProperties.get(Cartridge_Manufacturer));
myModelNo->setEditString(myGameProperties.get(Cartridge_ModelNo)); myModelNo->setText(myGameProperties.get(Cartridge_ModelNo));
myRarity->setEditString(myGameProperties.get(Cartridge_Rarity)); myRarity->setText(myGameProperties.get(Cartridge_Rarity));
myNote->setEditString(myGameProperties.get(Cartridge_Note)); myNote->setText(myGameProperties.get(Cartridge_Note));
mySound->setSelected(myGameProperties.get(Cartridge_Sound), "MONO"); mySound->setSelected(myGameProperties.get(Cartridge_Sound), "MONO");
myType->setSelected(myGameProperties.get(Cartridge_Type), "AUTO"); myType->setSelected(myGameProperties.get(Cartridge_Type), "AUTO");
@ -488,8 +488,8 @@ void GameInfoDialog::loadView()
// Display properties // Display properties
myFormat->setSelected(myGameProperties.get(Display_Format), "AUTO"); myFormat->setSelected(myGameProperties.get(Display_Format), "AUTO");
myYStart->setEditString(myGameProperties.get(Display_YStart)); myYStart->setText(myGameProperties.get(Display_YStart));
myHeight->setEditString(myGameProperties.get(Display_Height)); myHeight->setText(myGameProperties.get(Display_Height));
const string& phos = myGameProperties.get(Display_Phosphor); const string& phos = myGameProperties.get(Display_Phosphor);
myPhosphor->setSelected(phos, "NO"); myPhosphor->setSelected(phos, "NO");

View File

@ -219,7 +219,7 @@ void InputDialog::loadConfig()
myMPaddleLabel->setLabel(instance().settings().getString("msense")); myMPaddleLabel->setLabel(instance().settings().getString("msense"));
// AtariVox serial port // AtariVox serial port
myAVoxPort->setEditString(instance().settings().getString("avoxport")); myAVoxPort->setText(instance().settings().getString("avoxport"));
// Allow all 4 joystick directions // Allow all 4 joystick directions
myAllowAll4->setState(instance().settings().getBool("joyallow4")); myAllowAll4->setState(instance().settings().getBool("joyallow4"));
@ -299,7 +299,7 @@ void InputDialog::setDefaults()
myMPaddleLabel->setLabel("6"); myMPaddleLabel->setLabel("6");
// AtariVox serial port // AtariVox serial port
myAVoxPort->setEditString(""); myAVoxPort->setText("");
// Allow all 4 joystick directions // Allow all 4 joystick directions
myAllowAll4->setState(false); myAllowAll4->setState(false);

View File

@ -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()) if((unsigned int)idx < myInput.size())
myInput[idx]->setEditString(str); myInput[idx]->setText(str);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -45,7 +45,7 @@ class InputTextDialog : public Dialog, public CommandSender
const string& getResult(int idx = 0); 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 setEmitSignal(int cmd) { myCmd = cmd; }
void setTitle(const string& title); void setTitle(const string& title);

View File

@ -461,7 +461,7 @@ void ListWidget::startEditMode()
if (_editable && !_editMode && _selectedItem >= 0) if (_editable && !_editMode && _selectedItem >= 0)
{ {
_editMode = true; _editMode = true;
setEditString(_list[_selectedItem]); setText(_list[_selectedItem]);
// Widget gets raw data while editing // Widget gets raw data while editing
EditableWidget::startEditMode(); EditableWidget::startEditMode();

View File

@ -113,7 +113,7 @@ void RomAuditDialog::loadConfig()
const string& path = currentdir == "" ? const string& path = currentdir == "" ?
instance().settings().getString("romdir") : currentdir; instance().settings().getString("romdir") : currentdir;
myRomPath->setEditString(path); myRomPath->setText(path);
myResults1->setLabel(""); myResults1->setLabel("");
myResults2->setLabel(""); myResults2->setLabel("");
} }
@ -210,7 +210,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
case kAuditDirChosenCmd: case kAuditDirChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myRomPath->setEditString(dir.getShortPath()); myRomPath->setText(dir.getShortPath());
myResults1->setLabel(""); myResults1->setLabel("");
myResults2->setLabel(""); myResults2->setLabel("");
break; break;