wipes: add star ripple

This commit is contained in:
Vince Weaver 2024-12-19 01:34:20 -05:00
parent af8a831892
commit a15de222ef
5 changed files with 309 additions and 121 deletions

View File

@ -13,6 +13,7 @@ wipes.dsk: HELLO \
star/WIPE_STAR \
star/WIPE_STAR_BLOOM \
star/WIPE_STAR_IN \
star/WIPE_STAR_RIPPLE \
cascade/WIPE_CASCADE \
center/WIPE_CENTER \
diamond/WIPE_DIAMOND \
@ -27,6 +28,7 @@ wipes.dsk: HELLO \
$(DOS33) -y wipes.dsk BSAVE -a 0x1000 star/WIPE_STAR
$(DOS33) -y wipes.dsk BSAVE -a 0x1000 star/WIPE_STAR_BLOOM
$(DOS33) -y wipes.dsk BSAVE -a 0x1000 star/WIPE_STAR_IN
$(DOS33) -y wipes.dsk BSAVE -a 0x1000 star/WIPE_STAR_RIPPLE
$(DOS33) -y wipes.dsk BSAVE -a 0x6000 diamond/WIPE_DIAMOND
$(DOS33) -y wipes.dsk BSAVE -a 0x6000 diamond_stripes/WIPE_DIAMOND_STRIPE
$(DOS33) -y wipes.dsk BSAVE -a 0x6000 crystal/WIPE_CRYSTAL
@ -72,6 +74,9 @@ star/WIPE_STAR:
star/WIPE_STAR_IN:
cd star && make
star/WIPE_STAR_RIPPLE:
cd star && make
star/WIPE_STAR_BLOOM:
cd star && make

View File

