]> git.sur5r.net Git - cc65/commitdiff
Turned the 'ST' status byte into a symbol resolved by the linker in order to allow...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 30 Sep 2012 18:20:15 +0000 (18:20 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 30 Sep 2012 18:20:15 +0000 (18:20 +0000)
Moved getdevice.s from 'c64'/'c128' to 'cbm' making use of the new 'ST' setup.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5834 b7a2c559-68d2-44c3-8de9-860c34a00d81

24 files changed:
libsrc/c128/Makefile
libsrc/c128/crt0.s
libsrc/c128/getdevice.s [deleted file]
libsrc/c128/status.s [new file with mode: 0644]
libsrc/c16/Makefile
libsrc/c16/crt0.s
libsrc/c16/status.s [new file with mode: 0644]
libsrc/c64/Makefile
libsrc/c64/crt0.s
libsrc/c64/getdevice.s [deleted file]
libsrc/c64/status.s [new file with mode: 0644]
libsrc/cbm/Makefile
libsrc/cbm/getdevice.s [new file with mode: 0644]
libsrc/pet/Makefile
libsrc/pet/checkst.s
libsrc/pet/crt0.s
libsrc/pet/kreadst.s
libsrc/pet/status.s [new file with mode: 0644]
libsrc/plus4/Makefile
libsrc/plus4/crt0.s
libsrc/plus4/status.s [new file with mode: 0644]
libsrc/vic20/Makefile
libsrc/vic20/crt0.s
libsrc/vic20/status.s [new file with mode: 0644]

index a6dc0f2b1532bdeb54b7b7242879089361fdde7e..b5b2a8a2a72c790f1b9263986a663ffa112c10da 100644 (file)
@@ -56,7 +56,6 @@ OBJS =        _scrsize.o              \
                devnum.o                \
        fast.o                  \
         get_tv.o               \
-        getdevice.o            \
        joy_stddrv.o            \
        kbhit.o                 \
         kernal.o               \
@@ -66,6 +65,7 @@ OBJS =        _scrsize.o              \
         randomize.o            \
         revers.o               \
        slow.o                  \
+       status.o                \
         systime.o               \
         sysuname.o              \
         tgi_colors.o            \
index 5185e2c835f479d904e2011b19bb12ae0f6750d5..64fec19a00a0124556aa7d15d2e9940fa334d4a1 100644 (file)
@@ -10,6 +10,7 @@
         .import         RESTOR, BSOUT, CLRCH
        .import         __INTERRUPTOR_COUNT__
        .import         __RAM_START__, __RAM_SIZE__, __STACKSIZE__
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "c128.inc"
diff --git a/libsrc/c128/getdevice.s b/libsrc/c128/getdevice.s
deleted file mode 100644 (file)
index 9ec2abe..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-;
-; Oliver Schmidt, 2012-09-04
-;
-; unsigned char getfirstdevice (void);
-; unsigned char __fastcall__ getnextdevice (unsigned char device);
-;
-
-        .export         _getfirstdevice
-        .export         _getnextdevice
-
-        .import         isdisk
-        .import         opencmdchannel
-        .import         closecmdchannel
-        .importzp       tmp2
-
-        .include        "c128.inc"
-
-;------------------------------------------------------------------------------
-; _getfirstdevice
-
-_getfirstdevice:
-        lda     #$FF
-        ; Fall through
-
-;------------------------------------------------------------------------------
-; _getnextdevice
-
-_getnextdevice:
-        tax
-next:  inx
-        cpx     #$FF
-        beq     done
-
-; [open|close]cmdchannel already call isdisk internally but they
-; interpret a non-disk as a no-op while we need to interpret it
-; as an error here
-
-        jsr     isdisk
-        bcs     next
-
-; [open|close]cmdchannel don't call into the Kernal at all if they
-; only [in|de]crement the reference count of the shared cmdchannel
-; so we need to explicitly initialize ST here
-
-        lda     #$00
-        sta     ST
-
-        stx     tmp2
-        jsr     opencmdchannel
-        ldx     tmp2
-        jsr     closecmdchannel
-        ldx     tmp2
-
-; As we had to reference ST above anyway we can as well do so
-; here too (instead of calling READST)
-
-        lda     ST
-
-; Either the Kernal calls above were successfull or there was
-; already a cmdchannel to the device open - which is a pretty
-; good indication of its existence ;-)
-
-        bmi     next
-
-done:   txa
-        ldx     #$00
-        rts
diff --git a/libsrc/c128/status.s b/libsrc/c128/status.s
new file mode 100644 (file)
index 0000000..3620c91
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $90       ; IEC status byte
index eca4991c4c043037a8f0cd06d3b980a0e1977dba..4019154a6ae45deff5d080e596104596de698fe3 100644 (file)
@@ -61,6 +61,7 @@ OBJS =        _scrsize.o      \
         mainargs.o      \
         randomize.o     \
         revers.o        \
