From 39bfbf1000713dedf852b14e5725f9b44777bfc9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 30 Jul 2015 23:01:28 -0400 Subject: [PATCH] Attempted ball graphics enable delay. --- Machines/Atari2600.cpp | 14 +++++++++----- Machines/Atari2600.hpp | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Machines/Atari2600.cpp b/Machines/Atari2600.cpp index bb569f6d5..b2ef85991 100644 --- a/Machines/Atari2600.cpp +++ b/Machines/Atari2600.cpp @@ -254,18 +254,22 @@ int Machine::perform_bus_operation(CPU6502::BusOperation operation, uint16_t add case 0x13: _missilePosition[1] = _horizontalTimer; break; case 0x14: _ballPosition = _horizontalTimer; break; - case 0x1b: - case 0x1c: { + case 0x1c: + _ballGraphicsEnable = _ballGraphicsEnableLatch; + case 0x1b: { int index = (address & 0x3f) - 0x1b; _playerGraphicsLatch[index] = *value; if(!(_playerGraphicsLatchEnable[index]&1)) _playerGraphics[index] = _playerGraphicsLatch[index]; - if(_playerGraphicsLatchEnable[index^1]&1) - _playerGraphics[index^1] = _playerGraphicsLatch[index^1]; + _playerGraphics[index^1] = _playerGraphicsLatch[index^1]; } break; case 0x1d: _missileGraphicsEnable[0] = *value; break; case 0x1e: _missileGraphicsEnable[1] = *value; break; - case 0x1f: _ballGraphicsEnable = *value; break; + case 0x1f: + _ballGraphicsEnableLatch = *value; + if(!(_ballGraphicsEnableDelay&1)) + _ballGraphicsEnable = _ballGraphicsEnableLatch; + break; case 0x20: _playerMotion[0] = *value; break; case 0x21: _playerMotion[1] = *value; break; diff --git a/Machines/Atari2600.hpp b/Machines/Atari2600.hpp index d6e162d83..4ce9d847e 100644 --- a/Machines/Atari2600.hpp +++ b/Machines/Atari2600.hpp @@ -61,7 +61,7 @@ class Machine: public CPU6502::Processor { uint8_t _missileMotion[2]; // ball registers - uint8_t _ballGraphicsEnable; + uint8_t _ballGraphicsEnable, _ballGraphicsEnableLatch; uint8_t _ballPosition; uint8_t _ballMotion; uint8_t _ballGraphicsEnableDelay;