From 654abce59d97c3d81e8b493665f72cb5aab5e03b Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sun, 21 Apr 2019 00:05:16 +0930 Subject: [PATCH] make sure screen Y is not too large when normalising --- c64/kernal/chrout.s | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout.s index ff09cdd2..499fd20b 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout.s @@ -241,7 +241,19 @@ x_not_too_big: bpl + lda #0 sta current_screen_y -* +* + ;; Make sure Y isn't too large for absolute size of + ;; screen + cmp #24 + bcc + + lda #24 + sta current_screen_y +* + + ;; Make sure Y isn't too much for the screen, taking + ;; into account + + lda current_screen_x sta $0403 lda current_screen_y