From 12ede40fadcf2e5b5c08f92839bd1350e8241ff9 Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 12 Nov 2019 11:22:57 -0500 Subject: [PATCH] add vertical blinds effect --- res/fx.conf | 2 +- src/fx/fx.hgr.and.a | 44 ------ src/fx/fx.hgr.vertical.blinds.a | 259 ++++++++++++++++++++++++++++++++ 3 files changed, 260 insertions(+), 45 deletions(-) delete mode 100644 src/fx/fx.hgr.and.a create mode 100755 src/fx/fx.hgr.vertical.blinds.a diff --git a/res/fx.conf b/res/fx.conf index 2bb1df941..8baca51bc 100644 --- a/res/fx.conf +++ b/res/fx.conf @@ -1 +1 @@ -RIPPLE STAR.IN SOFT.DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD HEART.IN CRYSTAL STAR.RIPPLE BIT.FIZZLE APPLE.IN MEETINTHEMIDDLE FLOWER.RAD.RIP SOFT.IRIS W.RIPPLE.BLOOM DIAGONAL MANDELBROT.IN CORNER.SUPERRIP STAR FLOWER.IN R.BY.PIXEL WAVY.IRIS APPLE SUNRISE MANDELBROT.RIP SOFT.L HEART.RIPPLE SUNSET FLOWER.RAD SLOW.STAR.IN IRIS.IN BUTTERFLYRIPPLE W.IRIS.BLOOM.IN CORNER.CIRCLE CENTER.BY.PIXEL SNOWFLAKE.IN FLOWER APPLE.RIPPLE DIAGONAL2 RIPPLE2 STAR.BLOOM PALETTE.FIZZLE RADIAL2 BUTTERFLY FLOWER.RIPPLE SPLIT.UD.INTRO WAVY.IRIS.IN R.BY.2 HALF.FIZZLE SNOWFLAKE.RIP RADIAL3 HEART FLOWER.RAD.IN DIAGONAL3 MANDELBROT WAVY.RIPPLE CORNER4.OUT LATTICE BAR.DISSOLVE R.BY.PALETTE FOURSPIRAL SOFT.R MAPLE.IN IRIS CASCADE SNOWFLAKE AND BUTTERFLY.IN CHECKERBOARD LR.BY.PIXEL RADIAL4 CHECKER.FIZZLE STAGGERWHITE.LR SOFT.UD.OUT ONESQUARE W.IRIS.BLOOM MAPLE FIZZLE SLOW.STAR ARROW.WHITE TRI.FIZZLE SOFT.IRIS.IN DIAMOND TWOPASS.LR HALF.MOSAIC RADIAL5 ARROW FOURSQUARE BLOCK.FIZZLE DIAGONAL4 STAGGER.UD INTERLOCK.LR SOFT.UD.IN BLOCK.MOSAIC CORNER4.IN MAPLE.RIPPLE INTERLOCK.UD LITTLE.BOXES SPIRAL WAVY.CORNER [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 can use $6000-$BFFF in main memory, zero page, and # text page if needed (but preserve the screen holes). $800-$1FFF is reserved # for the slideshow data. 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 +VERTICAL.BLINDS # RIPPLE STAR.IN SOFT.DIAGONAL STAGGERWHITE.UD RADIAL STAGGER.LR SOFT.UD HEART.IN CRYSTAL STAR.RIPPLE BIT.FIZZLE APPLE.IN MEETINTHEMIDDLE FLOWER.RAD.RIP SOFT.IRIS W.RIPPLE.BLOOM DIAGONAL MANDELBROT.IN CORNER.SUPERRIP STAR FLOWER.IN R.BY.PIXEL WAVY.IRIS APPLE SUNRISE MANDELBROT.RIP SOFT.L HEART.RIPPLE SUNSET FLOWER.RAD SLOW.STAR.IN IRIS.IN BUTTERFLYRIPPLE W.IRIS.BLOOM.IN CORNER.CIRCLE CENTER.BY.PIXEL SNOWFLAKE.IN FLOWER APPLE.RIPPLE DIAGONAL2 RIPPLE2 STAR.BLOOM PALETTE.FIZZLE RADIAL2 BUTTERFLY FLOWER.RIPPLE SPLIT.UD.INTRO WAVY.IRIS.IN R.BY.2 HALF.FIZZLE SNOWFLAKE.RIP RADIAL3 HEART FLOWER.RAD.IN DIAGONAL3 MANDELBROT WAVY.RIPPLE CORNER4.OUT LATTICE BAR.DISSOLVE R.BY.PALETTE FOURSPIRAL SOFT.R MAPLE.IN IRIS CASCADE SNOWFLAKE VERTICAL.BLINDS BUTTERFLY.IN CHECKERBOARD LR.BY.PIXEL RADIAL4 CHECKER.FIZZLE STAGGERWHITE.LR SOFT.UD.OUT ONESQUARE W.IRIS.BLOOM MAPLE FIZZLE SLOW.STAR ARROW.WHITE TRI.FIZZLE SOFT.IRIS.IN DIAMOND TWOPASS.LR HALF.MOSAIC RADIAL5 ARROW FOURSQUARE BLOCK.FIZZLE DIAGONAL4 STAGGER.UD INTERLOCK.LR SOFT.UD.IN BLOCK.MOSAIC CORNER4.IN MAPLE.RIPPLE INTERLOCK.UD LITTLE.BOXES SPIRAL WAVY.CORNER [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 can use $6000-$BFFF in main memory, zero page, and # text page if needed (but preserve the screen holes). $800-$1FFF is reserved # for the slideshow data. 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.and.a b/src/fx/fx.hgr.and.a deleted file mode 100644 index f01afd07c..000000000 --- a/src/fx/fx.hgr.and.a +++ /dev/null @@ -1,44 +0,0 @@ -;license:MIT -;(c) 2018 by 4am -; -!cpu 6502 -!to "build/FX/AND",plain -*=$6000 - -i = $ff - - lda #$06 - sta i -@outerloop - dec i - bpl + -@exit rts -+ ldx i - lda masks,x - sta @mask - ldx #$40 - stx @src - ldx #$20 - stx @dest - ldy #0 -@innerloop -@src=*+2 - lda $FD00,y ; SMC -@mask=*+1 - and #$FD ; SMC -@dest=*+2 - sta $FD00,y ; SMC - iny - bne @innerloop - inc @src - inc @dest - dex - bne @innerloop - lda #$30 - jsr WaitForKeyWithTimeout - bmi @exit - bpl @outerloop ; always branches -masks - !byte $FF,$BF,$9F,$8F,$87,$83,$81 - !source "src/wait.a" - !source "src/fx/fx.hgr.common.a" diff --git a/src/fx/fx.hgr.vertical.blinds.a b/src/fx/fx.hgr.vertical.blinds.a new file mode 100755 index 000000000..cb5c9decf --- /dev/null +++ b/src/fx/fx.hgr.vertical.blinds.a @@ -0,0 +1,259 @@ +;license:MIT +;(c) 2019 by qkumba +; +!cpu 6502 +!to "build/FX/VERTICAL.BLINDS",plain +*=$6000 + + ldx #0 + clc + + ;build pre-shift tables + +- txa + and #%11111100 + sta tbl00000000a,x + adc #1 + sta tbl00000001,x + adc #1 + sta tbl00000010,x + adc #1 + sta tbl00000011,x + txa + and #%11110011 + sta tbl00000000b,x + ora #%00000100 + sta tbl00000100,x + adc #4 + sta tbl00001000,x + adc #4 + sta tbl00001100,x + txa + and #%11001111 + sta tbl00000000c,x + ora #%00010000 + sta tbl00010000,x + adc #16 + sta tbl00100000,x + adc #16 + sta tbl00110000,x + txa + and #%00111111 + sta tbl00000000d,x + ora #%01000000 + sta tbl01000000,x + adc #64 + sta tbl10000000,x + adc #64 + sta tbl11000000,x + + ;build index table + + txa + and #3 + adc #>tbl00000000a + sta tblx00,x + txa + lsr + lsr + pha + and #3 + clc + adc #>tbl00000000b + sta tblx01,x + pla + lsr + lsr + pha + and #3 + clc + adc #>tbl00000000c + sta tblx02,x + pla + lsr + lsr + clc + adc #>tbl00000000d + sta tblx03,x + inx + bne - + + stx $26 + lda #$20 + sta $27 + stx $fe + lda #>shift + sta $ff + + lda #>tblx03 + sta patchtbl + 1 + lda #<(shift + 2) + sta loop1 + 6 + lda #>(shift + 2) + sta loop1 + 7 + + ;generate unrolled rotate-left code + + lda #4 + sta $fd +-- ldx #0 + ldy #0 + lda #$a2 + sta ($fe),y + iny + lda #0 + sta ($fe),y + clc +- ldy #2 + lda #$bc + sta ($fe),y + iny + lda $26 + sta ($fe),y + iny + lda $27 + eor #$60 + sta ($fe),y + iny + lda #$b9 + sta ($fe),y + iny + lda #0 + sta ($fe),y + iny +patchtbl + lda #>tblx00 + sta ($fe),y + iny + lda #$8d + sta ($fe),y + iny + lda $fe + adc #16 + sta ($fe),y + iny + lda $ff + adc #0 + sta ($fe),y + iny + lda #$bc + sta ($fe),y + iny + lda $26 + sta ($fe),y + iny + lda $27 + sta ($fe),y + iny + lda #$b9 + sta ($fe),y + iny + lda #0 + sta ($fe),y + iny + iny + lda #$9d + sta ($fe),y + iny + lda $26 + sta ($fe),y + iny + lda $27 + sta ($fe),y + lda #18 + adc $fe + sta $fe + bcc + + inc $ff ++ jsr nextline + inx + cpx #<$c0 + bne - + + ;copy loop1 code + + ldy #2 +- lda loop1 - $c0,x + sta ($fe),y + inx + iny + cpx #<($c0 + (loop1_e - loop1)) + bne - + + lda $fe + clc + adc #(loop1_e - loop1) + 2 + sta $fe + bcc + + inc $ff ++ adc #2 + sta loop1 + 6 + lda $ff + adc #0 + sta loop1 + 7 + dec patchtbl + 1 + dec $fd + beq + + jmp -- ++ ldy #0 + lda #$60 + sta ($fe),y + + jmp shift + +loop1 inx + cpx #$28 + beq + + jmp shift + 2 ++ +loop1_e + +nextline + clc + lda $27 + adc #4 + bit x1c + bne + + asl $26 + bcc ++ + adc #$e0 + clc + bit x04 + beq +++ + lda $26 + adc #$50 + eor #$f0 + beq ++++ + eor #$f0 +++++ sta $26 + lda #$20 + bcc +++ +++ adc #$e0 ++++ ror $26 ++ sta $27 + rts + +x1c !byte $1c +x04 !byte $04 + +tblx00 = (loop1_e + 255) and -256 +tblx01 = tblx00 + 256 +tblx02 = tblx01 + 256 +tblx03 = tblx02 + 256 +tbl00000000a = tblx03 + 256 +tbl00000001 = tbl00000000a + 256 +tbl00000010 = tbl00000001 + 256 +tbl00000011 = tbl00000010 + 256 +tbl00000000b = tbl00000011 + 256 +tbl00000100 = tbl00000000b + 256 +tbl00001000 = tbl00000100 + 256 +tbl00001100 = tbl00001000 + 256 +tbl00000000c = tbl00001100 + 256 +tbl00010000 = tbl00000000c + 256 +tbl00100000 = tbl00010000 + 256 +tbl00110000 = tbl00100000 + 256 +tbl00000000d = tbl00110000 + 256 +tbl01000000 = tbl00000000d + 256 +tbl10000000 = tbl01000000 + 256 +tbl11000000 = tbl10000000 + 256 +shift = tbl11000000 + 256