From d5d0d65cd63fcc3d82966039158c2c2c00d4c2ef Mon Sep 17 00:00:00 2001 From: izydorst Date: Fri, 7 Mar 2003 00:31:51 +0000 Subject: [PATCH] cr/lf hell fixed git-svn-id: svn://svn.cc65.org/cc65/trunk@2006 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/geos/conio/cputc.s | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libsrc/geos/conio/cputc.s b/libsrc/geos/conio/cputc.s index 5a9f306cc..50b657910 100644 --- a/libsrc/geos/conio/cputc.s +++ b/libsrc/geos/conio/cputc.s @@ -33,7 +33,7 @@ _cputc: cmp #$20 bcs L1 cmp #CR - beq echo_crlf + beq do_cr cmp #LF beq do_lf cmp #$1d @@ -72,16 +72,15 @@ L2: php inc cursor_c lda cursor_c - cmp xsize + cmp xsize ; hit right margin? bne update_cursor -echo_crlf: - lda #0 + lda #0 ; yes - do cr+lf sta cursor_c do_lf: inc cursor_r lda cursor_r - cmp ysize + cmp ysize ; hit bottom margin? bne update_cursor - dec cursor_r + dec cursor_r ; yes - stay in the last line update_cursor: jsr fixcursor @@ -96,3 +95,8 @@ update_cursor: lda #1 ; update cursor prompt position sta r3L jmp PosSprite + +do_cr: lda #0 + sta cursor_c + beq update_cursor + -- 2.39.5