Added wrappers for the kernal functions

git-svn-id: svn://svn.cc65.org/cc65/trunk@1587 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-11-22 22:16:20 +00:00
parent df42c5943d
commit b7e7864fc5
28 changed files with 595 additions and 113 deletions

View File

@@ -9,9 +9,10 @@
.include "plus4.inc"
; --------------------------------------------------------------------------
.segment "LOWMEM" ; Accesses the ROM - must go into low mem
_cgetc: lda KEY_COUNT ; Get number of characters
ora FKEY_COUNT ; Or with number of function key chars
bne L2 ; Jump if there are already chars waiting
@@ -44,7 +45,9 @@ L1: lda KEY_COUNT
sta TED_CURSLO ; Cursor off
sta TED_CURSHI
L2: jsr KBDREAD ; Read char and return in A
L2: sta ENABLE_ROM ; Bank in the ROM
jsr KBDREAD ; Read char and return in A (ROM routine)
sta ENABLE_RAM ; Reenable the RAM
ldx #0
rts
@@ -56,6 +59,8 @@ L2: jsr KBDREAD ; Read char and return in A
.constructor initkbd
.destructor donekbd
.code ; Can go into the normal code segment
.proc initkbd
ldy #15
@@ -68,13 +73,17 @@ L2: jsr KBDREAD ; Read char and return in A
.endproc
.segment "LOWMEM" ; Accesses the ROM - must go into low mem
.proc donekbd
ldx #$39 ; Copy the original function keys
sta ENABLE_ROM ; Bank in the ROM
@L1: lda FKEY_ORIG,x
sta FKEY_SPACE,x
dex
bpl @L1
sta ENABLE_RAM ; Bank out the ROM
rts
.endproc