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
43 inc CURS_FLAG ; Mark it as off
44 lda CURS_STATE ; Cursor currently displayed?
46 ldy CURS_X ; Get the character column
47 lda (SCREEN_PTR),y ; Get character
49 sta (SCREEN_PTR),y ; Store character back
51 sta (CRAM_PTR),y ; Store color back
53 sta CURS_STATE ; Cursor not displayed