From 32eaba36059f6c461149d78dd6e6ee5b313102c3 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sun, 17 Oct 2021 20:57:24 -0700 Subject: [PATCH] shave some bytes --- src/ui.font.lc2.a | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ui.font.lc2.a b/src/ui.font.lc2.a index 2a22c76fb..6de65743f 100644 --- a/src/ui.font.lc2.a +++ b/src/ui.font.lc2.a @@ -19,8 +19,7 @@ DrawPageInternal ; clobbers PTR ; clobbers $FF ; clobbers A/X/Y -; preserves all flags - php +; preserves C, other flags clobbered stx $FF ldx #0 stx VTAB @@ -30,8 +29,7 @@ DrawPageInternal sta HTAB ldy #0 lda (PTR), y ; A = length of line, or #$FF - bmi PLP_AND_RTS ; if #$FF then we're done - plp + bmi drawLineDone ; if #$FF then we're done php ; C = whatever was passed in pha ; save length jsr DrawStringSuperInternal @@ -41,10 +39,10 @@ DrawPageInternal sta PTR bcc + 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 -PLP_AND_RTS - plp +drawLineDone rts Draw40CharsInternal @@ -116,9 +114,9 @@ DrawBufferInternal ; VTAB is NOT incremented ; clobbers A/X/Y +ST16 DBISrc+1 - php dex - bmi PLP_AND_RTS ; empty string + bmi drawLineDone ; empty string + php lda VTAB asl asl @@ -162,7 +160,6 @@ DrawBufferInternal adc #$04 sta DBIRow7+2 @hgrlo lda #$FD - clc adc HTAB sta DBIRow0+1 sta DBIRow1+1