Cleaned up ContextMenu API wrt multiple setSelected methods; in some cases,

it was confusing which one was being called.

Fixed output in debugger bankstate info; in some cases, hex numbers were shown
when decimal was required.

Fixed regression wrt the last TIA change (incorrect framerate counter); the
PAL autodetection was failing in certain cases.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2774 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-07-30 20:31:14 +00:00
parent 20b9253430
commit 4958e87c3e
35 changed files with 110 additions and 103 deletions

View File

@ -61,7 +61,7 @@ Cartridge0840Widget::Cartridge0840Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge0840Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -85,7 +85,7 @@ string Cartridge0840Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$800", "$840" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -92,13 +92,13 @@ void Cartridge3EWidget::loadConfig()
{
if(myCart.myCurrentBank < 256)
{
myROMBank->setSelected(myCart.myCurrentBank % myNumRomBanks);
myROMBank->setSelectedIndex(myCart.myCurrentBank % myNumRomBanks);
myRAMBank->setSelectedMax();
}
else
{
myROMBank->setSelectedMax();
myRAMBank->setSelected(myCart.myCurrentBank - 256);
myRAMBank->setSelectedIndex(myCart.myCurrentBank - 256);
}
CartDebugWidget::loadConfig();
@ -120,7 +120,7 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender,
else
{
bank = 256; // default to first RAM bank
myRAMBank->setSelected(0);
myRAMBank->setSelectedIndex(0);
}
}
else if(cmd == kRAMBankChanged)
@ -133,7 +133,7 @@ void Cartridge3EWidget::handleCommand(CommandSender* sender,
else
{
bank = 0; // default to first ROM bank
myROMBank->setSelected(0);
myROMBank->setSelectedIndex(0);
}
}
@ -151,7 +151,7 @@ string Cartridge3EWidget::bankState()
uInt16& bank = myCart.myCurrentBank;
if(bank < 256)
buf << "ROM bank " << bank % myNumRomBanks << ", RAM inactive";
buf << "ROM bank " << dec << bank % myNumRomBanks << ", RAM inactive";
else
buf << "ROM inactive, RAM bank " << bank % myNumRomBanks;

View File

@ -62,7 +62,7 @@ Cartridge3FWidget::Cartridge3FWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Cartridge3FWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -85,7 +85,7 @@ string Cartridge3FWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $3F";
buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $3F";
return buf.str();
}

View File

