pt3: optimize the one-color lores putsprite routine

This commit is contained in:
Vince Weaver 2019-05-17 11:04:52 -04:00
parent 81d28fe305
commit 1ce802e3a8
2 changed files with 28 additions and 42 deletions

View File

@ -1,11 +1,14 @@
;=============================================
; put_sprite_color_no_transparent
; put_sprite_one_color_no_transparent
;=============================================
; Sprite to display in INH,INL
; Location is XPOS,YPOS
; Note, only works if YPOS is multiple of two
; This is a fast sprite with no transparency and assumes
; only black/white sprite. Can change color by setting the
; sprite_color_smc+1 value
put_sprite:
@ -45,26 +48,30 @@ put_sprite_pixel:
sty TEMP ; save sprite pointer ; 3
cmp #$00
beq sprite_output
cmp #$ff
bne not_ff
sprite_color_ff_smc:
lda #$ff
jmp sprite_output
not_ff:
cmp #$f0
bne not_f0
sprite_color_f0_smc:
lda #$f0
jmp sprite_output
sprite_color_smc:
and #$ff
not_f0:
sprite_color_0f_smc:
lda #$0f
; cmp #$00
; beq sprite_output
sprite_output:
; cmp #$ff
; bne not_ff
;sprite_color_ff_smc:
; lda #$ff
; jmp sprite_output
;not_ff:
; cmp #$f0
; bne not_f0
;sprite_color_f0_smc:
; lda #$f0
; jmp sprite_output
;not_f0:
;sprite_color_0f_smc:
; lda #$0f
;sprite_output:
ldy #$0 ; 2
sta (OUTL),Y ; and write it out ; 6

View File

@ -9,14 +9,7 @@ put_letters:
;================
first_note_a:
lda #$bb
sta sprite_color_ff_smc+1
lda #$0b
sta sprite_color_0f_smc+1
lda #$b0
sta sprite_color_f0_smc+1
sta sprite_color_smc+1
ldx note_a+NOTE_NOTE
; cpx olda
@ -94,14 +87,7 @@ do_sharp_a:
first_note_b:
lda #$22
sta sprite_color_ff_smc+1
lda #$02
sta sprite_color_0f_smc+1
lda #$20
sta sprite_color_f0_smc+1
sta sprite_color_smc+1
ldx note_b+NOTE_NOTE
; cpx oldb
@ -180,14 +166,7 @@ do_sharp_b:
first_note_c:
lda #$33
sta sprite_color_ff_smc+1
lda #$03
sta sprite_color_0f_smc+1
lda #$30
sta sprite_color_f0_smc+1
sta sprite_color_smc+1
ldx note_c+NOTE_NOTE
; cpx oldc