RESMx simplification and improvements.

This commit is contained in:
Christian Speckner 2017-01-25 00:11:33 +01:00
parent 72b8f6491e
commit 990fac5895
1 changed files with 6 additions and 9 deletions

View File

@ -76,11 +76,12 @@ void Missile::resm(uInt8 counter)
myRenderCounter = Count::renderCounterOffset + (counter - 157); myRenderCounter = Count::renderCounterOffset + (counter - 157);
} 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 :)
switch (myWidth) { switch (myWidth) {
case 8: case 8:
myRenderCounter = (counter != 157 && myRenderCounter >= 4) ? 7 : (counter - 157); myRenderCounter = (counter - 157) + ((myRenderCounter >= 4) ? 5 : 0);
break; break;
case 4: case 4:
@ -88,18 +89,14 @@ void Missile::resm(uInt8 counter)
break; break;
case 2: case 2:
if (counter != 157) { if (counter != 157) myIsRendering = myRenderCounter > 1;
if (myRenderCounter == 1 || myRenderCounter == 0) myIsRendering = false; else if (myRenderCounter == 0) myRenderCounter++;
} else {
if (myRenderCounter == 0) myRenderCounter++;
}
break; break;
default: default:
if (counter != 157) { if (counter != 157) myIsRendering = myRenderCounter > 0;
if (myRenderCounter == 0) myIsRendering = false;
}
break; break;
} }
} }