]> git.sur5r.net Git - cc65/commitdiff
Use external symbols for the CBM kernal jump table functions. This allows
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 19 Nov 2002 23:02:47 +0000 (23:02 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 19 Nov 2002 23:02:47 +0000 (23:02 +0000)
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

70 files changed:
libsrc/c128/Makefile
libsrc/c128/_scrsize.s
libsrc/c128/cputc.s
libsrc/c128/crt0.s
libsrc/c128/kernal.s [new file with mode: 0644]
libsrc/c64/Makefile
libsrc/c64/_scrsize.s
libsrc/c64/cputc.s
libsrc/c64/crt0.s
libsrc/c64/kernal.s [new file with mode: 0644]
libsrc/c64/tgi_mode_table.s
libsrc/cbm/c_acptr.s
libsrc/cbm/c_basin.s
libsrc/cbm/c_bsout.s
libsrc/cbm/c_chkin.s
libsrc/cbm/c_ciout.s
libsrc/cbm/c_ckout.s
libsrc/cbm/c_clall.s
libsrc/cbm/c_close.s
libsrc/cbm/c_clrch.s
libsrc/cbm/c_iobase.s
libsrc/cbm/c_listen.s
libsrc/cbm/c_load.s
libsrc/cbm/c_open.s
libsrc/cbm/c_readst.s
libsrc/cbm/c_save.s
libsrc/cbm/c_setlfs.s
libsrc/cbm/c_setnam.s
libsrc/cbm/c_talk.s
libsrc/cbm/c_unlsn.s
libsrc/cbm/c_untlk.s
libsrc/cbm/cbm.inc
libsrc/cbm/cbm_read.s
libsrc/cbm/cbm_write.s
libsrc/cbm/clock.s
libsrc/cbm/close.s
libsrc/cbm/diskcmd.s
libsrc/cbm/filename.s
libsrc/cbm/open.s
libsrc/cbm/read.s
libsrc/cbm/where.s
libsrc/cbm/write.s
libsrc/cbm510/cputc.s
libsrc/cbm510/crt0.s
libsrc/cbm510/kplot.s
libsrc/cbm510/kscnkey.s
libsrc/cbm510/kudtim.s
libsrc/cbm610/cputc.s
libsrc/cbm610/crt0.s
libsrc/cbm610/kplot.s
libsrc/cbm610/kscnkey.s
libsrc/cbm610/kudtim.s
libsrc/pet/Makefile
libsrc/pet/crt0.s
libsrc/pet/kernal.s [new file with mode: 0644]
libsrc/pet/krdtim.s [new file with mode: 0644]
libsrc/pet/kreadst.s [new file with mode: 0644]
libsrc/pet/ksetlfs.s [new file with mode: 0644]
libsrc/pet/ksetnam.s [new file with mode: 0644]
libsrc/pet/pet.inc
libsrc/plus4/Makefile
libsrc/plus4/_scrsize.s
libsrc/plus4/cputc.s
libsrc/plus4/crt0.s
libsrc/plus4/kernal.s [new file with mode: 0644]
libsrc/vic20/Makefile
libsrc/vic20/_scrsize.s
libsrc/vic20/cputc.s
libsrc/vic20/crt0.s
libsrc/vic20/kernal.s [new file with mode: 0644]

index 555fe81ebe323519af063552d9fb5b5dd507d60c..a7693b7ea1e94ea153c9622035d4a3b921210254 100644 (file)
@@ -20,6 +20,7 @@ OBJS =        _scrsize.o      \
                color.o         \
        cputc.o         \
        kbhit.o         \
+        kernal.o        \
        mouse.o         \
         randomize.o     \
        readjoy.o       \
index d377be7dffdebbdb68fb0bd1528d0f1622391d33..dcbc4a2d9b83602fef73a046948114def65d912b 100644 (file)
@@ -5,9 +5,9 @@
 ;
 
        .export         xsize, ysize
+        .import         SCREEN
        .constructor    initscrsize
 
-       .include        "../cbm/cbm.inc"
 
 .code
 
@@ -26,4 +26,4 @@ ysize:        .res    1
 
 
 
-                
+
index 7f35ded29b24b63037c68fcbabc7f6b01f3831c2..318aa6175928ddd6fa956e16f1d7eff752928f7b 100644 (file)
@@ -9,9 +9,10 @@
        .export         newline, plot
        .import         popa, _gotoxy
        .import         xsize, revers
+        .import         PLOT
 
        .include        "c128.inc"
-       .include        "../cbm/cbm.inc"
+
 
 _cputcxy:
        pha                     ; Save C
index a35839914b1f1777351a7912a7407679984d4ddd..b7309c9c2e941286791390018c72b85109554eda 100644 (file)
@@ -9,12 +9,13 @@
        .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
diff --git a/libsrc/c128/kernal.s b/libsrc/c128/kernal.s
new file mode 100644 (file)
index 0000000..4f7b201
--- /dev/null
@@ -0,0 +1,90 @@
+;
+; 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
+
index 5b67a4b1cefe06f2407ece7c22443f18c81ad4ed..10cd36fc27b4873812574c9d69644950bbac92b9 100644 (file)
@@ -23,6 +23,7 @@ OBJS =        _scrsize.o              \
                conio.o                 \
                cputc.o                 \
                kbhit.o                 \
+        kernal.o                \
                mouse.o                 \
         randomize.o             \
                readjoy.o               \
index 749226d36565912c346f0eb6388388e06b839ebd..c63df59d234697537f3d9aaf986d49fc9713e639 100644 (file)
@@ -5,9 +5,9 @@
 ;
 
        .export         xsize, ysize
+        .import         SCREEN
        .constructor    initscrsize
 
-       .include        "../cbm/cbm.inc"
 
 .code
 
index 1efeaa7018970d2b245bd1a0e0cae6ecc4936e06..7bdcdc859cc5ec6518c87fb7bceba5927c876827 100644 (file)
@@ -9,9 +9,10 @@
        .export         newline, plot
        .import         popa, _gotoxy
        .import         xsize, revers
+        .import         PLOT
 
        .include        "c64.inc"
-       .include        "../cbm/cbm.inc"
+
 
 _cputcxy:
        pha                     ; Save C
index 7702973723536afbec8e651bdfb074c45cf3da36..607f779be27cc49ce0a0c167a46daf9cac4e7fc4 100644 (file)
@@ -8,11 +8,12 @@
        .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
 
diff --git a/libsrc/c64/kernal.s b/libsrc/c64/kernal.s
new file mode 100644 (file)
index 0000000..ac39779
--- /dev/null
@@ -0,0 +1,90 @@
+;
+; 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
+
index 0f918f170043a8d0a1ae3f6bce60e243d7291ddf..bed27a52b5e2d52e84a65b865d2e4df86ab3b518 100644 (file)
@@ -17,7 +17,7 @@
 .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
 
 
index d77d6f1ce5327473c739c26ac4c64113283871cb..e5c9852b6abcb73108bae7d0a2939c4e44efa4ee 100644 (file)
@@ -4,13 +4,13 @@
 ; unsigned char __fastcall__ cbm_acptr (void);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_acptr
+        .import         ACPTR
+
 
 _cbm_acptr:
        jsr     ACPTR
        ldx     #0
        rts
 
-                    
+
index a852b6c5babe8febfe9fecd540381c3d4435ade5..80dda8bdbbb521fca48182b86128ba04937225e7 100644 (file)
@@ -4,8 +4,7 @@
 ; unsigned char __fastcall__ cbm_k_basin (void);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_basin
+        .import         BASIN
 
 _cbm_k_basin = BASIN
index 9bb0430cd11ef439386fb8ff49ec2a4fd67dd2ba..14b1252a60099f2981f151cdd00a9dc49beffd4b 100644 (file)
@@ -4,8 +4,7 @@
 ; void __fastcall__ cbm_k_bsout (unsigned char C);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_bsout
+        .import         BSOUT
 
 _cbm_k_bsout = BSOUT
index 4febff74c15bcd852315f15207e260fa7f6aab0f..f687147ac85b3433345f2990f373ddd087bd8ef1 100644 (file)
@@ -4,9 +4,8 @@
 ; unsigned char __fastcall__ cbm_k_chkin (unsigned char FN);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_chkin
+        .import         CHKIN
 
 _cbm_k_chkin:
        tax
index b2c149fb1c548fe16f417d0b8210add87a176984..72f42daf3b12d14e97cd4ad8fbe1af55a35a9401 100644 (file)
@@ -4,9 +4,8 @@
 ; void __fastcall__ cbm_ciout (unsigned char C);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_ciout
+        .import         CIOUT
 
 _cbm_ciout = CIOUT
 
index 148619d6b3d891add5cd0d127c4d21e57d05215c..299254c03d611a4ddf96bcd2ee55f37a514940f4 100644 (file)
@@ -4,9 +4,9 @@
 ; unsigned char __fastcall__ cbm_k_ckout (unsigned char FN);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_ckout
+        .import         CKOUT
+
 
 _cbm_k_ckout:
        tax
index d7c5625eecd4cb04981781588e096d89f428ae03..b062c6ff38e8b4e3b68c9c277c68a462a84df4c0 100644 (file)
@@ -4,9 +4,9 @@
 ; void __fastcall__ cbm_clall (void);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_clall
+        .import         CLALL
+
 
 _cbm_clall = CLALL
 
index e2a559cc4033dc7beafc2090ecf7a2e0a7617da7..5a99f50570bf32b33ba7f7fed2bdafce583c1740 100644 (file)
@@ -4,12 +4,11 @@
 ; void __fastcall__ cbm_k_close (unsigned char FN);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_close
+        .import         CLOSE
 
 _cbm_k_close:
-               clc
+               clc                  
                jmp     CLOSE
 
 
index 632a9e2b2611ea7b632937549fe8768d96c05d78..7750fd8112d7b2518b19ecb1292e5ee70700a42d 100644 (file)
@@ -4,9 +4,8 @@
 ; void __fastcall__ cbm_k_clrch (void);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_clrch
+        .import         CLRCH
 
 _cbm_k_clrch = CLRCH
 
index 58fb1598b4389b475cfc1bbcc31710340ef8bf0c..2780b0ca34a0d5e97e70308860046b2e4d711251 100644 (file)
@@ -4,9 +4,8 @@
 ; unsigned __fastcall__ cbm_iobase (void);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_iobase
+        .import         IOBASE
 
 _cbm_iobase:
        jsr     IOBASE
index a5cc4e0cb8f2e89c9d09274d4224363128d3354a..9502c2d1a2645391c331f146a1db97b6a44fa211 100644 (file)
@@ -4,9 +4,8 @@
 ; void __fastcall__ cbm_listen (unsigned char dev);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_listen
+        .import         LISTEN
 
 _cbm_listen = LISTEN
 
index 3424722db199526c3952db34f8ddcb0f9dd671bf..8213307045b00c6717c46d05843ced94b1b0f8e7 100644 (file)
@@ -4,9 +4,8 @@
 ; 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
@@ -28,4 +27,4 @@ _cbm_k_load:
         tax
         pla
         rts
-       
+
index 23577f9d483dcc4fec7661b4cf2a42355aada469..300aa54ad5a0e1010dd49ccc92ccfaadef5abbf3 100644 (file)
@@ -4,9 +4,9 @@
 ; unsigned char __fastcall__ cbm_k_open (void);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_k_open
+        .import         OPEN
+
 
 _cbm_k_open:
        jsr     OPEN
index 4854ae25d36a2e01cf9c15f82fdbbcc6e3b1948d..2a3075accfc4e8e5498589a836241f70df738e57 100644 (file)
@@ -4,8 +4,8 @@
 ; unsigned char __fastcall__ cbm_k_readst (void);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_k_readst
+        .import         READST
+
 
 _cbm_k_readst = READST
index ec896d29a298e8f1e3426b53820ef0b05e437399..e17471fa7f84a44debe205d119c315ef3cbe4614 100644 (file)
@@ -4,11 +4,11 @@
 ; 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
index 315a4fc5082ba951e84844a32c76cf3ca2d900b8..5277cf453b798e5cb9e89f0e1ecbaf09e4e6abbd 100644 (file)
@@ -6,11 +6,11 @@
 ;                                unsigned char SA);
 ;
 
