bank change tracking for more CartDebugWidgets added

This commit is contained in:
thrust26 2017-12-20 21:54:40 +01:00
parent ff1911a85d
commit f0d5ffbd0a
15 changed files with 41 additions and 9 deletions

View File

@ -121,7 +121,12 @@ CartridgeBFWidget::CartridgeBFWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeBFWidget::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();
}

View File

@ -155,12 +155,14 @@ void CartridgeCMWidget::saveOldState()
myOldState.internalram.clear();
for(uInt32 i = 0; i < this->internalRamSize();i++)
myOldState.internalram.push_back(myCart.myRAM[i]);
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCMWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.getBank());
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
RiotDebug& riot = Debugger::debugger().riotDebug();
const RiotState& state = static_cast<const RiotState&>(riot.getState());

View File

@ -41,6 +41,7 @@ class CartridgeCMWidget : public CartDebugWidget
uInt8 swcha;
uInt8 column;
ByteArray internalram;
uInt16 bank;
};
CartridgeCM& myCart;

View File

@ -64,12 +64,13 @@ void CartridgeCTYWidget::saveOldState()
{
myOldState.internalram.push_back(myCart.myRAM[i]);
}
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCTYWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.getBank()-1);
myBank->setSelectedIndex(myCart.getBank()-1, myCart.getBank() != myOldState.bank);
CartDebugWidget::loadConfig();
}

View File

@ -38,6 +38,7 @@ class CartridgeCTYWidget : public CartDebugWidget
struct CartState {
ByteArray internalram;
uInt16 bank;
};
CartState myOldState;

View File

@ -58,7 +58,7 @@ CartridgeCVPlusWidget::CartridgeCVPlusWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeCVPlusWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.myCurrentBank);
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
CartDebugWidget::loadConfig();
}
@ -92,6 +92,8 @@ void CartridgeCVPlusWidget::saveOldState()
myOldState.internalram.clear();
for(uInt32 i = 0; i < this->internalRamSize();i++)
myOldState.internalram.push_back(myCart.myRAM[i]);
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -37,6 +37,7 @@ class CartridgeCVPlusWidget : public CartDebugWidget
PopUpWidget* myBank;
struct CartState {
ByteArray internalram;
uInt16 bank;
};
CartState myOldState;

View File

@ -99,12 +99,14 @@ void CartridgeDFSCWidget::saveOldState()
{
myOldState.internalram.push_back(myCart.myRAM[i]);
}
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDFSCWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.getBank());
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
CartDebugWidget::loadConfig();
}

View File

@ -38,6 +38,7 @@ class CartridgeDFSCWidget : public CartDebugWidget
struct CartState {
ByteArray internalram;
uInt16 bank;
};
CartState myOldState;

View File

@ -89,7 +89,12 @@ CartridgeDFWidget::CartridgeDFWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDFWidget::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();
}

View File

@ -213,12 +213,14 @@ void CartridgeDPCPlusWidget::saveOldState()
for(uInt32 i = 0; i < internalRamSize(); ++i)
myOldState.internalram.push_back(myCart.myDisplayImage[i]);
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCPlusWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.getBank());
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
// Get registers, using change tracking
IntArray alist;

View File

@ -47,6 +47,7 @@ class CartridgeDPCPlusWidget : public CartDebugWidget
IntArray mwaves;
uInt32 random;
ByteArray internalram;
uInt16 bank;
};
CartridgeDPCPlus& myCart;

View File

@ -151,12 +151,14 @@ void CartridgeDPCWidget::saveOldState()
for(uInt32 i = 0; i < internalRamSize(); ++i)
myOldState.internalram.push_back(myCart.myDisplayImage[i]);
myOldState.bank = myCart.getBank();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeDPCWidget::loadConfig()
{
myBank->setSelectedIndex(myCart.getBank());
myBank->setSelectedIndex(myCart.getBank(), myCart.getBank() != myOldState.bank);
// Get registers, using change tracking
IntArray alist;

View File

@ -42,6 +42,7 @@ class CartridgeDPCWidget : public CartDebugWidget
BoolArray music;
uInt8 random;
ByteArray internalram;
uInt16 bank;
};
CartridgeDPC& myCart;

View File

@ -73,7 +73,12 @@ CartridgeEFWidget::CartridgeEFWidget(
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CartridgeEFWidget::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();
}