diff --git a/res/fx.conf b/res/fx.conf index 7adb76242..34baa5f1b 100644 --- a/res/fx.conf +++ b/res/fx.conf @@ -1 +1 @@ -RIPPLE STARWHITE SOFT.DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD BIT.FIZZLE MEETINTHEMIDDLE CRYSTAL DIAGONAL R.BY.PIXEL SUNRISE SOFT.L SUNSET CORNER.CIRCLE DIAGONAL2 RIPPLE2 RADIAL2 SPLIT.UD.INTRO HALF.FIZZLE RADIAL3 DIAGONAL3 BAR.DISSOLVE FOURSPIRAL SOFT.R 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. # \ No newline at end of file +RIPPLE STARWHITE SOFT.DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD BIT.FIZZLE MEETINTHEMIDDLE CRYSTAL DIAGONAL R.BY.PIXEL SUNRISE SOFT.L SUNSET CORNER.CIRCLE DIAGONAL2 RIPPLE2 RADIAL2 SPLIT.UD.INTRO HALF.FIZZLE RADIAL3 DIAGONAL3 BAR.DISSOLVE FOURSPIRAL SOFT.R IRIS CASCADE AND CHECKERBOARD LR.BY.PIXEL RADIAL4 STAGGERWHITE.LR SOFT.UD.OUT ONESQUARE FIZZLE STAR DIAMOND TWOPASS.LR HALF.MOSAIC RADIAL5 ARROW 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. # \ No newline at end of file diff --git a/src/fx/fx.hgr.arrow.a b/src/fx/fx.hgr.arrow.a new file mode 100644 index 000000000..debedcffc --- /dev/null +++ b/src/fx/fx.hgr.arrow.a @@ -0,0 +1,95 @@ +;license:MIT +;(c) 2019 by 4am +; +!cpu 6502 +!to "build/FX/ARROW",plain +*=$6000 + +y = $fc +row = $fd +col = $fe +counter = $ff + + !source "src/fx/macros.a" + + +INIT_MASKS sourcemasks1, copymasks1 + +INIT_MASKS sourcemasks4, copymasks4 + + lda #(40+12) + sta counter + + lda #39 + sta col +ColLoop + lda #11 + sta row + ldy col + sty y +RowLoop + ; check if this column is visible + ldy y + +IS_Y_OFFSCREEN + bcs @skip1 + + ; do top half of arrow + +SWITCH_TO_MASKS sourcemasks1, copymasks1 + lda row + jsr HGRBlockCopyWithMask + + ; do bottom half of arrow (opposing row, same col) + +SWITCH_TO_MASKS sourcemasks4, copymasks4 + lda #23 + sec + sbc row + jsr HGRBlockCopyWithMask +@skip1 + ; now check if *this* column is visible + iny + sty y + +IS_Y_OFFSCREEN + bcs @nextrow + + ; do top half of arrow + lda row + jsr HGRBlockCopy + + ; do bottom half of arrow + lda #23 + sec + sbc row + jsr HGRBlockCopy +@nextrow + 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 +sourcemasks4 + !byte 0,0,0,0,0,0,0,0 ; SMC +copymasks1 + !byte %11111111 + !byte %11111110 + !byte %11111100 + !byte %11111000 + !byte %11110000 + !byte %11100000 + !byte %11000000 + !byte %10000000 +copymasks4 + !byte %10000000 + !byte %11000000 + !byte %11100000 + !byte %11110000 + !byte %11111000 + !byte %11111100 + !byte %11111110 + !byte %11111111 + + !source "src/wait.a" + !source "src/fx/fx.hgr.common.a" diff --git a/src/fx/fx.hgr.soft.diagonal.a b/src/fx/fx.hgr.soft.diagonal.a index 9261f66b3..f448ab89f 100644 --- a/src/fx/fx.hgr.soft.diagonal.a +++ b/src/fx/fx.hgr.soft.diagonal.a @@ -12,15 +12,6 @@ counter = $ff !source "src/fx/macros.a" -; must LDY or INY immediately before this -!macro IS_Y_OFFSCREEN { - bpl + - sec - bcs ++ -+ cpy #40 -++ -} - +INIT_MASKS sourcemasks1, copymasks1 +INIT_MASKS sourcemasks2, copymasks2 +INIT_MASKS sourcemasks3, copymasks3 diff --git a/src/fx/fx.hgr.soft.l.a b/src/fx/fx.hgr.soft.l.a index 1085a12d5..aaad65dd3 100644 --- a/src/fx/fx.hgr.soft.l.a +++ b/src/fx/fx.hgr.soft.l.a @@ -12,15 +12,6 @@ counter = $ff !source "src/fx/macros.a" -; must LDY or INY immediately before this -!macro IS_Y_OFFSCREEN { - bpl + - sec - bcs ++ -+ cpy #40 -++ -} - +INIT_MASKS sourcemasks1, copymasks1 +INIT_MASKS sourcemasks2, copymasks2 +INIT_MASKS sourcemasks3, copymasks3 diff --git a/src/fx/fx.hgr.soft.r.a b/src/fx/fx.hgr.soft.r.a index 665fec6c9..8d5098a9a 100644 --- a/src/fx/fx.hgr.soft.r.a +++ b/src/fx/fx.hgr.soft.r.a @@ -12,15 +12,6 @@ counter = $ff !source "src/fx/macros.a" -; must LDY or INY or DEY or TYA or something immediately before this -!macro IS_Y_OFFSCREEN { - bpl + - sec - bcs ++ -+ cpy #40 -++ -} - +INIT_MASKS sourcemasks1, copymasks1 +INIT_MASKS sourcemasks2, copymasks2 +INIT_MASKS sourcemasks3, copymasks3 diff --git a/src/fx/macros.a b/src/fx/macros.a index 577b0a0a5..2b2fe44be 100644 --- a/src/fx/macros.a +++ b/src/fx/macros.a @@ -56,5 +56,15 @@ jsr BuildSourceMaskFromCopyMask } +; must set N flag based on Y immediately before using this macro +; e.g. LDY, INY, DEY, TYA +!macro IS_Y_OFFSCREEN { + bpl + + sec + bcs ++ ++ cpy #40 +++ +} + _HGRMACROS_=* }