2 ; Ullrich von Bassewitz, 06.08.1998
10 .include "cbm_kernal.inc"
13 _cgetc: lda KEY_COUNT ; Get number of characters
14 bne L3 ; Jump if there are already chars waiting
16 ; Switch on the cursor if needed
31 L3: jsr KBDREAD ; Read char and return in A
36 ; Switch the cursor on or off
41 bne seton ; Go set it on
42 lda CURS_FLAG ; Is the cursor currently off?
43 bne crs9 ; Jump if yes
44 inc 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