Update TIA shadow registers for HMCLR (and code cleanup). Fixes #211.

This commit is contained in:
Stephen Anthony 2017-08-22 16:38:52 -02:30
parent 21bf401836
commit 52c16d604b
3 changed files with 6 additions and 14 deletions

View File

@ -40,10 +40,6 @@ TIADebug::TIADebug(Debugger& dbg, Console& console)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const DebuggerState& TIADebug::getState()
{
myState.ram.clear();
for(int i = 0; i < 0x010; ++i)
myState.ram.push_back(myTIA.peek(i));
// Color registers
myState.coluRegs.clear();
myState.coluRegs.push_back(coluP0());
@ -117,10 +113,6 @@ const DebuggerState& TIADebug::getState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIADebug::saveOldState()
{
myOldState.ram.clear();
for(int i = 0; i < 0x010; ++i)
myOldState.ram.push_back(myTIA.peek(i));
// Color registers
myOldState.coluRegs.clear();
myOldState.coluRegs.push_back(coluP0());

View File

@ -38,7 +38,6 @@ enum {
class TiaState : public DebuggerState
{
public:
IntArray ram;
IntArray coluRegs;
IntArray fixedCols;
IntArray gr;

View File

@ -1409,11 +1409,12 @@ void TIA::delayedWrite(uInt8 address, uInt8 value)
break;
case HMCLR:
myMissile0.hmm(0);
myMissile1.hmm(0);
myPlayer0.hmp(0);
myPlayer1.hmp(0);
myBall.hmbl(0);
// We must update the shadow registers for each HM object too
myMissile0.hmm(0); myShadowRegisters[HMM0] = 0;
myMissile1.hmm(0); myShadowRegisters[HMM1] = 0;
myPlayer0.hmp(0); myShadowRegisters[HMP0] = 0;
myPlayer1.hmp(0); myShadowRegisters[HMP1] = 0;
myBall.hmbl(0); myShadowRegisters[HMBL] = 0;
break;
case GRP0: