From 0c7ea1a3ecb0fb7557fbadd089fc52c49ed8d8d1 Mon Sep 17 00:00:00 2001 From: 4am Date: Thu, 25 Aug 2022 21:56:15 -0400 Subject: [PATCH] new DHGR dither transition effects --- res/ATTRACT/ANGEL.1 | 7 + res/ATTRACT/BLITZKRIEG | 7 + res/ATTRACT/BLOODSUCKERS | 7 + res/ATTRACT/SANITRON | 7 + res/DFX.CONF | 15 ++ src/fx/fx.dhgr.48boxes.common.unused.a | 254 ------------------ src/fx/fx.dhgr.common.a | 21 -- src/fx/fx.dhgr.dither.bubbles.a | 16 ++ src/fx/fx.dhgr.dither.butterfly.a | 16 ++ src/fx/fx.dhgr.dither.corner4.a | 16 ++ src/fx/fx.dhgr.dither.heart.a | 16 ++ src/fx/fx.dhgr.dither.iris.a | 16 ++ src/fx/fx.dhgr.dither.maple.a | 16 ++ src/fx/fx.dhgr.dither.radial.a | 158 ++++++++++++ src/fx/fx.dhgr.dither.radial.common.a | 135 ++++++++++ src/fx/fx.dhgr.dither.radial2.a | 20 ++ src/fx/fx.dhgr.dither.radial4.a | 20 ++ src/fx/fx.dhgr.dither.slow.star.a | 16 ++ src/fx/fx.dhgr.dither.snowflake.a | 16 ++ src/fx/fx.dhgr.dither.soft.iris.a | 16 ++ src/fx/fx.dhgr.dither.star.a | 16 ++ src/fx/fx.dhgr.dither.wavy.iris.a | 16 ++ src/fx/fx.dhgr.dither.wavy.iris.bloom.a | 16 ++ src/fx/fx.dhgr.precomputed.1bit.a | 174 ++++++++++++- src/fx/fx.dhgr.precomputed.2bit.a | 139 +++++++++- src/fx/fx.dhgr.radial.a | 6 +- src/fx/fx.dhgr.radial.common.a | 11 +- src/fx/fx.dhgr.radial3.a | 7 +- src/fx/fx.dhgr.soft.diagonal.a | 13 +- src/fx/fx.hgr.2pass.lr.a | 3 +- src/fx/fx.hgr.arrow.a | 1 - src/fx/fx.hgr.arrow.white.a | 1 - src/fx/fx.hgr.bar.dissolve.a | 3 +- src/fx/fx.hgr.block.fizzle.a | 1 - src/fx/fx.hgr.block.fizzle.white.a | 1 - src/fx/fx.hgr.center.by.pixel.a | 1 - src/fx/fx.hgr.color.fizzle.a | 1 - src/fx/fx.hgr.common.a | 137 ---------- src/fx/fx.hgr.crystal.a | 3 +- src/fx/fx.hgr.diagonal.a | 1 - src/fx/fx.hgr.diagonal2.a | 1 - src/fx/fx.hgr.diagonal3.a | 1 - src/fx/fx.hgr.diagonal4.a | 1 - src/fx/fx.hgr.diamond.a | 1 - src/fx/fx.hgr.dither.dissolve.a | 3 +- src/fx/fx.hgr.dither.radial.a | 10 +- src/fx/fx.hgr.dither.radial.common.a | 11 +- src/fx/fx.hgr.fourspiral.a | 3 +- src/fx/fx.hgr.foursquare.white.a | 3 +- src/fx/fx.hgr.halfblock.fizzle.a | 1 - src/fx/fx.hgr.halfblock.fizzle.white.a | 1 - src/fx/fx.hgr.interlock.lr.a | 3 +- src/fx/fx.hgr.interlock.ud.a | 3 +- src/fx/fx.hgr.lattice.a | 1 - src/fx/fx.hgr.lr.by.pixel.a | 2 +- src/fx/fx.hgr.meet.in.the.middle.a | 2 +- src/fx/fx.hgr.onesquare.white.a | 3 +- src/fx/fx.hgr.precomputed.1bit.a | 125 ++------- src/fx/fx.hgr.precomputed.2bit.a | 30 +-- src/fx/fx.hgr.precomputed.3bit.a | 12 +- src/fx/fx.hgr.r.by.2.a | 1 - src/fx/fx.hgr.r.by.palette.a | 1 - src/fx/fx.hgr.r.by.pixel.a | 2 +- src/fx/fx.hgr.radial.a | 2 +- src/fx/fx.hgr.radial.common.a | 7 +- src/fx/fx.hgr.radial3.a | 2 +- src/fx/fx.hgr.redlines.a | 2 +- src/fx/fx.hgr.soft.l.a | 1 - src/fx/fx.hgr.soft.r.a | 1 - src/fx/fx.hgr.soft.ud.a | 1 - src/fx/fx.hgr.soft.ud.in.a | 1 - src/fx/fx.hgr.soft.ud.out.a | 1 - src/fx/fx.hgr.spiral.a | 2 +- src/fx/fx.hgr.split.ud.intro.a | 1 - src/fx/fx.hgr.stagger.lr.a | 3 +- src/fx/fx.hgr.stagger.lr.white.a | 3 +- src/fx/fx.hgr.stagger.ud.a | 7 +- src/fx/fx.hgr.stagger.ud.white.a | 3 +- src/fx/fx.hgr.thin.bar.dissolve.a | 3 +- src/fx/fx.hgr.tri.fizzle.a | 1 - src/fx/fx.shr.2pass.lr.a | 1 - src/fx/fx.shr.80boxes.common.a | 1 - src/fx/fx.shr.diagonal.a | 1 - src/fx/fx.shr.fizzle.a | 1 - src/fx/fx.shr.iris.a | 1 - src/fx/fx.shr.iris.in.a | 1 - src/fx/fx.shr.lr.a | 1 - src/fx/fx.shr.lr2.a | 1 - src/fx/fx.shr.radial.a | 1 - src/fx/fx.shr.radial2.a | 1 - src/fx/fx.shr.ripple.a | 1 - src/fx/fx.shr.soft.iris.a | 1 - src/fx/fx.shr.soft.iris.in.a | 1 - src/fx/fx.shr.ud.a | 1 - src/fx/macros.a | 227 +---------------- src/fx/macros.copybit.a | 50 ++++ src/fx/macros.dhgr.a | 42 +++ src/fx/macros.dither.a | 73 ++++++ src/fx/macros.hgr.a | 312 +++++++++++++++++++++++ src/fx/macros.misc.a | 83 ++++++ src/fx/{fx.shr.common.a => macros.shr.a} | 0 src/index/artwork.idx.a | 2 +- src/index/attract.idx.a | 2 +- src/index/cache00.idx.a | 2 +- src/index/cache01.idx.a | 2 +- src/index/cache10.idx.a | 2 +- src/index/cache11.idx.a | 2 +- src/index/coverfade.idx.a | 2 +- src/index/credits.idx.a | 2 +- src/index/decrunch.idx.a | 2 +- src/index/dfx.idx.a | 4 +- src/index/dgr.fizzle.idx.a | 2 +- src/index/dgr.idx.a | 2 +- src/index/dhgr.idx.a | 2 +- src/index/dtitle.idx.a | 2 +- src/index/fx.idx.a | 2 +- src/index/gamehelp.idx.a | 2 +- src/index/gr.fizzle.idx.a | 2 +- src/index/gr.idx.a | 2 +- src/index/helptext.idx.a | 2 +- src/index/hgr0.idx.a | 2 +- src/index/hgr1.idx.a | 2 +- src/index/hgr2.idx.a | 2 +- src/index/hgr3.idx.a | 2 +- src/index/hgr4.idx.a | 2 +- src/index/hgr5.idx.a | 2 +- src/index/hgr6.idx.a | 2 +- src/index/joystick.idx.a | 2 +- src/index/miniattract0.idx.a | 4 +- src/index/miniattract1.idx.a | 4 +- src/index/prelaunch.idx.a | 2 +- src/index/search00.idx.a | 2 +- src/index/search01.idx.a | 2 +- src/index/search10.idx.a | 2 +- src/index/search11.idx.a | 2 +- src/index/sfx.idx.a | 2 +- src/index/slideshow.idx.a | 2 +- src/index/title.idx.a | 2 +- 138 files changed, 1580 insertions(+), 909 deletions(-) create mode 100644 res/ATTRACT/ANGEL.1 create mode 100644 res/ATTRACT/BLITZKRIEG create mode 100644 res/ATTRACT/BLOODSUCKERS create mode 100644 res/ATTRACT/SANITRON delete mode 100644 src/fx/fx.dhgr.48boxes.common.unused.a delete mode 100644 src/fx/fx.dhgr.common.a create mode 100644 src/fx/fx.dhgr.dither.bubbles.a create mode 100644 src/fx/fx.dhgr.dither.butterfly.a create mode 100644 src/fx/fx.dhgr.dither.corner4.a create mode 100644 src/fx/fx.dhgr.dither.heart.a create mode 100644 src/fx/fx.dhgr.dither.iris.a create mode 100644 src/fx/fx.dhgr.dither.maple.a create mode 100644 src/fx/fx.dhgr.dither.radial.a create mode 100644 src/fx/fx.dhgr.dither.radial.common.a create mode 100644 src/fx/fx.dhgr.dither.radial2.a create mode 100644 src/fx/fx.dhgr.dither.radial4.a create mode 100644 src/fx/fx.dhgr.dither.slow.star.a create mode 100644 src/fx/fx.dhgr.dither.snowflake.a create mode 100644 src/fx/fx.dhgr.dither.soft.iris.a create mode 100644 src/fx/fx.dhgr.dither.star.a create mode 100644 src/fx/fx.dhgr.dither.wavy.iris.a create mode 100644 src/fx/fx.dhgr.dither.wavy.iris.bloom.a delete mode 100644 src/fx/fx.hgr.common.a create mode 100644 src/fx/macros.copybit.a create mode 100644 src/fx/macros.dhgr.a create mode 100644 src/fx/macros.dither.a create mode 100644 src/fx/macros.hgr.a create mode 100644 src/fx/macros.misc.a rename src/fx/{fx.shr.common.a => macros.shr.a} (100%) diff --git a/res/ATTRACT/ANGEL.1 b/res/ATTRACT/ANGEL.1 new file mode 100644 index 000000000..f94745889 --- /dev/null +++ b/res/ATTRACT/ANGEL.1 @@ -0,0 +1,7 @@ +# +# Attract mode for ANGEL.1 +# This file is automatically generated +# + + +[eof] diff --git a/res/ATTRACT/BLITZKRIEG b/res/ATTRACT/BLITZKRIEG new file mode 100644 index 000000000..2f7966043 --- /dev/null +++ b/res/ATTRACT/BLITZKRIEG @@ -0,0 +1,7 @@ +# +# Attract mode for BLITZKRIEG +# This file is automatically generated +# + + +[eof] diff --git a/res/ATTRACT/BLOODSUCKERS b/res/ATTRACT/BLOODSUCKERS new file mode 100644 index 000000000..ec5e222d8 --- /dev/null +++ b/res/ATTRACT/BLOODSUCKERS @@ -0,0 +1,7 @@ +# +# Attract mode for BLOODSUCKERS +# This file is automatically generated +# + + +[eof] diff --git a/res/ATTRACT/SANITRON b/res/ATTRACT/SANITRON new file mode 100644 index 000000000..ed4871f0e --- /dev/null +++ b/res/ATTRACT/SANITRON @@ -0,0 +1,7 @@ +# +# Attract mode for SANITRON +# This file is automatically generated +# + + +[eof] diff --git a/res/DFX.CONF b/res/DFX.CONF index 70828af03..aca9fc09e 100644 --- a/res/DFX.CONF +++ b/res/DFX.CONF @@ -29,62 +29,77 @@ DHGR.FIZZLE2BIT DHGR.RIPPLE DHGR.SOFT.DIAG DHGR.48BOXES +DHGR.DITHIRIS DHGR.BUBBLES DHGR.RADIAL DHGR.SOFT.IRIS DHGR.WAVY.RIP +DHGR.DITHBUBBLE DHGR.48.SNAKE DHGR.SNOWFL.IN DHGR.MAPLE DHGR.SLOW.STAR +DHGR.DITHCORNER DHGR.48.SNAKEC DHGR.HEART.RIP DHGR.CORNER4 DHGR.STAR.IN +DHGR.DITHSLOWST DHGR.48.ARROW DHGR.REDLINES DHGR.BUTTERFLY DHGR.BLOOM.IN +DHGR.DITHSNOWFL DHGR.48.SYNCC DHGR.RADIAL4 DHGR.TWOPASS.LR DHGR.WAVY.IN +DHGR.DITHHEART DHGR.CORNER4RIP DHGR.STAR DHGR.48.LDIAGON DHGR.MAPLE.IN +DHGR.DITHBUTTER DHGR.BAR.DISSLV DHGR.BLOOM DHGR.SLOW.STARI DHGR.HEART +DHGR.DITHMAPLE DHGR.48.2SNAKES DHGR.RADIAL3 DHGR.STAR.RIP DHGR.BFLY.IN +DHGR.DITHSOFTIR DHGR.DIAGONAL DHGR.SNOWFLAKE DHGR.48.DOWN DHGR.SOFTIRISIN +DHGR.DITHSTAR DHGR.RADIAL2 DHGR.IRIS DHGR.BUBBLES.IN DHGR.SLOWST.RIP +DHGR.DITHWAVYIR DHGR.48.SPIRAL DHGR.RADIAL5 DHGR.FIZZLE DHGR.48.PAGEC +DHGR.DITHBLOOM DHGR.BFLY.RIP DHGR.IRIS.IN DHGR.SWIRL DHGR.48.SPIRALC +DHGR.DITHRADIAL DHGR.MAPLE.RIP DHGR.R.BY.PIXEL DHGR.HEART.IN DHGR.SNOWFL.RIP +DHGR.DITHRAD2 DHGR.48.SIDES DHGR.CORNER4.IN DHGR.WAVY.IRIS DHGR.BLOOM.RIP +DHGR.DITHRAD4 DHGR.48.SYNC DHGR.FLICK [eof] diff --git a/src/fx/fx.dhgr.48boxes.common.unused.a b/src/fx/fx.dhgr.48boxes.common.unused.a deleted file mode 100644 index cf1aef20d..000000000 --- a/src/fx/fx.dhgr.48boxes.common.unused.a +++ /dev/null @@ -1,254 +0,0 @@ -!macro AUXMEM { - sta $C055 - lda auxsrc_hgrhi, x - sta src+1 -} - -!macro MAINMEM { - sta $C054 -} - -!macro INX_AND_RECALC { - inx - lda hgrlo, x - sta src - sta dst - lda hgrhi, x - sta dst+1 - eor #$60 - sta src+1 -} - -!macro BITCOPY .copy, .mask { -!if .mask != %00000000 { -!if .mask = %11111111 { -!if .copy != 0 { - lda (src), y -} else { - lda #$00 -} - sta (dst), y -} else { - lda (dst), y -!if .copy != 0 { - eor (src), y -} else { - bit src -} - and #.mask - eor (dst), y - sta (dst), y -} -} -} - -!macro MIDDLE_STAGE_DHGR .copy, .rowcount, .firstrow, .edge_left_mask_main, .edge_right_mask_main, .left_mask_main, .right_mask_main, .edge_left_mask_aux, .edge_right_mask_aux, .left_mask_aux, .right_mask_aux { - lda #(.rowcount-2) ;k_set_row_count - sta rowcount - txa ;k_set_first_row - adc #(.firstrow-1) - tax - iny ;k_iny - sty tmpy ;k_save_y - jsr + ;k_middle_jsr, k_current_page -- - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, .left_mask_main ;k_bitcopy, k_left_mask_main - iny ;k_iny - iny ;k_iny - +BITCOPY .copy, .right_mask_main ;k_bitcopy, k_right_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, .right_mask_aux ;k_bitcopy, k_right_mask_aux - ldy tmpy ;k_restore_y - +BITCOPY .copy, .left_mask_aux ;k_bitcopy, k_left_mask_aux - +MAINMEM ;k_switch_to_main - dec rowcount ;k_middle_branch - bpl - -+ - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, .edge_left_mask_main ;k_bitcopy, k_edge_left_mask_main - iny ;k_iny - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - iny ;k_iny - +BITCOPY .copy, .edge_right_mask_main ;k_bitcopy, k_edge_right_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, .edge_right_mask_aux ;k_bitcopy, k_edge_right_mask_aux - dey ;k_dey - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - dey ;k_dey - +BITCOPY .copy, .edge_left_mask_aux ;k_bitcopy, k_edge_left_mask_aux - +MAINMEM ;k_switch_to_main - rts -} - -!macro OUTER_STAGE_DHGR .copy, .rowcount, .firstrow, .edge_left_mask_main, .edge_right_mask_main, .left_mask_main, .right_mask_main, .edge_left_mask_aux, .edge_right_mask_aux, .left_mask_aux, .right_mask_aux { - lda #(.rowcount-2) ;k_set_row_count - sta rowcount - txa ;k_set_first_row - adc #(.firstrow-1) - tax - sty tmpy ;k_save_y - jsr + ;k_outer_jsr -- - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, .left_mask_main ;k_bitcopy, k_left_mask_main - iny ;k_iny - iny ;k_iny - iny ;k_iny - iny ;k_iny - +BITCOPY .copy, .right_mask_main ;k_bitcopy, k_right_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, .right_mask_aux ;k_bitcopy, k_right_mask_aux - ldy tmpy ;k_restore_y - +BITCOPY .copy, .left_mask_aux ;k_bitcopy, k_left_mask_aux - +MAINMEM ;k_switch_to_main - dec rowcount ;k_outer_branch - bpl - -+ - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, .edge_left_mask_main ;k_bitcopy, k_edge_left_mask_main - iny ;k_iny - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - iny ;k_iny - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - iny ;k_iny - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - iny ;k_iny - +BITCOPY .copy, .edge_right_mask_main ;k_bitcopy, k_edge_right_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, .edge_right_mask_aux ;k_bitcopy, k_edge_right_mask_aux - dey ;k_dey - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - dey ;k_dey - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - dey ;k_dey - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - dey ;k_dey - +BITCOPY .copy, .edge_left_mask_aux ;k_bitcopy, k_edge_left_mask_aux - +MAINMEM ;k_switch_to_main - rts -} - -!macro STAGE0 .copy { - txa ;k_set_first_row - adc #($0F-1) - tax - iny ;k_iny - iny ;k_iny - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %00011111 ;k_bitcopy, k_left_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %01111100 ;k_bitcopy, k_left_mask_aux - +MAINMEM ;k_switch_to_main - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %00011111 ;k_bitcopy, k_left_mask_main - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %01111100 ;k_bitcopy, k_left_mask_aux - +MAINMEM ;k_switch_to_main - rts -} - -!macro STAGE1 .copy { - txa ;k_set_first_row - adc #($0E-1) - tax - iny ;k_iny - iny ;k_iny - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +MAINMEM ;k_switch_to_main - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +MAINMEM ;k_switch_to_main - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +MAINMEM ;k_switch_to_main - +INX_AND_RECALC ;k_inx_and_recalc - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +AUXMEM ;k_switch_to_aux - +BITCOPY .copy, %11111111 ;k_bitcopy, k_full_mask - +MAINMEM ;k_switch_to_main - rts -} - -;clear00 -*=$7000 - +STAGE0 0 -;clear01 -*=$7100 - +STAGE1 0 -;clear02-0F -*=$7200 - +MIDDLE_STAGE_DHGR 0, $05, $0D, %01100000, %00000000, %01100000, %00000000, %00000000, %00000011, %00000000, %00000011 -*=$7300 - +MIDDLE_STAGE_DHGR 0, $07, $0C, %01111000, %00000000, %00011000, %00000000, %00000000, %00001111, %00000000, %00001100 -*=$7400 - +MIDDLE_STAGE_DHGR 0, $09, $0B, %11111111, %00000000, %00000111, %00000000, %00000000, %11111111, %00000000, %01110000 -*=$7500 - +MIDDLE_STAGE_DHGR 0, $0B, $0A, %11111111, %00000001, %00000000, %00000001, %01000000, %11111111, %01000000, %00000000 -*=$7600 - +MIDDLE_STAGE_DHGR 0, $0D, $09, %11111111, %00000111, %00000000, %00000110, %01110000, %11111111, %00110000, %00000000 -*=$7700 - +MIDDLE_STAGE_DHGR 0, $0F, $08, %11111111, %00011111, %00000000, %00011000, %01111100, %11111111, %00001100, %00000000 -*=$7800 - +MIDDLE_STAGE_DHGR 0, $11, $07, %11111111, %11111111, %00000000, %01100000, %11111111, %11111111, %00000011, %00000000 -*=$7900 - +OUTER_STAGE_DHGR 0, $13, $06, %01100000, %00000000, %01100000, %00000000, %00000000, %00000011, %00000000, %00000011 -*=$7A00 - +OUTER_STAGE_DHGR 0, $15, $05, %01111000, %00000000, %00011000, %00000000, %00000000, %00001111, %00000000, %00001100 -*=$7B00 - +OUTER_STAGE_DHGR 0, $17, $04, %11111111, %00000000, %00000111, %00000000, %00000000, %11111111, %00000000, %01110000 -*=$7C00 - +OUTER_STAGE_DHGR 0, $19, $03, %11111111, %00000001, %00000000, %00000001, %01000000, %11111111, %01000000, %00000000 -*=$7D00 - +OUTER_STAGE_DHGR 0, $1B, $02, %11111111, %00000111, %00000000, %00000110, %01110000, %11111111, %00110000, %00000000 -*=$7E00 - +OUTER_STAGE_DHGR 0, $1D, $01, %11111111, %00011111, %00000000, %00011000, %01111100, %11111111, %00001100, %00000000 -*=$7F00 - +OUTER_STAGE_DHGR 0, $1F, $00, %11111111, %11111111, %00000000, %01100000, %11111111, %11111111, %00000011, %00000000 - -;copy02-08 -; cp rowc frow edgeleft edgeright left right edgeltaux edgertaux leftaux rightaux -*=$A000 - +MIDDLE_STAGE_DHGR 1, $05, $0D, %01100000, %00000000, %01100000, %00000000, %00000000, %00000011, %00000000, %00000011 -*=$A100 - +MIDDLE_STAGE_DHGR 1, $07, $0C, %01111000, %00000000, %00011000, %00000000, %00000000, %00001111, %00000000, %00001100 -*=$A200 - +MIDDLE_STAGE_DHGR 1, $09, $0B, %11111111, %00000000, %00000111, %00000000, %00000000, %11111111, %00000000, %01110000 -*=$A300 - +MIDDLE_STAGE_DHGR 1, $0B, $0A, %11111111, %00000001, %00000000, %00000001, %01000000, %11111111, %01000000, %00000000 -*=$A400 - +MIDDLE_STAGE_DHGR 1, $0D, $09, %11111111, %00000111, %00000000, %00000110, %01110000, %11111111, %00110000, %00000000 -*=$A500 - +MIDDLE_STAGE_DHGR 1, $0F, $08, %11111111, %00011111, %00000000, %00011000, %01111100, %11111111, %00001100, %00000000 -*=$A600 - +MIDDLE_STAGE_DHGR 1, $11, $07, %11111111, %11111111, %00000000, %01100000, %11111111, %11111111, %00000011, %00000000 -;copy09-0F -*=$A700 - +OUTER_STAGE_DHGR 1, $13, $06, %01100000, %00000000, %01100000, %00000000, %00000000, %00000011, %00000000, %00000011 -*=$A800 - +OUTER_STAGE_DHGR 1, $15, $05, %01111000, %00000000, %00011000, %00000000, %00000000, %00001111, %00000000, %00001100 -*=$A900 - +OUTER_STAGE_DHGR 1, $17, $04, %11111111, %00000000, %00000111, %00000000, %00000000, %11111111, %00000000, %01110000 -*=$AA00 - +OUTER_STAGE_DHGR 1, $19, $03, %11111111, %00000001, %00000000, %00000001, %01000000, %11111111, %01000000, %00000000 -*=$AB00 - +OUTER_STAGE_DHGR 1, $1B, $02, %11111111, %00000111, %00000000, %00000110, %01110000, %11111111, %00110000, %00000000 -*=$AC00 - +OUTER_STAGE_DHGR 1, $1D, $01, %11111111, %00011111, %00000000, %00011000, %01111100, %11111111, %00001100, %00000000 -*=$AD00 - +OUTER_STAGE_DHGR 1, $1F, $00, %11111111, %11111111, %00000000, %01100000, %11111111, %11111111, %00000011, %00000000 - -;copy00 -*=$AE00 - +STAGE0 1 -;copy01 -*=$AF00 - +STAGE1 1 - diff --git a/src/fx/fx.dhgr.common.a b/src/fx/fx.dhgr.common.a deleted file mode 100644 index 9bea36e3f..000000000 --- a/src/fx/fx.dhgr.common.a +++ /dev/null @@ -1,21 +0,0 @@ -!macro COPY_TO_AUXMEM .startpage, .pagecount { - ldx #.pagecount - lda #.startpage - sta $FF - lda #$00 - sta $FE - tay - sta $c005 -- lda ($FE),y - sta ($FE),y - iny - bne - - inc $FF - dex - bne - - sta $c004 -} - -!macro COPY_SELF_TO_AUXMEM { - +COPY_TO_AUXMEM $60, $60 -} diff --git a/src/fx/fx.dhgr.dither.bubbles.a b/src/fx/fx.dhgr.dither.bubbles.a new file mode 100644 index 000000000..32584cd34 --- /dev/null +++ b/src/fx/fx.dhgr.dither.bubbles.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHBUBBLE",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.1bit.a" + + +FX_INITONCE_1BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit + +CoordinatesFile + !byte 15 + !text "FX/BUBBLES.DATA" diff --git a/src/fx/fx.dhgr.dither.butterfly.a b/src/fx/fx.dhgr.dither.butterfly.a new file mode 100644 index 000000000..6ca85e296 --- /dev/null +++ b/src/fx/fx.dhgr.dither.butterfly.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHBUTTER",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.2bit.a" + + +FX_INITONCE_2BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_2BIT_DHGR_DITHER Coordinates2Bit, EndCoordinates2Bit + +CoordinatesFile + !byte 17 + !text "FX/BUTTERFLY.DATA" diff --git a/src/fx/fx.dhgr.dither.corner4.a b/src/fx/fx.dhgr.dither.corner4.a new file mode 100644 index 000000000..46b9ae829 --- /dev/null +++ b/src/fx/fx.dhgr.dither.corner4.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHCORNER",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.1bit.a" + + +FX_INITONCE_1BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit + +CoordinatesFile + !byte 15 + !text "FX/CORNER4.DATA" diff --git a/src/fx/fx.dhgr.dither.heart.a b/src/fx/fx.dhgr.dither.heart.a new file mode 100644 index 000000000..cdd1a823d --- /dev/null +++ b/src/fx/fx.dhgr.dither.heart.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHHEART",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.2bit.a" + + +FX_INITONCE_2BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_2BIT_DHGR_DITHER Coordinates2Bit, EndCoordinates2Bit + +CoordinatesFile + !byte 13 + !text "FX/HEART.DATA" diff --git a/src/fx/fx.dhgr.dither.iris.a b/src/fx/fx.dhgr.dither.iris.a new file mode 100644 index 000000000..d16f598c1 --- /dev/null +++ b/src/fx/fx.dhgr.dither.iris.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHIRIS",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.1bit.a" + + +FX_INITONCE_1BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_1BIT_DHGR_DITHER Coordinates1Bit, EndCoordinates1Bit + +CoordinatesFile + !byte 12 + !text "FX/IRIS.DATA" diff --git a/src/fx/fx.dhgr.dither.maple.a b/src/fx/fx.dhgr.dither.maple.a new file mode 100644 index 000000000..cf976eb7a --- /dev/null +++ b/src/fx/fx.dhgr.dither.maple.a @@ -0,0 +1,16 @@ +;license:MIT +;(c) 2019-2020 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHMAPLE",plain +*=$6000 + + !source "src/fx/fx.dhgr.precomputed.2bit.a" + + +FX_INITONCE_2BIT CoordinatesFile, Start +Start + +FX_PRECOMPUTED_2BIT_DHGR_DITHER Coordinates2Bit, EndCoordinates2Bit + +CoordinatesFile + !byte 13 + !text "FX/MAPLE.DATA" diff --git a/src/fx/fx.dhgr.dither.radial.a b/src/fx/fx.dhgr.dither.radial.a new file mode 100644 index 000000000..643310304 --- /dev/null +++ b/src/fx/fx.dhgr.dither.radial.a @@ -0,0 +1,158 @@ +;license:MIT +;(c) 2019-2022 by 4am/qkumba +; +!cpu 6502 +!to "build/FX.INDEXED/DHGR.DITHRADIAL",plain +*=$6000 + +evenrow_ptr = $E4 ; word +oddrow_ptr = $E6 ; word +mirror_src1 = $E8 ; word +mirror_dest1 = $EA ; word +mirror_src2 = $EC ; word +mirror_dest2 = $EE ; word +src1 = $F0 ; word +dest1 = $F2 ; word +src2 = $F4 ; word +dest2 = $F6 ; word +input = $FE ; word + + !source "src/fx/fx.dhgr.precomputed.1bit.a" + + +FX_INITONCE_1BIT CoordinatesFile, Start + lda #$80 + sta Coordinates1Bit-2 + +Start + +BUILD_DITHER_MASKS_DHGR dithermasks + +BUILD_SPARSE_BITMASKS_1BIT_DHGR copymasks, mirror_copymasks + +BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 hgrlo, hgr1hi + +BUILD_HGR_MIRROR_LOOKUP_TABLES hgrlomirror, hgr1himirror + +BUILD_MIRROR_COLS_DHGR mirror_cols + +COPY_TO_AUXMEM $60, 4 + + +LDADDR evenrow_masks + +ST16 evenrow_ptr + +LDADDR oddrow_masks + +ST16 oddrow_ptr + jsr FullRadial + bit KBD + bpl + + rts ++ lda # 127 then we're done + +ROW_X_TO_BASE_ADDRESSES + +ROW_X_TO_MIRROR_ADDRESSES + + iny + lda (input), y + +HIGH_3_LOW_5 input + sty .copy - sta CopyMaskAddr+1 -} - -; must set N flag based on Y immediately before using these macros -; e.g. LDY, INY, DEY, TYA -!macro IS_Y_OFFSCREEN { - bpl + - sec - bcs ++ -+ cpy #40 -++ -} -!macro BRANCH_IF_Y_IS_OFFSCREEN .target { - cpy #40 - bcs .target -} -!macro LONG_BRANCH_IF_Y_IS_OFFSCREEN .target { - cpy #40 - bcc + - jmp .target -+ -} - -!macro COPY_TO_0 .start, .end { -; out: X=0 -; Z=1 - ldx #(.end-.start) -- lda .start-1, x - sta $FF, x - dex - bne - -} - -!macro OVERCOPY_TO_0 .start, .end { -; over-copy region to $00 -; clobbers $FF -; out: X=0 -; Y=last byte before start (e.g. 0 if the last instruction is JMP $0000) - ldx #(.end-.start+1) -- ldy .start-2, x - sty $FE, x - dex - bne - -} + !source "src/fx/macros.hgr.a" + !source "src/fx/macros.dhgr.a" + !source "src/fx/macros.shr.a" + !source "src/fx/macros.copybit.a" + !source "src/fx/macros.dither.a" + !source "src/fx/macros.misc.a" _FX_MACROS_=* } diff --git a/src/fx/macros.copybit.a b/src/fx/macros.copybit.a new file mode 100644 index 000000000..8b0d53b01 --- /dev/null +++ b/src/fx/macros.copybit.a @@ -0,0 +1,50 @@ +;license:MIT +;(c) 2019-2022 by 4am +; + +!ifndef _FX_MACROS_COPYBIT_ { + +!macro COPY_BIT .src1, .dest1, .copymasks { + lda (.src1),y + eor (.dest1),y ; merge source and destination bits + and .copymasks,x ; isolate the bits to replace, zero the rest + eor (.dest1),y ; unmerge source and destination bits, leaves 'to keep' destination bits intact + sta (.dest1),y ; write the result +} + +!macro COPY_BIT_DITHER .src1, .dest1, .copymasks, .dithermaskptr { + lda (.src1),y + eor (.dest1),y ; merge source and destination bits + and .copymasks,x ; isolate the bits to replace, zero the rest + and (.dithermaskptr),y ; apply dither mask (if any) + eor (.dest1),y ; unmerge source and destination bits, leaves 'to keep' destination bits intact + sta (.dest1),y ; write the result +} + +!macro COPY_BIT_ZP .src1, .dest1, .zpcopymask { + lda (.src1),y + eor (.dest1),y ; merge source and destination bits + and <.zpcopymask ; isolate the bits to replace, zero the rest + eor (.dest1),y ; unmerge source and destination bits, leaves 'to keep' destination bits intact + sta (.dest1),y ; write the result +} + +!macro COPY_BIT_ZP_DITHER .src1, .dest1, .zpcopymask, .ditherptr { + lda (.src1),y + eor (.dest1),y ; merge source and destination bits + and <.zpcopymask ; isolate the bits to replace, zero the rest + and (.ditherptr), y ; apply dither mask (if any) + eor (.dest1),y ; unmerge source and destination bits, leaves 'to keep' destination bits intact + sta (.dest1),y ; write the result +} + +!macro COPY_BIT_IMMEDIATE .copymask { + lda (src), y + eor (dst), y ; merge source and destination bits + and #.copymask ; isolate the bits to replace, zero the rest + eor (dst), y ; unmerge source and destination bits, leaves 'to keep' destination bits intact + sta (dst), y ; write the result +} + +_FX_MACROS_COPYBIT_=* +} diff --git a/src/fx/macros.dhgr.a b/src/fx/macros.dhgr.a new file mode 100644 index 000000000..c3c2c81c4 --- /dev/null +++ b/src/fx/macros.dhgr.a @@ -0,0 +1,42 @@ +;license:MIT +;(c) 2019-2022 by 4am +; + +!ifndef _FX_MACROS_DHGR_ { + +!macro COPY_TO_AUXMEM .startpage, .pagecount { + ldx #.pagecount + lda #.startpage + sta $FF + lda #$00 + sta $FE + tay + sta $C005 +- lda ($FE),y + sta ($FE),y + iny + bne - + inc $FF + dex + bne - + sta $C004 +} + +!macro BUILD_MIRROR_COLS_DHGR .mirror_cols { + ; build lookup table to get $27-y for y in $00..$27 + ; duplicate in both mainmem and auxmem + ldx #$28 + ldy #$00 +- tya + sta .mirror_cols-1, x + sta $C005 + sta .mirror_cols-1, x + sta $C004 + iny + dex + bne - +; X=0 +} + +_FX_MACROS_DHGR_=* +} diff --git a/src/fx/macros.dither.a b/src/fx/macros.dither.a new file mode 100644 index 000000000..affc80ccb --- /dev/null +++ b/src/fx/macros.dither.a @@ -0,0 +1,73 @@ +;license:MIT +;(c) 2019-2022 by 4am +; + +!ifndef _FX_MACROS_DITHER_ { + +!macro BUILD_DITHER_MASKS .dithermasks { + ldy #40 +- lda #%10110011 + sta .dithermasks, y + lda #%11100110 + sta .dithermasks+1, y + lda #%11001100 + sta .dithermasks+2, y + lda #%10011001 + sta .dithermasks+3, y + dey + dey + dey + dey + bpl - + ldy #39 + lda #$FF +- sta .dithermasks+44, y + dey + bpl - +} + +!macro BUILD_DITHER_MASKS_DHGR .dithermasks { + ldy #40 +- lda #%10011110 + sta .dithermasks, y + lda #%11111000 + sta .dithermasks+1, y + lda #%11100001 + sta .dithermasks+2, y + lda #%10000111 + sta .dithermasks+3, y + dey + dey + dey + dey + bpl - + ldy #39 +- lda #$FF + sta .dithermasks+44, y + dey + bpl - + sta $C005 + ldy #40 +- lda #%10001111 + sta .dithermasks, y + lda #%10111100 + sta .dithermasks+1, y + lda #%11110000 + sta .dithermasks+2, y + lda #%11000011 + sta .dithermasks+3, y + dey + dey + dey + dey + bpl - + ldy #39 +- lda #$FF + sta .dithermasks+44, y + dey + bne - + sta $C004 +} + +_FX_MACROS_DITHER_=* +} diff --git a/src/fx/macros.hgr.a b/src/fx/macros.hgr.a new file mode 100644 index 000000000..bfe4e7afb --- /dev/null +++ b/src/fx/macros.hgr.a @@ -0,0 +1,312 @@ +;license:MIT +;(c) 2019-2022 by 4am +; + +!ifndef _FX_MACROS_HGR_ { + +; .hgrlo, .hgr1hi will each be filled with $C0 bytes +; based on routine by John Brooks +; posted on comp.sys.apple2 on 2018-07-11 +; https://groups.google.com/d/msg/comp.sys.apple2/v2HOfHOmeNQ/zD76fJg_BAAJ +!macro BUILD_HGR_LOOKUP_TABLES .hgrlo, .hgr1hi { +; preserves Y + ldx #0 + +BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 .hgrlo, .hgr1hi +} + +; use this macro instead if you know X is already 0 on entry, to save 2 bytes +!macro BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 .hgrlo, .hgr1hi { +; preserves Y +- txa + and #$F8 + bpl + + ora #5 ++ asl + bpl + + ora #5 ++ asl + asl + sta .hgrlo,x + txa + and #7 + rol + asl .hgrlo,x + rol + ora #$20 + sta .hgr1hi,x + inx + cpx #$C0 + bne - +} + +; .hgrlomirror, .hgr1himirror will each be filled with $C0 bytes +!macro BUILD_HGR_MIRROR_LOOKUP_TABLES .hgrlomirror, .hgr1himirror { + ldx #$C0 + ldy #0 +- tya + and #$F8 + bpl + + ora #5 ++ asl + bpl + + ora #5 ++ asl + asl + sta .hgrlomirror-1,x + tya + and #7 + rol + asl .hgrlomirror-1,x + rol + ora #$20 + sta .hgr1himirror-1,x + iny + dex + bne - +} + +!macro BUILD_MIRROR_COLS .mirror_cols { +; in: none +; out: .mirror_cols populated with lookup table to get $27-y for y in $00..$27 +; all registers and flags clobbered + ldx #$27 + ldy #$00 +- tya + sta .mirror_cols, x + iny + dex + bpl - +} + +!macro HGR_CALC { +; in: A = HGR row (0x00..0xBF) +; out: A/X clobbered +; Y preserved +; ($26) points to first byte of given HGR row on hi-res page 1 +; ($3C) points to same byte on hi-res page 2 +; based on 'Woz Recodes Hi-Res Address Calculations' +; Apple Assembly Line vol. 7 issue 3 (December 1986) +; http://www.txbobsc.com/aal/1986/aal8612.html#a9 + asl + tax + and #$F0 + bpl @calc1 + ora #$05 +@calc1 bcc @calc2 + ora #$0A +@calc2 asl + asl + sta $26 + txa + and #$0E + adc #$10 + asl $26 + rol + sta $27 + eor #$60 + sta $3d + lda $26 + sta $3c +} + +!macro HGR_ROW_CALC { + asl + asl + asl + +HGR_CALC +} + +; /!\ C must be clear before using this macro +!macro HGR_INC_WITHIN_BLOCK { + lda $27 + adc #$04 + sta $27 + eor #$60 + sta $3d +} + +!macro RESET_HGR_CALC { + lda $27 + sec + sbc #$20 + sta $27 + eor #$60 + sta $3d +} + +!macro SWITCH_TO_MASKS .copy { + lda #<.copy + sta CopyMaskAddr + lda #>.copy + sta CopyMaskAddr+1 +} + +!macro ROW_X_TO_BASE_ADDRESSES { + lda hgrlo, x + sta