2 ; Ullrich von Bassewitz, 06.08.1998
12 _cgetc: lda KEY_COUNT ; Get number of characters
13 bne L3 ; Jump if there are already chars waiting
15 ; Switch on the cursor if needed
30 ; Fetch the character from the keyboard buffer
42 ldx #$00 ; Clear high byte
46 ; Switch the cursor on or off
50 bne seton ; Go set it on
51 lda CURS_FLAG ; Is the cursor currently off?
52 bne crs9 ; Jump if yes
54 sta CURS_FLAG ; Mark it as off
55 lda CURS_STATE ; Cursor currently displayed?
57 ldy CURS_X ; Get the character column
58 lda (SCREEN_PTR),y ; Get character
60 sta (SCREEN_PTR),y ; Store character back
62 sta CURS_STATE ; Cursor not displayed