Use external symbols for the CBM kernal jump table functions. This allows

to emulate these functions on platforms where one or more of these functions
are not available (PET, CBM-II).


git-svn-id: svn://svn.cc65.org/cc65/trunk@1544 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-11-19 23:02:47 +00:00
parent 3b081086f3
commit 6d498d8187
70 changed files with 720 additions and 187 deletions

View File

@@ -20,7 +20,12 @@ OBJS = _scrsize.o \
cputc.o \
crt0.o \
kbhit.o \
randomize.o
kernal.o \
krdtim.o \
kreadst.o \
ksetlfs.o \
ksetnam.o \
randomize.o
all: $(OBJS)

View File

@@ -8,6 +8,7 @@
.import initlib, donelib
.import zerobss, push0
.import _main
.import CLRCH, BSOUT
.include "zeropage.inc"
.include "pet.inc"

38
libsrc/pet/kernal.s Normal file
View File

@@ -0,0 +1,38 @@
;
; Ullrich von Bassewitz, 19.11.2002
;
; PET kernal functions
;
.export OPEN
.export CLOSE
.export CHKIN
.export CKOUT
.export CLRCH
.export BASIN
.export BSOUT
.export STOP
.export GETIN
.export CLALL
.export UDTIM
;-----------------------------------------------------------------------------
; Functions that are available in the kernal jump table
OPEN = $FFC0
CLOSE = $FFC3
CHKIN = $FFC6
CKOUT = $FFC9
CLRCH = $FFCC
BASIN = $FFCF
BSOUT = $FFD2
STOP = $FFE1
GETIN = $FFE4
CLALL = $FFE7
UDTIM = $FFEA

23
libsrc/pet/krdtim.s Normal file
View File

@@ -0,0 +1,23 @@
;
; Ullrich von Bassewitz, 19.11.2002
;
; RDTIM replacement function for the PETs
;
.export RDTIM
.include "pet.inc"
.proc RDTIM
sei
lda TIME+2
ldx TIME+1
ldy TIME
cli
rts
.endproc

19
libsrc/pet/kreadst.s Normal file
View File

@@ -0,0 +1,19 @@
;
; Ullrich von Bassewitz, 19.11.2002
;
; READST replacement function for the PETs
;
.export READST
.include "pet.inc"
.proc READST
lda ST
rts
.endproc

21
libsrc/pet/ksetlfs.s Normal file
View File

@@ -0,0 +1,21 @@
;
; Ullrich von Bassewitz, 19.11.2002
;
; SETLFS replacement function for the PETs
;
.export SETLFS
.include "pet.inc"
.proc SETLFS
sta LFN ; LFN
stx DEVNUM ; Device address
sty SECADR ; Secondary address
rts
.endproc

21
libsrc/pet/ksetnam.s Normal file
View File

@@ -0,0 +1,21 @@
;
; Ullrich von Bassewitz, 19.11.2002
;
; SETNAM replacement function for the PETs
;
.export SETNAM
.include "pet.inc"
.proc SETNAM
sta FNLEN
stx FNADR
sty FNADR+1
rts
.endproc

View File

@@ -6,11 +6,9 @@
; ---------------------------------------------------------------------------
; Zero page, Commodore stuff
MEMSIZE = $34 ; Size of memory installed
TIME = $8D ; 60HZ clock
MEMSIZE = $34 ; Size of memory installed
ST = $96 ; IEC status byte
SECADR = $D3 ; Secondary address
DEVNUM = $D4 ; Device number
KEY_COUNT = $9E ; Number of keys in input buffer
CURS_FLAG = $A7 ; 1 = cursor off
CURS_BLINK = $A8 ; Blink counter
@@ -18,8 +16,13 @@ CURS_CHAR = $A9 ; Character under the cursor
CURS_STATE = $AA ; Cursor blink state
SCREEN_PTR = $C4 ; Pointer to current char in text screen
CURS_X = $C6 ; Cursor column
CURS_Y = $D8 ; Cursor row
FNLEN = $D1 ; Length of filename
LFN = $D2 ; Current Logical File Number
SECADR = $D3 ; Secondary address
DEVNUM = $D4 ; Device number
SCR_LINELEN = $D5 ; Screen line length
CURS_Y = $D8 ; Cursor row
FNADR = $DA ; Pointer to file name
KEY_BUF = $26F ; Keyboard buffer