]> git.sur5r.net Git - cc65/commitdiff
Make use of the new common __directerrno and __mappederrno function.
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jun 2010 20:38:05 +0000 (20:38 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jun 2010 20:38:05 +0000 (20:38 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4720 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/Makefile
libsrc/apple2/close.s
libsrc/apple2/fileerr.s [deleted file]
libsrc/apple2/open.s
libsrc/apple2/read.s
libsrc/apple2/rootdir.s
libsrc/apple2/rwcommon.s
libsrc/apple2/write.s
libsrc/apple2enh/Makefile

index 9f5c08b4f1f2d6665829b34fbe4a7886818ce3c2..36b85b8e129fe77a10d5b866a4a321d143564495 100644 (file)
@@ -72,7 +72,6 @@ S_OBJS=       _scrsize.o      \
        dosdetect.o     \
        drives.o        \
        filedes.o       \
-       fileerr.o       \
        filename.o      \
         get_ostype.o    \
        gotoxy.o        \
index 737e29d1c61c9d27dbfcb1c6df20804f3857860f..45c3452119ef62f36f3335e6987bbeafe0633f58 100644 (file)
@@ -7,9 +7,9 @@
         .export        _close
 
         .import                closedirect, freebuffer
-        .import        errnoexit, oserrexit
         .import        return0
 
+        .include       "errno.inc"
         .include       "filedes.inc"
 
 _close:
@@ -34,8 +34,8 @@ zerofd: lda   #$00
         ; Return success
         jmp    return0
 
-        ; Return errno
-errno:  jmp    errnoexit
+        ; Set __errno
+errno:  jmp    __directerrno
 
-        ; Return oserror
-oserr:  jmp    oserrexit
+        ; Set __oserror
+oserr:  jmp    __mappederrno
diff --git a/libsrc/apple2/fileerr.s b/libsrc/apple2/fileerr.s
deleted file mode 100644 (file)
index 91dbcbd..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-;
-; Oliver Schmidt, 15.01.2004
-;
-; Error handling for ProDOS 8 file I/O
-;
-
-        .export                errnoexit, oserrexit
-
-        .include       "errno.inc"
-
-errnoexit:
-        jsr    __seterrno      ; Returns with A = 0
-
-oserrexit:
-        sta     __oserror
-        lda    #$FF
-        tax
-        rts
index aef0f56e8d1be05b6bbc9f7c3757bd340cae22e8..9d3c158b6ac3e81644c7192c17d6f388b1e2f2b9 100644 (file)
@@ -11,7 +11,6 @@
         .destructor    closeallfiles, 17
 
         .import                pushname, popname
-        .import        errnoexit, oserrexit
         .import                iobuf_alloc, iobuf_free
         .import        addysp, incsp4, incaxy, pushax, popax
 
@@ -54,8 +53,8 @@ _open:
         ; Cleanup stack
 errno:  jsr    incsp4          ; Preserves A
 
-        ; Return errno
-        jmp    errnoexit
+        ; Set __errno
+        jmp    __directerrno
 
         ; Save fdtab slot
 found:  tya
@@ -138,8 +137,8 @@ oserr1: ldy tmp2            ; Restore fdtab slot
         jsr    freebuffer
         pla                    ; Restore oserror code
 
-        ; Return oserror
-        jmp    oserrexit
+        ; Set __oserror
+        jmp    __mappederrno
 
 open:   ldy    tmp2            ; Restore fdtab slot
 
index ed84e70e193827471e13218c29cdcbd9b2f5bf33..d850007305d345386bb8ffa781f1fce7664b228d 100644 (file)
@@ -7,7 +7,6 @@
         .constructor   initprompt
         .export                _read
         .import                rwprolog, rwcommon
-        .import                errnoexit
         .import                RDKEY, COUT
 
         .include       "zeropage.inc"
@@ -101,5 +100,5 @@ check:  lda ptr3
         ; Load errno code
 einval: lda    #EINVAL
 
-        ; Return errno
-errno:  jmp    errnoexit
+        ; Set __errno
+errno:  jmp    __directerrno
index f3cf1f1ae7ea0fec151eb0bd848598c2fedbe816..e2134e5d49f80c3859256e6110a877c688b1c935 100644 (file)
@@ -5,7 +5,7 @@
 ;
 
         .export        _rootdir
-        .import                popax, oserrexit
+        .import                popax
 
         .include       "zeropage.inc"
         .include       "errno.inc"
@@ -50,5 +50,5 @@ _rootdir:
         tax
         rts
         
-        ; Return oserror
-oserr:  jmp    oserrexit
+        ; Set __oserror
+oserr:  jmp    __mappederrno
index 06d791164dbeb40a1f12e298afb2b4f39d9b7173..b9f86dff328b5530f04f673263135cde46a26db2 100644 (file)
@@ -3,10 +3,10 @@
 ;
 
         .export                rwprolog, rwcommon, rwepilog
-        .import                oserrexit
         .import                popax
 
         .include       "zeropage.inc"
+        .include       "errno.inc"
         .include       "fcntl.inc"
         .include       "mli.inc"
         .include       "filedes.inc"
@@ -55,5 +55,5 @@ rwepilog:
         ldx    mliparam + MLI::RW::TRANS_COUNT+1
         rts
 
-        ; Return oserror
-oserr:  jmp    oserrexit
+        ; Set __oserror
+oserr:  jmp    __mappederrno
index 9b6d2561c0073660fde0d5a50e704639bcb95d71..ec9efa3b77dcd9dff9261bccac3fb312de088d57 100644 (file)
@@ -6,7 +6,6 @@
 
         .export                _write
         .import                rwprolog, rwcommon, rwepilog
-        .import                errnoexit, oserrexit
         .import                COUT
 
         .include       "zeropage.inc"
@@ -106,9 +105,9 @@ done:   jmp rwepilog
         ; Load errno code
 einval: lda    #EINVAL
 
-        ; Return errno
-errno:  jmp    errnoexit
+        ; Set __errno
+errno:  jmp    __directerrno
 
-        ; Return oserror
-oserr:  jmp    oserrexit
+        ; Set __oserror
+oserr:  jmp    __mappederrno
                                                           
index 4ed14d989290dc9e16476b914e2b5de44be332d3..eaca78064efaa3718bc40fd0c0df22313ef93d67 100644 (file)
@@ -75,7 +75,6 @@ S_OBJS=       _scrsize.o      \
        dosdetect.o     \
        drives.o        \
        filedes.o       \
-       fileerr.o       \
        filename.o      \
         get_ostype.o    \
        gotoxy.o        \