Fixed configure script wrt Thumb ARM support; the help message

never actually included info on how to enable/disable it.

StringParser is now width-sensitive, in that it can also split
on a maximum string length.  This is useful for making the various
UI items font-size independent, and to flow the text accordingly.

Increased minimum size of debugger window to 1080x720, which allows
things to be laid out a little nicer, and gives some much needed
extra room.  Sorry guys, the most common resolution now in use
is 1366x768, so it's time to move with the times.

Cleaned up some of the descriptions in the ROM debugger tab(s).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2694 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-04-17 15:00:32 +00:00
parent 0a8050faf4
commit 8487a60faa
11 changed files with 106 additions and 72 deletions

2
configure vendored
View File

@ -213,6 +213,8 @@ Optional Features:
--disable-joystick --disable-joystick
--enable-cheats enable/disable cheatcode support [enabled] --enable-cheats enable/disable cheatcode support [enabled]
--disable-cheats --disable-cheats
--enable-thumb enable/disable Thumb ARM support [enabled]
--disable-thumb
--enable-shared build shared binary [enabled] --enable-shared build shared binary [enabled]
--enable-static build static binary (if possible) [disabled] --enable-static build static binary (if possible) [disabled]
--disable-static --disable-static

View File

@ -33,20 +33,51 @@ class StringParser
{ {
public: public:
/** /**
Split the given string based on delimiter (by default, the newline Split the given string based on the newline character.
character, and by desired length (by default, not used).
@param str The string to split @param str The string to split
@param len The maximum length of string to generate (0 means unlimited)
@param delim The character indicating the end of a line (newline by default)
*/ */
StringParser(const string& str, uInt32 len = 0, char delim = '\n') StringParser(const string& str)
{ {
stringstream buf(str); stringstream buf(str);
string line; string line;
while(std::getline(buf, line, delim))
{ while(std::getline(buf, line, '\n'))
myStringList.push_back(line); myStringList.push_back(line);
}
/**
Split the given string based on the newline character, making sure that
no string is longer than maximum string length.
@param str The string to split
@param maxlen The maximum length of string to generate
*/
StringParser(const string& str, uInt16 maxlen)
{
stringstream buf(str);
string line;
while(std::getline(buf, line, '\n'))
{
size_t beg = 0, len = maxlen, size = line.size();
if(size <= len)
myStringList.push_back(line);
else
{
while((beg+maxlen) < size)
{
size_t spos = line.find_last_of(' ', beg+len);
if(spos > beg)
len = spos - beg;
myStringList.push_back(line.substr(beg, len));
beg += len + 1;
len = maxlen;
}
myStringList.push_back(line.substr(beg));
}
} }
} }

View File

@ -121,8 +121,8 @@ Debugger::Debugger(OSystem& osystem, Console& console)
myBreakPoints(NULL), myBreakPoints(NULL),
myReadTraps(NULL), myReadTraps(NULL),
myWriteTraps(NULL), myWriteTraps(NULL),
myWidth(1050), myWidth(1080),
myHeight(620), myHeight(720),
myRewindManager(NULL) myRewindManager(NULL)
{ {
// Init parser // Init parser
@ -169,8 +169,8 @@ void Debugger::initialize()
myOSystem->settings().getSize("debuggerres", w, h); myOSystem->settings().getSize("debuggerres", w, h);
myWidth = BSPF_max(w, 0); myWidth = BSPF_max(w, 0);
myHeight = BSPF_max(h, 0); myHeight = BSPF_max(h, 0);
myWidth = BSPF_max(myWidth, 1050u); myWidth = BSPF_max(myWidth, 1080u);
myHeight = BSPF_max(myHeight, 700u); myHeight = BSPF_max(myHeight, 720u);
myOSystem->settings().setSize("debuggerres", myWidth, myHeight); myOSystem->settings().setSize("debuggerres", myWidth, myHeight);
const GUI::Rect& r = getDialogBounds(); const GUI::Rect& r = getDialogBounds();

View File

@ -33,12 +33,12 @@ Cartridge3EWidget::Cartridge3EWidget(
uInt32 size = cart.mySize; uInt32 size = cart.mySize;
ostringstream info; ostringstream info;
info << "Tigervision 3E cartridge - (3E + RAM)\n" info << "3E cartridge - (3F + RAM)\n"
<< " 2-256 2K ROM (currently " << myNumRomBanks << "), 32 1K RAM\n" << " 2-256 2K ROM (currently " << myNumRomBanks << "), 32 1K RAM\n"
<< "(ROM) First 2K selected by writing to $3F\n" << "First 2K (ROM) selected by writing to $3F\n"
<< "(RAM) First 2K selected by writing to $3E\n" "First 2K (RAM) selected by writing to $3E\n"
<< " $F000 - $F3FF (R), $F400 - $F7FF (W)\n" " $F000 - $F3FF (R), $F400 - $F7FF (W)\n"
<< "Last 2K always points to last 2K of ROM\n"; "Last 2K always points to last 2K of ROM\n";
if(cart.myStartBank < myNumRomBanks) if(cart.myStartBank < myNumRomBanks)
info << "Startup bank = " << cart.myStartBank << " (ROM)\n"; info << "Startup bank = " << cart.myStartBank << " (ROM)\n";
else else

View File

@ -53,7 +53,7 @@ class CartDebugWidget : public Widget, public CommandSender
const string& desc) const string& desc)
{ {
const int lwidth = _font.getStringWidth("Manufacturer: "), const int lwidth = _font.getStringWidth("Manufacturer: "),
fwidth = _w - lwidth - 30; fwidth = _w - lwidth - 20;
EditTextWidget* w = 0; EditTextWidget* w = 0;
ostringstream buf; ostringstream buf;
@ -78,7 +78,7 @@ class CartDebugWidget : public Widget, public CommandSender
w->setEditable(false); w->setEditable(false);
y += myLineHeight + 4; y += myLineHeight + 4;
StringParser bs(desc); StringParser bs(desc, (fwidth - kScrollBarWidth) / myFontWidth);
const StringList& sl = bs.stringList(); const StringList& sl = bs.stringList();
uInt32 lines = sl.size(); uInt32 lines = sl.size();
if(lines < 3) lines = 3; if(lines < 3) lines = 3;
@ -110,6 +110,7 @@ class CartDebugWidget : public Widget, public CommandSender
// we may as well make them protected variables // we may as well make them protected variables
int myFontWidth, myFontHeight, myLineHeight; int myFontWidth, myFontHeight, myLineHeight;
private:
StringListWidget* myDesc; StringListWidget* myDesc;
}; };

View File

@ -30,17 +30,17 @@ CartridgeE0Widget::CartridgeE0Widget(
{ {
uInt32 size = 8 * 1024; uInt32 size = 8 * 1024;
ostringstream info; string info =
info << "Parker Bros E0 cartridge, 8 1K slices\n" "E0 cartridge, eight 1K slices\n"
<< "Segment 0 accessible @ $F000 - $F3FF\n" "Segment 0 accessible @ $F000 - $F3FF\n"
<< " Hotspots $FE0 to $FE7\n" " Hotspots $FE0 to $FE7\n"
<< "Segment 1 accessible @ $F400 - $F7FF\n" "Segment 1 accessible @ $F400 - $F7FF\n"
<< " Hotspots $FE8 to $FEF\n" " Hotspots $FE8 to $FEF\n"
<< "Segment 2 accessible @ $F800 - $FBFF\n" "Segment 2 accessible @ $F800 - $FBFF\n"
<< " Hotspots $FF0 to $FF7\n" " Hotspots $FF0 to $FF7\n"
<< "Segment 3 accessible @ $FC00 - $FFFF\n" "Segment 3 accessible @ $FC00 - $FFFF\n"
<< " Always points to last 1K of ROM\n" " Always points to last 1K of ROM\n"
<< "Startup slices = 0 / 1 / 2\n"; "Startup slices = 0 / 1 / 2\n";
#if 0 #if 0
// Eventually, we should query this from the debugger/disassembler // Eventually, we should query this from the debugger/disassembler
@ -49,7 +49,7 @@ CartridgeE0Widget::CartridgeE0Widget(
info << "Bank RORG" << " = $" << HEX4 << start << "\n"; info << "Bank RORG" << " = $" << HEX4 << start << "\n";
#endif #endif
int xpos = 10, int xpos = 10,
ypos = addBaseInformation(size, "Parker Brothers", info.str()) + myLineHeight; ypos = addBaseInformation(size, "Parker Brothers", info) + myLineHeight;
StringMap items0, items1, items2; StringMap items0, items1, items2;
items0.push_back("0 ($FE0)", "0"); items0.push_back("0 ($FE0)", "0");

View File

@ -49,22 +49,22 @@ CartridgeF0Widget::CartridgeF0Widget(
info.str()) + myLineHeight; info.str()) + myLineHeight;
StringMap items; StringMap items;
items.push_back(" 0", "0"); items.push_back(" 0", "0");
items.push_back(" 1", "1"); items.push_back(" 1", "1");
items.push_back(" 2", "2"); items.push_back(" 2", "2");
items.push_back(" 3", "3"); items.push_back(" 3", "3");
items.push_back(" 4", "4"); items.push_back(" 4", "4");
items.push_back(" 5", "5"); items.push_back(" 5", "5");
items.push_back(" 6", "6"); items.push_back(" 6", "6");
items.push_back(" 7", "7"); items.push_back(" 7", "7");
items.push_back(" 8", "8"); items.push_back(" 8", "8");
items.push_back(" 9", "9"); items.push_back(" 9", "9");
items.push_back("10", "10"); items.push_back(" 10", "10");
items.push_back("11", "11"); items.push_back(" 11", "11");
items.push_back("12", "12"); items.push_back(" 12", "12");
items.push_back("13", "13"); items.push_back(" 13", "13");
items.push_back("14", "14"); items.push_back(" 14", "14");
items.push_back("15", "15"); items.push_back(" 15", "15");
myBank = myBank =
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "), new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth(" 15 "),
myLineHeight, items, "Set bank: ", myLineHeight, items, "Set bank: ",

View File

@ -26,17 +26,15 @@ CartridgeFEWidget::CartridgeFEWidget(
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)
{ {
uInt16 size = 2 * 4096; string info =
"FE cartridge, two 4K banks\n"
"Doesn't support bankswitching with hotspots, "
"but instead watches A13 of called addresses:\n"
"Bank 0 @ $F000 - $FFFF (A13 = 1)\n"
"Bank 1 @ $D000 - $DFFF (A13 = 0)\n"
"\n"
"Changing banks is not supported, since it "
"would immediately switch on the next address\n";
ostringstream info; addBaseInformation(2 * 4096, "Activision", info);
info << "FE cartridge, two 4K banks\n"
<< "Doesn't support bankswitching with hotspots,\n"
<< "but instead watches A13 of called addresses:\n"
<< "Bank 0 @ $F000 - $FFFF (A13 = 1)\n"
<< "Bank 1 @ $D000 - $DFFF (A13 = 0)\n"
<< "\n"
<< "Changing banks is not supported, since it\n"
<< "would immediately switch on the next address\n";
addBaseInformation(size, "Activision", info.str());
} }

View File

@ -46,7 +46,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
const int fontWidth = font.getMaxCharWidth(), const int fontWidth = font.getMaxCharWidth(),
fontHeight = font.getFontHeight(), fontHeight = font.getFontHeight(),
lineHeight = font.getLineHeight(), lineHeight = font.getLineHeight(),
bwidth = 44,//font.getStringWidth("Undo "), bwidth = font.getStringWidth("Compare "),
bheight = lineHeight + 2; bheight = lineHeight + 2;
int xpos, ypos, lwidth; int xpos, ypos, lwidth;
@ -66,22 +66,22 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
ypos += bheight + 4; ypos += bheight + 4;
myRevertButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight, myRevertButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
"Rev", kRevertCmd); "Revert", kRevertCmd);
myRevertButton->setTarget(this); myRevertButton->setTarget(this);
ypos += 2 * bheight + 2; ypos += 2 * bheight + 2;
mySearchButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight, mySearchButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
"Srch", kSearchCmd); "Search", kSearchCmd);
mySearchButton->setTarget(this); mySearchButton->setTarget(this);
ypos += bheight + 4; ypos += bheight + 4;
myCompareButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight, myCompareButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
"Cmp", kCmpCmd); "Compare", kCmpCmd);
myCompareButton->setTarget(this); myCompareButton->setTarget(this);
ypos += bheight + 4; ypos += bheight + 4;
myRestartButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight, myRestartButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
"Rset", kRestartCmd); "Reset", kRestartCmd);
myRestartButton->setTarget(this); myRestartButton->setTarget(this);
// Labels for RAM grid // Labels for RAM grid

View File

@ -612,7 +612,9 @@ void OSystem::deleteConsole()
logMessage(buf.str(), 1); logMessage(buf.str(), 1);
delete myConsole; myConsole = NULL; delete myConsole; myConsole = NULL;
#ifdef DEBUGGER_SUPPORT
delete myDebugger; myDebugger = NULL; delete myDebugger; myDebugger = NULL;
#endif
} }
} }

View File

@ -169,7 +169,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth, myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
lineHeight, "Debugger Width: ", lineHeight, "Debugger Width: ",
lwidth, kDWidthChanged); lwidth, kDWidthChanged);
myDebuggerWidthSlider->setMinValue(1050); myDebuggerWidthSlider->setMinValue(1080);
myDebuggerWidthSlider->setMaxValue(1920); myDebuggerWidthSlider->setMaxValue(1920);
myDebuggerWidthSlider->setStepValue(10); myDebuggerWidthSlider->setStepValue(10);
wid.push_back(myDebuggerWidthSlider); wid.push_back(myDebuggerWidthSlider);
@ -183,7 +183,7 @@ UIDialog::UIDialog(OSystem* osystem, DialogContainer* parent,
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth, myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos, pwidth,
lineHeight, "Debugger Height: ", lineHeight, "Debugger Height: ",
lwidth, kDHeightChanged); lwidth, kDHeightChanged);
myDebuggerHeightSlider->setMinValue(700); myDebuggerHeightSlider->setMinValue(720);
myDebuggerHeightSlider->setMaxValue(1200); myDebuggerHeightSlider->setMaxValue(1200);
myDebuggerHeightSlider->setStepValue(10); myDebuggerHeightSlider->setStepValue(10);
wid.push_back(myDebuggerHeightSlider); wid.push_back(myDebuggerHeightSlider);
@ -314,8 +314,8 @@ void UIDialog::loadConfig()
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
// Debugger size // Debugger size
instance().settings().getSize("debuggerres", w, h); instance().settings().getSize("debuggerres", w, h);
w = BSPF_max(w, 1050); w = BSPF_max(w, 1080);
h = BSPF_max(h, 620); h = BSPF_max(h, 720);
w = BSPF_min(w, 1920); w = BSPF_min(w, 1920);
h = BSPF_min(h, 1200); h = BSPF_min(h, 1200);
@ -398,10 +398,10 @@ void UIDialog::setDefaults()
} }
case 1: // Debugger options case 1: // Debugger options
myDebuggerWidthSlider->setValue(1050); myDebuggerWidthSlider->setValue(1080);
myDebuggerWidthLabel->setValue(1050); myDebuggerWidthLabel->setValue(1080);
myDebuggerHeightSlider->setValue(700); myDebuggerHeightSlider->setValue(720);
myDebuggerHeightLabel->setValue(700); myDebuggerHeightLabel->setValue(720);
break; break;
case 2: // Misc. options case 2: // Misc. options