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