-               .include        "cbm.inc"
-
                .export         _cbm_k_setlfs
+        .import         SETLFS
        .import         popa
        .importzp       tmp1
+                              
 
 _cbm_k_setlfs:
        sta     tmp1            ; Save SA
index f3d571d28e8a200033c84757dd092c0fc79c0a39..8f35d37fb284f50ec966cb40d45d928f6bdfa690 100644 (file)
@@ -4,10 +4,10 @@
 ; 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
index d9d7099131248e3ac9723d45cf1105b6aeb52184..062b5e49248cd606af126ea960f2282cb74a29f6 100644 (file)
@@ -4,9 +4,9 @@
 ; void __fastcall__ cbm_talk (unsigned char dev);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_talk
+        .import         TALK
+
 
 _cbm_talk = TALK
 
index bcf4e0be0f8a7c2f712a02b07a546ff5c3f016fd..1b48cf9abacd2ceccaab4d0aeb72411eca50129d 100644 (file)
@@ -4,9 +4,9 @@
 ; void __fastcall__ cbm_unlsn (void);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_unlsn
+        .import         UNLSN
+
 
 _cbm_unlsn = UNLSN
 
index 4417188b39ac08c08eb7527b07779cb2a6f3dca0..b45997bb3547e73fa9b27fe4e997b6522faca5ea 100644 (file)
@@ -4,9 +4,9 @@
 ; void __fastcall__ cbm_untlk (void);
 ;
 
