mirror of https://github.com/stella-emu/stella.git
added bank change tracking to most CartDebugWidgets
This commit is contained in:
parent
0826ce6bd6
commit
e3baeb209e
|
@ -59,7 +59,12 @@ Cartridge0840Widget::Cartridge0840Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge0840Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -94,6 +94,8 @@ void Cartridge3EWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.myCurrentBank;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -101,13 +103,13 @@ void Cartridge3EWidget::loadConfig()
|
|||
{
|
||||
if(myCart.myCurrentBank < 256)
|
||||
{
|
||||
myROMBank->setSelectedIndex(myCart.myCurrentBank % myNumRomBanks);
|
||||
myRAMBank->setSelectedMax();
|
||||
myROMBank->setSelectedIndex(myCart.myCurrentBank % myNumRomBanks, myOldState.bank != myCart.myCurrentBank);
|
||||
myRAMBank->setSelectedMax(myOldState.bank >= 256);
|
||||
}
|
||||
else
|
||||
{
|
||||
myROMBank->setSelectedMax();
|
||||
myRAMBank->setSelectedIndex(myCart.myCurrentBank - 256);
|
||||
myROMBank->setSelectedMax(myOldState.bank < 256);
|
||||
myRAMBank->setSelectedIndex(myCart.myCurrentBank - 256, myOldState.bank != myCart.myCurrentBank);
|
||||
}
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
|
|
|
@ -40,6 +40,7 @@ class Cartridge3EWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -60,7 +60,12 @@ Cartridge3FWidget::Cartridge3FWidget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge3FWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.myCurrentBank);
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -79,7 +79,12 @@ CartridgeARWidget::CartridgeARWidget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeARWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.myCurrentBank);
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -131,12 +131,13 @@ void CartridgeBFSCWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeBFSCWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeBFSCWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace GUI {
|
|||
#include "Base.hxx" // not needed here, but all child classes need it
|
||||
#include "Command.hxx"
|
||||
#include "Widget.hxx"
|
||||
#include "Debugger.hxx"
|
||||
#include "CartDebug.hxx"
|
||||
|
||||
class CartDebugWidget : public Widget, public CommandSender
|
||||
{
|
||||
|
|
|
@ -83,12 +83,14 @@ void CartridgeEFSCWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeEFSCWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeEFSCWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -74,7 +74,12 @@ CartridgeF0Widget::CartridgeF0Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF0Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -74,12 +74,13 @@ void CartridgeF4SCWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF4SCWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeF4SCWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -64,7 +64,12 @@ CartridgeF4Widget::CartridgeF4Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF4Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -70,12 +70,14 @@ void CartridgeF6SCWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF6SCWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ class CartridgeF6SCWidget : public CartDebugWidget
|
|||
private:
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartridgeF6SC& myCart;
|
||||
PopUpWidget* myBank;
|
||||
|
|
|
@ -60,7 +60,12 @@ CartridgeF6Widget::CartridgeF6Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF6Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -68,12 +68,14 @@ void CartridgeF8SCWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF8SCWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeF8SCWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -58,7 +58,12 @@ CartridgeF8Widget::CartridgeF8Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeF8Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -106,12 +106,14 @@ void CartridgeFA2Widget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeFA2Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ class CartridgeFA2Widget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -69,12 +69,14 @@ void CartridgeFAWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeFAWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeFAWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -51,7 +51,12 @@ CartridgeFEWidget::CartridgeFEWidget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeFEWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -69,13 +69,16 @@ void CartridgeMNetworkWidget::saveOldState()
|
|||
{
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
}
|
||||
|
||||
myOldState.lowerBank = myCart.myCurrentSlice[0];
|
||||
myOldState.upperBank = myCart.myCurrentRAM;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeMNetworkWidget::loadConfig()
|
||||
{
|
||||
myLower2K->setSelectedIndex(myCart.myCurrentSlice[0]);
|
||||
myUpper256B->setSelectedIndex(myCart.myCurrentRAM);
|
||||
myLower2K->setSelectedIndex(myCart.myCurrentSlice[0], myCart.myCurrentSlice[0] != myOldState.lowerBank);
|
||||
myUpper256B->setSelectedIndex(myCart.myCurrentRAM, myCart.myCurrentRAM != myOldState.upperBank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ class CartridgeMNetworkWidget : public CartDebugWidget
|
|||
struct CartState
|
||||
{
|
||||
ByteArray internalram;
|
||||
uInt16 lowerBank;
|
||||
uInt16 upperBank;
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -65,7 +65,12 @@ CartridgeSBWidget::CartridgeSBWidget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeSBWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,12 @@ CartridgeUAWidget::CartridgeUAWidget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeUAWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -72,12 +72,14 @@ void CartridgeWDWidget::saveOldState()
|
|||
|
||||
for(uInt32 i = 0; i < internalRamSize(); ++i)
|
||||
myOldState.internalram.push_back(myCart.myRAM[i]);
|
||||
|
||||
myOldState.bank = myCart.getBank();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeWDWidget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.getBank());
|
||||
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ class CartridgeWDWidget : public CartDebugWidget
|
|||
|
||||
struct CartState {
|
||||
ByteArray internalram;
|
||||
uInt16 bank; // Current banking layout
|
||||
};
|
||||
CartState myOldState;
|
||||
|
||||
|
|
|
@ -75,7 +75,12 @@ CartridgeX07Widget::CartridgeX07Widget(
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeX07Widget::loadConfig()
|
||||
{
|
||||
myBank->setSelectedIndex(myCart.myCurrentBank);
|
||||
Debugger& dbg = instance().debugger();
|
||||
CartDebug& cart = dbg.cartDebug();
|
||||
const CartState& state = static_cast<const CartState&>(cart.getState());
|
||||
const CartState& oldstate = static_cast<const CartState&>(cart.getOldState());
|
||||
|
||||
myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank);
|
||||
|
||||
CartDebugWidget::loadConfig();
|
||||
}
|
||||
|
|
|
@ -100,8 +100,9 @@ void PopUpWidget::setSelectedIndex(int idx, bool changed)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void PopUpWidget::setSelectedMax()
|
||||
void PopUpWidget::setSelectedMax(bool changed)
|
||||
{
|
||||
_changed = changed;
|
||||
myMenu->setSelectedMax();
|
||||
}
|
||||
|
||||
|
@ -248,7 +249,7 @@ void PopUpWidget::drawWidget(bool hilite)
|
|||
s.frameRect(x + w - 16, _y + 1, 15, _h - 2, isEnabled() && hilite ? kTextColorHi : kBGColorLo);
|
||||
|
||||
// Fill the background
|
||||
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, kWidColor);
|
||||
s.fillRect(x + 1, _y + 1, w - 17, _h - 2, _changed ? kDbgChangedColor : kWidColor);
|
||||
s.fillRect(x + w - 15, _y + 2, 13, _h - 4, isEnabled() && hilite ? kWidColor : kBGColorHi);
|
||||
// Draw an arrow pointing down at the right end to signal this is a dropdown/popup
|
||||
s.drawBitmap(down_arrow, x + w - 13, _y + myArrowsY + 1,
|
||||
|
|
|
@ -51,7 +51,7 @@ class PopUpWidget : public Widget, public CommandSender
|
|||
void setSelected(const Variant& tag,
|
||||
const Variant& def = EmptyVariant);
|
||||
void setSelectedIndex(int idx, bool changed = false);
|
||||
void setSelectedMax();
|
||||
void setSelectedMax(bool changed = false);
|
||||
void clearSelection();
|
||||
|
||||
int getSelected() const;
|
||||
|
|
Loading…
Reference in New Issue