2 ; Ullrich von Bassewitz, 06.08.1998
12 ; --------------------------------------------------------------------------
14 .segment "LOWCODE" ; Accesses the ROM - must go into low mem
16 _cgetc: lda KEY_COUNT ; Get number of characters
17 ora FKEY_COUNT ; Or with number of function key chars
18 bne L2 ; Jump if there are already chars waiting
20 ; Switch on the cursor if needed
23 lda (CRAM_PTR),y ; Get current char
29 beq L1 ; Jump if no cursor
36 sbc #$0B ; + carry = $C00 (screen address)
45 sta TED_CURSLO ; Cursor off
48 L2: sta ENABLE_ROM ; Bank in the ROM
49 jsr KBDREAD ; Read char and return in A (ROM routine)
50 sta ENABLE_RAM ; Reenable the RAM
54 ; --------------------------------------------------------------------------
55 ; Make the function keys return function key codes instead of the current
56 ; strings so the program will see and may handle them.
57 ; Undo this change when the program ends
62 .code ; Can go into the normal code segment
76 .segment "LOWCODE" ; Accesses the ROM - must go into low mem
80 ldx #$39 ; Copy the original function keys
81 sta ENABLE_ROM ; Bank in the ROM
86 sta ENABLE_RAM ; Bank out the ROM
92 ; Function key table, readonly
95 fnkeys: .byte $01, $01, $01, $01, $01, $01, $01, $01
96 .byte 133, 137, 134, 138, 135, 139, 136, 140