@ -448,130 +448,148 @@ rc2_pp:
rts
.if 0
RippleCoordinates2Bit:
ldy #0
ldy #0
ldx #$33
- lda @ptrtbl, x
sta $c0, x
dex
bpl -
ldx #$33
ric2_m:
lda ric2_ptrtbl, X
sta $c0, X
dex
bpl ric2_m
lda #$9b
sta $fe
iny
sty $ff
lda #$9b
sta $fe
iny
sty $ff
ldx #6
- lda Coordinates2Bit + 1, x
sta $7f, x
lda Coordinates2Bit + 9, x
sta $85, x
lda Coordinates2Bit + 17, x
sta $8b, x
lda Coordinates2Bit + 65, x
sta $9b, x
dex
bne -
lda Coordinates2Bit + 28
sta $92
lda Coordinates2Bit + 29
sta $93
ldx #4
- lda Coordinates2Bit + 33, x
sta $93, x
lda Coordinates2Bit + 41, x
sta $97, x
lda Coordinates2Bit + 83, x
sta $a1, x
dex
bne -
ldx #2
- lda Coordinates2Bit + 125, x
sta $a5, x
lda Coordinates2Bit + 131, x
sta $a7, x
lda Coordinates2Bit + 139, x
sta $a9, x
lda Coordinates2Bit + 169, x
sta $ab, x
lda Coordinates2Bit + 237, x
sta $ad, x
lda Coordinates2Bit + 2193, x
sta $af, x
lda Coordinates2Bit + 6581, x
sta $b1, x
dex
bne -
ldx #6
ric2_m2:
lda Coordinates2Bit + 1, X
sta $7f, X
lda Coordinates2Bit + 9, X
sta $85, X
lda Coordinates2Bit + 17, X
sta $8b, X
lda Coordinates2Bit + 65, X
sta $9b, X
dex
bne ric2_m2
lda Coordinates2Bit + 28
sta $92
lda Coordinates2Bit + 29
sta $93
ldx #4
ric2_m3:
lda Coordinates2Bit + 33, X
sta $93, X
lda Coordinates2Bit + 41, X
sta $97, X
lda Coordinates2Bit + 83, X
sta $a1, X
dex
bne ric2_m3
ldx #2
ric2_m4:
lda Coordinates2Bit + 125, X
sta $a5, X
lda Coordinates2Bit + 131, X
sta $a7, X
lda Coordinates2Bit + 139, X
sta $a9, X
lda Coordinates2Bit + 169, X
sta $ab, X
lda Coordinates2Bit + 237, X
sta $ad, X
lda Coordinates2Bit + 2193, X
sta $af, X
lda Coordinates2Bit + 6581, X
sta $b1, X
dex
bne ric2_m4
--- ldx #$34
-- lda $be, x
tay
ora $bf, x
beq +
lda $bf, x
jsr @aslmod
sty $be, x
sta $bf, x
sty $fc
clc
adc #>Coordinates2Bit
sta $fd
ldy #0
!byte $24
- sec
lda ($fc), y
pha
lda $7e, x
sta ($fc), y
pla
sta $7e, x
inx
iny
bcc -
dex
dex
+ dex
dex
bne --
ldy #1
lda $fe
eor #<(411 - 2)
beq +
ldy #9
eor #<(411 - 2) xor <(411 - 136)
bne ++
+
- ldx @zerotbl, y
sta $0, x
sta $1, x
dey
bpl -
++ dec $fe
bne ---
dec $ff
bpl ---
bmi @exit ; always branches
@aslmod jsr +
+ cmp #$1E
bcc +
iny
+ pha
tya
asl
tay
pla
rol
cmp #$3C
bcc @exit
sbc #$3C
@exit rts
@ptrtbl !word 2, 4, 6, 10, 12, 14, 18, 20
!word 22, 28, 34, 36, 42, 44, 66, 68
!word 70, 84, 86, 126, 132, 140, 170, 238
!word 2194, 6582
@zerotbl !byte $f0, $f2, $ca, $d2, $d8, $e0, $e2, $e6, $ea, $ee
ric2_mmm:
ldx #$34
ric2_mm:
lda $be, X
tay
ora $bf, X
beq ric2_p
lda $bf, X
jsr ric2_aslmod
sty $be, x
sta $bf, x
sty $fc
clc
adc #>Coordinates2Bit
sta $fd
ldy #0
.byte $24
ric2_m5:
sec
lda ($fc), Y
pha
lda $7e, X
sta ($fc), Y
pla
sta $7e, X
inx
iny
bcc ric2_m5
dex
dex
ric2_p:
dex
dex
bne ric2_mm
ldy #1
lda $fe
eor #<(411 - 2)
beq ric2_p2
ldy #9
eor #(<(411 - 2) ^ <(411 - 136))
bne ric2_pp
ric2_p2:
ric2_m6:
ldx ric2_zerotbl, Y
sta $0, X
sta $1, X
dey
bpl ric2_m6
ric2_pp:
dec $fe
bne ric2_mmm
dec $ff
bpl ric2_mmm
bmi ric2_exit ; always branches
ric2_aslmod:
jsr ric2_p3
ric2_p3:
cmp #$1E
bcc ric2_p4
iny
ric2_p4:
pha
tya
asl
tay
pla
rol
cmp #$3C
bcc ric2_exit
sbc #$3C
ric2_exit:
rts
ric2_ptrtbl:
.word 2, 4, 6, 10, 12, 14, 18, 20
.word 22, 28, 34, 36, 42, 44, 66, 68
.word 70, 84, 86, 126, 132, 140, 170, 238
.word 2194, 6582
ric2_zerotbl:
.byte $f0, $f2, $ca, $d2, $d8, $e0, $e2, $e6, $ea, $ee
.if 0
SetupPrecomputed3Bit:
; build regular HGR lookup tables, then split them

View File

@ -3,7 +3,7 @@ include ../../../../Makefile.inc
LINKER_SCRIPTS = ../../../../linker_scripts
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
all: WIPE_STAR WIPE_STAR_BLOOM WIPE_STAR_IN
all: WIPE_STAR WIPE_STAR_BLOOM WIPE_STAR_IN WIPE_STAR_RIPPLE
###
@ -53,6 +53,23 @@ wipe_star_in.o: wipe_star_in.s \
../macros.s
ca65 -o wipe_star_in.o wipe_star_in.s -l wipe_star_in.lst
###
WIPE_STAR_RIPPLE: wipe_star_ripple.o
ld65 -o WIPE_STAR_RIPPLE wipe_star_ripple.o -C $(LINKER_SCRIPTS)/apple2_1000.inc
wipe_star_ripple.o: wipe_star_ripple.s \
../zp.inc ../hardware.inc ../wait_keypress.s ../zx02_optim.s \
code.hgr.precomputed.2bit.s \
../main_macros.s \
fx.hgr.star.ripple.s \
fx.hgr.precomputed.2bit.s \
fx.hgr.star.data \
../fx.lib.s \
../macros.s
ca65 -o wipe_star_ripple.o wipe_star_ripple.s -l wipe_star_ripple.lst
###
@ -79,6 +96,6 @@ fx.hgr.star_bloom.data.o: fx.hgr.star.bloom.data.s
clean:
rm -f *~ *.o *.lst *.zx02 HELLO \
WIPE_STAR WIPE_STAR_BLOOM WIPE_STAR_IN \
WIPE_STAR WIPE_STAR_BLOOM WIPE_STAR_IN WIPE_STAR_RIPPLE \
fx.hgr.star.data fx.hgr.star_bloom.data

View File

@ -0,0 +1,32 @@
;license:MIT
;(c) 2019-2020 by 4am/qkumba
;
;!cpu 6502
;!to "build/FX.INDEXED/STAR.RIPPLE",plain
;*=$6000
; !source "src/fx/fx.hgr.precomputed.2bit.a"
.include "fx.hgr.precomputed.2bit.s"
; +FX_INITONCE_2BIT FXCodeFile, CoordinatesFile, Start
InitOnce:
bit Start
lda #$4c
sta InitOnce
lda #0
sta EndCoordinates2Bit
jsr RippleCoordinates2Bit
Start:
.include "code.hgr.precomputed.2bit.s"
; jmp FXCode
;FXCodeFile
; +PSTRING "HGR2"
;CoordinatesFile
; +PSTRING "STAR.DATA"

View File

@ -0,0 +1,116 @@
; test some of the 4cade wipes
.include "../zp.inc"
.include "../hardware.inc"
Coordinates2Bit=$8100
EndCoordinates2Bit = Coordinates2Bit + (origEndCoordinates2Bit-origCoordinates2Bit)
wipe_test:
; jmp after
test_graphic:
; .incbin "../graphics/a2_dating.hgr.zx02"
;.include "../zx02_optim.s"
after:
; from code.hgr.precomputed.2bit
jsr BuildHGRTables
jsr BuildHGRMirrorCols
jsr BuildHGRSparseBitmasks2Bit
bit SET_GR
bit HIRES
bit FULLGR
bit PAGE1
;=================================
; intro
;=================================
; copy data table to $8100
ldx #((>origEndCoordinates2Bit)-(>origCoordinates2Bit))
outer_copy_coords_loop:
ldy #0
copy_coords_loop:
col_smc1:
lda origCoordinates2Bit,Y
col_smc2:
sta Coordinates2Bit,Y
iny
bne copy_coords_loop
inc col_smc1+2
inc col_smc2+2
dex
bpl outer_copy_coords_loop
; lda #<test_graphic
; sta zx_src_l+1
; lda #>test_graphic
; sta zx_src_h+1
; lda #$20
; jsr zx02_full_decomp
; ldy #0
;fake_hgr2:
; lda #$0
; sta $4000,Y
; dey
; bne fake_hgr2
;
; inc fake_hgr2+2
; lda fake_hgr2+2
; cmp #$60
; bne fake_hgr2
jsr HGR2
jsr HGR
bit FULLGR
jsr InitOnce
do_it_again:
oog:
lda #$FF
jsr BKGND0
jsr wait_until_keypress
;=================================
; test wipe...
;=================================
test_loop:
jsr wait_until_keypress
dec oog+1
jmp do_it_again
.include "../wait_keypress.s"
.include "../fx.lib.2bit.s"
.include "fx.hgr.star.ripple.s"
; possibly some bytes before get chewed on with some effects?
.align $100
origCoordinates2Bit:
.incbin "fx.hgr.star.data"
origEndCoordinates2Bit: