diff --git a/src/debugger/gui/CartDPCPlusWidget.hxx b/src/debugger/gui/CartDPCPlusWidget.hxx index e233fe402..b5c58fb88 100644 --- a/src/debugger/gui/CartDPCPlusWidget.hxx +++ b/src/debugger/gui/CartDPCPlusWidget.hxx @@ -85,7 +85,7 @@ class CartridgeDPCPlusWidget : public CartDebugWidget CheckboxWidget* myIMLDA; DataGridWidget* myRandom; - CartState myState, myOldState; + CartState myOldState; enum { kBankChanged = 'bkCH' }; }; diff --git a/src/debugger/gui/CartDPCWidget.cxx b/src/debugger/gui/CartDPCWidget.cxx index 68d30b994..d4fa040b3 100644 --- a/src/debugger/gui/CartDPCWidget.cxx +++ b/src/debugger/gui/CartDPCWidget.cxx @@ -147,11 +147,12 @@ void CartridgeDPCWidget::saveOldState() myOldState.flags.push_back(myCart.myFlags[i]); } for(int i = 0; i < 3; ++i) - { myOldState.music.push_back(myCart.myMusicMode[i]); - } myOldState.random = myCart.myRandomNumber; + + for(int i = 0; i < internalRamSize(); ++i) + myOldState.internalram.push_back(myCart.myDisplayImage[i]); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -234,3 +235,56 @@ string CartridgeDPCWidget::bankState() return buf.str(); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt32 CartridgeDPCWidget::internalRamSize() +{ + return 2*1024; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt32 CartridgeDPCWidget::internalRamRPort(int start) +{ + return 0x0000 + start; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +string CartridgeDPCWidget::internalRamDescription() +{ + ostringstream desc; + desc << "$0000 - $07FF - 2K display data\n" + << " indirectly accessible to 6507\n" + << " via DPC+'s Data Fetcher registers\n"; + + return desc.str(); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const ByteArray& CartridgeDPCWidget::internalRamOld(int start, int count) +{ + myRamOld.clear(); + for(int i = 0; i < count; i++) + myRamOld.push_back(myOldState.internalram[start + i]); + return myRamOld; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const ByteArray& CartridgeDPCWidget::internalRamCurrent(int start, int count) +{ + myRamCurrent.clear(); + for(int i = 0; i < count; i++) + myRamCurrent.push_back(myCart.myDisplayImage[start + i]); + return myRamCurrent; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void CartridgeDPCWidget::internalRamSetValue(int addr, uInt8 value) +{ + myCart.myDisplayImage[addr] = value; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +uInt8 CartridgeDPCWidget::internalRamGetValue(int addr) +{ + return myCart.myDisplayImage[addr]; +} diff --git a/src/debugger/gui/CartDPCWidget.hxx b/src/debugger/gui/CartDPCWidget.hxx index 376a95428..50892b30a 100644 --- a/src/debugger/gui/CartDPCWidget.hxx +++ b/src/debugger/gui/CartDPCWidget.hxx @@ -42,6 +42,16 @@ class CartridgeDPCWidget : public CartDebugWidget string bankState(); + // start of functions for Cartridge RAM tab + uInt32 internalRamSize(); + uInt32 internalRamRPort(int start); + string internalRamDescription(); + const ByteArray& internalRamOld(int start, int count); + const ByteArray& internalRamCurrent(int start, int count); + void internalRamSetValue(int addr, uInt8 value); + uInt8 internalRamGetValue(int addr); + // end of functions for Cartridge RAM tab + private: struct CartState { ByteArray tops; @@ -50,6 +60,7 @@ class CartridgeDPCWidget : public CartDebugWidget ByteArray flags; BoolArray music; uInt8 random; + ByteArray internalram; }; private: