soft diagonal wipe and some refactoring

This commit is contained in:
4am 2019-10-18 15:41:41 -04:00
parent 4fa2057c88
commit 4c02462dd8
6 changed files with 209 additions and 10 deletions

View File

@ -1 +1 @@
DIAMOND RIPPLE STARWHITE DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD BIT.FIZZLE MEETINTHEMIDDLE CRYSTAL R.BY.PIXEL SUNRISE DIAGONAL2 SUNSET CORNER.CIRCLE RIPPLE2 RADIAL2 SPLIT.UD.INTRO HALF.FIZZLE RADIAL3 DIAGONAL3 BAR.DISSOLVE FOURSPIRAL IRIS CASCADE AND CHECKERBOARD LR.BY.PIXEL RADIAL4 STAGGERWHITE.LR SOFT.UD.OUT ONESQUARE FIZZLE STAR DIAMOND TWOPASS.LR HALF.MOSAIC RADIAL5 FOURSQUARE DIAGONAL4 STAGGER.UD INTERLOCK.LR SOFT.UD.IN BLOCK.MOSAIC INTERLOCK.UD BLOCK.FIZZLE SPIRAL [eof] # # transition effects for HGR slideshows # # Each Mega-Attract Module that is an HGR slideshow (see attract.conf) # will use a single transition effect for the length of the module. # Transition effects are loaded in the order listed in this file. Each line # of this file is a filename (not including comments, like this one). The # name of the next transition effect is stored in the global prefs, so this # file should not contain duplicates. # # Transition effects are binary files loaded at $6000 and called with # hi-res page 1 showing and the next HGR graphic already loaded at $4000. # A transition effect has full use of main memory, including zero page and # text page if needed. LC RAM banks 1 and 2 are reserved for the launcher. # # Important: LC RAM bank 1 will be read/write on entry and must be read/write # on exit. If you need ROM routines, you are responsible for switching to ROM # then switching back to RAM bank 1 (read/write) before returning. #
RIPPLE STARWHITE DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD BIT.FIZZLE MEETINTHEMIDDLE CRYSTAL SOFT.DIAGONAL R.BY.PIXEL SUNRISE DIAGONAL2 SUNSET CORNER.CIRCLE RIPPLE2 RADIAL2 SPLIT.UD.INTRO HALF.FIZZLE RADIAL3 DIAGONAL3 BAR.DISSOLVE FOURSPIRAL IRIS CASCADE AND CHECKERBOARD LR.BY.PIXEL RADIAL4 STAGGERWHITE.LR SOFT.UD.OUT ONESQUARE FIZZLE STAR DIAMOND TWOPASS.LR HALF.MOSAIC RADIAL5 FOURSQUARE DIAGONAL4 STAGGER.UD INTERLOCK.LR SOFT.UD.IN BLOCK.MOSAIC INTERLOCK.UD BLOCK.FIZZLE SPIRAL [eof] # # transition effects for HGR slideshows # # Each Mega-Attract Module that is an HGR slideshow (see attract.conf) # will use a single transition effect for the length of the module. # Transition effects are loaded in the order listed in this file. Each line # of this file is a filename (not including comments, like this one). The # name of the next transition effect is stored in the global prefs, so this # file should not contain duplicates. # # Transition effects are binary files loaded at $6000 and called with # hi-res page 1 showing and the next HGR graphic already loaded at $4000. # A transition effect has full use of main memory, including zero page and # text page if needed. LC RAM banks 1 and 2 are reserved for the launcher. # # Important: LC RAM bank 1 will be read/write on entry and must be read/write # on exit. If you need ROM routines, you are responsible for switching to ROM # then switching back to RAM bank 1 (read/write) before returning. #

View File

@ -27,6 +27,7 @@ HGRBlockCopy
asl
asl
+HGR_CALC
HGRBlockCopyNoRecalc
clc
ldx #$08
@loop
@ -148,6 +149,7 @@ HGRBlockCopyWithMask
asl
asl
+HGR_CALC
HGRBlockCopyWithMaskNoRecalc
ldx #7
HGRBlockCopyWithMasksLoop
lda ($26),y
@ -159,12 +161,8 @@ CopyMaskAddr=*+1
and $FDFD,x ; call SetCopyMask to set
ora $00
sta ($26),y
lda $27
clc
adc #$04
sta $27
eor #$60
sta $3d
+HGR_INC_WITHIN_BLOCK
dex
bpl HGRBlockCopyWithMasksLoop
rts

View File

@ -35,12 +35,9 @@ counter = $ff
+ cpy #40
bcs -
; do corner 1
sty y
+SWITCH_TO_MASKS sourcemasks1, copymasks1
ldy y
lda row
jsr HGRBlockCopyWithMask
sty y
; do corner 2 (same row, opposing col)
+SWITCH_TO_MASKS sourcemasks2, copymasks2
lda #39
@ -70,8 +67,8 @@ counter = $ff
ldy y
@skip1
iny
; now check if *this* column is visible
sty y
; now check if *this* column is visible
bpl +
- jmp @skip2
+ cpy #40

