Optimization

This commit is contained in:
blondie7575 2017-08-07 21:41:52 -07:00
parent e7ada08d40
commit 0b5ba93a22
2 changed files with 13 additions and 13 deletions

Binary file not shown.

View File

@ -63,14 +63,24 @@ renderClippedSpanChain:
sta renderSpanComplete+1 ; 4
; Find right edge of screen within span chains
; = 27 cycles per skipped span
; = 26 cycles per skipped span
renderClippedSpanChainLoop:
lda spanChain,y ; 4
sec ; 2
sbc <RIGHTEDGE ; 3
bmi renderClippedSpanChainNextSpan ; 2/3
beq renderClippedSpanChainNextSpan ; 2/3
beq renderClippedSpanChainNextSpan ; 2
bpl renderClippedSpanChainLoop2 ; 2
renderClippedSpanChainNextSpan:
; Track remaining distance from right edge and
; continue searching for visible right edge
eor #$ffff ; 2
inc ; 2
sta <RIGHTEDGE ; 3
dey ; 2
dey ; 2
bra renderClippedSpanChainLoop ; 3
renderClippedSpanChainLoop2:
; Now render spans until left edge of screen
@ -107,16 +117,6 @@ renderClippedSpanChainRenderNext:
lda spanChain,y ; 5
bra renderClippedSpanChainLoop2 ; 3
renderClippedSpanChainNextSpan:
; Track remaining distance from right edge and
; continue searching for visible right edge
eor #$ffff ; 2
inc ; 2
sta <RIGHTEDGE ; 3
dey ; 2
dey ; 2
bra renderClippedSpanChainLoop ; 3
renderClippedSpanChainLastSpan:
; Render visible portion of last visible span
; = 26 cycles per row