factor out screen coordinate normalisation function

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-21 00:07:01 +09:30
1 parent 654abce59d
commit b7621f9c7d
1 file changed
+4 -2
+4 -2
View File
@@ -190,7 +190,7 @@ add_40_to_screen_x:
sta current_screen_x sta current_screen_x
rts rts
calculate_screen_line_pointer: normalise_screen_x_y:
;; Normalise X and Y values ;; Normalise X and Y values
lda current_screen_x lda current_screen_x
@@ -249,7 +249,6 @@ x_not_too_big:
lda #24 lda #24
sta current_screen_y sta current_screen_y
* *
;; Make sure Y isn't too much for the screen, taking ;; Make sure Y isn't too much for the screen, taking
;; into account ;; into account
@@ -258,7 +257,10 @@ x_not_too_big:
sta $0403 sta $0403
lda current_screen_y lda current_screen_y
sta $0404 sta $0404
rts
calculate_screen_line_pointer:
jsr normalise_screen_x_y
;; Reset pointer to start of screen ;; Reset pointer to start of screen
lda HIBASE lda HIBASE