diff --git a/src/debugger/gui/Cart0840Widget.cxx b/src/debugger/gui/Cart0840Widget.cxx index a8f6b7f7a..5cc9c4880 100644 --- a/src/debugger/gui/Cart0840Widget.cxx +++ b/src/debugger/gui/Cart0840Widget.cxx @@ -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(); diff --git a/src/debugger/gui/Cart3EWidget.cxx b/src/debugger/gui/Cart3EWidget.cxx index eaf03946e..22bf23637 100644 --- a/src/debugger/gui/Cart3EWidget.cxx +++ b/src/debugger/gui/Cart3EWidget.cxx @@ -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; diff --git a/src/debugger/gui/Cart3FWidget.cxx b/src/debugger/gui/Cart3FWidget.cxx index 1ea06d8aa..20ffc7036 100644 --- a/src/debugger/gui/Cart3FWidget.cxx +++ b/src/debugger/gui/Cart3FWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/Cart4A50Widget.cxx b/src/debugger/gui/Cart4A50Widget.cxx index ddcbe8005..24816125a 100644 --- a/src/debugger/gui/Cart4A50Widget.cxx +++ b/src/debugger/gui/Cart4A50Widget.cxx @@ -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 diff --git a/src/debugger/gui/CartARWidget.cxx b/src/debugger/gui/CartARWidget.cxx index b69757b78..8dc902330 100644 --- a/src/debugger/gui/CartARWidget.cxx +++ b/src/debugger/gui/CartARWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartCMWidget.cxx b/src/debugger/gui/CartCMWidget.cxx index de6bf9a2d..192a1b65c 100644 --- a/src/debugger/gui/CartCMWidget.cxx +++ b/src/debugger/gui/CartCMWidget.cxx @@ -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"); diff --git a/src/debugger/gui/CartCTYWidget.cxx b/src/debugger/gui/CartCTYWidget.cxx index f739a81bc..13f41cdce 100644 --- a/src/debugger/gui/CartCTYWidget.cxx +++ b/src/debugger/gui/CartCTYWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx index 7c8142359..8e3dc9376 100644 --- a/src/debugger/gui/CartDPCPlusWidget.cxx +++ b/src/debugger/gui/CartDPCPlusWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx index 7c3ffdec3..4868ac60a 100644 --- a/src/debugger/gui/CartDPCWidget.cxx +++ b/src/debugger/gui/CartDPCWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartE0Widget.cxx b/src/debugger/gui/CartE0Widget.cxx index dbdbc6a73..9d4a175b5 100644 --- a/src/debugger/gui/CartE0Widget.cxx +++ b/src/debugger/gui/CartE0Widget.cxx @@ -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]]; diff --git a/src/debugger/gui/CartE7Widget.cxx b/src/debugger/gui/CartE7Widget.cxx index 8371ae755..20065975a 100644 --- a/src/debugger/gui/CartE7Widget.cxx +++ b/src/debugger/gui/CartE7Widget.cxx @@ -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]; diff --git a/src/debugger/gui/CartEFSCWidget.cxx b/src/debugger/gui/CartEFSCWidget.cxx index 5537193aa..7f5c3a46a 100644 --- a/src/debugger/gui/CartEFSCWidget.cxx +++ b/src/debugger/gui/CartEFSCWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartEFWidget.cxx b/src/debugger/gui/CartEFWidget.cxx index a6778dc39..b7eca5c10 100644 --- a/src/debugger/gui/CartEFWidget.cxx +++ b/src/debugger/gui/CartEFWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF0Widget.cxx b/src/debugger/gui/CartF0Widget.cxx index eff973c1e..0bfb3f7de 100644 --- a/src/debugger/gui/CartF0Widget.cxx +++ b/src/debugger/gui/CartF0Widget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartF4SCWidget.cxx b/src/debugger/gui/CartF4SCWidget.cxx index ac063e380..1ecab8703 100644 --- a/src/debugger/gui/CartF4SCWidget.cxx +++ b/src/debugger/gui/CartF4SCWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF4Widget.cxx b/src/debugger/gui/CartF4Widget.cxx index 03123de12..ec22a4921 100644 --- a/src/debugger/gui/CartF4Widget.cxx +++ b/src/debugger/gui/CartF4Widget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF6SCWidget.cxx b/src/debugger/gui/CartF6SCWidget.cxx index f8e3adee9..ee79b85ca 100644 --- a/src/debugger/gui/CartF6SCWidget.cxx +++ b/src/debugger/gui/CartF6SCWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF6Widget.cxx b/src/debugger/gui/CartF6Widget.cxx index ae0b8adb8..87d00ca59 100644 --- a/src/debugger/gui/CartF6Widget.cxx +++ b/src/debugger/gui/CartF6Widget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF8SCWidget.cxx b/src/debugger/gui/CartF8SCWidget.cxx index c82f6b018..0a365b93e 100644 --- a/src/debugger/gui/CartF8SCWidget.cxx +++ b/src/debugger/gui/CartF8SCWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartF8Widget.cxx b/src/debugger/gui/CartF8Widget.cxx index e30df7b4a..05aca8eee 100644 --- a/src/debugger/gui/CartF8Widget.cxx +++ b/src/debugger/gui/CartF8Widget.cxx @@ -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(); diff --git a/src/debugger/gui/CartFA2Widget.cxx b/src/debugger/gui/CartFA2Widget.cxx index e0f396217..18a2cb4ad 100644 --- a/src/debugger/gui/CartFA2Widget.cxx +++ b/src/debugger/gui/CartFA2Widget.cxx @@ -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(); diff --git a/src/debugger/gui/CartFAWidget.cxx b/src/debugger/gui/CartFAWidget.cxx index edd69d51d..562ef9136 100644 --- a/src/debugger/gui/CartFAWidget.cxx +++ b/src/debugger/gui/CartFAWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartFEWidget.cxx b/src/debugger/gui/CartFEWidget.cxx index 736d82fdb..b27a9468d 100644 --- a/src/debugger/gui/CartFEWidget.cxx +++ b/src/debugger/gui/CartFEWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartMCWidget.cxx b/src/debugger/gui/CartMCWidget.cxx index 03931f124..bf2e14e18 100644 --- a/src/debugger/gui/CartMCWidget.cxx +++ b/src/debugger/gui/CartMCWidget.cxx @@ -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] << " / " diff --git a/src/debugger/gui/CartSBWidget.cxx b/src/debugger/gui/CartSBWidget.cxx index b63c79230..382dfbdfc 100644 --- a/src/debugger/gui/CartSBWidget.cxx +++ b/src/debugger/gui/CartSBWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartUAWidget.cxx b/src/debugger/gui/CartUAWidget.cxx index 05c31ff5f..207c4b6a1 100644 --- a/src/debugger/gui/CartUAWidget.cxx +++ b/src/debugger/gui/CartUAWidget.cxx @@ -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(); diff --git a/src/debugger/gui/CartX07Widget.cxx b/src/debugger/gui/CartX07Widget.cxx index fae377230..3b31b7dec 100644 --- a/src/debugger/gui/CartX07Widget.cxx +++ b/src/debugger/gui/CartX07Widget.cxx @@ -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(); } diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx index 9e517f0eb..be35777a4 100644 --- a/src/debugger/gui/RiotWidget.cxx +++ b/src/debugger/gui/RiotWidget.cxx @@ -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()); diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index b90228966..e6a1fd44c 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -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++; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index 4a45d729b..8635e96d7 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -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); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx index 959d2bdfb..b28a5c443 100644 --- a/src/gui/ContextMenu.hxx +++ b/src/gui/ContextMenu.hxx @@ -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(); diff --git a/src/gui/Font.cxx b/src/gui/Font.cxx index a7363654a..2ee55344a 100644 --- a/src/gui/Font.cxx +++ b/src/gui/Font.cxx @@ -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 diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index a95b6e8ee..8bc901006 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -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; diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 3481f2110..156f4d15b 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -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); diff --git a/src/gui/PopUpWidget.hxx b/src/gui/PopUpWidget.hxx index 20cc38ce4..b64013be6 100644 --- a/src/gui/PopUpWidget.hxx +++ b/src/gui/PopUpWidget.hxx @@ -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(); }