@ -131,37 +131,37 @@ void Cartridge4A50Widget::loadConfig()
// Lower bank
if(myCart.myIsRomLow) // ROM active
{
myROMLower->setSelected((myCart.mySliceLow >> 11) & 0x1F);
myROMLower->setSelectedIndex((myCart.mySliceLow >> 11) & 0x1F);
myRAMLower->setSelectedMax();
}
else // RAM active
{
myROMLower->setSelectedMax();
myRAMLower->setSelected((myCart.mySliceLow >> 11) & 0x0F);
myRAMLower->setSelectedIndex((myCart.mySliceLow >> 11) & 0x0F);
}
// Middle bank
if(myCart.myIsRomMiddle) // ROM active
{
myROMMiddle->setSelected((myCart.mySliceMiddle >> 11) & 0x1F);
myROMMiddle->setSelectedIndex((myCart.mySliceMiddle >> 11) & 0x1F);
myRAMMiddle->setSelectedMax();
}
else // RAM active
{
myROMMiddle->setSelectedMax();
myRAMMiddle->setSelected((myCart.mySliceMiddle >> 11) & 0x0F);
myRAMMiddle->setSelectedIndex((myCart.mySliceMiddle >> 11) & 0x0F);
}
// High bank
if(myCart.myIsRomHigh) // ROM active
{
myROMHigh->setSelected((myCart.mySliceHigh >> 11) & 0xFF);
myROMHigh->setSelectedIndex((myCart.mySliceHigh >> 11) & 0xFF);
myRAMHigh->setSelectedMax();
}
else // RAM active
{
myROMHigh->setSelectedMax();
myRAMHigh->setSelected((myCart.mySliceHigh >> 11) & 0x7F);
myRAMHigh->setSelectedIndex((myCart.mySliceHigh >> 11) & 0x7F);
}
CartDebugWidget::loadConfig();
@ -184,7 +184,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first RAM bank
myRAMLower->setSelected(0);
myRAMLower->setSelectedIndex(0);
myCart.bankRAMLower(0);
}
break;
@ -198,7 +198,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first ROM bank
myROMLower->setSelected(0);
myROMLower->setSelectedIndex(0);
myCart.bankROMLower(0);
}
break;
@ -212,7 +212,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first RAM bank
myRAMMiddle->setSelected(0);
myRAMMiddle->setSelectedIndex(0);
myCart.bankRAMMiddle(0);
}
break;
@ -226,7 +226,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first ROM bank
myROMMiddle->setSelected(0);
myROMMiddle->setSelectedIndex(0);
myCart.bankROMMiddle(0);
}
break;
@ -240,7 +240,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first RAM bank
myRAMHigh->setSelected(0);
myRAMHigh->setSelectedIndex(0);
myCart.bankRAMHigh(0);
}
break;
@ -254,7 +254,7 @@ void Cartridge4A50Widget::handleCommand(CommandSender* sender,
else
{
// default to first ROM bank
myROMHigh->setSelected(0);
myROMHigh->setSelectedIndex(0);
myCart.bankROMHigh(0);
}
break;
@ -269,7 +269,7 @@ string Cartridge4A50Widget::bankState()
{
ostringstream& buf = buffer();
buf << "L/M/H = ";
buf << "L/M/H = " << dec;
if(myCart.myIsRomLow)
buf << "ROM bank " << ((myCart.mySliceLow >> 11) & 0x1F) << " / ";
else

View File

@ -81,7 +81,7 @@ CartridgeARWidget::CartridgeARWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeARWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -104,7 +104,7 @@ string CartridgeARWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank;
buf << "Bank = " << dec << myCart.myCurrentBank;
return buf.str();
}

View File

@ -156,7 +156,7 @@ void CartridgeCMWidget::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCMWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
RiotDebug& riot = Debugger::debugger().riotDebug();
const RiotState& state = (RiotState&) riot.getState();
@ -217,7 +217,7 @@ string CartridgeCMWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", RAM is" << (myCart.mySWCHA & 0x10 ? " Inactive" :
myCart.mySWCHA & 0x20 ? " Read-only" : " Write-only");

View File

@ -58,7 +58,7 @@ CartridgeCTYWidget::CartridgeCTYWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCTYWidget::loadConfig()
{
myBank->setSelected(myCart.bank()-1);
myBank->setSelectedIndex(myCart.bank()-1);
CartDebugWidget::loadConfig();
}
@ -85,7 +85,7 @@ string CartridgeCTYWidget::bankState()
"", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
uInt16 bank = myCart.bank();
buf << "Bank = " << bank << ", hotspot = " << spot[bank];
buf << "Bank = " << dec << bank << ", hotspot = " << spot[bank];
return buf.str();
}

View File

