diff --git a/.vscode/settings.json b/.vscode/settings.json index 917818c91..5bfcd1feb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,8 +4,8 @@ "-std=c++11", "-I/home/cnspeckn/git/stella/src/common", "-I/home/cnspeckn/git/stella/src/emucore", - "-I/home/cnspeckn/git/stella/src/emucore/tia/default_core", - "-I/home/cnspeckn/git/stella/src/emucore/tia/6502ts_core" + "-I/home/cnspeckn/git/stella/src/emucore/tia", + "-I/home/cnspeckn/git/stella/src/emucore/debugger" ], "editor.tabSize": 2, "files.trimTrailingWhitespace": true, diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx index 5bb5f6afd..6de2a4d39 100644 --- a/src/debugger/TIADebug.cxx +++ b/src/debugger/TIADebug.cxx @@ -185,7 +185,7 @@ bool TIADebug::vdelP0(int newVal) if(newVal > -1) mySystem.poke(VDELP0, bool(newVal)); - return (myTIA.valueLastWrittenToRegister(VDELP0) & 0x01) > 0; + return myTIA.lastValueWrittenToRegister(VDELP0) & 0x01; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -194,7 +194,7 @@ bool TIADebug::vdelP1(int newVal) if(newVal > -1) mySystem.poke(VDELP1, bool(newVal)); - return (myTIA.valueLastWrittenToRegister(VDELP1) & 0x01) > 0; + return myTIA.lastValueWrittenToRegister(VDELP1) & 0x01; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -203,7 +203,7 @@ bool TIADebug::vdelBL(int newVal) if(newVal > -1) mySystem.poke(VDELBL, bool(newVal)); - return myTIA.myBall.vdelbl(); + return myTIA.lastValueWrittenToRegister(VDELBL) & 0x01; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -212,7 +212,7 @@ bool TIADebug::enaM0(int newVal) if(newVal > -1) mySystem.poke(ENAM0, bool(newVal) << 1); - return myTIA.myMissile0.enam(); + return myTIA.lastValueWrittenToRegister(ENAM0) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -221,7 +221,7 @@ bool TIADebug::enaM1(int newVal) if(newVal > -1) mySystem.poke(ENAM1, bool(newVal) << 1); - return myTIA.myMissile1.enam(); + return myTIA.lastValueWrittenToRegister(ENAM1) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -230,7 +230,7 @@ bool TIADebug::enaBL(int newVal) if(newVal > -1) mySystem.poke(ENABL, bool(newVal) << 1); - return myTIA.myBall.enabl(); + return myTIA.lastValueWrittenToRegister(ENABL) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -239,7 +239,7 @@ bool TIADebug::resMP0(int newVal) if(newVal > -1) mySystem.poke(RESMP0, bool(newVal) << 1); - return myTIA.myMissile0.resmp(); + return myTIA.lastValueWrittenToRegister(RESMP0) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -248,7 +248,7 @@ bool TIADebug::resMP1(int newVal) if(newVal > -1) mySystem.poke(RESMP1, bool(newVal) << 1); - return myTIA.myMissile1.resmp(); + return myTIA.lastValueWrittenToRegister(RESMP1) & 0x02;; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -257,7 +257,7 @@ bool TIADebug::refP0(int newVal) if(newVal > -1) mySystem.poke(REFP0, bool(newVal) << 3); - return myTIA.myPlayer0.refp(); + return myTIA.lastValueWrittenToRegister(REFP0) & 0x08; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -266,7 +266,7 @@ bool TIADebug::refP1(int newVal) if(newVal > -1) mySystem.poke(REFP1, bool(newVal) << 3); - return myTIA.myPlayer1.refp(); + return myTIA.lastValueWrittenToRegister(REFP1) & 0x08; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -274,7 +274,7 @@ bool TIADebug::refPF(int newVal) { if(newVal > -1) { - int tmp = myTIA.myCtrlPF; + int tmp = myTIA.lastValueWrittenToRegister(CTRLPF); if(newVal) tmp |= 0x01; else @@ -282,7 +282,7 @@ bool TIADebug::refPF(int newVal) mySystem.poke(CTRLPF, tmp); } - return myTIA.myCtrlPF & 0x01; + return myTIA.lastValueWrittenToRegister(CTRLPF) & 0x01; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -290,7 +290,7 @@ bool TIADebug::scorePF(int newVal) { if(newVal > -1) { - int tmp = myTIA.myCtrlPF; + int tmp = myTIA.lastValueWrittenToRegister(CTRLPF); if(newVal) tmp |= 0x02; else @@ -298,7 +298,7 @@ bool TIADebug::scorePF(int newVal) mySystem.poke(CTRLPF, tmp); } - return myTIA.myCtrlPF & 0x02; + return myTIA.lastValueWrittenToRegister(CTRLPF) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -306,7 +306,7 @@ bool TIADebug::priorityPF(int newVal) { if(newVal > -1) { - int tmp = myTIA.myCtrlPF; + int tmp = myTIA.lastValueWrittenToRegister(CTRLPF); if(newVal) tmp |= 0x04; else @@ -314,7 +314,7 @@ bool TIADebug::priorityPF(int newVal) mySystem.poke(CTRLPF, tmp); } - return myTIA.myCtrlPF & 0x04; + return myTIA.lastValueWrittenToRegister(CTRLPF) & 0x04; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -347,7 +347,7 @@ uInt8 TIADebug::audC0(int newVal) if(newVal > -1) mySystem.poke(AUDC0, newVal); - return myTIA.myAUDC0; + return myTIA.lastValueWrittenToRegister(AUDC0) & 0x0f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -356,7 +356,7 @@ uInt8 TIADebug::audC1(int newVal) if(newVal > -1) mySystem.poke(AUDC1, newVal); - return myTIA.myAUDC1; + return myTIA.lastValueWrittenToRegister(AUDC1) & 0x0f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -365,7 +365,7 @@ uInt8 TIADebug::audV0(int newVal) if(newVal > -1) mySystem.poke(AUDV0, newVal); - return myTIA.myAUDV0; + return myTIA.lastValueWrittenToRegister(AUDV0) & 0x0f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -374,7 +374,7 @@ uInt8 TIADebug::audV1(int newVal) if(newVal > -1) mySystem.poke(AUDV1, newVal); - return myTIA.myAUDV1; + return myTIA.lastValueWrittenToRegister(AUDV1) & 0x0f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -383,7 +383,7 @@ uInt8 TIADebug::audF0(int newVal) if(newVal > -1) mySystem.poke(AUDF0, newVal); - return myTIA.myAUDF0; + return myTIA.lastValueWrittenToRegister(AUDF0) & 0x1f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -392,7 +392,7 @@ uInt8 TIADebug::audF1(int newVal) if(newVal > -1) mySystem.poke(AUDF1, newVal); - return myTIA.myAUDF1; + return myTIA.lastValueWrittenToRegister(AUDF1) & 0x1f; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -401,7 +401,7 @@ uInt8 TIADebug::pf0(int newVal) if(newVal > -1) mySystem.poke(PF0, newVal << 4); - return myTIA.myPlayfield.pf0(); + return myTIA.lastValueWrittenToRegister(PF0) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -410,7 +410,7 @@ uInt8 TIADebug::pf1(int newVal) if(newVal > -1) mySystem.poke(PF1, newVal); - return myTIA.myPlayfield.pf1(); + return myTIA.lastValueWrittenToRegister(PF1); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -419,7 +419,7 @@ uInt8 TIADebug::pf2(int newVal) if(newVal > -1) mySystem.poke(PF2, newVal); - return myTIA.myPlayfield.pf2(); + return myTIA.lastValueWrittenToRegister(PF1); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -428,7 +428,7 @@ uInt8 TIADebug::coluP0(int newVal) if(newVal > -1) mySystem.poke(COLUP0, newVal); - return myTIA.myPlayer0.getColor(); + return myTIA.lastValueWrittenToRegister(COLUP0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -437,7 +437,7 @@ uInt8 TIADebug::coluP1(int newVal) if(newVal > -1) mySystem.poke(COLUP1, newVal); - return myTIA.myPlayer1.getColor(); + return myTIA.lastValueWrittenToRegister(COLUP1); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -446,7 +446,7 @@ uInt8 TIADebug::coluPF(int newVal) if(newVal > -1) mySystem.poke(COLUPF, newVal); - return myTIA.myPlayfield.getColor(); + return myTIA.lastValueWrittenToRegister(COLUPF); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -455,95 +455,77 @@ uInt8 TIADebug::coluBK(int newVal) if(newVal > -1) mySystem.poke(COLUBK, newVal); - return myTIA.myBackground.getColor(); + return myTIA.lastValueWrittenToRegister(COLUBK); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusiz0(int newVal) { -#if 0 // FIXME if(newVal > -1) mySystem.poke(NUSIZ0, newVal); - return myTIA.myNUSIZ0; -#endif -return 0; + return myTIA.lastValueWrittenToRegister(NUSIZ0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusiz1(int newVal) { -#if 0 // FIXME if(newVal > -1) mySystem.poke(NUSIZ1, newVal); - return myTIA.myNUSIZ1; -#endif -return 0; + return myTIA.lastValueWrittenToRegister(NUSIZ1); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusizP0(int newVal) { -#if 0 // FIXME if(newVal > -1) { - uInt8 tmp = myTIA.myNUSIZ0 & ~0x07; + uInt8 tmp = myTIA.lastValueWrittenToRegister(NUSIZ0) & ~0x07; tmp |= (newVal & 0x07); mySystem.poke(NUSIZ0, tmp); } - return myTIA.myNUSIZ0 & 0x07; -#endif -return 0; + return myTIA.lastValueWrittenToRegister(NUSIZ0) & 0x07; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusizP1(int newVal) { -#if 0 // FIXME if(newVal > -1) { - uInt8 tmp = myTIA.myNUSIZ1 & ~0x07; + uInt8 tmp = myTIA.lastValueWrittenToRegister(NUSIZ1) & ~0x07; tmp |= newVal & 0x07; mySystem.poke(NUSIZ1, tmp); } - return myTIA.myNUSIZ1 & 0x07; -#endif -return 0; + return myTIA.lastValueWrittenToRegister(NUSIZ1) & 0x07; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusizM0(int newVal) { -#if 0 // FIXME if(newVal > -1) { - uInt8 tmp = myTIA.myNUSIZ0 & ~0x30; + uInt8 tmp = myTIA.lastValueWrittenToRegister(NUSIZ0) & ~0x30; tmp |= (newVal & 0x04) << 4; mySystem.poke(NUSIZ0, tmp); } - return (myTIA.myNUSIZ0 & 0x30) >> 4; -#endif -return 0; + return (myTIA.lastValueWrittenToRegister(NUSIZ0) & 0x30) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::nusizM1(int newVal) { -#if 0 // FIXME if(newVal > -1) { - uInt8 tmp = myTIA.myNUSIZ1 & ~0x30; + uInt8 tmp = myTIA.lastValueWrittenToRegister(NUSIZ1) & ~0x30; tmp |= (newVal & 0x04) << 4; mySystem.poke(NUSIZ1, tmp); } - return (myTIA.myNUSIZ1 & 0x30) >> 4; -#endif -return 0; + return (myTIA.lastValueWrittenToRegister(NUSIZ1) & 0x30) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -552,7 +534,7 @@ uInt8 TIADebug::grP0(int newVal) if(newVal > -1) mySystem.poke(GRP0, newVal); - return myTIA.myPlayer0.grp(); + return myTIA.lastValueWrittenToRegister(GRP0); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -561,7 +543,7 @@ uInt8 TIADebug::grP1(int newVal) if(newVal > -1) mySystem.poke(GRP1, newVal); - return myTIA.myPlayer1.grp(); + return myTIA.lastValueWrittenToRegister(GRP1); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -630,23 +612,20 @@ uInt8 TIADebug::ctrlPF(int newVal) if(newVal > -1) mySystem.poke(CTRLPF, newVal); - return myTIA.myCtrlPF; + return myTIA.lastValueWrittenToRegister(CTRLPF); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt8 TIADebug::sizeBL(int newVal) { -#if 0 // FIXME if(newVal > -1) { - uInt8 tmp = myTIA.myCTRLPF & ~0x30; + uInt8 tmp = myTIA.lastValueWrittenToRegister(CTRLPF) & ~0x30; tmp |= (newVal & 0x04) << 4; mySystem.poke(CTRLPF, tmp); } - return (myTIA.myCTRLPF & 0x30) >> 4; -#endif -return 0; + return (myTIA.lastValueWrittenToRegister(CTRLPF) & 0x30) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -655,7 +634,7 @@ uInt8 TIADebug::hmP0(int newVal) if(newVal > -1) mySystem.poke(HMP0, newVal << 4); - return myTIA.myPlayer0.hmp(); + return myTIA.lastValueWrittenToRegister(HMP0) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -664,7 +643,7 @@ uInt8 TIADebug::hmP1(int newVal) if(newVal > -1) mySystem.poke(HMP1, newVal << 4); - return myTIA.myPlayer1.hmp(); + return myTIA.lastValueWrittenToRegister(HMP1) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -673,7 +652,7 @@ uInt8 TIADebug::hmM0(int newVal) if(newVal > -1) mySystem.poke(HMM0, newVal << 4); - return myTIA.myMissile0.hmm(); + return myTIA.lastValueWrittenToRegister(HMM0) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -682,7 +661,7 @@ uInt8 TIADebug::hmM1(int newVal) if(newVal > -1) mySystem.poke(HMM1, newVal << 4); - return myTIA.myMissile1.hmm(); + return myTIA.lastValueWrittenToRegister(HMM1) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -691,7 +670,7 @@ uInt8 TIADebug::hmBL(int newVal) if(newVal > -1) mySystem.poke(HMBL, newVal << 4); - return myTIA.myBall.hmbl(); + return myTIA.lastValueWrittenToRegister(HMBL) >> 4; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -715,13 +694,13 @@ int TIADebug::clocksThisLine() const // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool TIADebug::vsync() const { - return myTIA.myFrameManager.vsync(); + return myTIA.lastValueWrittenToRegister(VSYNC) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool TIADebug::vblank() const { - return myTIA.myFrameManager.vblank(); + return myTIA.lastValueWrittenToRegister(VBLANK) & 0x02; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -875,15 +854,15 @@ string TIADebug::toString() << endl << " " << booleanWithLabel("m0_m1 ", collM0_M1()) << endl - << "AUDF0: $" << Common::Base::HEX2 << int(myTIA.myAUDF0) - << "/" << audFreq(myTIA.myAUDF0) << " " - << "AUDC0: $" << Common::Base::HEX2 << int(myTIA.myAUDC0) << " " - << "AUDV0: $" << Common::Base::HEX2 << int(myTIA.myAUDV0) + << "AUDF0: $" << Common::Base::HEX2 << int(audF0()) + << "/" << audFreq(audF0()) << " " + << "AUDC0: $" << Common::Base::HEX2 << int(audC0()) << " " + << "AUDV0: $" << Common::Base::HEX2 << int(audV0()) << endl - << "AUDF1: $" << Common::Base::HEX2 << int(myTIA.myAUDF1) - << "/" << audFreq(myTIA.myAUDF1) << " " - << "AUDC1: $" << Common::Base::HEX2 << int(myTIA.myAUDC1) << " " - << "AUDV1: $" << Common::Base::HEX2 << int(myTIA.myAUDV1) + << "AUDF1: $" << Common::Base::HEX2 << int(audF1()) + << "/" << audFreq(audF1()) << " " + << "AUDC1: $" << Common::Base::HEX2 << int(audC1()) << " " + << "AUDV1: $" << Common::Base::HEX2 << int(audV1()) ; // note: last line should not contain \n, caller will add. return buf.str(); diff --git a/src/emucore/tia/Ball.hxx b/src/emucore/tia/Ball.hxx index 3a45e5640..aa0055e5d 100644 --- a/src/emucore/tia/Ball.hxx +++ b/src/emucore/tia/Ball.hxx @@ -32,17 +32,14 @@ class Ball : public Serializable void reset(); void enabl(uInt8 value); - bool enabl() const { return myIsEnabled; } void hmbl(uInt8 value); - uInt8 hmbl() const { return myHmmClocks; } void resbl(uInt8 counter); void ctrlpf(uInt8 value); void vdelbl(uInt8 value); - bool vdelbl() const { return myIsDelaying; } void toggleCollisions(bool enabled); diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index 271d86687..68c76bd25 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -32,15 +32,12 @@ class Missile : public Serializable void reset(); void enam(uInt8 value); - bool enam() const { return myEnam; } void hmm(uInt8 value); - uInt32 hmm() const { return myHmmClocks; } void resm(uInt8 counter, bool hblank); void resmp(uInt8 value, const Player& player); - bool resmp() const { return bool(myResmp); } void nusiz(uInt8 value); diff --git a/src/emucore/tia/Player.hxx b/src/emucore/tia/Player.hxx index 07227478e..59991c8cd 100644 --- a/src/emucore/tia/Player.hxx +++ b/src/emucore/tia/Player.hxx @@ -31,17 +31,14 @@ class Player : public Serializable void reset(); void grp(uInt8 value); - uInt8 grp() const { return myPatternNew; } void hmp(uInt8 value); - uInt8 hmp() const { return myHmmClocks; } void nusiz(uInt8 value, bool hblank); void resp(uInt8 counter); void refp(uInt8 value); - bool refp() const { return myIsReflected; } void vdelp(uInt8 value); @@ -50,7 +47,6 @@ class Player : public Serializable void toggleCollisions(bool enabled); void setColor(uInt8 color); - uInt8 getColor() const { return myObjectColor; } void setDebugColor(uInt8 color); void enableDebugColors(bool enabled); diff --git a/src/emucore/tia/Playfield.hxx b/src/emucore/tia/Playfield.hxx index 81e7cde16..22c71843e 100644 --- a/src/emucore/tia/Playfield.hxx +++ b/src/emucore/tia/Playfield.hxx @@ -31,13 +31,10 @@ class Playfield : public Serializable void reset(); void pf0(uInt8 value); - uInt8 pf0() const { return myPf0; } void pf1(uInt8 value); - uInt8 pf1() const { return myPf1; } void pf2(uInt8 value); - uInt8 pf2() const { return myPf2; } void ctrlpf(uInt8 value); @@ -46,7 +43,6 @@ class Playfield : public Serializable void toggleCollisions(bool enabled); void setColor(uInt8 color); - uInt8 getColor() const { return myObjectColor; } void setColorP0(uInt8 color); diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index b5fc7bbe1..2b36cac00 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -140,9 +140,6 @@ void TIA::reset() myFrameManager.reset(); toggleFixedColors(0); // Turn off debug colours - // FIXME - rework this when we add the new sound core - myAUDV0 = myAUDV1 = myAUDF0 = myAUDF1 = myAUDC0 = myAUDC1 = 0; - frameReset(); // Recalculate the size of the display } @@ -236,7 +233,6 @@ bool TIA::save(Serializer& out) const out.putInt(myLinesSinceChange); out.putInt(int(myPriority)); - out.putByte(myCtrlPF); out.putByte(mySubClock); out.putInt(myLastCycle); @@ -250,12 +246,7 @@ bool TIA::save(Serializer& out) const out.putBool(myAutoFrameEnabled); - out.putByte(myAUDV0); - out.putByte(myAUDV1); - out.putByte(myAUDC0); - out.putByte(myAUDC1); - out.putByte(myAUDF0); - out.putByte(myAUDF1); + out.putByteArray(myShadowRegisters, 64); } catch(...) { @@ -312,7 +303,6 @@ bool TIA::load(Serializer& in) myLinesSinceChange = in.getInt(); myPriority = Priority(in.getInt()); - myCtrlPF = in.getByte(); mySubClock = in.getByte(); myLastCycle = in.getInt(); @@ -326,12 +316,7 @@ bool TIA::load(Serializer& in) myAutoFrameEnabled = in.getBool(); - myAUDV0 = in.getByte(); - myAUDV1 = in.getByte(); - myAUDC0 = in.getByte(); - myAUDC1 = in.getByte(); - myAUDF0 = in.getByte(); - myAUDF1 = in.getByte(); + in.getByteArray(myShadowRegisters, 64); } catch(...) { @@ -473,27 +458,21 @@ bool TIA::poke(uInt16 address, uInt8 value) //////////////////////////////////////////////////////////// // FIXME - rework this when we add the new sound core case AUDV0: - myAUDV0 = value & 0x0f; mySound.set(address, value, mySystem->cycles()); break; case AUDV1: - myAUDV1 = value & 0x0f; mySound.set(address, value, mySystem->cycles()); break; case AUDF0: - myAUDF0 = value & 0x1f; mySound.set(address, value, mySystem->cycles()); break; case AUDF1: - myAUDF1 = value & 0x1f; mySound.set(address, value, mySystem->cycles()); break; case AUDC0: - myAUDC0 = value & 0x0f; mySound.set(address, value, mySystem->cycles()); break; case AUDC1: - myAUDC1 = value & 0x0f; mySound.set(address, value, mySystem->cycles()); break; //////////////////////////////////////////////////////////// @@ -529,7 +508,6 @@ bool TIA::poke(uInt16 address, uInt8 value) (value & 0x02) ? Priority::score : Priority::normal; myPlayfield.ctrlpf(value); myBall.ctrlpf(value); - myCtrlPF = value; break; case COLUPF: @@ -927,7 +905,7 @@ void TIA::updateScanlineByTrace(int target) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -uInt8 TIA::valueLastWrittenToRegister(uInt8 reg) const +uInt8 TIA::lastValueWrittenToRegister(uInt8 reg) const { return reg < 64 ? myShadowRegisters[reg] : 0; } diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index 4a3ea8363..a48b5bb86 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -309,7 +309,7 @@ class TIA : public Device void updateScanlineByTrace(int target); // Retrieve the last value written to a certain register - uInt8 valueLastWrittenToRegister(uInt8 reg) const; + uInt8 lastValueWrittenToRegister(uInt8 reg) const; /** Save the current state of this device to the given Serializer. @@ -450,7 +450,6 @@ class TIA : public Device uInt32 myLinesSinceChange; Priority myPriority; - uInt8 myCtrlPF; // needed for the debugger uInt8 mySubClock; Int32 myLastCycle; @@ -467,11 +466,6 @@ class TIA : public Device // Automatic framerate correction based on number of scanlines bool myAutoFrameEnabled; - ////////////////////////////////////////////////////////////// - // Audio values; only used by TIADebug - // FIXME - remove this when the new sound core is implemented - uInt8 myAUDV0, myAUDV1, myAUDC0, myAUDC1, myAUDF0, myAUDF1; - private: TIA() = delete; TIA(const TIA&) = delete;