mirror of
https://github.com/a2-4am/4cade.git
synced 2025-01-17 18:30:41 +00:00
split hgr.common routines into separate macros and make effects declare which ones they use
This commit is contained in:
parent
c455158253
commit
3189ef9176
@ -7,6 +7,8 @@ coord = $FE
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
!source "src/fx/fx.dhgr.common.a"
|
!source "src/fx/fx.dhgr.common.a"
|
||||||
|
|
||||||
Start
|
Start
|
||||||
|
@ -59,3 +59,4 @@ row = $FF
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -88,3 +88,5 @@ copymasks4
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
@ -195,3 +195,4 @@ copymasks4
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -40,3 +40,4 @@ row2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -38,3 +38,4 @@ coord = $FE
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -63,3 +63,5 @@ coord = $FE
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -80,3 +80,4 @@ Coordinates
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
;
|
;
|
||||||
!source "src/fx/macros.a"
|
!source "src/fx/macros.a"
|
||||||
|
|
||||||
|
!macro HGR_CALC_ROUTINES {
|
||||||
HGRCalc
|
HGRCalc
|
||||||
; in: A = HGR row (0x00..0xBF)
|
; in: A = HGR row (0x00..0xBF)
|
||||||
; out: A/X clobbered
|
; out: A/X clobbered
|
||||||
@ -14,7 +15,9 @@ HGRCalc
|
|||||||
; http://www.txbobsc.com/aal/1986/aal8612.html#a9
|
; http://www.txbobsc.com/aal/1986/aal8612.html#a9
|
||||||
+HGR_CALC
|
+HGR_CALC
|
||||||
rts
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
!macro HGR_BLOCK_COPY_ROUTINES {
|
||||||
HGRBlockCopy
|
HGRBlockCopy
|
||||||
; in: A = HGR row / 8 (0x00..0x17)
|
; in: A = HGR row / 8 (0x00..0x17)
|
||||||
; Y = HGR column (0x00..0x27)
|
; Y = HGR column (0x00..0x27)
|
||||||
@ -34,26 +37,9 @@ HGRBlockCopyNoRecalc
|
|||||||
dex
|
dex
|
||||||
bne @loop
|
bne @loop
|
||||||
rts
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
HGRBlockToWhite
|
!macro HGR_HALF_BLOCK_COPY_ROUTINES {
|
||||||
; 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
|
|
||||||
|
|
||||||
HGRHalfBlockCopy
|
HGRHalfBlockCopy
|
||||||
; in: A = HGR row / 4 (0x00..0x2F)
|
; in: A = HGR row / 4 (0x00..0x2F)
|
||||||
; Y = HGR column (0x00..0x27)
|
; Y = HGR column (0x00..0x27)
|
||||||
@ -75,6 +61,27 @@ HGRStaggerCopy
|
|||||||
dex
|
dex
|
||||||
bne @loop
|
bne @loop
|
||||||
rts
|
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
|
HGRHalfBlockToWhite
|
||||||
; in: A = HGR row / 4 (0x00..0x2F)
|
; in: A = HGR row / 4 (0x00..0x2F)
|
||||||
@ -97,7 +104,9 @@ HGRStaggerToWhite
|
|||||||
dex
|
dex
|
||||||
bne @loop
|
bne @loop
|
||||||
rts
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
!macro HGR_COPY_MASK_ROUTINES {
|
||||||
SetCopyMask
|
SetCopyMask
|
||||||
; in: A/Y points to 8-byte array of bit masks used by HGRBlockCopyWithMask
|
; in: A/Y points to 8-byte array of bit masks used by HGRBlockCopyWithMask
|
||||||
+ST16 CopyMaskAddr
|
+ST16 CopyMaskAddr
|
||||||
@ -125,3 +134,4 @@ CopyMaskAddr=*+1
|
|||||||
dex
|
dex
|
||||||
bpl HGRBlockCopyWithMasksLoop
|
bpl HGRBlockCopyWithMasksLoop
|
||||||
rts
|
rts
|
||||||
|
}
|
||||||
|
@ -54,3 +54,5 @@
|
|||||||
!byte $80
|
!byte $80
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -60,3 +60,5 @@ copymasks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -61,3 +61,5 @@ copymasks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -62,3 +62,5 @@ copymasks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -62,3 +62,5 @@ copymasks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -146,3 +146,5 @@ copymasks4
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -91,3 +91,4 @@
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -73,3 +73,5 @@
|
|||||||
!byte $80
|
!byte $80
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -38,3 +38,4 @@ coord = $FE
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -63,3 +63,5 @@ coord = $FE
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -41,3 +41,4 @@ row = $FF
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -40,3 +40,4 @@ row2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -112,3 +112,4 @@ copymasks
|
|||||||
!byte $FF,$BF,$9F,$8F,$87,$83,$81
|
!byte $FF,$BF,$9F,$8F,$87,$83,$81
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -95,3 +95,4 @@ copymasks2
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -73,3 +73,5 @@
|
|||||||
!byte $80
|
!byte $80
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -63,3 +63,4 @@ copymasks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -98,3 +98,4 @@ CopyLine
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -149,3 +149,4 @@ masks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -157,3 +157,4 @@ masks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -160,3 +160,4 @@ masks
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
@ -78,3 +78,4 @@
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
@ -124,3 +124,5 @@ row2 = $FF
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_CALC_ROUTINES
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
@ -41,3 +41,4 @@ col2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -70,3 +70,5 @@ col2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -37,3 +37,4 @@ row2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -69,3 +69,5 @@ row2 = $ff
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_WHITE_ROUTINES
|
||||||
|
+HGR_HALF_BLOCK_COPY_ROUTINES
|
||||||
|
@ -112,3 +112,5 @@ Coordinates
|
|||||||
|
|
||||||
!source "src/wait.a"
|
!source "src/wait.a"
|
||||||
!source "src/fx/fx.hgr.common.a"
|
!source "src/fx/fx.hgr.common.a"
|
||||||
|
+HGR_COPY_MASK_ROUTINES
|
||||||
|
+HGR_BLOCK_COPY_ROUTINES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user