Tiles are updating
This commit is contained in:
28
plat.s
28
plat.s
@@ -415,7 +415,9 @@ frame_counter: .res 1
|
||||
last_frame_jumped: .res 1
|
||||
last_frame_moving: .res 1
|
||||
|
||||
column_pattern: .res 1
|
||||
tile_update_pos_r: .res 1
|
||||
tile_update_pos_l: .res 1
|
||||
|
||||
pointer: .res 2
|
||||
|
||||
@@ -1474,13 +1476,19 @@ check_column_update:
|
||||
|
||||
cmp tile_update_pos_r
|
||||
bne :+
|
||||
; Load column pattern
|
||||
lda tile_update_pos_r
|
||||
sta column_pattern
|
||||
|
||||
; Apply pattern
|
||||
jsr update_nmt_column
|
||||
|
||||
; Increment tile_update_pos_r
|
||||
lda tile_update_pos_r
|
||||
clc
|
||||
adc #1
|
||||
and #%00011111
|
||||
sta tile_update_pos_r
|
||||
|
||||
:
|
||||
|
||||
rts
|
||||
@@ -1492,7 +1500,7 @@ update_nmt_column:
|
||||
lda tile_update_pos_r
|
||||
clc
|
||||
; Add offset in tiles from left edge of screen
|
||||
adc #8
|
||||
adc #16
|
||||
sta var_n
|
||||
|
||||
; Nametable base
|
||||
@@ -1532,15 +1540,23 @@ update_nmt_column:
|
||||
clc
|
||||
adc var_p
|
||||
tay
|
||||
|
||||
|
||||
; Specifies what tile gets written to the column
|
||||
lda #%10110001
|
||||
sty var_m
|
||||
lda column_pattern
|
||||
rol
|
||||
stx var_m
|
||||
:
|
||||
lsr
|
||||
ror
|
||||
dec var_m
|
||||
bne :-
|
||||
dec var_m
|
||||
bpl :-
|
||||
|
||||
and #%00000001
|
||||
cmp #0
|
||||
beq :+
|
||||
ora #%10000000
|
||||
:
|
||||
sta (pointer), Y
|
||||
|
||||
and #%01111111
|
||||
|
||||
Reference in New Issue
Block a user