From bd3b540db943c2ffdd246d88af212cfe41511d0f Mon Sep 17 00:00:00 2001
From: "B. Watson" <yalhcru@gmail.com>
Date: Mon, 19 Apr 2021 13:48:30 -0400
Subject: Save 3 bytes

---
 conio/chline.s | 23 ++++++++++-------------
 conio/cputc.s  |  4 ++--
 2 files changed, 12 insertions(+), 15 deletions(-)

(limited to 'conio')

diff --git a/conio/chline.s b/conio/chline.s
index 81cf2e9..5b7ce6c 100644
--- a/conio/chline.s
+++ b/conio/chline.s
@@ -1,5 +1,5 @@
 ; modified for taipan:
-; - commented out _chlinexy as taipan never uses it.
+; - removed _chlinexy as taipan never uses it.
 ; - get rid of the check for a 0 argument. taipan only calls chline()
 ;   with constant non-zero args.
 ;
@@ -9,9 +9,9 @@
 ; void chline (unsigned char length);
 ;
 
-        .export         _chline
-        .import         popa, _gotoxy, cputdirect
-        .importzp       tmp1
+        .export         _chline, _cspaces
+        .import         cputdirect
+        .importzp       tmp1, tmp2
 
 .ifdef __ATARI5200__
 CHRCODE =       14
@@ -19,17 +19,14 @@ CHRCODE =       14
 CHRCODE =       $12+64
 .endif
 
-;_chlinexy:
-;        pha                     ; Save the length
-;        jsr     popa            ; Get y
-;        jsr     _gotoxy         ; Call this one, will pop params
-;        pla                     ; Restore the length
-
+_cspaces:
+ ldx #0
+ .byte $2c
 _chline:
-;       cmp     #0              ; Is the length zero?
-;       beq     L9              ; Jump if done
+ ldx #CHRCODE
+ stx tmp2
         sta     tmp1
-L1:     lda     #CHRCODE        ; Horizontal line, screen code
+L1:     lda     tmp2
         jsr     cputdirect      ; Direct output
         dec     tmp1
         bne     L1
diff --git a/conio/cputc.s b/conio/cputc.s
index 4e29482..a34217f 100644
--- a/conio/cputc.s
+++ b/conio/cputc.s
@@ -60,8 +60,8 @@ cputdirect:                     ; accepts screen code
         lda     COLCRS
         cmp     #40
         bcc     plot
-        lda     #0
-        sta     COLCRS
+        ;lda     #0
+        ;sta     COLCRS
 
         .export newline
 _crlf:
-- 
cgit v1.2.3