small cleanup in screen code

This commit is contained in:
FeralChild64 committed 2019-12-17 18:46:52 +01:00
1 parent db2d887234
commit d5d3a1c3b2
2 files changed
+13 -10

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
screen_add_40_to_PNTR:
lda PNTR
clc
adc #40
sta PNTR
rts
+3 -10
View File
@@ -14,13 +14,13 @@ screen_normalize_xy:
lda #0 lda #0
sta TBLX sta TBLX
!: jsr add_40_to_screen_x !: jsr screen_add_40_to_PNTR
// Check if line is linked, if so, add 40 again // Check if line is linked, if so, add 40 again
ldy TBLX ldy TBLX
lda LDTBL,y lda LDTBL,y
bpl !+ bpl !+
jsr add_40_to_screen_x jsr screen_add_40_to_PNTR
!: !:
x_not_negative: x_not_negative:
@@ -29,7 +29,7 @@ x_not_negative:
lda LDTBL,y lda LDTBL,y
bpl !+ bpl !+
lda #79 lda #79
.byte $2C // BIT $nnnn, used to skip next instruction skip_2_bytes_trash_nvz
!: lda #39 !: lda #39
cmp PNTR cmp PNTR
bcs x_not_too_big bcs x_not_too_big
@@ -73,10 +73,3 @@ link_count_loop:
sta TBLX sta TBLX
y_ok: y_ok:
rts rts
add_40_to_screen_x:
lda PNTR
clc
adc #40
sta PNTR
rts