-       .include        "cbm.inc"
-
                .export         _cbm_untlk
+        .import         UNTLK
+
 
 _cbm_untlk = UNTLK
 
index d0f0aad3ca1739b5e02a8013f7444a880e09bc8e..8caaa66a82ede82dda439b35dea8b4d82046af17 100644 (file)
@@ -7,45 +7,45 @@
 ; 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
 
 
 ;-----------------------------------------------------------------------------
@@ -60,7 +60,7 @@ CBMDEV_SCREEN   = 3
 ;-----------------------------------------------------------------------------
 ; Disk stuff
 ;
-            
+
 MAX_DRIVES      = 24
 FIRST_DRIVE     = 8
 
index 20d3db124c4f6f596dce1e4c42cfb668d1a3efe6..5df18e34d7f0b8ee30e5e3e6daaf45e6bfe0d762 100644 (file)
         .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
index 402cd3ea78310260cbe3eb03ab61dd7701f0cd06..295ff2cd05c2c4974b30bc21c45e1beef9d113a5 100644 (file)
@@ -3,9 +3,9 @@
 ;
 ; 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
index 4e744dc8988a412d59fc85954c7cd01562a35313..71fa40336122b98937bdbc720582d2496b1c1160 100644 (file)
@@ -5,9 +5,9 @@
 ;
 
        .export         _clock
