From b7621f9c7d2bd015a67a5d847338a0c9df3ca75f Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sun, 21 Apr 2019 00:07:01 +0930 Subject: [PATCH] factor out screen coordinate normalisation function --- c64/kernal/chrout.s | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout.s index 499fd20b..24af4147 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout.s @@ -189,8 +189,8 @@ add_40_to_screen_x: adc #40 sta current_screen_x rts - -calculate_screen_line_pointer: + +normalise_screen_x_y: ;; Normalise X and Y values lda current_screen_x @@ -249,7 +249,6 @@ x_not_too_big: lda #24 sta current_screen_y * - ;; Make sure Y isn't too much for the screen, taking ;; into account @@ -258,7 +257,10 @@ x_not_too_big: sta $0403 lda current_screen_y sta $0404 + rts +calculate_screen_line_pointer: + jsr normalise_screen_x_y ;; Reset pointer to start of screen lda HIBASE