Fixed some dead code warnings generated by llvm scan-build.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2992 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-09-06 00:33:17 +00:00
parent 2cb4d31c5b
commit 56d84a3c04
12 changed files with 56 additions and 83 deletions

View File

@ -111,8 +111,7 @@ uInt32 ZipHandler::decompress(uInt8*& image)
return length; return length;
else else
{ {
delete[] image; image = 0; delete[] image; image = NULL;
length = 0;
throw zip_error_s[err]; throw zip_error_s[err];
} }

View File

@ -263,7 +263,7 @@ static void init( init_t* impl, atari_ntsc_setup_t const* setup )
float* out = impl->to_rgb; float* out = impl->to_rgb;
int n; int n;
n = burst_count; //n = burst_count; FIXME: dead code detected by llvm scan-build
do do
{ {
float const* in = decoder; float const* in = decoder;

View File

@ -307,10 +307,8 @@ void DiStella::disasm(uInt32 distart, int pass)
if(referenced) // start a new line with a label if(referenced) // start a new line with a label
{ {
if(!line_empty) if(!line_empty)
{
addEntry(CartDebug::ROW); addEntry(CartDebug::ROW);
line_empty = true;
}
myDisasmBuf << Base::HEX4 << myPC+myOffset << "'L" << Base::HEX4 myDisasmBuf << Base::HEX4 << myPC+myOffset << "'L" << Base::HEX4
<< myPC+myOffset << "'.byte " << "$" << Base::HEX2 << myPC+myOffset << "'.byte " << "$" << Base::HEX2
<< (int)Debugger::debugger().peek(myPC+myOffset); << (int)Debugger::debugger().peek(myPC+myOffset);

View File

@ -58,13 +58,11 @@ CartridgeDASHWidget::CartridgeDASHWidget(
for(uInt32 i = 0; i < 4; ++i) for(uInt32 i = 0; i < 4; ++i)
{ {
int xpos_s = xpos, ypos_s = ypos; int xpos_s, ypos_s = ypos;
ostringstream label; ostringstream label;
label << "Set segment " << i << " as: "; label << "Set segment " << i << " as: ";
ypos_s = ypos;
new StaticTextWidget(boss, _font, xpos, ypos, _font.getStringWidth(label.str()), new StaticTextWidget(boss, _font, xpos, ypos, _font.getStringWidth(label.str()),
myFontHeight, label.str(), kTextAlignLeft); myFontHeight, label.str(), kTextAlignLeft);
ypos += myLineHeight + 8; ypos += myLineHeight + 8;
@ -108,8 +106,8 @@ CartridgeDASHWidget::CartridgeDASHWidget(
label.str(""); label.str("");
label << Common::Base::HEX4 << (addr2 + 1) << "-" << Common::Base::HEX4 << (addr2 + 1 + 0x1FF); label << Common::Base::HEX4 << (addr2 + 1) << "-" << Common::Base::HEX4 << (addr2 + 1 + 0x1FF);
t = new StaticTextWidget(boss, _font, xpos_s, ypos_s+2, new StaticTextWidget(boss, _font, xpos_s, ypos_s+2,
_font.getStringWidth(label.str()), myFontHeight, label.str(), kTextAlignLeft); _font.getStringWidth(label.str()), myFontHeight, label.str(), kTextAlignLeft);
myBankState[2*i+1] = new EditTextWidget(boss, _font, xoffset, ypos_s, myBankState[2*i+1] = new EditTextWidget(boss, _font, xoffset, ypos_s,
w - xoffset - 10, myLineHeight, ""); w - xoffset - 10, myLineHeight, "");

View File

@ -542,7 +542,7 @@ void DataGridWidget::drawWidget(bool hilite)
{ {
//cerr << "DataGridWidget::drawWidget\n"; //cerr << "DataGridWidget::drawWidget\n";
FBSurface& s = _boss->dialog().surface(); FBSurface& s = _boss->dialog().surface();
int row, col, deltax; int row, col;
// Draw the internal grid and labels // Draw the internal grid and labels
int linewidth = _cols * _colWidth; int linewidth = _cols * _colWidth;
@ -569,15 +569,12 @@ void DataGridWidget::drawWidget(bool hilite)
if (_selectedItem == pos && _editMode) if (_selectedItem == pos && _editMode)
{ {
adjustOffset(); adjustOffset();
deltax = -_editScrollOffset;
s.drawString(_font, _editString, x, y, _colWidth, kTextColor, s.drawString(_font, _editString, x, y, _colWidth, kTextColor,
kTextAlignLeft, deltax, false); kTextAlignLeft, -_editScrollOffset, false);
} }
else else
{ {
deltax = 0;
uInt32 color = kTextColor; uInt32 color = kTextColor;
if(_changedList[pos]) if(_changedList[pos])
{ {

View File

@ -437,7 +437,6 @@ void RomListWidget::drawWidget(bool hilite)
FBSurface& s = _boss->dialog().surface(); FBSurface& s = _boss->dialog().surface();
const CartDebug::DisassemblyList& dlist = myDisasm->list; const CartDebug::DisassemblyList& dlist = myDisasm->list;
int i, pos, xpos, ypos, len = dlist.size(); int i, pos, xpos, ypos, len = dlist.size();
int deltax;
const GUI::Rect& r = getEditRect(); const GUI::Rect& r = getEditRect();
const GUI::Rect& l = getLineRect(); const GUI::Rect& l = getLineRect();
@ -509,16 +508,13 @@ void RomListWidget::drawWidget(bool hilite)
if (_selectedItem == pos && _editMode) if (_selectedItem == pos && _editMode)
{ {
adjustOffset(); adjustOffset();
deltax = -_editScrollOffset;
s.drawString(_font, _editString, _x + r.x(), ypos, r.width(), kTextColor, s.drawString(_font, _editString, _x + r.x(), ypos, r.width(), kTextColor,
kTextAlignLeft, deltax, false); kTextAlignLeft, -_editScrollOffset, false);
drawCaret(); drawCaret();
} }
else else
{ {
deltax = 0;
s.drawString(_font, dlist[pos].bytes, _x + r.x(), ypos, r.width(), kTextColor); s.drawString(_font, dlist[pos].bytes, _x + r.x(), ypos, r.width(), kTextColor);
} }
} }

View File

@ -49,10 +49,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
const char* regNames[] = { "COLUP0:", "COLUP1:", "COLUPF:", "COLUBK:" }; const char* regNames[] = { "COLUP0:", "COLUP1:", "COLUPF:", "COLUBK:" };
for(int row = 0; row < 4; ++row) for(int row = 0; row < 4; ++row)
{ {
t = new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2, new StaticTextWidget(boss, lfont, xpos, ypos + row*lineHeight + 2,
7*fontWidth, fontHeight, 7*fontWidth, fontHeight, regNames[row], kTextAlignLeft);
regNames[row],
kTextAlignLeft);
} }
xpos += 7*fontWidth + 5; xpos += 7*fontWidth + 5;
myColorRegs = new DataGridWidget(boss, nfont, xpos, ypos, myColorRegs = new DataGridWidget(boss, nfont, xpos, ypos,
@ -86,18 +84,17 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
"PF BL M1 M0 P1", kTextAlignLeft); "PF BL M1 M0 P1", kTextAlignLeft);
// Add label for Strobes; buttons will be added later // Add label for Strobes; buttons will be added later
t = new StaticTextWidget(boss, lfont, xpos + t->getWidth() + 9*fontWidth, ypos, new StaticTextWidget(boss, lfont, xpos + t->getWidth() + 9*fontWidth, ypos,
8*fontWidth, fontHeight, 8*fontWidth, fontHeight, "Strobes:", kTextAlignLeft);
"Strobes:", kTextAlignLeft);
// Add vertical labels // Add vertical labels
xpos -= 2*fontWidth + 5; ypos += lineHeight; xpos -= 2*fontWidth + 5; ypos += lineHeight;
const char* collLabel[] = { "P0", "P1", "M0", "M1", "BL" }; const char* collLabel[] = { "P0", "P1", "M0", "M1", "BL" };
for(int row = 0; row < 5; ++row) for(int row = 0; row < 5; ++row)
{ {
t = new StaticTextWidget(boss, lfont, xpos, ypos + row*(lineHeight+3), new StaticTextWidget(boss, lfont, xpos, ypos + row*(lineHeight+3),
2*fontWidth, fontHeight, 2*fontWidth, fontHeight,
collLabel[row], kTextAlignLeft); collLabel[row], kTextAlignLeft);
} }
// Finally, add all 15 collision bits // Finally, add all 15 collision bits
@ -184,9 +181,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// grP0 // grP0
xpos = 10; ypos = buttonY + 2*lineHeight; xpos = 10; ypos = buttonY + 2*lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight,
7*fontWidth, fontHeight, "P0: GR:", kTextAlignLeft);
"P0: GR:", kTextAlignLeft);
xpos += 7*fontWidth + 5; xpos += 7*fontWidth + 5;
myGRP0 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); myGRP0 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1);
myGRP0->setTarget(this); myGRP0->setTarget(this);
@ -208,9 +204,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// hmP0 // hmP0
xpos += myPosP0->getWidth() + 8; xpos += myPosP0->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
3*fontWidth, fontHeight, "HM:", kTextAlignLeft);
"HM:", kTextAlignLeft);
xpos += 3*fontWidth + 5; xpos += 3*fontWidth + 5;
myHMP0 = new DataGridWidget(boss, nfont, xpos, ypos, myHMP0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 4, Common::Base::F_16_1); 1, 1, 1, 4, Common::Base::F_16_1);
@ -235,9 +230,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// NUSIZ0 (player portion) // NUSIZ0 (player portion)
xpos = 10 + lwidth; ypos += myGRP0->getHeight() + 5; xpos = 10 + lwidth; ypos += myGRP0->getHeight() + 5;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight,
8*fontWidth, fontHeight, "NusizP0:", kTextAlignLeft);
"NusizP0:", kTextAlignLeft);
xpos += 8*fontWidth + 5; xpos += 8*fontWidth + 5;
myNusizP0 = new DataGridWidget(boss, nfont, xpos, ypos, myNusizP0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 3, Common::Base::F_16_1); 1, 1, 1, 3, Common::Base::F_16_1);
@ -255,8 +249,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// grP1 // grP1
xpos = 10; ypos += 2*lineHeight; xpos = 10; ypos += 2*lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 7*fontWidth, fontHeight,
"P1: GR:", kTextAlignLeft); "P1: GR:", kTextAlignLeft);
xpos += 7*fontWidth + 5; xpos += 7*fontWidth + 5;
myGRP1 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1); myGRP1 = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 8, 1);
myGRP1->setTarget(this); myGRP1->setTarget(this);
@ -277,8 +271,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// hmP1 // hmP1
xpos += myPosP1->getWidth() + 8; xpos += myPosP1->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"HM:", kTextAlignLeft); "HM:", kTextAlignLeft);
xpos += 3*fontWidth + 5; xpos += 3*fontWidth + 5;
myHMP1 = new DataGridWidget(boss, nfont, xpos, ypos, myHMP1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 4, Common::Base::F_16_1); 1, 1, 1, 4, Common::Base::F_16_1);
@ -303,8 +297,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// NUSIZ1 (player portion) // NUSIZ1 (player portion)
xpos = 10 + lwidth; ypos += myGRP1->getHeight() + 5; xpos = 10 + lwidth; ypos += myGRP1->getHeight() + 5;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 8*fontWidth, fontHeight,
"NusizP1:", kTextAlignLeft); "NusizP1:", kTextAlignLeft);
xpos += 8*fontWidth + 5; xpos += 8*fontWidth + 5;
myNusizP1 = new DataGridWidget(boss, nfont, xpos, ypos, myNusizP1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 3, Common::Base::F_16_1); 1, 1, 1, 3, Common::Base::F_16_1);
@ -322,8 +316,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// enaM0 // enaM0
xpos = 10; ypos += 2*lineHeight; xpos = 10; ypos += 2*lineHeight;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"M0:", kTextAlignLeft); "M0:", kTextAlignLeft);
xpos += 3*fontWidth + 8; xpos += 3*fontWidth + 8;
myEnaM0 = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaM0 = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd); "Enable", kCheckActionCmd);
@ -345,8 +339,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// hmM0 // hmM0
xpos += myPosM0->getWidth() + 8; xpos += myPosM0->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"HM:", kTextAlignLeft); "HM:", kTextAlignLeft);
xpos += 3*fontWidth + 5; xpos += 3*fontWidth + 5;
myHMM0 = new DataGridWidget(boss, nfont, xpos, ypos, myHMM0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 4, Common::Base::F_16_1); 1, 1, 1, 4, Common::Base::F_16_1);
@ -356,8 +350,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// NUSIZ0 (missile portion) // NUSIZ0 (missile portion)
xpos += myHMM0->getWidth() + 8; xpos += myHMM0->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight,
"Size:", kTextAlignLeft); "Size:", kTextAlignLeft);
xpos += 5*fontWidth + 5; xpos += 5*fontWidth + 5;
myNusizM0 = new DataGridWidget(boss, nfont, xpos, ypos, myNusizM0 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 2, Common::Base::F_16_1); 1, 1, 1, 2, Common::Base::F_16_1);
@ -378,8 +372,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// enaM1 // enaM1
xpos = 10; ypos += lineHeight + 6; xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"M1:", kTextAlignLeft); "M1:", kTextAlignLeft);
xpos += 3*fontWidth + 8; xpos += 3*fontWidth + 8;
myEnaM1 = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaM1 = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd); "Enable", kCheckActionCmd);
@ -401,8 +395,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// hmM0 // hmM0
xpos += myPosM1->getWidth() + 8; xpos += myPosM1->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"HM:", kTextAlignLeft); "HM:", kTextAlignLeft);
xpos += 3*fontWidth + 5; xpos += 3*fontWidth + 5;
myHMM1 = new DataGridWidget(boss, nfont, xpos, ypos, myHMM1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 4, Common::Base::F_16_1); 1, 1, 1, 4, Common::Base::F_16_1);
@ -412,8 +406,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// NUSIZ1 (missile portion) // NUSIZ1 (missile portion)
xpos += myHMM1->getWidth() + 8; xpos += myHMM1->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight,
"Size:", kTextAlignLeft); "Size:", kTextAlignLeft);
xpos += 5*fontWidth + 5; xpos += 5*fontWidth + 5;
myNusizM1 = new DataGridWidget(boss, nfont, xpos, ypos, myNusizM1 = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 2, Common::Base::F_16_1); 1, 1, 1, 2, Common::Base::F_16_1);
@ -434,8 +428,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// enaBL // enaBL
xpos = 10; ypos += lineHeight + 6; xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"BL:", kTextAlignLeft); "BL:", kTextAlignLeft);
xpos += 3*fontWidth + 8; xpos += 3*fontWidth + 8;
myEnaBL = new CheckboxWidget(boss, lfont, xpos, ypos+2, myEnaBL = new CheckboxWidget(boss, lfont, xpos, ypos+2,
"Enable", kCheckActionCmd); "Enable", kCheckActionCmd);
@ -457,8 +451,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// hmBL // hmBL
xpos += myPosBL->getWidth() + 8; xpos += myPosBL->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 3*fontWidth, fontHeight,
"HM:", kTextAlignLeft); "HM:", kTextAlignLeft);
xpos += 3*fontWidth + 5; xpos += 3*fontWidth + 5;
myHMBL = new DataGridWidget(boss, nfont, xpos, ypos, myHMBL = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 4, Common::Base::F_16_1); 1, 1, 1, 4, Common::Base::F_16_1);
@ -468,8 +462,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
// CTRLPF (size portion) // CTRLPF (size portion)
xpos += myHMBL->getWidth() + 8; xpos += myHMBL->getWidth() + 8;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 5*fontWidth, fontHeight,
"Size:", kTextAlignLeft); "Size:", kTextAlignLeft);
xpos += 5*fontWidth + 5; xpos += 5*fontWidth + 5;
mySizeBL = new DataGridWidget(boss, nfont, xpos, ypos, mySizeBL = new DataGridWidget(boss, nfont, xpos, ypos,
1, 1, 1, 2, Common::Base::F_16_1); 1, 1, 1, 2, Common::Base::F_16_1);
@ -490,8 +484,8 @@ TiaWidget::TiaWidget(GuiObject* boss, const GUI::Font& lfont,
//////////////////////////// ////////////////////////////
// PF0 // PF0
xpos = 10; ypos += lineHeight + 6; xpos = 10; ypos += lineHeight + 6;
t = new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight, new StaticTextWidget(boss, lfont, xpos, ypos+2, 4*fontWidth, fontHeight,
"PF:", kTextAlignLeft); "PF:", kTextAlignLeft);
xpos += 4*fontWidth; xpos += 4*fontWidth;
myPF[0] = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 4, 1); myPF[0] = new TogglePixelWidget(boss, nfont, xpos, ypos+1, 4, 1);
myPF[0]->setTarget(this); myPF[0]->setTarget(this);