+        .import         RDTIM
        .importzp       sreg
 
-       .include        "cbm.inc"
 
 
 .proc  _clock
@@ -16,7 +16,7 @@
                sta     sreg+1
        jsr     RDTIM
        sty     sreg
-               rts                     
+               rts
 
 .endproc
 
index c521c0801cd255a13af15a7a5db6994644f5c2ad..cb71224f9b5b725734a3ef066ffa77b16fc3d632 100644 (file)
@@ -6,6 +6,7 @@
 
         .export         _close
 
+        .import         CLOSE
         .import         readdiskerror, closecmdchannel
         .import         __errno, __oserror
         .importzp       tmp2
index 134622f20eb0a3a4afa66ebbb09fc6296487fec3..c6f04e9fe9acde1861368943e1cc9522a8fd2894 100644 (file)
@@ -10,6 +10,8 @@
         .export         readdiskerror
         .export         writediskcmd
 
+        .import         SETLFS, SETNAM, OPEN, CLOSE, BSOUT, BASIN
+        .import         CHKIN, CKOUT, CLRCH
         .importzp       tmp1, ptr1
 
         .include        "cbm.inc"
@@ -203,7 +205,7 @@ writediskcmd:
         rts
 
 
-           
+
 ;--------------------------------------------------------------------------
 ; Data
 
index 594c7da9188f22109be36e59c48e3fda71b38132..572be21e4fa203f7301a8eacd46c5a9e8332b443 100644 (file)
@@ -7,11 +7,11 @@
         .export         fnparse, fnset, fncomplete
         .export         fnunit, fnlen, fncmd, fnbuf
 
+        .import         SETNAM
         .import         __curunit, __filetype
         .importzp       ptr1
 
         .include        "ctype.inc"
-        .include        "cbm.inc"
 
 
 ;--------------------------------------------------------------------------
index 509951b0fe3cdca9661ac4724f88663a5301cbe1..bb6c6188c1df69cfcbf7e7972f32f8343a650e34 100644 (file)
@@ -6,6 +6,7 @@
 
         .export         _open
 
+        .import         SETLFS, OPEN, CLOSE
         .import         addysp, popax
         .import         scratch, fnparse, fncomplete, fnset
         .import         opencmdchannel, closecmdchannel, readdiskerror
