2 ; Ullrich von Bassewitz, 06.08.1998
8 .import plot, write_crtc
11 .import keyidx: zp, keybuf: zp, config: zp
15 _cgetc: lda keyidx ; 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