From 5d0c33d5456ccf8ac790b816a977a99711cedd89 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 12 Dec 2017 22:19:33 -0500 Subject: [PATCH] Corrects occasional TMS sprite glitching. --- Components/9918/9918.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Components/9918/9918.cpp b/Components/9918/9918.cpp index bfe4a46e5..497881095 100644 --- a/Components/9918/9918.cpp +++ b/Components/9918/9918.cpp @@ -204,14 +204,15 @@ void TMS9918::run_for(const HalfCycles cycles) { } // Four more access windows: no collection. - if(access_pointer_ >= 15 && access_pointer_ < 19) + if(access_pointer_ >= 15 && access_pointer_ < 19) { access_pointer_ = std::min(19, access_slot); - // Start new sprite set if this is location 19. - if(access_pointer_ == 19) { - active_sprite_set_ ^= 1; - sprite_sets_[active_sprite_set_].active_sprite_slot = 0; - sprites_stopped_ = false; + // Start new sprite set if this is location 19. + if(access_pointer_ == 19) { + active_sprite_set_ ^= 1; + sprite_sets_[active_sprite_set_].active_sprite_slot = 0; + sprites_stopped_ = false; + } } // Then eight access windows fetch the y position for the first eight sprites.