diff --git a/src/emucore/tia/Ball.cxx b/src/emucore/tia/Ball.cxx index f259945cd..7cd37d694 100644 --- a/src/emucore/tia/Ball.cxx +++ b/src/emucore/tia/Ball.cxx @@ -69,9 +69,9 @@ void Ball::hmbl(uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Ball::resbl(bool hblank) +void Ball::resbl(bool hblank, bool extendedHblank) { - myCounter = hblank ? 159 : 157; + myCounter = hblank ? (extendedHblank ? 158 : 159) : 157; myIsRendering = true; myRenderCounter = Count::renderCounterOffset; diff --git a/src/emucore/tia/Ball.hxx b/src/emucore/tia/Ball.hxx index 0792ed14d..7f9468445 100644 --- a/src/emucore/tia/Ball.hxx +++ b/src/emucore/tia/Ball.hxx @@ -39,7 +39,7 @@ class Ball : public Serializable void hmbl(uInt8 value); uInt8 hmbl() const { return myHmmClocks; } - void resbl(bool hblank); + void resbl(bool hblank, bool extendedHblank); void ctrlpf(uInt8 value); diff --git a/src/emucore/tia/Missile.cxx b/src/emucore/tia/Missile.cxx index 635b2e6d2..4c7cff39a 100644 --- a/src/emucore/tia/Missile.cxx +++ b/src/emucore/tia/Missile.cxx @@ -69,9 +69,9 @@ void Missile::hmm(uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Missile::resm(bool hblank) +void Missile::resm(bool hblank, bool extendedHblank) { - myCounter = hblank ? 159 : 157; + myCounter = hblank ? (extendedHblank ? 158 : 159) : 157; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/Missile.hxx b/src/emucore/tia/Missile.hxx index 0fe195c69..c8ea58c0d 100644 --- a/src/emucore/tia/Missile.hxx +++ b/src/emucore/tia/Missile.hxx @@ -39,7 +39,7 @@ class Missile : public Serializable void hmm(uInt8 value); uInt32 hmm() const { return myHmmClocks; } - void resm(bool hblank); + void resm(bool hblank, bool extendHblank); void resmp(uInt8 value, const Player& player); bool resmp() const { return bool(myResmp); } diff --git a/src/emucore/tia/Player.cxx b/src/emucore/tia/Player.cxx index f7fb179f1..1ec5150de 100644 --- a/src/emucore/tia/Player.cxx +++ b/src/emucore/tia/Player.cxx @@ -91,9 +91,9 @@ void Player::nusiz(uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Player::resp(bool hblank) +void Player::resp(bool hblank, bool extendedHblank) { - myCounter = hblank ? 159 : 157; + myCounter = hblank ? (extendedHblank ? 158 : 159) : 157; if (myIsRendering && myRenderCounter < -1) myRenderCounter = Count::renderCounterOffset; diff --git a/src/emucore/tia/Player.hxx b/src/emucore/tia/Player.hxx index 3b4f17a35..2883d6ba7 100644 --- a/src/emucore/tia/Player.hxx +++ b/src/emucore/tia/Player.hxx @@ -40,7 +40,7 @@ class Player : public Serializable void nusiz(uInt8 value); - void resp(bool hblank); + void resp(bool hblank, bool extendedHblank); void refp(uInt8 value); bool refp() const { return myIsReflected; } diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 279072115..5aeb6dc5c 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -442,12 +442,12 @@ bool TIA::poke(uInt16 address, uInt8 value) case RESM0: myLinesSinceChange = 0; - myMissile0.resm(myHstate == HState::blank); + myMissile0.resm(myHstate == HState::blank, myExtendedHblank); break; case RESM1: myLinesSinceChange = 0; - myMissile1.resm(myHstate == HState::blank); + myMissile1.resm(myHstate == HState::blank, myExtendedHblank); break; case RESMP0: @@ -512,12 +512,12 @@ bool TIA::poke(uInt16 address, uInt8 value) case RESP0: myLinesSinceChange = 0; - myPlayer0.resp(myHstate == HState::blank); + myPlayer0.resp(myHstate == HState::blank, myExtendedHblank); break; case RESP1: myLinesSinceChange = 0; - myPlayer1.resp(myHstate == HState::blank); + myPlayer1.resp(myHstate == HState::blank, myExtendedHblank); break; case REFP0: @@ -553,7 +553,7 @@ bool TIA::poke(uInt16 address, uInt8 value) case RESBL: myLinesSinceChange = 0; - myBall.resbl(myHstate == HState::blank); + myBall.resbl(myHstate == HState::blank, myExtendedHblank); break; case VDELBL: