dos33fsprogs/games/sb/hgr_copy_fast.s

55 lines
883 B
ArmAsm
Raw Normal View History

2023-06-11 17:14:24 +00:00
; special case
2023-06-03 22:37:14 +00:00
;=========================================================
2023-06-11 17:14:24 +00:00
; hgr copy from $A000/$8000 to current DRAW_PAGE
2023-06-03 22:37:14 +00:00
;=========================================================
; would be faster if we unroll it, but much bigger
2023-06-11 17:14:24 +00:00
; old numbers
2023-06-03 22:37:14 +00:00
; 14+ ((14*256)+20)*32 + 5 = 115347 = 8.6fps
; theoretical unrolled, 30*6 bytes bigger (180 bytes?)
; 2 + ((9*32)+5)*256 + 5 = 75015 = 13.3 fps
hgr_copy:
2023-06-11 17:14:24 +00:00
; copy from in A ($80/$A0)
2023-06-03 22:37:14 +00:00
sta hgr_copy_smc+2 ; 4
2023-06-11 17:14:24 +00:00
clc
adc #$20
sta hgr_copy_end_smc+1
; lda #$A0 ; 2
ldx #0 ; 2
2023-06-03 22:37:14 +00:00
lda DRAW_PAGE
clc
adc #$20
sta hgr_copy_smc+5 ; 4
hgr_copy_column:
hgr_copy_smc:
lda $8000,X ; 4
sta $2000,X ; 5
dex ; 2
bne hgr_copy_column ; 2nt/3t
inc hgr_copy_smc+2 ; 6
inc hgr_copy_smc+5 ; 6
lda hgr_copy_smc+2 ; 4
2023-06-11 17:14:24 +00:00
hgr_copy_end_smc:
2023-06-05 20:29:18 +00:00
cmp #$C0 ; 2
2023-06-03 22:37:14 +00:00
bne hgr_copy_column ; 2/3
rts ; 6