dos33fsprogs/hellmood_memories/fast_plot.s

67 lines
1.2 KiB
ArmAsm
Raw Normal View History

2020-05-13 18:53:51 +00:00
; fast plot
; roughly $4D (77) cycles
; note: ROM plot routine takes $5D (93) cycles
; original, with SMC code = 77 cycles
; using indirect-Y/GBASL = 69 cycles
; split gr_offsets table = 61 cycles
2020-05-13 18:53:51 +00:00
; color in COLOR
; horiz=y, vert=A (A trashed, XY Saved)
2020-05-13 18:53:51 +00:00
fast_plot:
stx TEMPX ; 3
lsr ; get low bit in carry ; 2
2020-05-13 18:53:51 +00:00
tax ; 2
lda gr_offsets_l,X ; 4+
sta GBASL ; 3
lda gr_offsets_h,X ; 4+
sta GBASH ; 3
2020-05-13 18:53:51 +00:00
;===
; 21
2020-05-13 18:53:51 +00:00
lda COLOR ; 3
bcs plot_top ; 2/3t
2020-05-13 18:53:51 +00:00
plot_bottom:
and #$0f ; 3
2020-05-13 18:53:51 +00:00
sta TEMP ; 3
lda #$f0 ; 2
and (GBASL),Y ; 5
jmp plot_common ; 3
plot_top:
and #$f0 ; 3
sta TEMP ; 3
lda #$0f ; 2
and (GBASL),Y ; 5
plot_common:
2020-05-13 18:53:51 +00:00
ora TEMP ; 3
sta (GBASL),Y ; 6
;====
; 31
2020-05-13 18:53:51 +00:00
ldx TEMPX ; 3
rts ; 6
;====
; 9
2020-05-13 18:53:51 +00:00
;.align $100
gr_offsets:
gr_offsets_l:
.byte $00,$80,$00,$80,$00,$80,$00,$80
.byte $28,$a8,$28,$a8,$28,$a8,$28,$a8
.byte $50,$d0,$50,$d0,$50,$d0,$50,$d0
gr_offsets_h:
.byte $4,$4,$5,$5,$6,$6,$7,$7
.byte $4,$4,$5,$5,$6,$6,$7,$7
.byte $4,$4,$5,$5,$6,$6,$7,$7
2020-05-13 18:53:51 +00:00
gr_offsets_end:
;.assert >gr_offsets = >gr_offsets_end, error, "gr_offsets crosses page"