mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-25 05:29:34 +00:00
tfv: inner loop optimization
This commit is contained in:
parent
863e5e5957
commit
dc0827941e
@ -838,7 +838,7 @@ match:
|
||||
|
||||
ram[SCREEN_X]++;
|
||||
if (ram[SCREEN_X] >= LOWRES_W) break;
|
||||
cycles.mode7+=43;
|
||||
cycles.mode7+=41;
|
||||
|
||||
|
||||
/* cache last value */
|
||||
|
@ -186,5 +186,19 @@ In-line unsigned multiply inside of signed multiply (save 12 cycles)
|
||||
Frame Rate = 5.42 fps
|
||||
|
||||
|
||||
Have loop counter count down from 40 instead of count up (avoid compare)
|
||||
Cycles: flying= 187
|
||||
Cycles: getkey= 46
|
||||
Cycles: page_flip= 26
|
||||
Cycles: multiply= 40,888
|
||||
Cycles: mode7= 115,538
|
||||
Cycles: lookup_map= 22,747
|
||||
Cycles: put_sprite= 2,561
|
||||
================================
|
||||
Total = 181,993
|
||||
Frame Rate = 5.49 fps
|
||||
|
||||
|
||||
|
||||
Each cycle removed from inner X loop saves
|
||||
32*40=1280 cycles
|
||||
|
@ -935,8 +935,7 @@ calc_horizontal_scale:
|
||||
|
||||
; brk ; space_y = f7:04
|
||||
|
||||
; FIXME: start at 40 and decrement?
|
||||
ldx #0 ; was SCREEN_X ; 2
|
||||
ldx #40 ; was SCREEN_X ; 2
|
||||
;==========
|
||||
; 22
|
||||
screenx_loop:
|
||||
@ -994,11 +993,10 @@ dyi_label:
|
||||
adc #0 ; 2
|
||||
sta SPACEY_I ; 3
|
||||
|
||||
inx ;inc SCREEN_X ; 2
|
||||
cpx #40 ; LOWRES width ; 2
|
||||
beq done_screenx_loop ; 2nt/3
|
||||
dex ; decrement SCREEN_X ; 2
|
||||
beq done_screenx_loop ; branch until we've done 40 ; 2nt/3
|
||||
;=============
|
||||
; 43
|
||||
; 41
|
||||
|
||||
|
||||
; cache color and return if same as last time
|
||||
|
Loading…
Reference in New Issue
Block a user