refactor precomputed fx, add fx/ripple2

This commit is contained in:
4am 2018-11-04 11:09:37 -05:00
parent d124019918
commit 6c2d1e1f5a
16 changed files with 2489 additions and 142 deletions

View File

@ -25,6 +25,7 @@ asm: md
$(ACME) src/fx/fx.hgr.interlock.ud.a
$(ACME) src/fx/fx.hgr.interlock.lr.a
$(ACME) src/fx/fx.hgr.spiral.a
$(ACME) src/fx/fx.hgr.fourspiral.a
$(ACME) src/fx/fx.hgr.fizzle.a
$(ACME) src/fx/fx.hgr.bar.dissolve.a
$(ACME) src/fx/fx.hgr.block.fizzle.a
@ -52,8 +53,8 @@ asm: md
$(ACME) src/fx/fx.hgr.split.ud.intro.a
$(ACME) src/fx/fx.hgr.iris.a
$(ACME) src/fx/fx.hgr.ripple.a
$(ACME) src/fx/fx.hgr.ripple2.a
$(ACME) src/fx/fx.hgr.star.a
$(ACME) src/fx/fx.hgr.fourspiral.a
dsk: md asm
$(CADIUS) CREATEVOLUME build/"$(DISK)" "${VOLUME}" 32766KB >>build/log

View File

@ -1 +1 @@
# # transition effects for HGR slideshows # SUNRISE SUNSET RADIAL RADIAL2 RADIAL3 RADIAL4 RADIAL5 FOURSPIRAL STAR RIPPLE IRIS SPLIT.UD.INTRO DIAGONAL CHECKERBOARD SUNRISE RADIAL3 CORNER.CIRCLE BAR.DISSOLVE STAGGERWHITE.LR DIAMOND ONESQUARE TWOPASS.LR CRYSTAL HALF.MOSAIC STAGGER.LR FOURSQUARE STAGGER.UD INTERLOCK.LR BLOCK.MOSAIC FIZZLE STAGGERWHITE.UD INTERLOCK.UD BLOCK.FIZZLE SPIRAL [eof]
# # transition effects for HGR slideshows # RIPPLE2 STAR CORNER.CIRCLE SUNRISE SUNSET RADIAL RADIAL2 RADIAL3 RADIAL4 RADIAL5 FOURSPIRAL RIPPLE IRIS SPLIT.UD.INTRO DIAGONAL CHECKERBOARD SUNRISE STAR LE BAR.DISSOLVE STAGGERWHITE.LR DIAMOND ONESQUARE TWOPASS.LR CRYSTAL HALF.MOSAIC STAGGER.LR FOURSQUARE STAGGER.UD INTERLOCK.LR BLOCK.MOSAIC FIZZLE STAGGERWHITE.UD INTERLOCK.UD BLOCK.FIZZLE SPIRAL [eof]

View File

@ -3,6 +3,7 @@ FIZZLE=Type(06),AuxType(6000),Access(C3)
INTERLOCK.UD=Type(06),AuxType(6000),Access(C3)
INTERLOCK.LR=Type(06),AuxType(6000),Access(C3)
SPIRAL=Type(06),AuxType(6000),Access(C3)
FOURSPIRAL=Type(06),AuxType(6000),Access(C3)
BAR.DISSOLVE=Type(06),AuxType(6000),Access(C3)
BLOCK.FIZZLE=Type(06),AuxType(6000),Access(C3)
BLOCK.MOSAIC=Type(06),AuxType(6000),Access(C3)
@ -28,6 +29,6 @@ RADIAL4=Type(06),AuxType(6000),Access(C3)
RADIAL5=Type(06),AuxType(6000),Access(C3)
SPLIT.UD.INTRO=Type(06),AuxType(6000),Access(C3)
IRIS=Type(06),AuxType(6000),Access(C3)
RIPPLE=Type(06),AuxType(6000),Access(C3)
STAR=Type(06),AuxType(6000),Access(C3)
FOURSPIRAL=Type(06),AuxType(6000),Access(C3)
RIPPLE=Type(06),AuxType(6000),Access(C3)
RIPPLE2=Type(06),AuxType(6000),Access(C3)

