dos33fsprogs/demos/outline2021/demo/shimmer.s

133 lines
1.4 KiB
ArmAsm
Raw Normal View History

2021-05-09 04:53:32 +00:00
shimmer:
;=========================================
; SETUP
;=========================================
2021-05-10 22:24:49 +00:00
jsr HGR
bit FULLGR
2021-05-09 04:53:32 +00:00
2021-05-12 03:00:09 +00:00
ldx #88
jsr long_wait
2021-05-09 04:53:32 +00:00
lda #0
sta FRAME
lda #14
sta YPOS
lda #3
sta HGR_SCALE
lda #32
sta DIRECTION
2021-05-12 03:00:09 +00:00
lda #22 ; only set once, we wrap
2021-05-09 04:53:32 +00:00
sta XPOS
y_loop:
x_loop:
main_loop:
;=======================
; xdraw
;=======================
xdraw:
; setup X and Y co-ords
ldy #0 ; XPOSH always 0 for us
ldx XPOS
lda YPOS
jsr HPOSN ; X= (y,x) Y=(a)
ldx #<shape_dsr
ldy #>shape_dsr
lda #0 ; set rotation
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
inc FRAME
lda FRAME
and #$7
beq reverse
add_x:
lda XPOS
clc
adc DIRECTION
sta XPOS
jmp x_loop
reverse:
2021-05-12 03:00:09 +00:00
ldx #26 ; 26 is close
jsr long_wait
2021-05-09 04:53:32 +00:00
lda DIRECTION ; switch direction
eor #$ff
sec
adc #0
sta DIRECTION
lda YPOS
clc
adc #16
sta YPOS
cmp #190
bne y_loop
;=====================================
; shimmer
;=====================================
do_shimmer:
2021-05-12 03:00:09 +00:00
lda #6
2021-05-09 04:53:32 +00:00
sta FRAME
do_shimmer_y:
ldx #0
do_shimmer_x:
blargh:
2021-05-10 22:24:49 +00:00
lda $2000,X
2021-05-09 04:53:32 +00:00
eor #$80
blargh2:
2021-05-10 22:24:49 +00:00
sta $2000,X
2021-05-09 04:53:32 +00:00
inx
bne do_shimmer_x
inc blargh+2
inc blargh2+2
lda blargh+2
2021-05-10 22:24:49 +00:00
cmp #$40
2021-05-09 04:53:32 +00:00
bne do_shimmer_y
2021-05-10 22:24:49 +00:00
lda #$20
2021-05-09 04:53:32 +00:00
sta blargh+2
sta blargh2+2
dec FRAME
bne do_shimmer_y
rts
shape_dsr:
.byte $2d,$36,$ff,$3f
.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
.byte $91,$3f,$36,$00