Comment cleanup and minro refactoring

This commit is contained in:
Lucas Scharenbroich 2023-04-28 00:13:05 -05:00
parent 515ec5280b
commit 869d80af1e
4 changed files with 19 additions and 18 deletions

View File

@ -428,22 +428,22 @@ UserHook1 rtl
; A = Table proc index
;
; see TileProcTables in static/TileStore.s
tblPtr equ blttmp
_SetTileProcs
:tblPtr equ blttmp
; Multiple the proc index by 6 to get the correct table entry offset
asl
sta tblPtr
sta :tblPtr
asl
adc tblPtr
sta tblPtr
adc :tblPtr
sta :tblPtr
; Add this offset to the base table address
tya
adc tblPtr
sta tblPtr
adc :tblPtr
sta :tblPtr
; Set the pointer to this bank
@ -451,20 +451,20 @@ _SetTileProcs
phk
pla
and #$00FF
sta tblPtr+2
sta :tblPtr+2
; Lookup the tile procedures
ldy #0
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_BASE_TILE_DISP,x
ldy #2
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_SPRITE_TILE_DISP,x
ldy #4
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_ONE_SPRITE,x
rts

View File

@ -746,6 +746,7 @@ _TSSetOverlay
_TSExit #0;#8
; UpdateOverlay(top, bottom, proc)
_TSUpdateOverlay
:proc equ FirstParam+0
:bottom equ FirstParam+4

View File

@ -240,14 +240,14 @@ epilogue_1 tsc
; its passed state, because having the carry bit clear prevents evaluation of
; the V bit.
;
; Version 2: In order to improve performance, especially for two-layer tiles + sprites, the
; snippet code was revised to have a fixed structure so that the constant DATA and
; MASK values always exist in the same location, regarless of the tile type. The
; tradeoff is that there is a different entry point into the snippet based on the
; tile type, but that is significantly cheaper to lookup and patch into the code
; field JMP instruction than it is to rebuild 20+ bytes of code each time.
; In order to improve performance, especially for two-layer tiles + sprites, the
; snippet code has a fixed structure so that the constant DATA and MASK values
; always exist in the same location, regarless of the tile type. The
; tradeoff is that there is a different entry point into the snippet based on the
; tile type, but that is significantly cheaper to lookup and patch into the code
; field JMP instruction than it is to rebuild 20+ bytes of code each time.
;
; There are different snippet templates + offset tables based on the EngineMode
; There are different snippet templates + offset tables based on the EngineMode
;
; EngineMode
;

View File

@ -286,7 +286,7 @@ DynamicOverTwoLyr
; tile blitter in the TwoLayer function set sees that a tile is marked as DAMAGED, it must
; restore the original code structure before proceeding.
;
; The damages area is not too bad -- just the 10 bytes from [2, 10] are overwritten and must be
; The damaged area is not too bad -- just the 10 bytes from [2, 10] are overwritten and must be
; restored. This is actually less work than a lot of the snippet macros were doing before
; applying the fixed snippet optimization.
DynamicUnderTwoLyr