color.o \
cputc.o \
kbhit.o \
+ kernal.o \
mouse.o \
randomize.o \
readjoy.o \
;
.export xsize, ysize
+ .import SCREEN
.constructor initscrsize
- .include "../cbm/cbm.inc"
.code
-
+
.export newline, plot
.import popa, _gotoxy
.import xsize, revers
+ .import PLOT
.include "c128.inc"
- .include "../cbm/cbm.inc"
+
_cputcxy:
pha ; Save C
.import condes, initlib, donelib
.import initconio, doneconio, zerobss
.import push0, _main
+ .import RESTOR, BSOUT, CLRCH
.import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
.import __RAM_START__, __RAM_SIZE__
.include "zeropage.inc"
.include "c128.inc"
- .include "../cbm/cbm.inc"
+
; ------------------------------------------------------------------------
; Constants
--- /dev/null
+;
+; Ullrich von Bassewitz, 19.11.2002
+;
+; C128 kernal functions
+;
+
+ .export CINT
+ .export IOINIT
+ .export RAMTAS
+ .export RESTOR
+ .export VECTOR
+ .export SETMSG
+ .export SECOND
+ .export TKSA
+ .export MEMTOP
+ .export MEMBOT
+ .export SCNKEY
+ .export SETTMO
+ .export ACPTR
+ .export CIOUT
+ .export UNTLK
+ .export UNLSN
+ .export LISTEN
+ .export TALK
+ .export READST
+ .export SETLFS
+ .export SETNAM
+ .export OPEN
+ .export CLOSE
+ .export CHKIN
+ .export CKOUT
+ .export CLRCH
+ .export BASIN
+ .export BSOUT
+ .export LOAD
+ .export SAVE
+ .export SETTIM
+ .export RDTIM
+ .export STOP
+ .export GETIN
+ .export CLALL
+ .export UDTIM
+ .export SCREEN
+ .export PLOT
+ .export IOBASE
+
+
+;-----------------------------------------------------------------------------
+; All functions are available in the kernal jump table
+
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
+
conio.o \
cputc.o \
kbhit.o \
+ kernal.o \
mouse.o \
randomize.o \
readjoy.o \
;
.export xsize, ysize
+ .import SCREEN
.constructor initscrsize
- .include "../cbm/cbm.inc"
.code
.export newline, plot
.import popa, _gotoxy
.import xsize, revers
+ .import PLOT
.include "c64.inc"
- .include "../cbm/cbm.inc"
+
_cputcxy:
pha ; Save C
.import initlib, donelib
.import zerobss, push0
.import _main
+ .import RESTOR, BSOUT, CLRCH
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.include "zeropage.inc"
.include "c64.inc"
- .include "../cbm/cbm.inc"
+
.code
--- /dev/null
+;
+; Ullrich von Bassewitz, 19.11.2002
+;
+; C64 kernal functions
+;
+
+ .export CINT
+ .export IOINIT
+ .export RAMTAS
+ .export RESTOR
+ .export VECTOR
+ .export SETMSG
+ .export SECOND
+ .export TKSA
+ .export MEMTOP
+ .export MEMBOT
+ .export SCNKEY
+ .export SETTMO
+ .export ACPTR
+ .export CIOUT
+ .export UNTLK
+ .export UNLSN
+ .export LISTEN
+ .export TALK
+ .export READST
+ .export SETLFS
+ .export SETNAM
+ .export OPEN
+ .export CLOSE
+ .export CHKIN
+ .export CKOUT
+ .export CLRCH
+ .export BASIN
+ .export BSOUT
+ .export LOAD
+ .export SAVE
+ .export SETTIM
+ .export RDTIM
+ .export STOP
+ .export GETIN
+ .export CLALL
+ .export UDTIM
+ .export SCREEN
+ .export PLOT
+ .export IOBASE
+
+
+;-----------------------------------------------------------------------------
+; All functions are available in the kernal jump table
+
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
+
.rodata
_tgi_mode_table:
- .byte TGI_MODE_320_200_2, "c64-320-200-2.tgi", 0
+ .byte TGI_MODE_320_200_2, "c64-high.tgi", 0
.byte 0 ; End marker
; unsigned char __fastcall__ cbm_acptr (void);
;
- .include "cbm.inc"
-
.export _cbm_acptr
+ .import ACPTR
+
_cbm_acptr:
jsr ACPTR
ldx #0
rts
-
+
; unsigned char __fastcall__ cbm_k_basin (void);
;
- .include "cbm.inc"
-
.export _cbm_k_basin
+ .import BASIN
_cbm_k_basin = BASIN
; void __fastcall__ cbm_k_bsout (unsigned char C);
;
- .include "cbm.inc"
-
.export _cbm_k_bsout
+ .import BSOUT
_cbm_k_bsout = BSOUT
; unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
;
- .include "cbm.inc"
-
.export _cbm_k_chkin
+ .import CHKIN
_cbm_k_chkin:
tax
; void __fastcall__ cbm_ciout (unsigned char C);
;
- .include "cbm.inc"
-
.export _cbm_ciout
+ .import CIOUT
_cbm_ciout = CIOUT
; unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
;
- .include "cbm.inc"
-
.export _cbm_k_ckout
+ .import CKOUT
+
_cbm_k_ckout:
tax
; void __fastcall__ cbm_clall (void);
;
- .include "cbm.inc"
-
.export _cbm_clall
+ .import CLALL
+
_cbm_clall = CLALL
; void __fastcall__ cbm_k_close (unsigned char FN);
;
- .include "cbm.inc"
-
.export _cbm_k_close
+ .import CLOSE
_cbm_k_close:
- clc
+ clc
jmp CLOSE
; void __fastcall__ cbm_k_clrch (void);
;
- .include "cbm.inc"
-
.export _cbm_k_clrch
+ .import CLRCH
_cbm_k_clrch = CLRCH
; unsigned __fastcall__ cbm_iobase (void);
;
- .include "cbm.inc"
-
.export _cbm_iobase
+ .import IOBASE
_cbm_iobase:
jsr IOBASE
; void __fastcall__ cbm_listen (unsigned char dev);
;
- .include "cbm.inc"
-
.export _cbm_listen
+ .import LISTEN
_cbm_listen = LISTEN
; unsigned int __fastcall__ cbm_k_load (unsigned char flag, unsigned addr);
;
- .include "cbm.inc"
-
.export _cbm_k_load
+ .import LOAD
.import __oserror
.import popa
.importzp ptr1
tax
pla
rts
-
+
; unsigned char __fastcall__ cbm_k_open (void);
;
- .include "cbm.inc"
-
.export _cbm_k_open
+ .import OPEN
+
_cbm_k_open:
jsr OPEN
; unsigned char __fastcall__ cbm_k_readst (void);
;
- .include "cbm.inc"
-
.export _cbm_k_readst
+ .import READST
+
_cbm_k_readst = READST
; unsigned char __fastcall__ cbm_k_save(unsigned int start, unsigned int end);
;
- .include "cbm.inc"
-
.export _cbm_k_save
+ .import SAVE
.import popax
.importzp ptr1, tmp1
+
_cbm_k_save:
sta tmp1 ; store end address
; unsigned char SA);
;
- .include "cbm.inc"
-
.export _cbm_k_setlfs
+ .import SETLFS
.import popa
.importzp tmp1
+
_cbm_k_setlfs:
sta tmp1 ; Save SA
; void __fastcall__ cbm_k_setnam (const char* Name);
;
- .include "cbm.inc"
-
.export _cbm_k_setnam
+ .import SETNAM
.importzp ptr1
+
_cbm_k_setnam:
sta ptr1 ; Store pointer to file name
; void __fastcall__ cbm_talk (unsigned char dev);
;
- .include "cbm.inc"
-
.export _cbm_talk
+ .import TALK
+
_cbm_talk = TALK
; void __fastcall__ cbm_unlsn (void);
;
- .include "cbm.inc"
-
.export _cbm_unlsn
+ .import UNLSN
+
_cbm_unlsn = UNLSN
; void __fastcall__ cbm_untlk (void);
;
- .include "cbm.inc"
-
.export _cbm_untlk
+ .import UNTLK
+
_cbm_untlk = UNTLK
; Subroutines available in the CBM jump table
;
-CINT = $FF81
-IOINIT = $FF84
-RAMTAS = $FF87
-RESTOR = $FF8A
-VECTOR = $FF8D
-SETMSG = $FF90
-SECOND = $FF93
-TKSA = $FF96
-MEMTOP = $FF99
-MEMBOT = $FF9C
-SCNKEY = $FF9F
-SETTMO = $FFA2
-ACPTR = $FFA5
-CIOUT = $FFA8
-UNTLK = $FFAB
-UNLSN = $FFAE
-LISTEN = $FFB1
-TALK = $FFB4
-READST = $FFB7
-SETLFS = $FFBA
-SETNAM = $FFBD
-OPEN = $FFC0
-CLOSE = $FFC3
-CHKIN = $FFC6
-CKOUT = $FFC9
-CLRCH = $FFCC
-BASIN = $FFCF
-BSOUT = $FFD2
-LOAD = $FFD5
-SAVE = $FFD8
-SETTIM = $FFDB
-RDTIM = $FFDE
-STOP = $FFE1
-GETIN = $FFE4
-CLALL = $FFE7
-UDTIM = $FFEA
-SCREEN = $FFED
-PLOT = $FFF0
-IOBASE = $FFF3
+;CINT = $FF81
+;IOINIT = $FF84
+;RAMTAS = $FF87
+;RESTOR = $FF8A
+;VECTOR = $FF8D
+;SETMSG = $FF90
+;SECOND = $FF93
+;TKSA = $FF96
+;MEMTOP = $FF99
+;MEMBOT = $FF9C
+;SCNKEY = $FF9F
+;SETTMO = $FFA2
+;ACPTR = $FFA5
+;CIOUT = $FFA8
+;UNTLK = $FFAB
+;UNLSN = $FFAE
+;LISTEN = $FFB1
+;TALK = $FFB4
+;READST = $FFB7
+;SETLFS = $FFBA
+;SETNAM = $FFBD
+;OPEN = $FFC0
+;CLOSE = $FFC3
+;CHKIN = $FFC6
+;CKOUT = $FFC9
+;CLRCH = $FFCC
+;BASIN = $FFCF
+;BSOUT = $FFD2
+;LOAD = $FFD5
+;SAVE = $FFD8
+;SETTIM = $FFDB
+;RDTIM = $FFDE
+;STOP = $FFE1
+;GETIN = $FFE4
+;CLALL = $FFE7
+;UDTIM = $FFEA
+;SCREEN = $FFED
+;PLOT = $FFF0
+;IOBASE = $FFF3
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
; Disk stuff
;
-
+
MAX_DRIVES = 24
FIRST_DRIVE = 8
.include "cbm.inc"
.export _cbm_read
+ .import CHKIN, READST, BASIN, CLRCH
.importzp ptr1, ptr2, ptr3, tmp1
.import popax, popa
.import __oserror
+
_cbm_read:
eor #$FF
sta ptr1
;
; Original C code by Marc 'BlackJack' Rintsch, 25.03.2001
;
-; int __fastcall__ cbm_write(unsigned char lfn, void* buffer, unsigned int size)
+; int __fastcall__ cbm_write(unsigned char lfn, void* buffer, unsigned int size)
; {
-;
+;
; static unsigned int byteswritten;
;
; /* if we can't change to the outputchannel #lfn then return an error */
.include "cbm.inc"
.export _cbm_write
+ .import CKOUT, READST, BSOUT, CLRCH
.importzp ptr1, ptr2, ptr3
.import popax, popa
.import __oserror
+
_cbm_write:
sta ptr3
;
.export _clock
+ .import RDTIM
.importzp sreg
- .include "cbm.inc"
.proc _clock
sta sreg+1
jsr RDTIM
sty sreg
- rts
+ rts
.endproc
.export _close
+ .import CLOSE
.import readdiskerror, closecmdchannel
.import __errno, __oserror
.importzp tmp2
.export readdiskerror
.export writediskcmd
+ .import SETLFS, SETNAM, OPEN, CLOSE, BSOUT, BASIN
+ .import CHKIN, CKOUT, CLRCH
.importzp tmp1, ptr1
.include "cbm.inc"
rts
-
+
;--------------------------------------------------------------------------
; Data
.export fnparse, fnset, fncomplete
.export fnunit, fnlen, fncmd, fnbuf
+ .import SETNAM
.import __curunit, __filetype
.importzp ptr1
.include "ctype.inc"
- .include "cbm.inc"
;--------------------------------------------------------------------------
.export _open
+ .import SETLFS, OPEN, CLOSE
.import addysp, popax
.import scratch, fnparse, fncomplete, fnset
.import opencmdchannel, closecmdchannel, readdiskerror
.include "errno.inc"
.include "fcntl.inc"
- .include "cbm.inc"
.include "filedes.inc"
.export _read
.constructor initstdin
-
+
+ .import SETLFS, OPEN, CHKIN, BASIN, CLRCH, READST
.import rwcommon
.import popax
.import __errno, __oserror
notopen:
lda #3 ; File not open
bne error
-
+
; Error entry, status not ok
error5: lda #5 ; Device not present
; unsigned char wherex (void);
; unsigned char wherey (void);
+
.export _wherex, _wherey
-
- .include "cbm.inc"
+ .import PLOT
+
_wherex:
sec
.export _write
.constructor initstdout
+ .import SETLFS, OPEN, CKOUT, BSOUT, CLRCH
.import rwcommon
.import __errno, __oserror
.importzp sp, ptr1, ptr2, ptr3
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
+
+ .import PLOT
.import popa, _gotoxy
.import xsize, revers
.include "cbm510.inc"
- .include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
;
.import __CHARRAM_START__, __CHARRAM_SIZE__, __VIDRAM_START__
.import __BSS_RUN__, __BSS_SIZE__
.import irq, nmi
- .import k_irq, k_nmi, k_plot, k_udtim, k_scnkey
+ .import k_irq, k_nmi, PLOT, UDTIM, SCNKEY
.include "zeropage.inc"
.include "cbm510.inc"
jmp $0000 ; TKSA
jmp $0000 ; MEMTOP
jmp $0000 ; MEMBOT
- jmp k_scnkey ; SCNKEY
+ jmp SCNKEY
jmp $0000 ; SETTMO
jmp $0000 ; ACPTR
jmp $0000 ; CIOUT
jmp $0000 ; LISTEN
jmp $0000 ; TALK
jmp $0000 ; READST
- jmp k_setlfs ; SETLFS
- jmp k_setnam ; SETNAM
+ jmp SETLFS
+ jmp SETNAM
jmp $0000 ; OPEN
jmp $0000 ; CLOSE
- jmp $0000 ; CHKIN
+ jmp $0000 ; CHKIN
jmp $0000 ; CKOUT
jmp $0000 ; CLRCH
jmp $0000 ; BASIN
jmp $0000 ; BSOUT
jmp $0000 ; LOAD
jmp $0000 ; SAVE
- jmp k_settim ; SETTIM
- jmp k_rdtim ; RDTIM
+ jmp SETTIM
+ jmp RDTIM
jmp $0000 ; STOP
jmp $0000 ; GETIN
jmp $0000 ; CLALL
- jmp k_udtim ; UDTIM
- jmp k_screen ; SCREEN
- jmp k_plot ; PLOT
- jmp k_iobase ; IOBASE
+ jmp UDTIM
+ jmp SCREEN
+ jmp PLOT
+ jmp IOBASE
sta ExecReg
rts
.byte $01 ; Filler
; ------------------------------------------------------------------------
; Code for a few simpler kernal calls goes here
-k_iobase:
- ldx cia2
+.export IOBASE
+.proc IOBASE
+ ldx cia2
ldy cia2+1
rts
+.endproc
-k_screen:
+.export SCREEN
+.proc SCREEN
ldx #40 ; Columns
ldy #25 ; Lines
rts
+.endproc
-k_setlfs:
+.export SETLFS
+.proc SETLFS
sta LogicalAdr
stx FirstAdr
sty SecondAdr
rts
+.endproc
-k_setnam:
+.export SETNAM
+.proc SETNAM
sta FileNameLen
lda $00,x
sta FileNameAdrLo
lda $02,x
sta FileNameAdrSeg
rts
+.endproc
-k_rdtim:
- sei
- lda time+0
- ldx time+1
- ldy time+2
- cli
- rts
-
-k_settim:
- sei
- sta time+0
- stx time+1
- sty time+2
- cli
- rts
+.export RDTIM
+.proc RDTIM
+ sei
+ lda time+0
+ ldx time+1
+ ldy time+2
+ cli
+ rts
+.endproc
+
+.export SETTIM
+.proc SETTIM
+ sei
+ sta time+0
+ stx time+1
+ sty time+2
+ cli
+ rts
+.endproc
; -------------------------------------------------------------------------
; Data area - switch back to relocatable mode
; PLOT routine for the 510.
;
- .export k_plot
+ .export PLOT
.import __VIDRAM_START__
.importzp crtc
; ------------------------------------------------------------------------
;
-.proc k_plot
+.proc PLOT
bcs get
LineMSBTab: LineHiTab
+
-;
+;
; Ullrich von Bassewitz, 13.09.2001
;
; Keyboard polling stuff for the 510.
;
- .export k_scnkey
+ .export SCNKEY
.importzp tpi2, ktab1, ktab2, ktab3, ktab4
.include "cbm510.inc"
-.proc k_scnkey
+.proc SCNKEY
lda #$FF
sta ModKey
sec
ldy #tpiPortB
lda (tpi2),y
- rol a
+ rol a
sta (tpi2),y
ldy #tpiPortA
lda (tpi2),y
sta (tpi2),y
ldy #tpiPortB
lda #$FF
- sta (tpi2),y
+ sta (tpi2),y
rts
Repeat: dec RepeatDelay
ldy #tpiPortC
L1: lda (tpi2),y
sta KeySave
- lda (tpi2),y
+ lda (tpi2),y
cmp KeySave
bne L1
rts
; C programs will not use it.
;
- .export k_udtim
+ .export UDTIM
.importzp time
-.proc k_udtim
+.proc UDTIM
inc time
bne L9
.endproc
+
.export _cputcxy, _cputc, cputdirect, putchar
.export newline, plot
.exportzp CURS_X, CURS_Y
+
+ .import PLOT
.import _gotoxy
.import popa
.import xsize, revers
.include "cbm610.inc"
- .include "../cbm/cbm.inc"
+
_cputcxy:
pha ; Save C
.import push0, _main
.import __BSS_RUN__, __BSS_SIZE__
.import irq, nmi
- .import k_irq, k_nmi, k_plot, k_udtim, k_scnkey
+ .import k_irq, k_nmi, PLOT, UDTIM, SCNKEY
.include "zeropage.inc"
.include "cbm610.inc"
jmp $0000 ; TKSA
jmp $0000 ; MEMTOP
jmp $0000 ; MEMBOT
- jmp k_scnkey ; SCNKEY
+ jmp SCNKEY
jmp $0000 ; SETTMO
jmp $0000 ; ACPTR
jmp $0000 ; CIOUT
jmp $0000 ; LISTEN
jmp $0000 ; TALK
jmp $0000 ; READST
- jmp k_setlfs ; SETLFS
- jmp k_setnam ; SETNAM
+ jmp SETLFS
+ jmp SETNAM
jmp $0000 ; OPEN
jmp $0000 ; CLOSE
jmp $0000 ; CHKIN
jmp $0000 ; BSOUT
jmp $0000 ; LOAD
jmp $0000 ; SAVE
- jmp k_settim ; SETTIM
- jmp k_rdtim ; RDTIM
+ jmp SETTIM
+ jmp RDTIM
jmp $0000 ; STOP
jmp $0000 ; GETIN
jmp $0000 ; CLALL
- jmp k_udtim ; UDTIM
- jmp k_screen ; SCREEN
- jmp k_plot ; PLOT
- jmp k_iobase ; IOBASE
+ jmp UDTIM
+ jmp SCREEN
+ jmp PLOT
+ jmp IOBASE
sta ExecReg
rts
.byte $01 ; Filler
; ------------------------------------------------------------------------
; Code for a few simpler kernal calls goes here
-k_iobase:
- ldx cia
- ldy cia+1
+.export IOBASE
+.proc IOBASE
+ ldx cia
+ ldy cia+1
rts
+.endproc
-k_screen:
+.export SCREEN
+.proc SCREEN
ldx #80 ; Columns
ldy #25 ; Lines
rts
+.endproc
-k_setlfs:
+.export SETLFS
+.proc SETLFS
sta LogicalAdr
stx FirstAdr
sty SecondAdr
rts
+.endproc
-k_setnam:
+.export SETNAM
+.proc SETNAM
sta FileNameLen
lda $00,x
sta FileNameAdrLo
lda $02,x
sta FileNameAdrSeg
rts
+.endproc
-k_rdtim:
+.export RDTIM
+.proc RDTIM
sei
- lda time+0
- ldx time+1
- ldy time+2
+ lda time+0
+ ldx time+1
+ ldy time+2
cli
rts
+.endproc
-k_settim:
+.export SETTIM
+.proc SETTIM
sei
- sta time+0
- stx time+1
+ sta time+0
+ stx time+1
sty time+2
cli
rts
+.endproc
; -------------------------------------------------------------------------
; Data area - switch back to relocatable mode
; PLOT routine for the 610.
;
- .export k_plot
+ .export PLOT
.importzp crtc
.include "cbm610.inc"
-.proc k_plot
+.proc PLOT
bcc set
ldx CURS_Y
; Keyboard polling stuff for the 610.
;
- .export k_scnkey
+ .export SCNKEY
.importzp tpi2, ktab1, ktab2, ktab3, ktab4
.include "cbm610.inc"
-.proc k_scnkey
+.proc SCNKEY
lda #$FF
sta ModKey
; C programs will not use it.
;
- .export k_udtim
+ .export UDTIM
.importzp time
-.proc k_udtim
+.proc UDTIM
inc time
bne L9
.endproc
-
+
cputc.o \
crt0.o \
kbhit.o \
- randomize.o
+ kernal.o \
+ krdtim.o \
+ kreadst.o \
+ ksetlfs.o \
+ ksetnam.o \
+ randomize.o
all: $(OBJS)
.import initlib, donelib
.import zerobss, push0
.import _main
+ .import CLRCH, BSOUT
.include "zeropage.inc"
.include "pet.inc"
--- /dev/null
+;
+; 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
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 19.11.2002
+;
+; READST replacement function for the PETs
+;
+
+ .export READST
+
+ .include "pet.inc"
+
+
+.proc READST
+
+ lda ST
+ rts
+
+.endproc
+
+
--- /dev/null
+;
+; 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
+
+
--- /dev/null
+;
+; 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
+
+
; ---------------------------------------------------------------------------
; 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
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
cputc.o \
crt0.o \
kbhit.o \
+ kernal.o \
randomize.o \
readjoy.o \
tgi_mode_table.o
;
.export xsize, ysize
+ .import SCREEN
.constructor initscrsize
- .include "../cbm/cbm.inc"
.code
.export newline, plot
.import popa, _gotoxy
.import xsize, revers
+ .import PLOT
.include "plus4.inc"
- .include "../cbm/cbm.inc"
+
_cputcxy:
pha ; Save C
beq plot ; Recalculate pointers
L1: cmp #$0D ; LF?
- beq newline ; Recalculate pointers
+ beq newline ; Recalculate pointers
; Printable char of some sort
plot: ldy CURS_X
ldx CURS_Y
- clc
+ clc
jmp PLOT ; Set the new cursor
.export _exit
.import initlib, donelib
.import push0, _main, zerobss
+ .import MEMTOP, RESTOR, BSOUT, CLRCH
.include "zeropage.inc"
.include "plus4.inc"
- .include "../cbm/cbm.inc"
+
; ------------------------------------------------------------------------
; BASIC header with a SYS call
--- /dev/null
+;
+; Ullrich von Bassewitz, 19.11.2002
+;
+; Plus/4 kernal functions
+;
+
+ .export CINT
+ .export IOINIT
+ .export RAMTAS
+ .export RESTOR
+ .export VECTOR
+ .export SETMSG
+ .export SECOND
+ .export TKSA
+ .export MEMTOP
+ .export MEMBOT
+ .export SCNKEY
+ .export SETTMO
+ .export ACPTR
+ .export CIOUT
+ .export UNTLK
+ .export UNLSN
+ .export LISTEN
+ .export TALK
+ .export READST
+ .export SETLFS
+ .export SETNAM
+ .export OPEN
+ .export CLOSE
+ .export CHKIN
+ .export CKOUT
+ .export CLRCH
+ .export BASIN
+ .export BSOUT
+ .export LOAD
+ .export SAVE
+ .export SETTIM
+ .export RDTIM
+ .export STOP
+ .export GETIN
+ .export CLALL
+ .export UDTIM
+ .export SCREEN
+ .export PLOT
+ .export IOBASE
+
+
+;-----------------------------------------------------------------------------
+; All functions are available in the kernal jump table
+
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
+
conio.o \
cputc.o \
kbhit.o \
+ kernal.o \
randomize.o \
- readjoy.o
+ readjoy.o
all: $(OBJS)
;
.export xsize, ysize
+ .import SCREEN
.constructor initscrsize
- .include "../cbm/cbm.inc"
.code
.export newline, plot
.import popa, _gotoxy
.import xsize, revers
+ .import PLOT
.include "vic20.inc"
- .include "../cbm/cbm.inc"
+
_cputcxy:
pha ; Save C
.import initlib, donelib
.import zerobss, push0
.import _main
+ .import RESTOR, BSOUT, CLRCH
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.include "zeropage.inc"
--- /dev/null
+;
+; Ullrich von Bassewitz, 19.11.2002
+;
+; VIC20 kernal functions
+;
+
+ .export CINT
+ .export IOINIT
+ .export RAMTAS
+ .export RESTOR
+ .export VECTOR
+ .export SETMSG
+ .export SECOND
+ .export TKSA
+ .export MEMTOP
+ .export MEMBOT
+ .export SCNKEY
+ .export SETTMO
+ .export ACPTR
+ .export CIOUT
+ .export UNTLK
+ .export UNLSN
+ .export LISTEN
+ .export TALK
+ .export READST
+ .export SETLFS
+ .export SETNAM
+ .export OPEN
+ .export CLOSE
+ .export CHKIN
+ .export CKOUT
+ .export CLRCH
+ .export BASIN
+ .export BSOUT
+ .export LOAD
+ .export SAVE
+ .export SETTIM
+ .export RDTIM
+ .export STOP
+ .export GETIN
+ .export CLALL
+ .export UDTIM
+ .export SCREEN
+ .export PLOT
+ .export IOBASE
+
+
+;-----------------------------------------------------------------------------
+; All functions are available in the kernal jump table
+
+CINT = $FF81
+IOINIT = $FF84
+RAMTAS = $FF87
+RESTOR = $FF8A
+VECTOR = $FF8D
+SETMSG = $FF90
+SECOND = $FF93
+TKSA = $FF96
+MEMTOP = $FF99
+MEMBOT = $FF9C
+SCNKEY = $FF9F
+SETTMO = $FFA2
+ACPTR = $FFA5
+CIOUT = $FFA8
+UNTLK = $FFAB
+UNLSN = $FFAE
+LISTEN = $FFB1
+TALK = $FFB4
+READST = $FFB7
+SETLFS = $FFBA
+SETNAM = $FFBD
+OPEN = $FFC0
+CLOSE = $FFC3
+CHKIN = $FFC6
+CKOUT = $FFC9
+CLRCH = $FFCC
+BASIN = $FFCF
+BSOUT = $FFD2
+LOAD = $FFD5
+SAVE = $FFD8
+SETTIM = $FFDB
+RDTIM = $FFDE
+STOP = $FFE1
+GETIN = $FFE4
+CLALL = $FFE7
+UDTIM = $FFEA
+SCREEN = $FFED
+PLOT = $FFF0
+IOBASE = $FFF3
+