2 ; Ullrich von Bassewitz, 06.08.1998
8 .import plot, write_crtc
11 .include "zeropage.inc"
15 _cgetc: lda KeyIndex ; Get number of characters
16 bne L2 ; Jump if there are already chars waiting
18 ; Switch on the cursor if needed
21 beq L1 ; Jump if no cursor
23 jsr plot ; Set the current cursor position
25 lda Config ; Cursor format
26 jsr write_crtc ; Set the cursor formar
35 L2: ldx #$00 ; Get index
36 ldy KeyBuf ; Get first character in the buffer
38 L3: lda KeyBuf+1,x ; Move up the remaining chars
47 tya ; First char from buffer