2024-01-21 04:10:30 +00:00
|
|
|
;======================================
|
|
|
|
; do very simple horizontal scroll
|
|
|
|
;======================================
|
|
|
|
; skips by 4 because we need fairly high FPS
|
|
|
|
|
|
|
|
; originally ~12 seconds to scroll 80 (twice)
|
|
|
|
; made double high, ~8s
|
|
|
|
|
|
|
|
; screens to pan in $2000/$4000 to left
|
|
|
|
|
2024-01-30 01:35:01 +00:00
|
|
|
horiz_pan_skip_short:
|
|
|
|
; value in A
|
|
|
|
jmp horiz_pan_skip_common
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
horiz_pan_skip:
|
2024-01-30 01:35:01 +00:00
|
|
|
lda #36
|
|
|
|
horiz_pan_skip_common:
|
|
|
|
sta horiz_pan_end_smc+1
|
2024-01-21 04:10:30 +00:00
|
|
|
|
2024-01-22 03:40:00 +00:00
|
|
|
pan_skip_loop:
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
; how many times to scroll
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta COUNT
|
|
|
|
|
2024-01-22 03:40:00 +00:00
|
|
|
pan_skip_outer_outer_loop:
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
ldx #191
|
2024-01-22 03:40:00 +00:00
|
|
|
pan_skip_outer_loop:
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
txa
|
|
|
|
pha
|
|
|
|
|
|
|
|
; self-modify the PAGE1 high input addresses
|
|
|
|
|
|
|
|
lda hposn_high,X
|
|
|
|
sta pil_in_smc1+2 ; input source
|
|
|
|
|
|
|
|
sta pil_out_smc1+2 ; output odd
|
|
|
|
sta pil_out_smc4+2
|
|
|
|
|
|
|
|
;self modify the PAGE2 high input addresses
|
|
|
|
eor #$60
|
|
|
|
sta pil_in_page2_smc1+2
|
|
|
|
|
|
|
|
|
|
|
|
; self modify the PAGE1 LOW addresses
|
|
|
|
lda hposn_low,X
|
|
|
|
sta pil_out_smc1+1 ; output odd
|
|
|
|
sta pil_out_smc4+1 ; output odd
|
|
|
|
|
|
|
|
|
|
|
|
; self modify the PAGE1 LOW input addresses
|
|
|
|
sta pil_in_smc1+1 ; input is regular+1
|
|
|
|
inc pil_in_smc1+1
|
|
|
|
inc pil_in_smc1+1
|
|
|
|
inc pil_in_smc1+1
|
|
|
|
inc pil_in_smc1+1
|
|
|
|
|
|
|
|
; offset in PAGE2 to get input from
|
|
|
|
|
|
|
|
clc
|
|
|
|
adc COUNT
|
|
|
|
sta pil_in_page2_smc1+1
|
|
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
lda hposn_high,X
|
|
|
|
sta pil_out_smc2+2 ; output even high
|
|
|
|
sta pil_out_smc5+2
|
|
|
|
|
|
|
|
lda hposn_low,X ; output even low
|
|
|
|
sta pil_out_smc2+1
|
|
|
|
sta pil_out_smc5+1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;=========================
|
|
|
|
; inner loop, from 0-36
|
|
|
|
|
|
|
|
ldy #0
|
2024-01-22 03:40:00 +00:00
|
|
|
pan_skip_inner_loop:
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
; load in+1, store to in
|
|
|
|
|
|
|
|
; if completely unrolled, would save 1 cycle for store and
|
|
|
|
; 5 for the branch/loop
|
|
|
|
; 192*6=not a lot
|
|
|
|
|
|
|
|
pil_in_smc1:
|
|
|
|
lda $2000+1,Y ; 4
|
|
|
|
pil_out_smc1:
|
|
|
|
sta $2000,Y ; 5
|
|
|
|
pil_out_smc2:
|
|
|
|
sta $2000,Y ; 5
|
|
|
|
|
|
|
|
iny ; 2
|
|
|
|
cpy #36 ; 2
|
2024-01-22 03:40:00 +00:00
|
|
|
bne pan_skip_inner_loop ; 2/3
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
; for right edge, scroll in from PAGE2
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
tail_loop:
|
|
|
|
|
|
|
|
pil_in_page2_smc1:
|
|
|
|
lda $4000,X
|
|
|
|
pil_out_smc4:
|
|
|
|
sta $2000,Y
|
|
|
|
pil_out_smc5:
|
|
|
|
sta $2000,Y
|
|
|
|
|
|
|
|
iny
|
|
|
|
inx
|
|
|
|
cpy #40
|
|
|
|
bne tail_loop
|
|
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
tax
|
|
|
|
|
|
|
|
dex
|
|
|
|
dex
|
|
|
|
cpx #$ff
|
2024-01-22 03:40:00 +00:00
|
|
|
bne pan_skip_outer_loop
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
inc COUNT
|
|
|
|
inc COUNT
|
|
|
|
inc COUNT
|
|
|
|
inc COUNT
|
|
|
|
|
|
|
|
lda COUNT
|
2024-01-30 01:35:01 +00:00
|
|
|
horiz_pan_end_smc:
|
2024-01-21 04:10:30 +00:00
|
|
|
cmp #36
|
|
|
|
|
2024-01-22 03:40:00 +00:00
|
|
|
bne pan_skip_outer_outer_loop
|
2024-01-21 04:10:30 +00:00
|
|
|
|
|
|
|
rts
|