Final cleanups for Fast mode

This commit is contained in:
Lucas Scharenbroich 2022-06-21 11:23:06 -05:00
parent 400851259d
commit 2820d318a0
5 changed files with 22 additions and 21 deletions

View File

@ -352,14 +352,12 @@ _SetTileProcs
FastProcs
FastOverZA dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0
FastOverZV dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0
FastOverNA dw _TBCopyDataAFast,GenericOverZero,_OneSpriteFastOverA
FastOverNV dw _TBCopyDataVFast,GenericOverZero,_OneSpriteFastOverV
;FastOverNA dw _TBCopyDataAFast,GenericOverAFast,_OneSpriteFastOverA
;FastOverNV dw _TBCopyDataVFast,GenericOverVFast,_OneSpriteFastOverV
FastOverNA dw _TBCopyDataAFast,GenericOverAFast,_OneSpriteFastOverA
FastOverNV dw _TBCopyDataVFast,GenericOverVFast,_OneSpriteFastOverV
FastUnderZA dw _TBConstTile0,GenericUnderZero,GenericUnderZero
FastUnderZV dw _TBConstTile0,GenericUnderZero,GenericUnderZero
FastUnderNA dw _TBConstTile0,GenericOverZero,_OneSpriteFastUnderA
FastUnderNV dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0
FastUnderNA dw _TBCopyDataAFast,GenericUnderAFast,_OneSpriteFastUnderA
FastUnderNV dw _TBCopyDataVFast,GenericUnderVFast,_OneSpriteFastUnderV
;FastUnderNA dw _TBCopyDataFast,GenericUnderAFast,_OneSpriteFastUnderA
;FastUnderNV dw _TBCopyDataVFast,GenericUnderVFast,_OneSpriteFastUnderV

View File

@ -90,12 +90,12 @@ GenericUnderAFast
lup 8
lda tmp_sprite_data+{]line*4}
andl tiledata+{]line*4}+32,x
oral tiledata+{]line*4}+32,x
oral tiledata+{]line*4},x
sta: $0004+{]line*$1000},y
lda tmp_sprite_data+{]line*4}+2
andl tiledata+{]line*4}+32+2,x
oral tiledata+{]line*4}+32+2,x
oral tiledata+{]line*4}+2,x
sta: $0001+{]line*$1000},y
]line equ ]line+1
--^
@ -116,12 +116,12 @@ GenericUnderVFast
lup 8
lda tmp_sprite_data+{]line*4}
andl tiledata+{]src*4}+32,x
oral tiledata+{]src*4}+32,x
oral tiledata+{]src*4},x
sta: $0004+{]line*$1000},y
lda tmp_sprite_data+{]line*4}+2
andl tiledata+{]src*4}+32+2,x
oral tiledata+{]src*4}+32+2,x
oral tiledata+{]src*4}+2,x
sta: $0001+{]line*$1000},y
]src equ ]src-1
]dest equ ]dest+1

View File

@ -22,17 +22,17 @@ _RenderTile
; flatten the sprite data into the direct page workspace and then pass control
; to the configurable routine which is set in SetTile and knows what to do
; based on the tile properties (over/under, engine mode, etc.)
;
; NOTE: Could pull the CopyXXXSprites function inline and same the 3 cycles for the JMP,
; - or - put the TYX into the macro and jump directly from there.
TwoSprites tyx
jsr CopyTwoSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
jmp CopyTwoSpritesDataAndMaskToDP
ThreeSprites tyx
jsr CopyThreeSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
jmp CopyThreeSpritesDataAndMaskToDP
FourSprites tyx
jsr CopyFourSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
jmp CopyFourSpritesDataAndMaskToDP
; Helper functions (and macros)

View File

@ -27,11 +27,8 @@ _OneSpriteFastOver0
plb ; Restore the TileStore bank
rts
; Next implementation; drawing a sprite onto a regular tile. In this case we need to make
; use of the K_TS_COPY_TILE_DATA function because that takes care of copying the correct
; tile data into the direct page buffer.
; The 1-sprite dispatch prserves the X-register, so it already points to the TileStore
; Next implementation; drawing a sprite onto a regular tile. The 1-sprite dispatch preerves the
; X-register, so it already points to the TileStore
_OneSpriteFastOverV
jsr FastCopyTileDataV

View File

@ -80,9 +80,13 @@ CopyTwoSpritesDataToDP
]line equ ]line+1
--^
rts
CopyFourSpritesDataAndMaskToDP
CopyThreeSpritesDataAndMaskToDP
CopyTwoSpritesDataAndMaskToDP
pei DP2_SPRITEDATA_AND_TILESTORE_BANKS
plb
]line equ 0
lup 8
ldy #{]line*SPRITE_PLANE_SPAN}
@ -98,5 +102,7 @@ CopyTwoSpritesDataAndMaskToDP
sta tmp_sprite_mask+{]line*4}+2
]line equ ]line+1
--^
plb
jmp (K_TS_SPRITE_TILE_DISP,x)