I don't know many tricks, but one that I use SOME TIMES is a single test for the space
character. If it is the space character AND the tile data has cleared pixel data on it, then
I just jump to the pixels remaining ( NC: Tile buffer position or what it's called ) variable adjustment.
Since it's a space it does not need to be processed really.
Another optimization I do at times is this...These tables replace the
the shifting loop that can eat up some cpu cycles. If the room
is available, I suggest using the shifting table. Not sure off hand of any
other optimizations.
For 8x16 VWF
;-------------------;
; Shifting Code ;
;-------------------;
DoShift:
; Assumes X = Index to Shift Table
; Assumes Accum = Font data
PHP
REP #$20
AND #$00FF
XBA
JMP (_Shifter,X)
_Shifter:
dw _1,_2,_3,_4,_5,_6,_7
;-------------;
; ;
;-------------;
_1:
LSR
_2:
LSR
_3:
LSR
_4:
LSR
_5:
LSR
_6:
LSR
_7:
LSR
;------------;
PLP
RTS
; For 16x16 VWF using 8x16 Tile increments
; and ASL for adding lost pixels to the following
; 8x16 tile
;############################
; Bit Shifting Code ;
;############################
ShiftBits:
; Assumes X = Index to Shift Table
; Assumes Accum = Font data
jmp (_Shifter_,X)
_Shifter_:
dw _R1,_R2,_R3,_R4,_R5,_R6,_R7,_R8,_R9,_RA,_RB,_RC,_RD,_RE,_RF
dw _L1,_L2,_L3,_L4,_L5,_L6,_L7,_L8,_L9,_LA,_LB,_LC,_LD,_LE,_LF
;###########################
; Shift bits to the right ;
;###########################
_R1:
LSR
_R2:
LSR
_R3:
LSR
_R4:
LSR
_R5:
LSR
_R6:
LSR
_R7:
LSR
_R8:
LSR
_R9:
LSR
_RA:
LSR
_RB:
LSR
_RC:
LSR
_RD:
LSR
_RE:
LSR
_RF:
LSR
;------------;
rts
;###########################
; Shift bits to the left ;
;###########################
_L1:
ASL
_L2:
ASL
_L3:
ASL
_L4:
ASL
_L5:
ASL
_L6:
ASL
_L7:
ASL
_L8:
ASL
_L9:
ASL
_LA:
ASL
_LB:
ASL
_LC:
ASL
_LD:
ASL
_LE:
ASL
_LF:
ASL
;------------;
rts