@ -216,7 +216,7 @@ void CartridgeDPCPlusWidget::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCPlusWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
// Get registers, using change tracking
IntArray alist;
@ -325,7 +325,7 @@ string CartridgeDPCPlusWidget::bankState()
static const char* spot[] = {
"$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -157,7 +157,7 @@ void CartridgeDPCWidget::saveOldState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
// Get registers, using change tracking
IntArray alist;
@ -229,7 +229,7 @@ string CartridgeDPCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -100,9 +100,9 @@ CartridgeE0Widget::CartridgeE0Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE0Widget::loadConfig()
{
mySlice0->setSelected(myCart.myCurrentSlice[0]);
mySlice1->setSelected(myCart.myCurrentSlice[1]);
mySlice2->setSelected(myCart.myCurrentSlice[2]);
mySlice0->setSelectedIndex(myCart.myCurrentSlice[0]);
mySlice1->setSelectedIndex(myCart.myCurrentSlice[1]);
mySlice2->setSelectedIndex(myCart.myCurrentSlice[2]);
CartDebugWidget::loadConfig();
}
@ -135,7 +135,7 @@ string CartridgeE0Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
buf << "Slices: " << dec
<< seg0[myCart.myCurrentSlice[0]] << " / "
<< seg1[myCart.myCurrentSlice[1]] << " / "
<< seg2[myCart.myCurrentSlice[2]];

View File

@ -86,8 +86,8 @@ CartridgeE7Widget::CartridgeE7Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeE7Widget::loadConfig()
{
myLower2K->setSelected(myCart.myCurrentSlice[0]);
myUpper256B->setSelected(myCart.myCurrentRAM);
myLower2K->setSelectedIndex(myCart.myCurrentSlice[0]);
myUpper256B->setSelectedIndex(myCart.myCurrentRAM);
CartDebugWidget::loadConfig();
}
@ -117,7 +117,7 @@ string CartridgeE7Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
buf << "Slices: " << dec
<< spot_lower[myCart.myCurrentSlice[0]] << " / "
<< spot_upper[myCart.myCurrentRAM];

View File

@ -77,7 +77,7 @@ CartridgeEFSCWidget::CartridgeEFSCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFSCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -104,7 +104,7 @@ string CartridgeEFSCWidget::bankState()
"$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7",
"$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -75,7 +75,7 @@ CartridgeEFWidget::CartridgeEFWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -102,7 +102,7 @@ string CartridgeEFWidget::bankState()
"$FE0", "$FE1", "$FE2", "$FE3", "$FE4", "$FE5", "$FE6", "$FE7",
"$FE8", "$FE9", "$FEA", "$FEB", "$FEC", "$FED", "$FEE", "$FEF"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -76,7 +76,7 @@ CartridgeF0Widget::CartridgeF0Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF0Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -99,7 +99,7 @@ string CartridgeF0Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank << ", hotspot = $FF0";
buf << "Bank = " << dec << myCart.myCurrentBank << ", hotspot = $FF0";
return buf.str();
}

View File

