diff --git a/src/debugger/gui/CartBFWidget.cxx b/src/debugger/gui/CartBFWidget.cxx index a319843af..90e76bdd7 100644 --- a/src/debugger/gui/CartBFWidget.cxx +++ b/src/debugger/gui/CartBFWidget.cxx @@ -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(cart.getState()); + const CartState& oldstate = static_cast(cart.getOldState()); + + myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank); CartDebugWidget::loadConfig(); } diff --git a/src/debugger/gui/CartCMWidget.cxx b/src/debugger/gui/CartCMWidget.cxx index b0d3942a7..6db45b47d 100644 --- a/src/debugger/gui/CartCMWidget.cxx +++ b/src/debugger/gui/CartCMWidget.cxx @@ -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(riot.getState()); diff --git a/src/debugger/gui/CartCMWidget.hxx b/src/debugger/gui/CartCMWidget.hxx index f712b0afc..d348cdf9e 100644 --- a/src/debugger/gui/CartCMWidget.hxx +++ b/src/debugger/gui/CartCMWidget.hxx @@ -41,6 +41,7 @@ class CartridgeCMWidget : public CartDebugWidget uInt8 swcha; uInt8 column; ByteArray internalram; + uInt16 bank; }; CartridgeCM& myCart; diff --git a/src/debugger/gui/CartCTYWidget.cxx b/src/debugger/gui/CartCTYWidget.cxx index 1ed4fa98f..ad1c94e45 100644 --- a/src/debugger/gui/CartCTYWidget.cxx +++ b/src/debugger/gui/CartCTYWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartCTYWidget.hxx b/src/debugger/gui/CartCTYWidget.hxx index 1ab1ec9c0..ea317d730 100644 --- a/src/debugger/gui/CartCTYWidget.hxx +++ b/src/debugger/gui/CartCTYWidget.hxx @@ -38,6 +38,7 @@ class CartridgeCTYWidget : public CartDebugWidget struct CartState { ByteArray internalram; + uInt16 bank; }; CartState myOldState; diff --git a/src/debugger/gui/CartCVPlusWidget.cxx b/src/debugger/gui/CartCVPlusWidget.cxx index 6e5bb9c72..97a4d1a14 100644 --- a/src/debugger/gui/CartCVPlusWidget.cxx +++ b/src/debugger/gui/CartCVPlusWidget.cxx @@ -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(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/CartCVPlusWidget.hxx b/src/debugger/gui/CartCVPlusWidget.hxx index 6d32641c0..c691bdb62 100644 --- a/src/debugger/gui/CartCVPlusWidget.hxx +++ b/src/debugger/gui/CartCVPlusWidget.hxx @@ -37,6 +37,7 @@ class CartridgeCVPlusWidget : public CartDebugWidget PopUpWidget* myBank; struct CartState { ByteArray internalram; + uInt16 bank; }; CartState myOldState; diff --git a/src/debugger/gui/CartDFSCWidget.cxx b/src/debugger/gui/CartDFSCWidget.cxx index 9979af959..bd66e577a 100644 --- a/src/debugger/gui/CartDFSCWidget.cxx +++ b/src/debugger/gui/CartDFSCWidget.cxx @@ -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(); } diff --git a/src/debugger/gui/CartDFSCWidget.hxx b/src/debugger/gui/CartDFSCWidget.hxx index 7dbed13df..44e340354 100644 --- a/src/debugger/gui/CartDFSCWidget.hxx +++ b/src/debugger/gui/CartDFSCWidget.hxx @@ -38,6 +38,7 @@ class CartridgeDFSCWidget : public CartDebugWidget struct CartState { ByteArray internalram; + uInt16 bank; }; CartState myOldState; diff --git a/src/debugger/gui/CartDFWidget.cxx b/src/debugger/gui/CartDFWidget.cxx index 4462a9a49..911fbe938 100644 --- a/src/debugger/gui/CartDFWidget.cxx +++ b/src/debugger/gui/CartDFWidget.cxx @@ -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(cart.getState()); + const CartState& oldstate = static_cast(cart.getOldState()); + + myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank); CartDebugWidget::loadConfig(); } diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx index f9425b8c6..9b8d59525 100644 --- a/src/debugger/gui/CartDPCPlusWidget.cxx +++ b/src/debugger/gui/CartDPCPlusWidget.cxx @@ -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; diff --git a/src/debugger/gui/CartDPCPlusWidget.hxx b/src/debugger/gui/CartDPCPlusWidget.hxx index 9494f16c3..668b5f580 100644 --- a/src/debugger/gui/CartDPCPlusWidget.hxx +++ b/src/debugger/gui/CartDPCPlusWidget.hxx @@ -47,6 +47,7 @@ class CartridgeDPCPlusWidget : public CartDebugWidget IntArray mwaves; uInt32 random; ByteArray internalram; + uInt16 bank; }; CartridgeDPCPlus& myCart; diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx index cb4c1359b..150edc2b1 100644 --- a/src/debugger/gui/CartDPCWidget.cxx +++ b/src/debugger/gui/CartDPCWidget.cxx @@ -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; diff --git a/src/debugger/gui/CartDPCWidget.hxx b/src/debugger/gui/CartDPCWidget.hxx index 768d02c1c..6db4c587b 100644 --- a/src/debugger/gui/CartDPCWidget.hxx +++ b/src/debugger/gui/CartDPCWidget.hxx @@ -42,6 +42,7 @@ class CartridgeDPCWidget : public CartDebugWidget BoolArray music; uInt8 random; ByteArray internalram; + uInt16 bank; }; CartridgeDPC& myCart; diff --git a/src/debugger/gui/CartEFWidget.cxx b/src/debugger/gui/CartEFWidget.cxx index cc4b5c29d..c9ebd0cbc 100644 --- a/src/debugger/gui/CartEFWidget.cxx +++ b/src/debugger/gui/CartEFWidget.cxx @@ -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(cart.getState()); + const CartState& oldstate = static_cast(cart.getOldState()); + + myBank->setSelectedIndex(myCart.getBank(), state.bank != oldstate.bank); CartDebugWidget::loadConfig(); }