Fix wide player dispatch after resp -> fixes missile command.

This commit is contained in:
Christian Speckner 2016-12-16 23:40:26 +01:00
parent a982a334a8
commit 48d90768f3
3 changed files with 10 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;
}