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 L3: jsr KBDREAD ; Read char and return in A
35 ; Switch the cursor on or off
40 bne seton ; Go set it on
41 lda CURS_FLAG ; Is the cursor currently off?
42 bne crs9 ; Jump if yes
44 sta CURS_FLAG ; Mark it as off
45 lda CURS_STATE ; Cursor currently displayed?
47 ldy CURS_X ; Get the character column
48 lda (SCREEN_PTR),y ; Get character
50 sta (SCREEN_PTR),y ; Store character back
52 sta (CRAM_PTR),y ; Store color back
54 sta CURS_STATE ; Cursor not displayed