@@ -15,7 +16,6 @@
 
         .include        "errno.inc"
         .include        "fcntl.inc"
-        .include        "cbm.inc"
         .include        "filedes.inc"
 
 
index 5a2157b998bb8e636fc82aef84509e53780bac1d..0183946b559ceb69a7243bd4d0004fe5fcbb0973 100644 (file)
@@ -6,7 +6,8 @@
 
         .export         _read
         .constructor    initstdin
-           
+
+        .import         SETLFS, OPEN, CHKIN, BASIN, CLRCH, READST
         .import         rwcommon
         .import         popax
         .import         __errno, __oserror
@@ -135,7 +136,7 @@ invalidfd:
 notopen:
         lda     #3              ; File not open
         bne     error
-                    
+
 ; Error entry, status not ok
 
 error5: lda     #5              ; Device not present
index d9c0b61ed55677684ce03923a95e59c3419b5fda..a7bf17d3eb448c2636c17c0ec44f60698f946b20 100644 (file)
@@ -4,9 +4,10 @@
 ; unsigned char wherex (void);
 ; unsigned char wherey (void);
 
+
        .export         _wherex, _wherey
-       
-       .include        "cbm.inc"
+        .import         PLOT
+
 
 _wherex:
        sec
index 7a1441fe005299a89b8dc68b921abe09e9503fd5..64b3c580ebd432a47f2e9672ade69870eccff618 100644 (file)
@@ -7,6 +7,7 @@
         .export         _write
         .constructor    initstdout
 
+        .import         SETLFS, OPEN, CKOUT, BSOUT, CLRCH
         .import         rwcommon
         .import         __errno, __oserror
         .importzp       sp, ptr1, ptr2, ptr3
index 557beae31b04c8d645dcaa2b7a435786b1ccea18..8b832614b3b82b84150a2791f429d979ebf2b865 100644 (file)
@@ -7,11 +7,12 @@
 
        .export         _cputcxy, _cputc, cputdirect, putchar
        .export         newline, plot
+
+        .import         PLOT
        .import         popa, _gotoxy
        .import         xsize, revers
 
        .include        "cbm510.inc"
-       .include        "../cbm/cbm.inc"
 
 ; ------------------------------------------------------------------------
 ;
index 6500397ae72e77375ab74acfb5dc612b0cff1cf9..a0b9c844b73639660be9b7036e1fdb79efce3b4e 100644 (file)
@@ -13,7 +13,7 @@
        .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"
@@ -319,7 +319,7 @@ vectable:
        jmp     $0000           ; TKSA
        jmp     $0000           ; MEMTOP
        jmp     $0000           ; MEMBOT
-       jmp     k_scnkey        ; SCNKEY
+               jmp     SCNKEY
        jmp     $0000           ; SETTMO
        jmp     $0000           ; ACPTR
        jmp     $0000           ; CIOUT
@@ -328,26 +328,26 @@ vectable:
        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
@@ -437,23 +437,30 @@ reset_size = * - reset
 ; ------------------------------------------------------------------------
 ; 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
@@ -462,22 +469,27 @@ k_setnam:
         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
index 3d16d578facd2a59189a00c5d898f138f35042ef..c5f52f85bca9ff45e28474e90917ec4c4c8e868c 100644 (file)
@@ -4,7 +4,7 @@
 ; PLOT routine for the 510.
 ;
 
-       .export         k_plot
+       .export         PLOT
        .import         __VIDRAM_START__
        .importzp       crtc
 
@@ -15,7 +15,7 @@
 ; ------------------------------------------------------------------------
 ;
 
-.proc  k_plot
+.proc  PLOT
 
                bcs     get
 
@@ -63,3 +63,4 @@ LineLSBTab:           LineLoTab
 LineMSBTab:    LineHiTab
 
 
+            
index 0832a34616801938ffcd8d929ba8aff952b22c43..95657508e372adaba0dde3c75f7e8e85f1048de5 100644 (file)
@@ -1,16 +1,16 @@
-;
+;             
 ; 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
@@ -50,7 +50,7 @@ L4:   lsr     a
         sec
        ldy     #tpiPortB
        lda     (tpi2),y
-       rol     a
+       rol     a
        sta     (tpi2),y
                ldy     #tpiPortA
        lda     (tpi2),y
@@ -102,7 +102,7 @@ End:        lda     #$7F
        sta     (tpi2),y
        ldy     #tpiPortB
        lda     #$FF