@ -68,7 +68,7 @@ CartridgeF4SCWidget::CartridgeF4SCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -94,7 +94,7 @@ string CartridgeF4SCWidget::bankState()
static const char* spot[] = {
"$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -66,7 +66,7 @@ CartridgeF4Widget::CartridgeF4Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF4Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -92,7 +92,7 @@ string CartridgeF4Widget::bankState()
static const char* spot[] = {
"$FF4", "$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -64,7 +64,7 @@ CartridgeF6SCWidget::CartridgeF6SCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -88,7 +88,7 @@ string CartridgeF6SCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -62,7 +62,7 @@ CartridgeF6Widget::CartridgeF6Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF6Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -86,7 +86,7 @@ string CartridgeF6Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF6", "$FF7", "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -62,7 +62,7 @@ CartridgeF8SCWidget::CartridgeF8SCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8SCWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -86,7 +86,7 @@ string CartridgeF8SCWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -60,7 +60,7 @@ CartridgeF8Widget::CartridgeF8Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeF8Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -84,7 +84,7 @@ string CartridgeF8Widget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -100,7 +100,7 @@ CartridgeFA2Widget::CartridgeFA2Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFA2Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -140,7 +140,7 @@ string CartridgeFA2Widget::bankState()
static const char* spot[] = {
"$FF5", "$FF6", "$FF7", "$FF8", "$FF9", "$FFA", "$FFB"
};
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -63,7 +63,7 @@ CartridgeFAWidget::CartridgeFAWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeFAWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -87,7 +87,7 @@ string CartridgeFAWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$FF8", "$FF9", "$FFA" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -46,7 +46,8 @@ string CartridgeFEWidget::bankState()
ostringstream& buf = buffer();
static const char* range[] = { "$F000", "$D000" };
buf << "Bank = " << myCart.bank() << ", address range = " << range[myCart.bank()];
buf << "Bank = " << dec << myCart.bank()
<< ", address range = " << range[myCart.bank()];
return buf.str();
}

View File

@ -98,10 +98,10 @@ CartridgeMCWidget::CartridgeMCWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeMCWidget::loadConfig()
{
mySlice0->setSelected(myCart.myCurrentBlock[0]);
mySlice1->setSelected(myCart.myCurrentBlock[1]);
mySlice2->setSelected(myCart.myCurrentBlock[2]);
mySlice3->setSelected(myCart.myCurrentBlock[3]);
mySlice0->setSelectedIndex(myCart.myCurrentBlock[0]);
mySlice1->setSelectedIndex(myCart.myCurrentBlock[1]);
mySlice2->setSelectedIndex(myCart.myCurrentBlock[2]);
mySlice3->setSelectedIndex(myCart.myCurrentBlock[3]);
CartDebugWidget::loadConfig();
}
@ -137,7 +137,7 @@ string CartridgeMCWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Slices: "
buf << "Slices: " << dec
<< myCart.myCurrentBlock[0] << " / "
<< myCart.myCurrentBlock[1] << " / "
<< myCart.myCurrentBlock[2] << " / "

View File

@ -67,7 +67,7 @@ CartridgeSBWidget::CartridgeSBWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeSBWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -90,7 +90,7 @@ string CartridgeSBWidget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = $" << Common::Base::HEX2 << (myCart.myCurrentBank + 0x800);
return buf.str();

View File

@ -61,7 +61,7 @@ CartridgeUAWidget::CartridgeUAWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeUAWidget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -85,7 +85,7 @@ string CartridgeUAWidget::bankState()
ostringstream& buf = buffer();
static const char* spot[] = { "$200", "$240" };
buf << "Bank = " << myCart.myCurrentBank
buf << "Bank = " << dec << myCart.myCurrentBank
<< ", hotspot = " << spot[myCart.myCurrentBank];
return buf.str();

View File

@ -77,7 +77,7 @@ CartridgeX07Widget::CartridgeX07Widget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeX07Widget::loadConfig()
{
myBank->setSelected(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.myCurrentBank);
CartDebugWidget::loadConfig();
}
@ -100,7 +100,7 @@ string CartridgeX07Widget::bankState()
{
ostringstream& buf = buffer();
buf << "Bank = " << myCart.myCurrentBank;
buf << "Bank = " << dec << myCart.myCurrentBank;
return buf.str();
}

View File

@ -325,9 +325,9 @@ void RiotWidget::loadConfig()
// Console switches (inverted, since 'selected' in the UI
// means 'grounded' in the system)
myP0Diff->setSelected((int)riot.diffP0());
myP1Diff->setSelected((int)riot.diffP1());
myTVType->setSelected((int)riot.tvType());
myP0Diff->setSelectedIndex((int)riot.diffP0());
myP1Diff->setSelectedIndex((int)riot.diffP1());
myTVType->setSelectedIndex((int)riot.tvType());
mySelect->setState(!riot.select());
myReset->setState(!riot.reset());

View File

@ -596,7 +596,11 @@ inline void TIA::startFrame()
}
}
myStartScanline = 0;
// Stats counters
myFrameCounter++;
if(myScanlineCountForLastFrame >= 287)
myPALFrameCounter++;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -666,10 +670,6 @@ inline void TIA::endFrame()
if(offset > myStopDisplayOffset && offset < 228 * 320)
myStopDisplayOffset = offset;
}
// Is this a PAL ROM?
if(myScanlineCountForLastFrame >= 287)
myPALFrameCounter++;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -84,7 +84,7 @@ void ContextMenu::show(uInt32 x, uInt32 y, int item)
recalc(instance().frameBuffer().imageRect());
open();
setSelected(item);
setSelectedIndex(item);
moveToSelected();
}
@ -128,10 +128,10 @@ void ContextMenu::recalc(const GUI::Rect& image)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ContextMenu::setSelected(int item)
void ContextMenu::setSelectedIndex(int idx)
{
if(item >= 0 && item < (int)_entries.size())
_selectedItem = item;
if(idx >= 0 && idx < (int)_entries.size())
_selectedItem = idx;
else
_selectedItem = -1;
}
@ -145,7 +145,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
{
if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), tag.toString()))
{
setSelected(item);
setSelectedIndex(item);
return;
}
}
@ -156,7 +156,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
{
if(BSPF_equalsIgnoreCase(_entries[item].second.toString(), defaultTag.toString()))
{
setSelected(item);
setSelectedIndex(item);
return;
}
}
@ -165,7 +165,7 @@ void ContextMenu::setSelected(const Variant& tag, const Variant& defaultTag)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ContextMenu::setSelectedMax()
{
setSelected(_entries.size() - 1);
setSelectedIndex(_entries.size() - 1);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -53,12 +53,12 @@ class ContextMenu : public Dialog, public CommandSender
/** Show context menu onscreen at the specified coordinates */
void show(uInt32 x, uInt32 y, int item = -1);
/** Select the entry at the given index. */
void setSelected(int item);
/** Select the first entry matching the given tag. */
void setSelected(const Variant& tag, const Variant& defaultTag);
/** Select the entry at the given index. */
void setSelectedIndex(int idx);
/** Select the highest/last entry in the internal list. */
void setSelectedMax();

View File

@ -51,12 +51,18 @@ int Font::getCharWidth(uInt8 chr) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int Font::getStringWidth(const string& str) const
{
int space = 0;
// If no width table is specified, use the maximum width
if(!myFontDesc.width)
return myFontDesc.maxwidth * str.size();
else
{
int space = 0;
for(unsigned int i = 0; i < str.size(); ++i)
space += getCharWidth(str[i]);
for(unsigned int i = 0; i < str.size(); ++i)
space += getCharWidth(str[i]);
return space;
return space;
}
}
} // namespace GUI

View File

@ -470,13 +470,13 @@ void GameInfoDialog::loadView()
bool autoAxis = BSPF_equalsIgnoreCase(mcontrol, "auto");
if(autoAxis)
{
myMouseControl->setSelected(0);
myMouseX->setSelected(0);
myMouseY->setSelected(0);
myMouseControl->setSelectedIndex(0);
myMouseX->setSelectedIndex(0);
myMouseY->setSelectedIndex(0);
}
else
{
myMouseControl->setSelected(1);
myMouseControl->setSelectedIndex(1);
myMouseX->setSelected(Variant(mcontrol[0] - '0'));
myMouseY->setSelected(Variant(mcontrol[1] - '0'));
}
@ -579,12 +579,12 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kLeftCChanged:
myRightPort->setSelected(
myRightPort->setSelectedIndex(
myLeftPort->getSelected() == 1 ? 0 : 1);
break;
case kRightCChanged:
myLeftPort->setSelected(
myLeftPort->setSelectedIndex(
myRightPort->getSelected() == 1 ? 0 : 1);
break;

View File

@ -203,7 +203,7 @@ void InputDialog::loadConfig()
{
// Left & right ports
const string& saport = instance().settings().getString("saport");
mySAPort->setSelected(BSPF_equalsIgnoreCase(saport, "rl") ? 1 : 0);
mySAPort->setSelectedIndex(BSPF_equalsIgnoreCase(saport, "rl") ? 1 : 0);
// Joystick deadzone
myDeadzone->setValue(instance().settings().getInt("joydeadzone"));
@ -283,7 +283,7 @@ void InputDialog::setDefaults()
case 2: // Virtual devices
{
// Left & right ports
mySAPort->setSelected("lr", "lr");
mySAPort->setSelected("lr");
// Joystick deadzone
myDeadzone->setValue(0);

View File

@ -51,10 +51,10 @@ class PopUpWidget : public Widget, public CommandSender
/** Various selection methods passed directly to the underlying menu
See ContextMenu.hxx for more information. */
void addItems(const VariantList& items) { myMenu->addItems(items); }
void setSelected(int item) { myMenu->setSelected(item); }
void setSelected(const Variant& tag,
const Variant& def = EmptyVariant)
{ myMenu->setSelected(tag, def); }
void setSelectedIndex(int idx) { myMenu->setSelectedIndex(idx); }
void setSelectedMax() { myMenu->setSelectedMax(); }
void clearSelection() { myMenu->clearSelection(); }