+       status.o        \
         systime.o       \
         sysuname.o
 
index 71e7b0cf8b0b9b0b5c5d4c6ec71af15a58b9f256..88b328afd0d2703c4c0b1a91ce286e32990e8bc1 100644 (file)
@@ -11,6 +11,7 @@
        .import         callmain, zerobss
         .import         MEMTOP, RESTOR, BSOUT, CLRCH
        .import         __INTERRUPTOR_COUNT__
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "plus4.inc"
diff --git a/libsrc/c16/status.s b/libsrc/c16/status.s
new file mode 100644 (file)
index 0000000..3620c91
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $90       ; IEC status byte
index 2c952b7c0a5e986998ed5247d7b7ce8bf06f31a4..5d4b16aedaa26792a62a704920806d5bb052ed2c 100644 (file)
@@ -55,7 +55,6 @@ OBJS =        _scrsize.o              \
                devnum.o                \
         get_ostype.o            \
         get_tv.o                \
-        getdevice.o             \
        joy_stddrv.o            \
                kbhit.o                 \
         kernal.o                \
@@ -65,6 +64,7 @@ OBJS =        _scrsize.o              \
         mouse_stddrv.o          \
         randomize.o             \
         revers.o                \
+        status.o                \
         systime.o               \
         sysuname.o              \
         tgi_colors.o            \
index c9fee203157663f7a31ba4ab02ce8f3aeb5a28d4..16d2fb367f0fc6ae27afd82477f6e73cc18bc667 100644 (file)
@@ -11,6 +11,7 @@
        .import         __INTERRUPTOR_COUNT__
        .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
        .import         __STACKSIZE__                   ; Linker generated
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "c64.inc"
diff --git a/libsrc/c64/getdevice.s b/libsrc/c64/getdevice.s
deleted file mode 100644 (file)
index 90bf6ba..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-;
-; Oliver Schmidt, 2012-09-04
-;
-; unsigned char getfirstdevice (void);
-; unsigned char __fastcall__ getnextdevice (unsigned char device);
-;
-
-        .export         _getfirstdevice
-        .export         _getnextdevice
-
-        .import         isdisk
-        .import         opencmdchannel
-        .import         closecmdchannel
-        .importzp       tmp2
-
-        .include        "c64.inc"
-
-;------------------------------------------------------------------------------
-; _getfirstdevice
-
-_getfirstdevice:
-        lda     #$FF
-        ; Fall through
-
-;------------------------------------------------------------------------------
-; _getnextdevice
-
-_getnextdevice:
-        tax
-next:  inx
-        cpx     #$FF
-        beq     done
-
-; [open|close]cmdchannel already call isdisk internally but they
-; interpret a non-disk as a no-op while we need to interpret it
-; as an error here
-
-        jsr     isdisk
-        bcs     next
-
-; [open|close]cmdchannel don't call into the Kernal at all if they
-; only [in|de]crement the reference count of the shared cmdchannel
-; so we need to explicitly initialize ST here
-
-        lda     #$00
-        sta     ST
-
-        stx     tmp2
-        jsr     opencmdchannel
-        ldx     tmp2
-        jsr     closecmdchannel
-        ldx     tmp2
-
-; As we had to reference ST above anyway we can as well do so
-; here too (instead of calling READST)
-
-        lda     ST
-
-; Either the Kernal calls above were successfull or there was
-; already a cmdchannel to the device open - which is a pretty
-; good indication of its existence ;-)
-
-        bmi     next
-
-done:   txa
-        ldx     #$00
-        rts
diff --git a/libsrc/c64/status.s b/libsrc/c64/status.s
new file mode 100644 (file)
index 0000000..3620c91
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $90       ; IEC status byte
index 639d69424d549b7ef9f16e27da3bf9f2e1948166..1b1a6a4cb0ed1cc7816613809e23b2cd83930b38 100644 (file)
@@ -76,6 +76,7 @@ S_OBJS =      c_acptr.o       \
                 filename.o      \
                 filetype.o      \
                 filevars.o      \
+                getdevice.o     \
                gotox.o         \
                gotoxy.o        \
                gotoy.o         \
