From f1d503a0efd0753404b26a267b62ddbb8ee4bd4c Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Fri, 27 Jan 2017 01:12:34 +0100 Subject: [PATCH] Cleanup. --- src/emucore/tia/Missile.cxx | 14 +++----------- src/emucore/tia/Missile.hxx | 2 +- src/emucore/tia/TIA.cxx | 4 ++-- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/emucore/tia/Missile.cxx b/src/emucore/tia/Missile.cxx index 000b7dcfe..9cd798d49 100644 --- a/src/emucore/tia/Missile.cxx +++ b/src/emucore/tia/Missile.cxx @@ -67,7 +67,7 @@ void Missile::hmm(uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Missile::resm(uInt8 counter, uInt32 hctr) +void Missile::resm(uInt8 counter, bool hblank) { myCounter = counter; @@ -78,22 +78,14 @@ void Missile::resm(uInt8 counter, uInt32 hctr) } else { // The following is an effective description of the behavior of missile width after a // RESMx during draw. It would be much simpler without the HBLANK cases :) - uInt8 delta = 0; - bool hblank = counter != 157; - - if (hblank) { - if (hctr > 72) delta = 0; - else if (hctr > 66) delta = 1; - else delta = 2; - } switch (myWidth) { case 8: - myRenderCounter = delta + ((myRenderCounter >= 4) ? 5 : 0); + myRenderCounter = (counter - 157) + ((myRenderCounter >= 4) ? 4 : 0); break; case 4: - myRenderCounter = delta; + myRenderCounter = (counter - 157); break; case 2: diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index cd9acde6e..5634995f0 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -37,7 +37,7 @@ class Missile : public Serializable void hmm(uInt8 value); uInt32 hmm() const { return myHmmClocks; } - void resm(uInt8 counter, uInt32 hctr); + void resm(uInt8 counter, bool hblank); void resmp(uInt8 value, const Player& player); bool resmp() const { return bool(myResmp); } diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 2e9bc0fbc..f6f96ca33 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -459,12 +459,12 @@ bool TIA::poke(uInt16 address, uInt8 value) case RESM0: myLinesSinceChange = 0; - myMissile0.resm(resxCounter(), myHctr); + myMissile0.resm(resxCounter(), myHstate == HState::blank); break; case RESM1: myLinesSinceChange = 0; - myMissile1.resm(resxCounter(), myHctr); + myMissile1.resm(resxCounter(), myHstate == HState::blank); break; case RESMP0: