diff --git a/src/emucore/tia/Ball.hxx b/src/emucore/tia/Ball.hxx index 74c44b7f1..5bfe8bb9c 100644 --- a/src/emucore/tia/Ball.hxx +++ b/src/emucore/tia/Ball.hxx @@ -167,7 +167,7 @@ class Ball : public Serializable /** Process a single movement tick. Inline for performance (implementation below). */ - FORCE_INLINE void movementTick(uInt32 clock, bool hblank); + FORCE_INLINE void movementTick(uInt32 clock, uInt32 hclock, bool hblank); /** Tick one color clock. Inline for performance (implementation below). @@ -341,7 +341,7 @@ class Ball : public Serializable // ############################################################################ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Ball::movementTick(uInt32 clock, bool hblank) +void Ball::movementTick(uInt32 clock, uInt32 hclock, bool hblank) { myLastMovementTick = myCounter; @@ -350,7 +350,7 @@ void Ball::movementTick(uInt32 clock, bool hblank) // Stop movement once the number of clocks according to HMBL is reached if (clock == myHmmClocks) isMoving = false; - else + else if (hclock != 0) { // Process the tick if we are in hblank. Otherwise, the tick is either masked // by an ordinary tick or merges two consecutive ticks into a single tick (inverted diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index 995a18650..aa54055a1 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -149,7 +149,7 @@ void Missile::movementTick(uInt8 clock, uInt8 hclock, bool hblank) // Stop movement once the number of clocks according to HMMx is reached if(clock == myHmmClocks) isMoving = false; - else + else if (hclock != 0) { // Process the tick if we are in hblank. Otherwise, the tick is either masked // by an ordinary tick or merges two consecutive ticks into a single tick (inverted diff --git a/src/emucore/tia/Player.hxx b/src/emucore/tia/Player.hxx index 222e2a7d5..289d22c1d 100644 --- a/src/emucore/tia/Player.hxx +++ b/src/emucore/tia/Player.hxx @@ -88,7 +88,7 @@ class Player : public Serializable bool save(Serializer& out) const override; bool load(Serializer& in) override; - FORCE_INLINE void movementTick(uInt32 clock, bool hblank); + FORCE_INLINE void movementTick(uInt32 clock, uInt32 hclock, bool hblank); FORCE_INLINE void tick(); @@ -158,14 +158,14 @@ class Player : public Serializable // ############################################################################ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Player::movementTick(uInt32 clock, bool hblank) +void Player::movementTick(uInt32 clock, uInt32 hclock, bool hblank) { if(isMoving) { // Stop movement once the number of clocks according to HMPx is reached if (clock == myHmmClocks) isMoving = false; - else + else if (hclock != 0) { // Process the tick if we are in hblank. Otherwise, the tick is either masked // by an ordinary tick or merges two consecutive ticks into a single tick (inverted diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index a7bb57f5d..658f53e69 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -1558,9 +1558,9 @@ FORCE_INLINE void TIA::tickMovement() myMissile0.movementTick(movementCounter, myHctr, hblank); myMissile1.movementTick(movementCounter, myHctr, hblank); - myPlayer0.movementTick(movementCounter, hblank); - myPlayer1.movementTick(movementCounter, hblank); - myBall.movementTick(movementCounter, hblank); + myPlayer0.movementTick(movementCounter, myHctr, hblank); + myPlayer1.movementTick(movementCounter, myHctr, hblank); + myBall.movementTick(movementCounter, myHctr, hblank); myMovementInProgress = myMissile0.isMoving ||