diff --git a/src/fx/fx.dhgr.precomputed.a b/src/fx/fx.dhgr.precomputed.a index 02a11ed61..1f83f8b50 100644 --- a/src/fx/fx.dhgr.precomputed.a +++ b/src/fx/fx.dhgr.precomputed.a @@ -7,6 +7,8 @@ coord = $FE !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_HALF_BLOCK_COPY_ROUTINES + +HGR_WHITE_ROUTINES !source "src/fx/fx.dhgr.common.a" Start diff --git a/src/fx/fx.hgr.2pass.lr.a b/src/fx/fx.hgr.2pass.lr.a index 26572e7c7..11b655285 100644 --- a/src/fx/fx.hgr.2pass.lr.a +++ b/src/fx/fx.hgr.2pass.lr.a @@ -59,3 +59,4 @@ row = $FF !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.arrow.a b/src/fx/fx.hgr.arrow.a index 48bce3d57..bfc09ef50 100644 --- a/src/fx/fx.hgr.arrow.a +++ b/src/fx/fx.hgr.arrow.a @@ -88,3 +88,5 @@ copymasks4 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_BLOCK_COPY_ROUTINES + +HGR_COPY_MASK_ROUTINES diff --git a/src/fx/fx.hgr.arrow.white.a b/src/fx/fx.hgr.arrow.white.a index eb2d3cbaf..f3e1474e5 100644 --- a/src/fx/fx.hgr.arrow.white.a +++ b/src/fx/fx.hgr.arrow.white.a @@ -195,3 +195,4 @@ copymasks4 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.bar.dissolve.a b/src/fx/fx.hgr.bar.dissolve.a index bac3dc619..de770e35a 100644 --- a/src/fx/fx.hgr.bar.dissolve.a +++ b/src/fx/fx.hgr.bar.dissolve.a @@ -40,3 +40,4 @@ row2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.block.fizzle.a b/src/fx/fx.hgr.block.fizzle.a index d262f0a22..260739b36 100644 --- a/src/fx/fx.hgr.block.fizzle.a +++ b/src/fx/fx.hgr.block.fizzle.a @@ -38,3 +38,4 @@ coord = $FE !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.block.fizzle.white.a b/src/fx/fx.hgr.block.fizzle.white.a index 6f88c4039..9343efa28 100644 --- a/src/fx/fx.hgr.block.fizzle.white.a +++ b/src/fx/fx.hgr.block.fizzle.white.a @@ -63,3 +63,5 @@ coord = $FE !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.color.fizzle.a b/src/fx/fx.hgr.color.fizzle.a index f6c72261c..2d5c7c9ac 100644 --- a/src/fx/fx.hgr.color.fizzle.a +++ b/src/fx/fx.hgr.color.fizzle.a @@ -80,3 +80,4 @@ Coordinates !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.common.a b/src/fx/fx.hgr.common.a index c2c78a06b..8643153e7 100644 --- a/src/fx/fx.hgr.common.a +++ b/src/fx/fx.hgr.common.a @@ -3,6 +3,7 @@ ; !source "src/fx/macros.a" +!macro HGR_CALC_ROUTINES { HGRCalc ; in: A = HGR row (0x00..0xBF) ; out: A/X clobbered @@ -14,7 +15,9 @@ HGRCalc ; http://www.txbobsc.com/aal/1986/aal8612.html#a9 +HGR_CALC rts +} +!macro HGR_BLOCK_COPY_ROUTINES { HGRBlockCopy ; in: A = HGR row / 8 (0x00..0x17) ; Y = HGR column (0x00..0x27) @@ -34,26 +37,9 @@ HGRBlockCopyNoRecalc dex bne @loop rts +} -HGRBlockToWhite -; in: A = HGR row / 8 (0x00..0x17) -; Y = HGR column (0x00..0x27) -; out: Y preserved -; X = #$00 -; Z set -; C clear -; all other flags and registers clobbered - +HGR_ROW_CALC - clc - ldx #$08 -@loop - lda #$7F - sta ($26),y - +HGR_INC_WITHIN_BLOCK - dex - bne @loop - rts - +!macro HGR_HALF_BLOCK_COPY_ROUTINES { HGRHalfBlockCopy ; in: A = HGR row / 4 (0x00..0x2F) ; Y = HGR column (0x00..0x27) @@ -75,6 +61,27 @@ HGRStaggerCopy dex bne @loop rts +} + +!macro HGR_WHITE_ROUTINES { +HGRBlockToWhite +; in: A = HGR row / 8 (0x00..0x17) +; Y = HGR column (0x00..0x27) +; out: Y preserved +; X = #$00 +; Z set +; C clear +; all other flags and registers clobbered + +HGR_ROW_CALC + clc + ldx #$08 +@loop + lda #$7F + sta ($26),y + +HGR_INC_WITHIN_BLOCK + dex + bne @loop + rts HGRHalfBlockToWhite ; in: A = HGR row / 4 (0x00..0x2F) @@ -97,7 +104,9 @@ HGRStaggerToWhite dex bne @loop rts +} +!macro HGR_COPY_MASK_ROUTINES { SetCopyMask ; in: A/Y points to 8-byte array of bit masks used by HGRBlockCopyWithMask +ST16 CopyMaskAddr @@ -125,3 +134,4 @@ CopyMaskAddr=*+1 dex bpl HGRBlockCopyWithMasksLoop rts +} diff --git a/src/fx/fx.hgr.crystal.a b/src/fx/fx.hgr.crystal.a index e0d1f99a1..27124f5a0 100644 --- a/src/fx/fx.hgr.crystal.a +++ b/src/fx/fx.hgr.crystal.a @@ -54,3 +54,5 @@ !byte $80 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.diagonal.a b/src/fx/fx.hgr.diagonal.a index 2768d81a1..47de5bae5 100644 --- a/src/fx/fx.hgr.diagonal.a +++ b/src/fx/fx.hgr.diagonal.a @@ -60,3 +60,5 @@ copymasks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.diagonal2.a b/src/fx/fx.hgr.diagonal2.a index 5b850e1a3..c6662c382 100644 --- a/src/fx/fx.hgr.diagonal2.a +++ b/src/fx/fx.hgr.diagonal2.a @@ -61,3 +61,5 @@ copymasks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.diagonal3.a b/src/fx/fx.hgr.diagonal3.a index a303c5ffc..87b005deb 100644 --- a/src/fx/fx.hgr.diagonal3.a +++ b/src/fx/fx.hgr.diagonal3.a @@ -62,3 +62,5 @@ copymasks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.diagonal4.a b/src/fx/fx.hgr.diagonal4.a index 4e9093599..6626a4a8f 100644 --- a/src/fx/fx.hgr.diagonal4.a +++ b/src/fx/fx.hgr.diagonal4.a @@ -62,3 +62,5 @@ copymasks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.diamond.a b/src/fx/fx.hgr.diamond.a index e35eef704..aaadc28bc 100644 --- a/src/fx/fx.hgr.diamond.a +++ b/src/fx/fx.hgr.diamond.a @@ -146,3 +146,5 @@ copymasks4 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.fourspiral.a b/src/fx/fx.hgr.fourspiral.a index 8d2a5c129..139dc3037 100644 --- a/src/fx/fx.hgr.fourspiral.a +++ b/src/fx/fx.hgr.fourspiral.a @@ -91,3 +91,4 @@ !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.foursquare.white.a b/src/fx/fx.hgr.foursquare.white.a index d1c434bc9..30ac8afc2 100644 --- a/src/fx/fx.hgr.foursquare.white.a +++ b/src/fx/fx.hgr.foursquare.white.a @@ -73,3 +73,5 @@ !byte $80 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.halfblock.fizzle.a b/src/fx/fx.hgr.halfblock.fizzle.a index c6afff9e4..dce3c2688 100644 --- a/src/fx/fx.hgr.halfblock.fizzle.a +++ b/src/fx/fx.hgr.halfblock.fizzle.a @@ -38,3 +38,4 @@ coord = $FE !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.halfblock.fizzle.white.a b/src/fx/fx.hgr.halfblock.fizzle.white.a index 115692387..ea939527b 100644 --- a/src/fx/fx.hgr.halfblock.fizzle.white.a +++ b/src/fx/fx.hgr.halfblock.fizzle.white.a @@ -63,3 +63,5 @@ coord = $FE !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.interlock.lr.a b/src/fx/fx.hgr.interlock.lr.a index 579d9c51d..01a93974e 100644 --- a/src/fx/fx.hgr.interlock.lr.a +++ b/src/fx/fx.hgr.interlock.lr.a @@ -41,3 +41,4 @@ row = $FF !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.interlock.ud.a b/src/fx/fx.hgr.interlock.ud.a index 8526eaff9..e8fd89e2b 100644 --- a/src/fx/fx.hgr.interlock.ud.a +++ b/src/fx/fx.hgr.interlock.ud.a @@ -40,3 +40,4 @@ row2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.lr.by.pixel.a b/src/fx/fx.hgr.lr.by.pixel.a index 7772e3168..6d65bf11b 100644 --- a/src/fx/fx.hgr.lr.by.pixel.a +++ b/src/fx/fx.hgr.lr.by.pixel.a @@ -112,3 +112,4 @@ copymasks !byte $FF,$BF,$9F,$8F,$87,$83,$81 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.meet.in.the.middle.a b/src/fx/fx.hgr.meet.in.the.middle.a index 62e5f4ae7..39493a9f6 100644 --- a/src/fx/fx.hgr.meet.in.the.middle.a +++ b/src/fx/fx.hgr.meet.in.the.middle.a @@ -95,3 +95,4 @@ copymasks2 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.onesquare.white.a b/src/fx/fx.hgr.onesquare.white.a index f3683f9e4..3105e9096 100644 --- a/src/fx/fx.hgr.onesquare.white.a +++ b/src/fx/fx.hgr.onesquare.white.a @@ -73,3 +73,5 @@ !byte $80 !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.r.by.pixel.a b/src/fx/fx.hgr.r.by.pixel.a index 27711ef62..cbf720482 100644 --- a/src/fx/fx.hgr.r.by.pixel.a +++ b/src/fx/fx.hgr.r.by.pixel.a @@ -63,3 +63,4 @@ copymasks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.redlines.a b/src/fx/fx.hgr.redlines.a index 686d65507..3e842bcef 100644 --- a/src/fx/fx.hgr.redlines.a +++ b/src/fx/fx.hgr.redlines.a @@ -98,3 +98,4 @@ CopyLine !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.soft.ud.a b/src/fx/fx.hgr.soft.ud.a index dbe662e76..73ec17054 100644 --- a/src/fx/fx.hgr.soft.ud.a +++ b/src/fx/fx.hgr.soft.ud.a @@ -149,3 +149,4 @@ masks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.soft.ud.in.a b/src/fx/fx.hgr.soft.ud.in.a index 9381294a8..d90cdfccc 100644 --- a/src/fx/fx.hgr.soft.ud.in.a +++ b/src/fx/fx.hgr.soft.ud.in.a @@ -157,3 +157,4 @@ masks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.soft.ud.out.a b/src/fx/fx.hgr.soft.ud.out.a index d945094fe..75eb4f367 100644 --- a/src/fx/fx.hgr.soft.ud.out.a +++ b/src/fx/fx.hgr.soft.ud.out.a @@ -160,3 +160,4 @@ masks !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES diff --git a/src/fx/fx.hgr.spiral.a b/src/fx/fx.hgr.spiral.a index 94a0c35f0..87e7b1d96 100644 --- a/src/fx/fx.hgr.spiral.a +++ b/src/fx/fx.hgr.spiral.a @@ -78,3 +78,4 @@ !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.split.ud.intro.a b/src/fx/fx.hgr.split.ud.intro.a index f6a2112f7..bf6646362 100644 --- a/src/fx/fx.hgr.split.ud.intro.a +++ b/src/fx/fx.hgr.split.ud.intro.a @@ -124,3 +124,5 @@ row2 = $FF !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_CALC_ROUTINES + +HGR_WHITE_ROUTINES diff --git a/src/fx/fx.hgr.stagger.lr.a b/src/fx/fx.hgr.stagger.lr.a index 061bfed07..1a1e303f6 100644 --- a/src/fx/fx.hgr.stagger.lr.a +++ b/src/fx/fx.hgr.stagger.lr.a @@ -41,3 +41,4 @@ col2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.stagger.lr.white.a b/src/fx/fx.hgr.stagger.lr.white.a index 5ed71ad16..e4a1b78e0 100644 --- a/src/fx/fx.hgr.stagger.lr.white.a +++ b/src/fx/fx.hgr.stagger.lr.white.a @@ -70,3 +70,5 @@ col2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.stagger.ud.a b/src/fx/fx.hgr.stagger.ud.a index 95252d9ba..17e3e0768 100644 --- a/src/fx/fx.hgr.stagger.ud.a +++ b/src/fx/fx.hgr.stagger.ud.a @@ -37,3 +37,4 @@ row2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.stagger.ud.white.a b/src/fx/fx.hgr.stagger.ud.white.a index 94483df59..642fc08d2 100644 --- a/src/fx/fx.hgr.stagger.ud.white.a +++ b/src/fx/fx.hgr.stagger.ud.white.a @@ -69,3 +69,5 @@ row2 = $ff !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_WHITE_ROUTINES + +HGR_HALF_BLOCK_COPY_ROUTINES diff --git a/src/fx/fx.hgr.tri.fizzle.a b/src/fx/fx.hgr.tri.fizzle.a index c7f2dfd20..61e9b1bac 100644 --- a/src/fx/fx.hgr.tri.fizzle.a +++ b/src/fx/fx.hgr.tri.fizzle.a @@ -112,3 +112,5 @@ Coordinates !source "src/wait.a" !source "src/fx/fx.hgr.common.a" + +HGR_COPY_MASK_ROUTINES + +HGR_BLOCK_COPY_ROUTINES