From 90a6f55ddfddda0dc26c0dfb93877c118dd9432f Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 28 May 2024 09:42:19 -0400 Subject: [PATCH] factor out more FX routines --- src/4cade.a | 1 + src/constants.a | 3 +- src/fx.lib.a | 79 ++++++++++++++++++++++++++++++++ src/fx/fx.hgr.bubbles.a | 4 +- src/fx/fx.hgr.bubbles.in.a | 2 +- src/fx/fx.hgr.corner4.a | 4 +- src/fx/fx.hgr.corner4.in.a | 2 +- src/fx/fx.hgr.corner4.ripple.a | 2 +- src/fx/fx.hgr.iris.a | 4 +- src/fx/fx.hgr.iris.in.a | 2 +- src/fx/fx.hgr.precomputed.1bit.a | 71 ---------------------------- src/fx/fx.hgr.ripple.a | 2 +- src/fx/fx.hgr.slow.star.a | 4 +- src/fx/fx.hgr.slow.star.in.a | 2 +- src/fx/fx.hgr.slow.star.ripple.a | 2 +- src/fx/fx.hgr.snowflake.a | 4 +- src/fx/fx.hgr.snowflake.in.a | 2 +- src/fx/fx.hgr.snowflake.ripple.a | 2 +- src/fx/fx.hgr.swirl.a | 2 +- 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/demo.idx.a | 2 +- src/index/dfx.idx.a | 2 +- 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/fxdata.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 | 2 +- src/index/miniattract1.idx.a | 2 +- 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 +- src/index/xsingle.idx.a | 2 +- 59 files changed, 137 insertions(+), 137 deletions(-) diff --git a/src/4cade.a b/src/4cade.a index 3c8d36d36..80f99bfdb 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -161,6 +161,7 @@ gGlobalPrefsStore +DEFINE_INDIRECT_VECTOR iReverseCoordinates2Bit, ReverseCoordinates2Bit +DEFINE_INDIRECT_VECTOR iBuildDHGRSparseBitmasks2Bit, BuildDHGRSparseBitmasks2Bit +DEFINE_INDIRECT_VECTOR iBuildHGRSparseBitmasks2Bit, BuildHGRSparseBitmasks2Bit + +DEFINE_INDIRECT_VECTOR iHGRPrecomputed1Bit, HGRPrecomputed1Bit +DEFINE_INDIRECT_VECTOR iBuildDHGRSparseBitmasks1Bit, BuildDHGRSparseBitmasks1Bit +DEFINE_INDIRECT_VECTOR iBuildHGRSparseBitmasks1Bit, BuildHGRSparseBitmasks1Bit +DEFINE_INDIRECT_VECTOR iRippleCoordinates1Bit4, RippleCoordinates1Bit4 diff --git a/src/constants.a b/src/constants.a index 079f77c15..07716ccb4 100644 --- a/src/constants.a +++ b/src/constants.a @@ -192,7 +192,8 @@ iRippleCoordinates1Bit3 = iRippleCoordinates1Bit2-3 iRippleCoordinates1Bit4 = iRippleCoordinates1Bit3-3 iBuildHGRSparseBitmasks1Bit = iRippleCoordinates1Bit4-3 iBuildDHGRSparseBitmasks1Bit = iBuildHGRSparseBitmasks1Bit-3 -iBuildHGRSparseBitmasks2Bit = iBuildDHGRSparseBitmasks1Bit-3 +iHGRPrecomputed1Bit = iBuildDHGRSparseBitmasks1Bit-3 +iBuildHGRSparseBitmasks2Bit = iHGRPrecomputed1Bit-3 iBuildDHGRSparseBitmasks2Bit = iBuildHGRSparseBitmasks2Bit-3 iReverseCoordinates2Bit = iBuildDHGRSparseBitmasks2Bit-3 iRippleCoordinates2Bit = iReverseCoordinates2Bit-3 diff --git a/src/fx.lib.a b/src/fx.lib.a index af70b8e7e..846a186e4 100644 --- a/src/fx.lib.a +++ b/src/fx.lib.a @@ -24,6 +24,7 @@ ; - RippleCoordinates1Bit2 ; - RippleCoordinates1Bit3 ; - RippleCoordinates1Bit4 +; - HGRPrecomputed1Bit ; - BuildHGRSparseBitmasks2Bit ; - BuildDHGRSparseBitmasks2Bit @@ -34,6 +35,12 @@ ; - ReverseCoordinates3Bit ; - RippleCoordinates3Bit + !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.misc.a" + WaitForKeyWithTimeout ; in: A = timeout length (like standard $FCA8 wait routine) ; out: A clobbered (not always 0 if key is pressed, but also not the key pressed) @@ -415,6 +422,78 @@ aslmod cmp #$1A exit rts } +!zone { +HGRPrecomputed1Bit + jsr BuildHGRTables + jsr BuildHGRMirrorTables + jsr BuildHGRMirrorCols + jsr BuildHGRSparseBitmasks1Bit + +COPY_TO_0 start, end + jmp InputLoop +start +!pseudopc 0 { +Exit1Bit rts +InputLoop + ldy #0 +input=*+1 + ldx Coordinates1Bit ; first value: HGR row (only 0..95 will be in input array) + bmi Exit1Bit ; if > 127 then we're done + +ROW_X_TO_BASE_ADDRESSES + +ROW_X_TO_MIRROR_ADDRESSES + + inc input + lda (input), y + +HIGH_3_LOW_5 input + + ; main 1x2 block in top-left quadrant +src1=*+1 + lda $FDFD, y + eor ( 127 then we're done - +ROW_X_TO_BASE_ADDRESSES - +ROW_X_TO_MIRROR_ADDRESSES - - inc input - lda (input), y - +HIGH_3_LOW_5 input - - ; main 1x2 block in top-left quadrant -src1=*+1 - lda $FDFD, y - eor (