mirror of
https://github.com/a2-4am/4cade.git
synced 2025-01-23 13:34:31 +00:00
shave some cycles (better A management allows us to remove an LDA in INC macro)
This commit is contained in:
parent
1ab825a37e
commit
abe5cdc25b
@ -12,22 +12,22 @@ col = $FE
|
||||
counter = $FF
|
||||
|
||||
!macro INC_HGR_HI_BY .blocks {
|
||||
lda dst+1
|
||||
; lda dst+1
|
||||
adc #(.blocks*4)
|
||||
sta dst+1
|
||||
eor #$60
|
||||
sta src+1
|
||||
}
|
||||
|
||||
!macro INC_HGR_HI {
|
||||
+INC_HGR_HI_BY 1
|
||||
!macro SET_HGR_HI {
|
||||
sta src+1
|
||||
eor #$60
|
||||
sta dst+1
|
||||
}
|
||||
|
||||
!macro RESET_HGR_HI {
|
||||
txa
|
||||
sta src+1
|
||||
eor #$60
|
||||
sta dst+1
|
||||
+SET_HGR_HI
|
||||
}
|
||||
|
||||
; note: .copymask is an immediate value, not an indexed array or a memory address
|
||||
@ -40,7 +40,8 @@ counter = $FF
|
||||
}
|
||||
!macro COPY_WITH_MASK_IMM_AND_INC .copymask {
|
||||
+COPY_WITH_MASK_IMM .copymask
|
||||
+INC_HGR_HI
|
||||
lda dst+1
|
||||
+INC_HGR_HI_BY 1
|
||||
}
|
||||
|
||||
!macro COPY_BYTE {
|
||||
@ -50,7 +51,8 @@ counter = $FF
|
||||
|
||||
!macro COPY_BYTE_AND_INC {
|
||||
+COPY_BYTE
|
||||
+INC_HGR_HI
|
||||
lda dst+1
|
||||
+INC_HGR_HI_BY 1
|
||||
}
|
||||
|
||||
!source "src/fx/macros.a"
|
||||
@ -74,75 +76,52 @@ RowLoop
|
||||
sta dst
|
||||
lda hgrrowhi, x
|
||||
tax
|
||||
sta src+1
|
||||
eor #$60
|
||||
sta dst+1
|
||||
+SET_HGR_HI
|
||||
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block2
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
adc #12
|
||||
sta dst+1
|
||||
eor #$60
|
||||
sta src+1
|
||||
+INC_HGR_HI_BY 3
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000001
|
||||
+COPY_WITH_MASK_IMM %10000001
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block2
|
||||
iny
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block3
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI_BY 2
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000110
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000001
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000001
|
||||
+COPY_WITH_MASK_IMM %10010110
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block3
|
||||
iny
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block4
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI_BY 2
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000111
|
||||
+COPY_WITH_MASK_IMM %10000111
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block4
|
||||
iny
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block5
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI
|
||||
+INC_HGR_HI_BY 1
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011001
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000001
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10000111
|
||||
+COPY_WITH_MASK_IMM %10011001
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block5
|
||||
iny
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block6
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI
|
||||
+INC_HGR_HI_BY 1
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10011111
|
||||
+COPY_WITH_MASK_IMM %10011111
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block6
|
||||
iny
|
||||
@ -171,7 +150,6 @@ RowLoop
|
||||
@switchtoaux
|
||||
sta $C003
|
||||
sta $C005
|
||||
tya
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block6_aux
|
||||
+COPY_BYTE_AND_INC
|
||||
+COPY_BYTE_AND_INC
|
||||
@ -197,67 +175,49 @@ RowLoop
|
||||
@block5_aux
|
||||
dey
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block4_aux
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI
|
||||
+INC_HGR_HI_BY 1
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM %11111100
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block4_aux
|
||||
dey
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block3_aux
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI
|
||||
+INC_HGR_HI_BY 1
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11001100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11111100
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM %11001100
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block3_aux
|
||||
dey
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block2_aux
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI_BY 2
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11110000
|
||||
+COPY_WITH_MASK_IMM %11110000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block2_aux
|
||||
dey
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @block1_aux
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI_BY 2
|
||||
+COPY_WITH_MASK_IMM_AND_INC %10110000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11000000
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11000000
|
||||
+COPY_WITH_MASK_IMM %10110000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
+RESET_HGR_HI
|
||||
@block1_aux
|
||||
dey
|
||||
+BRANCH_IF_Y_IS_OFFSCREEN @switchtomain
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
+INC_HGR_HI_BY 3
|
||||
+COPY_WITH_MASK_IMM_AND_INC %11000000
|
||||
+COPY_WITH_MASK_IMM %11000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM_AND_INC %00000000
|
||||
; +COPY_WITH_MASK_IMM %00000000
|
||||
@switchtomain
|
||||
sta $C002
|
||||
sta $C004
|
||||
|
Loading…
x
Reference in New Issue
Block a user