View File

@ -0,0 +1,181 @@
;license:MIT
;(c) 2019 by 4am
;
!cpu 6502
!to "build/FX/SOFT.DIAGONAL",plain
*=$6000
y = $fc
row = $fd
col = $fe
counter = $ff
!source "src/fx/macros.a"
!macro IS_OFFSCREEN {
tya
bpl +
sec
bcs ++
+ cpy #40
++
}
+INIT_MASKS sourcemasks1, copymasks1
+INIT_MASKS sourcemasks2, copymasks2
+INIT_MASKS sourcemasks3, copymasks3
+INIT_MASKS sourcemasks4, copymasks4
+INIT_MASKS sourcemasks5, copymasks5
+INIT_MASKS sourcemasks6, copymasks6
lda #70
sta counter
lda #39
sta col
ColLoop
lda #23
sta row
ldy col
sty y
RowLoop
lda row
asl
asl
asl
+HGR_CALC
+IS_OFFSCREEN
bcs @block2
+SWITCH_TO_MASKS sourcemasks1, copymasks1
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block2
iny
+IS_OFFSCREEN
bcs @block3
+SWITCH_TO_MASKS sourcemasks2, copymasks2
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block3
iny
+IS_OFFSCREEN
bcs @block4
+SWITCH_TO_MASKS sourcemasks3, copymasks3
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block4
iny
+IS_OFFSCREEN
bcs @block5
+SWITCH_TO_MASKS sourcemasks4, copymasks4
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block5
iny
+IS_OFFSCREEN
bcs @block6
+SWITCH_TO_MASKS sourcemasks5, copymasks5
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block6
iny
+IS_OFFSCREEN
bcs @block7
+SWITCH_TO_MASKS sourcemasks6, copymasks6
lda row
jsr HGRBlockCopyWithMaskNoRecalc
+RESET_HGR_CALC
@block7
iny
+IS_OFFSCREEN
bcs @nextrow
lda row
jsr HGRBlockCopyNoRecalc
+RESET_HGR_CALC
@nextrow
ldy y
iny
sty y
dec row
+LBPL RowLoop
lda $c000
bmi @exit
dec col
dec counter
+LBNE ColLoop
@exit rts
sourcemasks1
!byte 0,0,0,0,0,0,0,0 ; SMC
sourcemasks2
!byte 0,0,0,0,0,0,0,0 ; SMC
sourcemasks3
!byte 0,0,0,0,0,0,0,0 ; SMC
sourcemasks4
!byte 0,0,0,0,0,0,0,0 ; SMC
sourcemasks5
!byte 0,0,0,0,0,0,0,0 ; SMC
sourcemasks6
!byte 0,0,0,0,0,0,0,0 ; SMC
copymasks1
!byte %10000000
!byte %10000000
!byte %10000000
!byte %10001000
!byte %10001000
!byte %10000000
!byte %10000000
!byte %10000000
copymasks2
!byte %10000000
!byte %10000000
!byte %10010100
!byte %10001000
!byte %10001000
!byte %10010100
!byte %10000000
!byte %10000000
copymasks3
!byte %10000000
!byte %10000000
!byte %10011100
!byte %10011100
!byte %10011100
!byte %10011100
!byte %10000000
!byte %10000000
copymasks4
!byte %10000000
!byte %10101010
!byte %10011100
!byte %10111110
!byte %10011100
!byte %10011100
!byte %10101010
!byte %10000000
copymasks5
!byte %10000000
!byte %10111110
!byte %10111110
!byte %10111110
!byte %10111110
!byte %10111110
!byte %10111110
!byte %10000000
copymasks6
!byte %11010101
!byte %10111110
!byte %11111111
!byte %10111110
!byte %11111111
!byte %10111110
!byte %10111110
!byte %11010101
!source "src/wait.a"
!source "src/fx/fx.hgr.common.a"

View File

@ -32,11 +32,22 @@
sta $3d
}
!macro RESET_HGR_CALC {
lda $27
sec
sbc #$20
sta $27
eor #$60
sta $3d
}
!macro SWITCH_TO_MASKS .source, .copy {
sty $00
+LDADDR .source
jsr SetSourceMask
+LDADDR .copy
jsr SetCopyMask
ldy $00
}
!macro INIT_MASKS .source, .copy {

View File

@ -57,6 +57,18 @@
sty .ptr+1
}
!macro LBPL .target {
bmi +
jmp .target
+
}
!macro LBNE .target {
beq +
jmp .target
+
}
; use BIT to swallow the following 1-byte opcode
!macro HIDE_NEXT_BYTE {
!byte $24