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
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.

View File

@ -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);

View File

@ -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)

View File

@ -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.

View File

@ -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;

View File

@ -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:

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -98,3 +98,13 @@ void CartridgeARWidget::handleCommand(CommandSender* sender,
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 handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private:
CartridgeAR& myCart;
PopUpWidget* myBank;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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;

View File

@ -94,3 +94,13 @@ void CartridgeX07Widget::handleCommand(CommandSender* sender,
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 handleCommand(CommandSender* sender, int cmd, int data, int id);
string bankState();
private:
CartridgeX07& myCart;
PopUpWidget* myBank;

View File

@ -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));
}

View File

@ -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
}
}

View File

@ -76,7 +76,7 @@ void DebuggerDialog::loadConfig()
myRam->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;
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);

View File

@ -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);
}
}

View File

@ -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:

View File

@ -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());
}

View File

@ -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

View File

@ -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));
}

View File

@ -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

View File

@ -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

View File

@ -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("");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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;
_changed = changed;
}
@ -129,5 +129,5 @@ void EditTextWidget::endEditMode()
void EditTextWidget::abortEditMode()
{
// 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,
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);

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,
// 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 = "");
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; }

View File

@ -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));
}
}

View File

@ -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;
}

View File

@ -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");

View File

@ -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);

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())
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);
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);

View File

@ -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();

View File

@ -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;