View File

@ -228,31 +228,31 @@ void EventHandler::mapStelladaptors(const string& saport)
{ {
if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "Stelladaptor")) if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "Stelladaptor"))
{ {
saCount++; if(saOrder[saCount] == 1)
if(saOrder[saCount-1] == 1)
{ {
myJoysticks[i]->name += " (emulates left joystick port)"; myJoysticks[i]->name += " (emulates left joystick port)";
myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_LEFT; myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_LEFT;
} }
else if(saOrder[saCount-1] == 2) else if(saOrder[saCount] == 2)
{ {
myJoysticks[i]->name += " (emulates right joystick port)"; myJoysticks[i]->name += " (emulates right joystick port)";
myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_RIGHT; myJoysticks[i]->type = StellaJoystick::JT_STELLADAPTOR_RIGHT;
} }
saCount++;
} }
else if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "2600-daptor")) else if(BSPF_startsWithIgnoreCase(myJoysticks[i]->name, "2600-daptor"))
{ {
saCount++; if(saOrder[saCount] == 1)
if(saOrder[saCount-1] == 1)
{ {
myJoysticks[i]->name += " (emulates left joystick port)"; myJoysticks[i]->name += " (emulates left joystick port)";
myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_LEFT; myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_LEFT;
} }
else if(saOrder[saCount-1] == 2) else if(saOrder[saCount] == 2)
{ {
myJoysticks[i]->name += " (emulates right joystick port)"; myJoysticks[i]->name += " (emulates right joystick port)";
myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_RIGHT; myJoysticks[i]->type = StellaJoystick::JT_2600DAPTOR_RIGHT;
} }
saCount++;
} }
} }
myOSystem.settings().setValue("saport", saport); myOSystem.settings().setValue("saport", saport);

