1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-11 08:30:55 +00:00

Minor thing: skip the internal counter stuff if we're definitely going to end up with a transparent pixel anyway for the player and missile graphics.

This commit is contained in:
Thomas Harte 2015-08-16 11:23:46 -04:00
parent 4b5aabdd54
commit afaa86a649

View File

@ -64,8 +64,10 @@ void Machine::get_output_pixel(uint8_t *pixel, int offset)
uint8_t playfieldColour = ((_playfieldControl&6) == 2) ? _playerColour[offset / 80] : _playfieldColour;
// get player and missile proposed pixels
uint8_t playerPixels[2], missilePixels[2];
uint8_t playerPixels[2] = {0, 0}, missilePixels[2] = {0, 0};
for(int c = 0; c < 2; c++)
{
if(_playerGraphics[c])
{
// figure out player colour
int flipMask = (_playerReflection[c]&0x8) ? 0 : 7;
@ -101,13 +103,15 @@ void Machine::get_output_pixel(uint8_t *pixel, int offset)
if(relativeTimer >= 0 && relativeTimer < 8)
playerPixels[c] = (_playerGraphics[c] >> (relativeTimer ^ flipMask)) &1;
else
playerPixels[c] = 0;
}
// figure out missile colour
if((_missileGraphicsEnable[c]&2) && !(_missileGraphicsReset[c]&2))
{
int missileIndex = _objectCounter[2+c] - 4;
int missileSize = 1 << ((_playerAndMissileSize[c] >> 4)&3);
missilePixels[c] = (missileIndex >= 0 && missileIndex < missileSize && (_missileGraphicsEnable[c]&2) && !(_missileGraphicsReset[c]&2)) ? 1 : 0;
missilePixels[c] = (missileIndex >= 0 && missileIndex < missileSize) ? 1 : 0;
}
}
// get the ball proposed colour