1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-25 16:29:08 +00:00

cr/lf hell fixed

git-svn-id: svn://svn.cc65.org/cc65/trunk@2006 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2003-03-07 00:31:51 +00:00
parent 14b402ab7e
commit d5d0d65cd6

View File

@ -33,7 +33,7 @@ _cputc:
cmp #$20 cmp #$20
bcs L1 bcs L1
cmp #CR cmp #CR
beq echo_crlf beq do_cr
cmp #LF cmp #LF
beq do_lf beq do_lf
cmp #$1d cmp #$1d
@ -72,16 +72,15 @@ L2: php
inc cursor_c inc cursor_c
lda cursor_c lda cursor_c
cmp xsize cmp xsize ; hit right margin?
bne update_cursor bne update_cursor
echo_crlf: lda #0 ; yes - do cr+lf
lda #0
sta cursor_c sta cursor_c
do_lf: inc cursor_r do_lf: inc cursor_r
lda cursor_r lda cursor_r
cmp ysize cmp ysize ; hit bottom margin?
bne update_cursor bne update_cursor
dec cursor_r dec cursor_r ; yes - stay in the last line
update_cursor: update_cursor:
jsr fixcursor jsr fixcursor
@ -96,3 +95,8 @@ update_cursor:
lda #1 ; update cursor prompt position lda #1 ; update cursor prompt position
sta r3L sta r3L
jmp PosSprite jmp PosSprite
do_cr: lda #0
sta cursor_c
beq update_cursor