View File

@ -88,7 +88,6 @@ void CheckListWidget::drawWidget(bool hilite)
FBSurface& s = _boss->dialog().surface(); FBSurface& s = _boss->dialog().surface();
int i, pos, len = _list.size(); int i, pos, len = _list.size();
string buffer; string buffer;
int deltax;
// Draw a thin frame around the list and to separate columns // Draw a thin frame around the list and to separate columns
s.hLine(_x, _y, _x + _w - 1, kColor); s.hLine(_x, _y, _x + _w - 1, kColor);
@ -124,15 +123,13 @@ void CheckListWidget::drawWidget(bool hilite)
{ {
buffer = _editString; buffer = _editString;
adjustOffset(); adjustOffset();
deltax = -_editScrollOffset;
s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor, s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor,
kTextAlignLeft, deltax, false); kTextAlignLeft, -_editScrollOffset, false);
} }
else else
{ {
buffer = _list[pos]; buffer = _list[pos];
deltax = 0;
s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor); s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor);
} }
} }

View File

@ -150,7 +150,6 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight,
"Quit", kQuitCmd); "Quit", kQuitCmd);
wid.push_back(myQuitButton); wid.push_back(myQuitButton);
xpos += bwidth + 8;
#else #else
myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, myQuitButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight,
"Quit", kQuitCmd); "Quit", kQuitCmd);
@ -167,7 +166,6 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
myStartButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, myStartButton = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight,
"Select", kLoadROMCmd); "Select", kLoadROMCmd);
wid.push_back(myStartButton); wid.push_back(myStartButton);
xpos += bwidth + 8;
#endif #endif
mySelectedItem = 0; // Highlight 'Rom Listing' mySelectedItem = 0; // Highlight 'Rom Listing'

