add flick transition

This commit is contained in:
4am 2020-09-12 12:58:03 -04:00
parent 670efc1a1d
commit b81a3b76b2
2 changed files with 84 additions and 0 deletions

View File

@ -105,6 +105,7 @@ LITTLE.BOXES
SPIRAL SPIRAL
WAVY.CORNER WAVY.CORNER
REDLINES REDLINES
FLICK
[eof] [eof]
# #

83
src/fx/fx.hgr.flick.a Normal file
View File

@ -0,0 +1,83 @@
;license:MIT
;(c) 2018 by 4am
;
!cpu 6502
!to "build/FX/FLICK",plain
*=$6000
rowcount = $FF ; [byte]
hgrlo = $200 ; [$C0 bytes]
startrows_by_column = $2C0 ; [$28 bytes]
hgrhi = $300 ; [$C0 bytes]
rowcounts_by_column = $3C0 ; [$28 bytes]
!source "src/fx/macros.a"
+BUILD_HGR_LOOKUP_TABLES hgrlo, hgrhi
ldy #$27
- lda #$00
sta startrows_by_column, y
lda initial_rowcounts, y
sta rowcounts_by_column, y
dey
bpl -
frameloop
ldy #$27
columnloop
lda rowcounts_by_column, y
beq nextcolumn
bmi nextcolumn
sta rowcount
ldx startrows_by_column, y
cpx #$C0
bcs nextcolumn
rowloop lda hgrlo, x
sta $3c
sta $26
lda hgrhi, x
sta $27
eor #$60
sta $3d
lda ($3c), y
sta ($26), y
inx
dec rowcount
bne rowloop
nextcolumn
dey
bpl columnloop
ldy #$27
- lda rowcounts_by_column, y
bmi +
beq +
tax
clc
adc startrows_by_column, y
sta startrows_by_column, y
lda next_rowcount, x
sta rowcounts_by_column, y
bne ++ ; always branches
+ clc
adc #1
sta rowcounts_by_column, y
++ dey
bpl -
lda #$30
jsr WaitForKeyWithTimeout
bmi exit
lda rowcounts_by_column+$27
cmp #$80
bne frameloop
exit rts
!source "src/wait.a"
initial_rowcounts
!byte $01,$01,$00,$00,$FF,$FF,$FE,$FE,$FD,$FD
!byte $FC,$FC,$FB,$FB,$FA,$FA,$F9,$F9,$F8,$F8
!byte $F7,$F7,$F6,$F6,$F5,$F5,$F4,$F4,$F3,$F3
!byte $F2,$F2,$F1,$F1,$F0,$F0,$EF,$EF,$EE,$EE
next_rowcount
!byte $01,$03,$80,$05,$02,$07,$04,$09,$06,$0B,$08,$0D,$0A,$0F,$0C,$11,$0E,$15,$10,$FD,$FD,$12