-       sta     (tpi2),y
+       sta     (tpi2),y
         rts
 
 Repeat:        dec     RepeatDelay
@@ -130,7 +130,7 @@ PutKey:     sta     KeyBuf,x
        ldy     #tpiPortC
 L1:    lda     (tpi2),y
        sta     KeySave
-       lda     (tpi2),y
+       lda     (tpi2),y
        cmp     KeySave
        bne     L1
        rts
index e50e1cf71e7ea919484ca2998f2cecd6bbbb4e20..54d6eb26e687d11d5740e925b6c4efe03222492b 100644 (file)
@@ -5,11 +5,11 @@
 ; C programs will not use it.
 ;
 
-       .export         k_udtim
+       .export         UDTIM
        .importzp       time
 
 
-.proc  k_udtim
+.proc  UDTIM
 
        inc     time
        bne     L9
@@ -23,3 +23,4 @@ L9:   rts
 .endproc
 
 
+             
index aa94b8aa42e32867946d10553b7a83c9fdb88215..ac3224c6f1840b84f203e3da4cd140ee0991a78a 100644 (file)
@@ -8,12 +8,14 @@
        .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
index c13bcb0436c40e2e9a22327731440b96420c16f2..f2298bcd9e504f6f0bb8339970f32a403affcd3c 100644 (file)
@@ -12,7 +12,7 @@
        .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"
@@ -238,7 +238,7 @@ vectable:
        jmp     $0000           ; TKSA
        jmp     $0000           ; MEMTOP
        jmp     $0000           ; MEMBOT
-       jmp     k_scnkey        ; SCNKEY
+       jmp     SCNKEY
        jmp     $0000           ; SETTMO
        jmp     $0000           ; ACPTR
        jmp     $0000           ; CIOUT
@@ -247,8 +247,8 @@ vectable:
        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
@@ -258,15 +258,15 @@ vectable:
        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
@@ -339,23 +339,30 @@ reset_size = * - reset
 ; ------------------------------------------------------------------------
 ; 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
@@ -364,22 +371,27 @@ k_setnam:
         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
index 2a514185aab08c6d601bf20c341fed6ccf64132e..d972b6039f7530ef3e62e755642e78b0c0aab224 100644 (file)
@@ -4,13 +4,13 @@
 ; 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
index ee30cf35abbc9583ca47bf86904e1cc880dfa86b..ce9851731ee6553a725bf287828077e0ea6ad922 100644 (file)
@@ -4,13 +4,13 @@
 ; 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
index e100a84c6d214d8d89c2113ca1115e28c8a386d7..a5f5256600c369a2b312118f559d043ec414748f 100644 (file)
@@ -5,11 +5,11 @@
 ; C programs will not use it.
 ;
 
-       .export         k_udtim
+       .export         UDTIM
        .importzp       time
 
 
-.proc  k_udtim
+.proc  UDTIM
 
        inc     time
        bne     L9
@@ -22,4 +22,4 @@ L9:   rts
 
 .endproc
 
-                
+
index 4bc6c22128bdda121ff23da6859b6e4a493c85af..4c3c44d0ced9ce20e8edd107e51565c51e01c56d 100644 (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)
 
index fb1babc388dea5f49ce63587f8ac819baaaebb8a..c1e5c009ff1e3900e688e0e115ace858f277e604 100644 (file)
@@ -8,6 +8,7 @@
        .import         initlib, donelib
                .import         zerobss, push0
        .import         _main
+        .import         CLRCH, BSOUT
 
         .include        "zeropage.inc"
        .include        "pet.inc"