View File

@ -50,7 +50,6 @@ void StringListWidget::drawWidget(bool hilite)
FBSurface& s = _boss->dialog().surface(); FBSurface& s = _boss->dialog().surface();
int i, pos, len = _list.size(); int i, pos, len = _list.size();
string buffer; string buffer;
int deltax;
// Draw a thin frame around the list. // Draw a thin frame around the list.
s.hLine(_x, _y, _x + _w - 1, kColor); s.hLine(_x, _y, _x + _w - 1, kColor);
@ -76,15 +75,13 @@ void StringListWidget::drawWidget(bool hilite)
{ {
buffer = _editString; buffer = _editString;
adjustOffset(); adjustOffset();
deltax = -_editScrollOffset;
s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor, s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor,
kTextAlignLeft, deltax, false); kTextAlignLeft, -_editScrollOffset, false);
} }
else else
{ {
buffer = _list[pos]; buffer = _list[pos];
deltax = 0;
s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor); s.drawString(_font, buffer, _x + r.left, y, r.width(), kTextColor);
} }
} }

View File

@ -192,7 +192,6 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
// Center window (in windowed mode) // Center window (in windowed mode)
myCenter = new CheckboxWidget(myTab, font, xpos, ypos, "Center window"); myCenter = new CheckboxWidget(myTab, font, xpos, ypos, "Center window");
wid.push_back(myCenter); wid.push_back(myCenter);
ypos += lineHeight + 4;
// Add items for tab 0 // Add items for tab 0
addToFocusList(wid, myTab, tabID); addToFocusList(wid, myTab, tabID);