diff --git a/libsrc/cbm/getdevice.s b/libsrc/cbm/getdevice.s
new file mode 100644 (file)
index 0000000..87f990b
--- /dev/null
@@ -0,0 +1,66 @@
+;
+; Oliver Schmidt, 2012-09-04
+;
+; unsigned char getfirstdevice (void);
+; unsigned char __fastcall__ getnextdevice (unsigned char device);
+;
+
+        .export         _getfirstdevice
+        .export         _getnextdevice
+
+        .import         isdisk
+        .import         opencmdchannel
+        .import         closecmdchannel
+        .importzp       ST
+        .importzp       tmp2
+
+;------------------------------------------------------------------------------
+; _getfirstdevice
+
+_getfirstdevice:
+        lda     #$FF
+        ; Fall through
+
+;------------------------------------------------------------------------------
+; _getnextdevice
+
+_getnextdevice:
+        tax
+next:  inx
+        cpx     #$FF
+        beq     done
+
+; [open|close]cmdchannel already call isdisk internally but they
+; interpret a non-disk as a no-op while we need to interpret it
+; as an error here
+
+        jsr     isdisk
+        bcs     next
+
+; [open|close]cmdchannel don't call into the Kernal at all if they
+; only [in|de]crement the reference count of the shared cmdchannel
+; so we need to explicitly initialize ST here
+
+        lda     #$00
+        sta     ST
+
+        stx     tmp2
+        jsr     opencmdchannel
+        ldx     tmp2
+        jsr     closecmdchannel
+        ldx     tmp2
+
+; As we had to reference ST above anyway we can as well do so
+; here too (instead of calling READST)
+
+        lda     ST
+
+; Either the Kernal calls above were successfull or there was
+; already a cmdchannel to the device open - which is a pretty
+; good indication of its existence ;-)
+
+        bmi     next
+
+done:   txa
+        ldx     #$00
+        rts
index 041643d40d32f6d79db9f721409c09cf256263db..8ecf018c1fe48e32c56cde5033df1cdb43f2d246 100644 (file)
@@ -70,6 +70,7 @@ OBJS =        _scrsize.o      \
         mainargs.o      \
         randomize.o    \
        revers.o        \
+       status.o        \
         sysuname.o
 
 #--------------------------------------------------------------------------
index 9996d0ed4bdbc8bb6aca8eabcb17201f39a16f54..8d9d9a4f3ebaa67c4350ee9e2b841a5a5d83319d 100644 (file)
@@ -6,8 +6,7 @@
 ;
 
         .export         checkst
-
-        .include        "pet.inc"
+        .importzp       ST
 
 
 .proc   checkst
@@ -22,5 +21,3 @@
         rts
 
 .endproc
-
-
index 564e9ce77a32ba3795acace76cfc0e39a045f01d..121f4c492028bcfd01f9b1f5d8f5a759d324677a 100644 (file)
@@ -9,6 +9,7 @@
        .import         callmain
         .import         CLRCH, BSOUT
        .import         __INTERRUPTOR_COUNT__
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "pet.inc"
index 56a491e5d6785afac7b45536b4aae2cc8f64f300..38f6bfb1933654c743864e652149919b5cf768bd 100644 (file)
@@ -5,8 +5,7 @@
 ;
 
         .export         READST
-
-        .include        "pet.inc"
+        .importzp       ST
 
 
 .proc   READST
diff --git a/libsrc/pet/status.s b/libsrc/pet/status.s
new file mode 100644 (file)
index 0000000..bb72817
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $96       ; IEC status byte
index d6a852e21a07aadb8a4019bc8ae00b40adbbf776..4dc01c96bcd63244efecbbbfbeb9bf33e3d4e7a3 100644 (file)
@@ -82,6 +82,7 @@ OBJS =        _scrsize.o      \
         mainargs.o      \
         randomize.o     \
         revers.o        \
+        status.o        \
         systime.o       \
         sysuname.o
 
index 0592cca7ec316f0bcc57f8c76f8c7aa089019e66..73460d82b367d08ef5cbcd946ecc8db6ed8a2850 100644 (file)
@@ -11,6 +11,7 @@
        .import         __INTERRUPTOR_COUNT__
        .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
        .import         __STACKSIZE__                   ; Linker generated
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "plus4.inc"
diff --git a/libsrc/plus4/status.s b/libsrc/plus4/status.s
new file mode 100644 (file)
index 0000000..3620c91
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $90       ; IEC status byte
index 929a19aadb3c7f28ce44636264856b0c93ac0c97..023f27a8fd1a760fdbff01ec838e4937c1150e71 100644 (file)
@@ -61,6 +61,7 @@ OBJS =        _scrsize.o      \
         mainargs.o      \
         randomize.o     \
        revers.o        \
+       status.o        \
         sysuname.o
 
 #--------------------------------------------------------------------------
index 944fabe48b40aa8cbabe73805c3f009758aac1ae..170ac3a39c72038d666e3e26f560c42a233d1a18 100644 (file)
@@ -11,6 +11,7 @@
        .import         __INTERRUPTOR_COUNT__
        .import         __RAM_START__, __RAM_SIZE__     ; Linker generated
         .import                __STACKSIZE__                   ; Linker generated
+       .importzp       ST
 
         .include        "zeropage.inc"
        .include        "vic20.inc"
diff --git a/libsrc/vic20/status.s b/libsrc/vic20/status.s
new file mode 100644 (file)
index 0000000..3620c91
--- /dev/null
@@ -0,0 +1,5 @@
+;
+; Oliver Schmidt, 2012-09-30
+;
+
+       .exportzp       ST := $90       ; IEC status byte