dos33fsprogs/xmas_2018/gr_scroll.s

68 lines
1.1 KiB
ArmAsm
Raw Normal View History

2018-12-18 03:58:19 +00:00
scroll_row1 = $800
scroll_row2 = $900
scroll_row3 = $A00
scroll_row4 = $B00
2018-12-18 05:17:20 +00:00
SCROLL_LENGTH = $63
2018-12-18 03:58:19 +00:00
;OFFSET = $62
; 5 + (45*40) +4 + 13 + 7 + 6 = 1835
scroll_loop:
ldx #0 ; 2
ldy OFFSET ; 3
draw_loop:
lda scroll_row1,Y ; 4
sta $650,X ; 5
lda scroll_row2,Y ; 4
sta $6d0,X ; 5
lda scroll_row3,Y ; 4
sta $750,X ; 5
lda scroll_row4,Y ; 4
sta $7d0,X ; 5
iny ; 2
inx ; 2
cpx #40 ; 2
bne draw_loop ; 2nt/3
;===============
; 45
; -1
inc OFFSET ; 5
;============
; 4
;==================
; wrap scrolltext
;==================
clc ; 2
lda OFFSET ; 3
adc #40 ; 2
cmp SCROLL_LENGTH ; 3
bne no_wrap ; 3
;============
; 13
; -1
lda #0 ; 2
sta OFFSET ; 3
jmp done_wrap ; 3
no_wrap:
lda $0 ; 3
nop ; 2
nop ; 2
;===========
; 7
done_wrap:
rts ; 6
2018-12-21 15:49:17 +00:00
.assert >scroll_loop = >done_wrap, error, "gr_scroll crosses page"