Skip to content

Commit

Permalink
Gobble movement pulse on clock 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyHairy committed Aug 13, 2024
1 parent 7faa9c7 commit 7be8c8f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/emucore/tia/Ball.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/emucore/tia/Missile.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/emucore/tia/Player.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/emucore/tia/TIA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit 7be8c8f

Please sign in to comment.