35
res/notes/ripple2.py Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env python3
from math import sqrt, sin, cos, acos, pi
def f(t, k):
t = float(t)
r = k*(1-cos(t)*sin(3*t))
return r*cos(t),r*sin(t)
coords = []
for k_mul in range(3013):
print(k_mul)
for t_mul in range(int(pi*100+1)):
a, b = f(float(t_mul/10), float(k_mul)/10.0)
x = round(20+a*.6)
y = round(24+b)
if x < 0 or x > 39 or y < 0 or y > 47 or (x,y) in coords:
continue
coords.append((x,y))
L = len(coords)
q1 = coords[0:L//4]
q2 = coords[L//4:L//2]
q3 = coords[L//2:L*3//4]
q4 = coords[L*3//4:]
q1.reverse()
q3.reverse()
coords = []
for cs in zip(q1, q2, q3, q4):
for c in cs:
coords.append(c)
coords.append((255,255))
with open("../../src/fx/fx.hgr.ripple2.data.a", "w") as f:
for x, y in coords:
f.write(" !byte %s,%s\n" % (y,x))

View File

@ -193,7 +193,7 @@ AttractMode
jmp BlankHGR
@HGRSlideshow
; jsr LoadTransition
jsr LoadTransition
jsr okvs_iter
!word gSlideshowStore
!word HGRLoad
@ -209,7 +209,7 @@ HGRLoad
; load HGR screenshot at $4000
+LOAD_FILE kHGRScreenshotDirectory, PTR
jsr LoadTransition
; jsr LoadTransition
jsr $6000 ; transition effect code was loaded here earlier
jmp WaitOnScreenshot

View File

@ -2,43 +2,9 @@
!to "build/FX/CORNER.CIRCLE",plain
*=$6000
coord = $FE
!source "src/fx/fx.hgr.precomputed.a"
lda #<@coords
sta coord
lda #>@coords
sta coord+1
ldy #0
@loop
lda (coord),y
bpl @copy
lda #$28
jsr WaitForKeyWithTimeout
bmi @exit
bpl @next ; always branches
@copy
tax
iny
lda (coord),y
tay
txa
jsr HGRHalfBlockCopy
@next
inc coord
bne +
inc coord+1
+ inc coord
bne +
inc coord+1
+ ldy #$00
lda ($FE),y
cmp #$80
bne @loop
@exit rts
+FX_PRECOMPUTED $28
@coords
!source "src/fx/fx.hgr.corner.circle.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -1,5 +1,13 @@
coord = $FE
jmp Start
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"
Start
!macro FX_PRECOMPUTED .wait {
lda #<@coords
sta coord
lda #>@coords
@ -7,13 +15,12 @@ coord = $FE
ldy #0
@loop
lda (coord),y
bpl @copy
lda #$6
bpl +
lda #.wait
jsr WaitForKeyWithTimeout
bmi @exit
bpl @next ; always branches
@copy
tax
bpl @next
+ tax
iny
lda (coord),y
tay
@ -31,3 +38,6 @@ coord = $FE
cmp #$80
bne @loop
@exit rts
@coords
}

View File

@ -2,11 +2,9 @@
!to "build/FX/RADIAL",plain
*=$6000
!source "src/fx/fx.hgr.radial.common.a"
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $06
@coords
!source "src/fx/fx.hgr.radial.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -2,11 +2,9 @@
!to "build/FX/RADIAL2",plain
*=$6000
!source "src/fx/fx.hgr.radial.common.a"
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $06
@coords
!source "src/fx/fx.hgr.radial2.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -2,11 +2,9 @@
!to "build/FX/RADIAL3",plain
*=$6000
!source "src/fx/fx.hgr.radial.common.a"
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $06
@coords
!source "src/fx/fx.hgr.radial3.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -2,11 +2,9 @@
!to "build/FX/RADIAL4",plain
*=$6000
!source "src/fx/fx.hgr.radial.common.a"
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $06
@coords
!source "src/fx/fx.hgr.radial4.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -2,11 +2,9 @@
!to "build/FX/RADIAL5",plain
*=$6000
!source "src/fx/fx.hgr.radial.common.a"
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $06
@coords
!source "src/fx/fx.hgr.radial5.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -2,42 +2,9 @@
!to "build/FX/RIPPLE",plain
*=$6000
coord = $FE
!source "src/fx/fx.hgr.precomputed.a"
lda #<@coords
sta coord
lda #>@coords
sta coord+1
ldy #0
@loop
lda (coord),y
bpl +
lda #$30
jsr WaitForKeyWithTimeout
bmi @exit
bpl @next
+ tax
iny
lda (coord),y
tay
txa
jsr HGRHalfBlockCopy
@next
inc coord
bne +
inc coord+1
+ inc coord
bne +
inc coord+1
+ ldy #$00
lda ($FE),y
cmp #$80
bne @loop
@exit rts
+FX_PRECOMPUTED $30
@coords
!source "src/fx/fx.hgr.ripple.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

10
src/fx/fx.hgr.ripple2.a Normal file
View File

@ -0,0 +1,10 @@
!cpu 6502
!to "build/FX/RIPPLE2",plain
*=$6000
!source "src/fx/fx.hgr.precomputed.a"
+FX_PRECOMPUTED $08
!source "src/fx/fx.hgr.ripple2.data.a"
!byte $80

2400
src/fx/fx.hgr.ripple2.data.a Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,42 +2,9 @@
!to "build/FX/STAR",plain
*=$6000
coord = $FE
!source "src/fx/fx.hgr.precomputed.a"
lda #<@coords
sta coord
lda #>@coords
sta coord+1
ldy #0
@loop
lda (coord),y
bpl +
lda #$10
jsr WaitForKeyWithTimeout
bmi @exit
bpl @next
+ tax
iny
lda (coord),y
tay
txa
jsr HGRHalfBlockCopy
@next
inc coord
bne +
inc coord+1
+ inc coord
bne +
inc coord+1
+ ldy #$00
lda ($FE),y
cmp #$80
bne @loop
@exit rts
+FX_PRECOMPUTED $10
@coords
!source "src/fx/fx.hgr.star.data.a"
!byte $80
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"