megademo: add some cycle counts

This commit is contained in:
Vince Weaver 2018-09-26 16:43:26 -04:00
parent 32a242e9d1
commit 6dcb160c22

View File

@ -1,34 +1,44 @@
;================================== ;==================================
; HLINE ; HLINE
;================================== ;==================================
; Color in A ; Color in A
; Y has which line ; Y has which line
; takes 435 cycles
hline: hline:
pha ; 3 pha ; 3
ldx gr_offsets,y ; 4+ ldx gr_offsets,y ; 4+
stx hline_loop+1 ; 4 stx hline_loop+1 ; self-modify code ; 4
lda gr_offsets+1,y ; 4+ lda gr_offsets+1,y ; 4+
clc ; 2 clc ; 2
adc DRAW_PAGE ; 3 adc DRAW_PAGE ; 3
sta hline_loop+2 ; 4 sta hline_loop+2 ; self-modify code ; 4
pla ; 4 pla ; 4
ldx #39 ; 2 ldx #39 ; 2
;===========
; 30
hline_loop: hline_loop:
sta $5d0,X ; 38 ; 5 sta $5d0,X ; 38 ; 5
dex ; 2 dex ; 2
bpl hline_loop ; 2nt/3 bpl hline_loop ; 2nt/3
;===========
; 40*(10)=400
; -1
rts ; 6 rts ; 6
;========================== ;==========================
; Clear gr screen ; Clear gr screen
;========================== ;==========================
; Color in A ; Color in A, Clears 0 to and including Y
; clear_gr: takes 2+(48/2)*(6+435+7)+5 = 10759
; cpl: takes (Y/2)*(6+435+7)+5 = ?
clear_gr: clear_gr:
ldy #46 ldy #46 ; 2
clear_page_loop: clear_page_loop:
jsr hline jsr hline ; 6+435
dey dey ; 2
dey dey ; 2
bpl clear_page_loop bpl clear_page_loop ; 2/3
rts rts ; 6