From 48d90768f382ea72ae05be10206eab770ffb92a8 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Fri, 16 Dec 2016 23:40:26 +0100 Subject: [PATCH] Fix wide player dispatch after resp -> fixes missile command. --- src/emucore/tia/DrawCounterDecodes.cxx | 7 ++----- src/emucore/tia/DrawCounterDecodes.hxx | 2 +- src/emucore/tia/Player.cxx | 11 +++++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/emucore/tia/DrawCounterDecodes.cxx b/src/emucore/tia/DrawCounterDecodes.cxx index 45effa54a..9a09d5b1d 100644 --- a/src/emucore/tia/DrawCounterDecodes.cxx +++ b/src/emucore/tia/DrawCounterDecodes.cxx @@ -49,9 +49,6 @@ DrawCounterDecodes::DrawCounterDecodes() decodes[156] = 1; } - memset(myDecodesWide, 0, 160); - myDecodesWide[157] = 1; - myDecodes1[12] = 1; myDecodes2[28] = 1; myDecodes3[12] = myDecodes3[28] = 1; @@ -63,9 +60,9 @@ DrawCounterDecodes::DrawCounterDecodes() myPlayerDecodes[2] = myDecodes2; myPlayerDecodes[3] = myDecodes3; myPlayerDecodes[4] = myDecodes4; - myPlayerDecodes[5] = myDecodesWide; + myPlayerDecodes[5] = myDecodes0; myPlayerDecodes[6] = myDecodes6; - myPlayerDecodes[7] = myDecodesWide; + myPlayerDecodes[7] = myDecodes0; myMissileDecodes[0] = myDecodes0; myMissileDecodes[1] = myDecodes1; diff --git a/src/emucore/tia/DrawCounterDecodes.hxx b/src/emucore/tia/DrawCounterDecodes.hxx index 550349924..89d2f3a52 100644 --- a/src/emucore/tia/DrawCounterDecodes.hxx +++ b/src/emucore/tia/DrawCounterDecodes.hxx @@ -43,7 +43,7 @@ class DrawCounterDecodes uInt8* myMissileDecodes[8]; uInt8 myDecodes0[160], myDecodes1[160], myDecodes2[160], myDecodes3[160], - myDecodes4[160], myDecodes6[160], myDecodesWide[160]; + myDecodes4[160], myDecodes6[160]; static DrawCounterDecodes myInstance; diff --git a/src/emucore/tia/Player.cxx b/src/emucore/tia/Player.cxx index d58753d00..e0073ee8e 100644 --- a/src/emucore/tia/Player.cxx +++ b/src/emucore/tia/Player.cxx @@ -21,7 +21,8 @@ #include "DrawCounterDecodes.hxx" enum Count: Int8 { - renderCounterOffset = -5 + renderCounterOffset = -5, + renderCounterOffsetWide = -6 }; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -95,8 +96,10 @@ void Player::resp(bool hblank, bool extendedHblank) { myCounter = hblank ? (extendedHblank ? 158 : 159) : 157; - if (myIsRendering && myRenderCounter < -1) - myRenderCounter = Count::renderCounterOffset; + const Int8 renderCounterOffset = myWidth > 8 ? Count::renderCounterOffsetWide : Count::renderCounterOffset; + + if (myIsRendering && (myRenderCounter - renderCounterOffset) < 4) + myRenderCounter = renderCounterOffset; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -189,7 +192,7 @@ void Player::tick() { if (myDecodes[myCounter]) { myIsRendering = true; - myRenderCounter = Count::renderCounterOffset; + myRenderCounter = myWidth > 8 ? Count::renderCounterOffset : Count::renderCounterOffset; } else if (myIsRendering && ++myRenderCounter >= myWidth) { myIsRendering = false; }