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 FastProcs
FastOverZA dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0 FastOverZA dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0
FastOverZV dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0 FastOverZV dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0
FastOverNA dw _TBCopyDataAFast,GenericOverZero,_OneSpriteFastOverA FastOverNA dw _TBCopyDataAFast,GenericOverAFast,_OneSpriteFastOverA
FastOverNV dw _TBCopyDataVFast,GenericOverZero,_OneSpriteFastOverV FastOverNV dw _TBCopyDataVFast,GenericOverVFast,_OneSpriteFastOverV
;FastOverNA dw _TBCopyDataAFast,GenericOverAFast,_OneSpriteFastOverA
;FastOverNV dw _TBCopyDataVFast,GenericOverVFast,_OneSpriteFastOverV
FastUnderZA dw _TBConstTile0,GenericUnderZero,GenericUnderZero FastUnderZA dw _TBConstTile0,GenericUnderZero,GenericUnderZero
FastUnderZV dw _TBConstTile0,GenericUnderZero,GenericUnderZero FastUnderZV dw _TBConstTile0,GenericUnderZero,GenericUnderZero
FastUnderNA dw _TBConstTile0,GenericOverZero,_OneSpriteFastUnderA FastUnderNA dw _TBCopyDataAFast,GenericUnderAFast,_OneSpriteFastUnderA
FastUnderNV dw _TBConstTile0,GenericOverZero,_OneSpriteFastOver0 FastUnderNV dw _TBCopyDataVFast,GenericUnderVFast,_OneSpriteFastUnderV
;FastUnderNA dw _TBCopyDataFast,GenericUnderAFast,_OneSpriteFastUnderA ;FastUnderNA dw _TBCopyDataFast,GenericUnderAFast,_OneSpriteFastUnderA
;FastUnderNV dw _TBCopyDataVFast,GenericUnderVFast,_OneSpriteFastUnderV ;FastUnderNV dw _TBCopyDataVFast,GenericUnderVFast,_OneSpriteFastUnderV

View File

@ -90,12 +90,12 @@ GenericUnderAFast
lup 8 lup 8
lda tmp_sprite_data+{]line*4} lda tmp_sprite_data+{]line*4}
andl tiledata+{]line*4}+32,x andl tiledata+{]line*4}+32,x
oral tiledata+{]line*4}+32,x oral tiledata+{]line*4},x
sta: $0004+{]line*$1000},y sta: $0004+{]line*$1000},y
lda tmp_sprite_data+{]line*4}+2 lda tmp_sprite_data+{]line*4}+2
andl tiledata+{]line*4}+32+2,x 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 sta: $0001+{]line*$1000},y
]line equ ]line+1 ]line equ ]line+1
--^ --^
@ -116,12 +116,12 @@ GenericUnderVFast
lup 8 lup 8
lda tmp_sprite_data+{]line*4} lda tmp_sprite_data+{]line*4}
andl tiledata+{]src*4}+32,x andl tiledata+{]src*4}+32,x
oral tiledata+{]src*4}+32,x oral tiledata+{]src*4},x
sta: $0004+{]line*$1000},y sta: $0004+{]line*$1000},y
lda tmp_sprite_data+{]line*4}+2 lda tmp_sprite_data+{]line*4}+2
andl tiledata+{]src*4}+32+2,x 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 sta: $0001+{]line*$1000},y
]src equ ]src-1 ]src equ ]src-1
]dest equ ]dest+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 ; 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 ; to the configurable routine which is set in SetTile and knows what to do
; based on the tile properties (over/under, engine mode, etc.) ; 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 TwoSprites tyx
jsr CopyTwoSpritesDataAndMaskToDP jmp CopyTwoSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
ThreeSprites tyx ThreeSprites tyx
jsr CopyThreeSpritesDataAndMaskToDP jmp CopyThreeSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
FourSprites tyx FourSprites tyx
jsr CopyFourSpritesDataAndMaskToDP jmp CopyFourSpritesDataAndMaskToDP
jmp (K_TS_SPRITE_TILE_DISP,x)
; Helper functions (and macros) ; Helper functions (and macros)

View File

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

View File

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