diff --git a/libsrc/pet/kernal.s b/libsrc/pet/kernal.s
new file mode 100644 (file)
index 0000000..522f2ba
--- /dev/null
@@ -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
+
diff --git a/libsrc/pet/krdtim.s b/libsrc/pet/krdtim.s
new file mode 100644 (file)
index 0000000..355cce3
--- /dev/null
@@ -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
+
+
diff --git a/libsrc/pet/kreadst.s b/libsrc/pet/kreadst.s
new file mode 100644 (file)
index 0000000..56a491e
--- /dev/null
@@ -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
+
+
diff --git a/libsrc/pet/ksetlfs.s b/libsrc/pet/ksetlfs.s
new file mode 100644 (file)
index 0000000..6e9065a
--- /dev/null
@@ -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
+
+
diff --git a/libsrc/pet/ksetnam.s b/libsrc/pet/ksetnam.s
new file mode 100644 (file)
index 0000000..0bf6411
--- /dev/null
@@ -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
+
+
index e8305122217a5539e609263a8bbde453b272582b..0dca57a765075723412177444be748b3d26c5313 100644 (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
 
index 2c431741ecda1fc60469318900eab165ad760a5d..a503225afb2d82cf8370a4df3a2658ce0926acc8 100644 (file)
@@ -20,6 +20,7 @@ OBJS =        _scrsize.o      \
        cputc.o         \
        crt0.o          \
        kbhit.o         \
+        kernal.o        \
         randomize.o     \
        readjoy.o       \
        tgi_mode_table.o
index 749226d36565912c346f0eb6388388e06b839ebd..c63df59d234697537f3d9aaf986d49fc9713e639 100644 (file)
@@ -5,9 +5,9 @@
 ;
 
        .export         xsize, ysize
+        .import         SCREEN
        .constructor    initscrsize
 
-       .include        "../cbm/cbm.inc"
 
 .code
 
index eab31f0cd8df2d2bf65af0335813e3fc3c4e000c..1d3208c28cdd95f621c53582f7528ab0d6587e25 100644 (file)
@@ -9,9 +9,10 @@
        .export         newline, plot
        .import         popa, _gotoxy
        .import         xsize, revers
+        .import         PLOT
 
        .include        "plus4.inc"
-       .include        "../cbm/cbm.inc"
+
 
 _cputcxy:
        pha                     ; Save C
@@ -28,7 +29,7 @@ _cputc: cmp           #$0A            ; CR?
                beq     plot            ; Recalculate pointers
 
 L1:    cmp     #$0D            ; LF?
-               beq     newline         ; Recalculate pointers
+               beq     newline         ; Recalculate pointers
 
 ; Printable char of some sort
 
@@ -88,7 +89,7 @@ L11:  ora     #$40
 
 plot:  ldy     CURS_X
        ldx     CURS_Y
-       clc
+       clc                 
        jmp     PLOT            ; Set the new cursor
 
 
index 701b172587627b4135a2393af06f6e2a7608b2ea..9c8b66feaf28e88c1a54482da80f97c54acfc14c 100644 (file)
@@ -7,10 +7,11 @@
        .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
diff --git a/libsrc/plus4/kernal.s b/libsrc/plus4/kernal.s
new file mode 100644 (file)
index 0000000..78914c0
--- /dev/null
@@ -0,0 +1,90 @@
+;
+; 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
+
index d3f42397d8596a313ec40993370bd958011a98f2..8ffc8e8865f56d9aff29520980282ba3a106b117 100644 (file)
@@ -20,8 +20,9 @@ OBJS =        _scrsize.o      \
        conio.o         \
        cputc.o         \
        kbhit.o         \
+        kernal.o        \
         randomize.o     \
-       readjoy.o       
+       readjoy.o
 
 all:   $(OBJS)
 
index 749226d36565912c346f0eb6388388e06b839ebd..c63df59d234697537f3d9aaf986d49fc9713e639 100644 (file)
@@ -5,9 +5,9 @@
 ;
 
        .export         xsize, ysize
+        .import         SCREEN
        .constructor    initscrsize
 
-       .include        "../cbm/cbm.inc"
 
 .code
 
index 85a29f4efb4633dd89576fdf2d4310644fd00395..c788d32af0b18ce3d0cc6149431e7a51ab9488f8 100644 (file)
@@ -9,9 +9,10 @@
        .export         newline, plot
        .import         popa, _gotoxy
        .import         xsize, revers
+        .import         PLOT
 
        .include        "vic20.inc"
-       .include        "../cbm/cbm.inc"
+
 
 _cputcxy:
        pha                     ; Save C
index 189a9d71bc508a2d12623e331df4826058399ae7..286b0407c63a92f59eed63b581d2c57ad588ac09 100644 (file)
@@ -8,6 +8,7 @@
        .import         initlib, donelib
                .import         zerobss, push0
        .import         _main
+        .import         RESTOR, BSOUT, CLRCH
        .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
 
         .include        "zeropage.inc"
diff --git a/libsrc/vic20/kernal.s b/libsrc/vic20/kernal.s
new file mode 100644 (file)
index 0000000..885a2fc
--- /dev/null
@@ -0,0 +1,90 @@
+;
+; 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
+