shave some bytes

This commit is contained in:
Peter Ferrie 2021-10-17 20:57:24 -07:00
parent 8ed18022b2
commit 32eaba3605

View File

@ -19,8 +19,7 @@ DrawPageInternal
; clobbers PTR ; clobbers PTR
; clobbers $FF ; clobbers $FF
; clobbers A/X/Y ; clobbers A/X/Y
; preserves all flags ; preserves C, other flags clobbered
php
stx $FF stx $FF
ldx #0 ldx #0
stx VTAB stx VTAB
@ -30,8 +29,7 @@ DrawPageInternal
sta HTAB sta HTAB
ldy #0 ldy #0
lda (PTR), y ; A = length of line, or #$FF lda (PTR), y ; A = length of line, or #$FF
bmi PLP_AND_RTS ; if #$FF then we're done bmi drawLineDone ; if #$FF then we're done
plp
php ; C = whatever was passed in php ; C = whatever was passed in
pha ; save length pha ; save length
jsr DrawStringSuperInternal jsr DrawStringSuperInternal
@ -41,10 +39,10 @@ DrawPageInternal
sta PTR sta PTR
bcc + bcc +
inc PTR+1 inc PTR+1
+ inc VTAB ; this will print 255 lines if you give + plp
inc VTAB ; this will print 255 lines if you give
bne @drawLine ; it 255 lines, because this is assembly bne @drawLine ; it 255 lines, because this is assembly
PLP_AND_RTS drawLineDone
plp
rts rts
Draw40CharsInternal Draw40CharsInternal
@ -116,9 +114,9 @@ DrawBufferInternal
; VTAB is NOT incremented ; VTAB is NOT incremented
; clobbers A/X/Y ; clobbers A/X/Y
+ST16 DBISrc+1 +ST16 DBISrc+1
php
dex dex
bmi PLP_AND_RTS ; empty string bmi drawLineDone ; empty string
php
lda VTAB lda VTAB
asl asl
asl asl
@ -162,7 +160,6 @@ DrawBufferInternal
adc #$04 adc #$04
sta DBIRow7+2 sta DBIRow7+2
@hgrlo lda #$FD @hgrlo lda #$FD
clc
adc HTAB adc HTAB
sta DBIRow0+1 sta DBIRow0+1
sta DBIRow1+1 sta DBIRow1+1