From 8c7ce1ec3fcfa3c3938c089063d551810672ebcd Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 18 May 2016 21:41:25 -0400 Subject: [PATCH] Attempted to fix sprite sizing and, again, missile repetition. --- Machines/Atari2600/Atari2600.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Machines/Atari2600/Atari2600.cpp b/Machines/Atari2600/Atari2600.cpp index 63686e915..67c6d2c12 100644 --- a/Machines/Atari2600/Atari2600.cpp +++ b/Machines/Atari2600/Atari2600.cpp @@ -115,7 +115,7 @@ void Machine::update_upcoming_events() { // otherwise visibility is determined by an appropriate repeat mask and hitting any of 12, 28 or 60, // in which case the counter reset (and hence the start of drawing) will occur in 4/5 cycles - uint8_t repeatMask = _playerAndMissileSize[c&3] & 7; + uint8_t repeatMask = _playerAndMissileSize[c&1] & 7; if( ( _objectCounter[c] == 12 && ((repeatMask == 1) || (repeatMask == 3)) ) || ( _objectCounter[c] == 28 && ((repeatMask == 2) || (repeatMask == 3) || (repeatMask == 6)) ) || @@ -154,29 +154,29 @@ uint8_t Machine::get_output_pixel() if(_playerGraphics[c]) { // figure out player colour int flipMask = (_playerReflection[c]&0x8) ? 0 : 7; - if(_pixelCounter[c] < 8) - playerPixels[c] = (_playerGraphics[c] >> (_pixelCounter[c] ^ flipMask)) &1; + if(_pixelCounter[c] < 32) + playerPixels[c] = (_playerGraphics[c] >> ((_pixelCounter[c] >> 2) ^ flipMask)) &1; } if((_missileGraphicsEnable[c]&2) && !(_missileGraphicsReset[c]&2)) { int missileSize = 1 << ((_playerAndMissileSize[c] >> 4)&3); - missilePixels[c] = (_pixelCounter[c+2] < missileSize) ? 1 : 0; + missilePixels[c] = ((_pixelCounter[c+2] >> 2) < missileSize) ? 1 : 0; } uint8_t repeatMask = _playerAndMissileSize[c] & 7; switch(repeatMask) { default: - _pixelCounter[c]++; - _pixelCounter[c+2]++; + _pixelCounter[c]+=4; + _pixelCounter[c+2]+=4; break; case 5: - _pixelCounter[c] += ((_objectCounter[c] >> 1)&1); - _pixelCounter[c+2] += ((_objectCounter[c+2] >> 1)&1); + _pixelCounter[c] += 2; + _pixelCounter[c+2] += 2; break; case 7: - _pixelCounter[c] += ((_objectCounter[c] >> 2)&1); - _pixelCounter[c+2] += ((_objectCounter[c+2] >> 2)&1); + _pixelCounter[c] += 1; + _pixelCounter[c+2] += 1; break; } }