This commit is contained in:
Christian Speckner 2017-01-27 01:12:34 +01:00
parent 94292bbbd1
commit f1d503a0ef
3 changed files with 6 additions and 14 deletions

View File

@ -67,7 +67,7 @@ void Missile::hmm(uInt8 value)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Missile::resm(uInt8 counter, uInt32 hctr) void Missile::resm(uInt8 counter, bool hblank)
{ {
myCounter = counter; myCounter = counter;
@ -78,22 +78,14 @@ void Missile::resm(uInt8 counter, uInt32 hctr)
} else { } else {
// The following is an effective description of the behavior of missile width after a // The following is an effective description of the behavior of missile width after a
// RESMx during draw. It would be much simpler without the HBLANK cases :) // RESMx during draw. It would be much simpler without the HBLANK cases :)
uInt8 delta = 0;
bool hblank = counter != 157;
if (hblank) {
if (hctr > 72) delta = 0;
else if (hctr > 66) delta = 1;
else delta = 2;
}
switch (myWidth) { switch (myWidth) {
case 8: case 8:
myRenderCounter = delta + ((myRenderCounter >= 4) ? 5 : 0); myRenderCounter = (counter - 157) + ((myRenderCounter >= 4) ? 4 : 0);
break; break;
case 4: case 4:
myRenderCounter = delta; myRenderCounter = (counter - 157);
break; break;
case 2: case 2:

View File

@ -37,7 +37,7 @@ class Missile : public Serializable
void hmm(uInt8 value); void hmm(uInt8 value);
uInt32 hmm() const { return myHmmClocks; } uInt32 hmm() const { return myHmmClocks; }
void resm(uInt8 counter, uInt32 hctr); void resm(uInt8 counter, bool hblank);
void resmp(uInt8 value, const Player& player); void resmp(uInt8 value, const Player& player);
bool resmp() const { return bool(myResmp); } bool resmp() const { return bool(myResmp); }

View File

@ -459,12 +459,12 @@ bool TIA::poke(uInt16 address, uInt8 value)
case RESM0: case RESM0:
myLinesSinceChange = 0; myLinesSinceChange = 0;
myMissile0.resm(resxCounter(), myHctr); myMissile0.resm(resxCounter(), myHstate == HState::blank);
break; break;
case RESM1: case RESM1:
myLinesSinceChange = 0; myLinesSinceChange = 0;
myMissile1.resm(resxCounter(), myHctr); myMissile1.resm(resxCounter(), myHstate == HState::blank);
break; break;
case RESMP0: case RESMP0: