1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-09 01:28:58 +00:00

- unsafe characters are ignored, added some notes to be considered

git-svn-id: svn://svn.cc65.org/cc65/trunk@3551 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2005-07-25 21:07:12 +00:00
parent 5dddf0639c
commit d2ee1c447d

View File

@ -4,10 +4,25 @@
; ;
; 27.10.2001 ; 27.10.2001
; 06.03.2002 ; 06.03.2002
; 25.07.2005
; void cputcxy (unsigned char x, unsigned char y, char c); ; void cputcxy (unsigned char x, unsigned char y, char c);
; void cputc (char c); ; void cputc (char c);
; TODO:
; TAB (should be implemented)
; other special characters directly from keyboard are unsafe, though some might be
; implemented:
; HOME, UPLINE, ULINEON, ULINEOFF, REV_ON, REV_OFF, BOLDON, ITALICON, OUTLINEON, PLAINTEXT
; and cursor movement, maybe stuff like INSERT too
;
; these must be ignored:
; ESC_GRAPHICS, ESC_RULER, GOTOX, GOTOY, GOTOXY, NEWCARDSET, all 1..8
;
; note that there are conflicts between control characters and keyboard:
; HOME = KEY_ENTER, KEY_HOME = REV_ON,
; UPLINE = ?, KEY_UPARROW = GOTOY, ...
.export _cputcxy, _cputc, update_cursor .export _cputcxy, _cputc, update_cursor
.import _gotoxy, fixcursor .import _gotoxy, fixcursor
@ -29,32 +44,18 @@ _cputcxy:
_cputc: _cputc:
tax ; save character tax ; save character
; some characters are not safe for PutChar ; some characters 0-31 are not safe for PutChar
cmp #$20 cmp #$20
bcs L1 bcs L1
cmp #CR cmp #CR
beq do_cr beq do_cr
cmp #LF cmp #LF
beq do_lf beq do_lf
cmp #$1d cmp #KEY_DELETE
bne L00 bne L0
ldx #BACKSPACE ldx #BACKSPACE
sec sec
bcs L2 bcs L2
L00: cmp #ESC_GRAPHICS
beq L0
cmp #ESC_RULER
beq L0
cmp #GOTOX
beq L0
cmp #GOTOY
beq L0
cmp #GOTOXY
beq L0
cmp #NEWCARDSET
beq L0
cmp #$1e
bne L1
L0: rts L0: rts
L1: clc L1: clc
@ -99,4 +100,3 @@ update_cursor:
do_cr: lda #0 do_cr: lda #0
sta cursor_c sta cursor_c
beq update_cursor beq update_cursor