From 9bc09046c0a15012c042ccb20ab742ef97ed4358 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 18 Oct 2018 21:48:57 -0400 Subject: [PATCH] Attempts to ensure that sprites can go off the top of the screen. --- Components/9918/9918.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Components/9918/9918.cpp b/Components/9918/9918.cpp index 554d39416..e4ae897a5 100644 --- a/Components/9918/9918.cpp +++ b/Components/9918/9918.cpp @@ -124,7 +124,7 @@ void Base::posit_sprite(LineBuffer &buffer, int sprite_number, int sprite_positi return; } - const int sprite_row = ((screen_row + 1) % mode_timing_.total_lines) - ((sprite_position + 1) & 255); + const int sprite_row = (((screen_row + 1) % mode_timing_.total_lines) - ((sprite_position + 1) & 255)) & 255; if(sprite_row < 0 || sprite_row >= sprite_height_) return; if(buffer.active_sprite_slot == mode_timing_.maximum_visible_sprites) {