Comment cleanup and minro refactoring
This commit is contained in:
parent
515ec5280b
commit
869d80af1e
20
src/Tiles.s
20
src/Tiles.s
|
@ -428,22 +428,22 @@ UserHook1 rtl
|
||||||
; A = Table proc index
|
; A = Table proc index
|
||||||
;
|
;
|
||||||
; see TileProcTables in static/TileStore.s
|
; see TileProcTables in static/TileStore.s
|
||||||
tblPtr equ blttmp
|
|
||||||
_SetTileProcs
|
_SetTileProcs
|
||||||
|
:tblPtr equ blttmp
|
||||||
|
|
||||||
; Multiple the proc index by 6 to get the correct table entry offset
|
; Multiple the proc index by 6 to get the correct table entry offset
|
||||||
|
|
||||||
asl
|
asl
|
||||||
sta tblPtr
|
sta :tblPtr
|
||||||
asl
|
asl
|
||||||
adc tblPtr
|
adc :tblPtr
|
||||||
sta tblPtr
|
sta :tblPtr
|
||||||
|
|
||||||
; Add this offset to the base table address
|
; Add this offset to the base table address
|
||||||
|
|
||||||
tya
|
tya
|
||||||
adc tblPtr
|
adc :tblPtr
|
||||||
sta tblPtr
|
sta :tblPtr
|
||||||
|
|
||||||
; Set the pointer to this bank
|
; Set the pointer to this bank
|
||||||
|
|
||||||
|
@ -451,20 +451,20 @@ _SetTileProcs
|
||||||
phk
|
phk
|
||||||
pla
|
pla
|
||||||
and #$00FF
|
and #$00FF
|
||||||
sta tblPtr+2
|
sta :tblPtr+2
|
||||||
|
|
||||||
; Lookup the tile procedures
|
; Lookup the tile procedures
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
lda [tblPtr],y
|
lda [:tblPtr],y
|
||||||
stal K_TS_BASE_TILE_DISP,x
|
stal K_TS_BASE_TILE_DISP,x
|
||||||
|
|
||||||
ldy #2
|
ldy #2
|
||||||
lda [tblPtr],y
|
lda [:tblPtr],y
|
||||||
stal K_TS_SPRITE_TILE_DISP,x
|
stal K_TS_SPRITE_TILE_DISP,x
|
||||||
|
|
||||||
ldy #4
|
ldy #4
|
||||||
lda [tblPtr],y
|
lda [:tblPtr],y
|
||||||
stal K_TS_ONE_SPRITE,x
|
stal K_TS_ONE_SPRITE,x
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
|
@ -746,6 +746,7 @@ _TSSetOverlay
|
||||||
|
|
||||||
_TSExit #0;#8
|
_TSExit #0;#8
|
||||||
|
|
||||||
|
; UpdateOverlay(top, bottom, proc)
|
||||||
_TSUpdateOverlay
|
_TSUpdateOverlay
|
||||||
:proc equ FirstParam+0
|
:proc equ FirstParam+0
|
||||||
:bottom equ FirstParam+4
|
:bottom equ FirstParam+4
|
||||||
|
|
|
@ -240,9 +240,9 @@ epilogue_1 tsc
|
||||||
; its passed state, because having the carry bit clear prevents evaluation of
|
; its passed state, because having the carry bit clear prevents evaluation of
|
||||||
; the V bit.
|
; the V bit.
|
||||||
;
|
;
|
||||||
; Version 2: In order to improve performance, especially for two-layer tiles + sprites, the
|
; 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
|
; snippet code has a fixed structure so that the constant DATA and MASK values
|
||||||
; MASK values always exist in the same location, regarless of the tile type. The
|
; 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
|
; 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
|
; 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.
|
; field JMP instruction than it is to rebuild 20+ bytes of code each time.
|
||||||
|
|
|
@ -286,7 +286,7 @@ DynamicOverTwoLyr
|
||||||
; tile blitter in the TwoLayer function set sees that a tile is marked as DAMAGED, it must
|
; tile blitter in the TwoLayer function set sees that a tile is marked as DAMAGED, it must
|
||||||
; restore the original code structure before proceeding.
|
; 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
|
; restored. This is actually less work than a lot of the snippet macros were doing before
|
||||||
; applying the fixed snippet optimization.
|
; applying the fixed snippet optimization.
|
||||||
DynamicUnderTwoLyr
|
DynamicUnderTwoLyr
|
||||||
|
|
Loading…
Reference in New Issue