]> git.sur5r.net Git - cc65/commitdiff
Clear __oserror on success.
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jun 2010 21:44:18 +0000 (21:44 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 15 Jun 2010 21:44:18 +0000 (21:44 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4721 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/apple2/close.s
libsrc/apple2/open.s
libsrc/apple2/read.s
libsrc/apple2/rootdir.s
libsrc/apple2/rwcommon.s
libsrc/apple2/write.s

index 45c3452119ef62f36f3335e6987bbeafe0633f58..18c4a14dd36bffce22dd84cf85c52bde8c4cb2b3 100644 (file)
@@ -7,7 +7,6 @@
         .export        _close
 
         .import                closedirect, freebuffer
-        .import        return0
 
         .include       "errno.inc"
         .include       "filedes.inc"
@@ -32,10 +31,10 @@ zerofd: lda #$00
         jsr    freebuffer
 
         ; Return success
-        jmp    return0
-
-        ; Set __errno
-errno:  jmp    __directerrno
+        lda    #$00
 
         ; Set __oserror
 oserr:  jmp    __mappederrno
+
+        ; Set __errno
+errno:  jmp    __directerrno
index 9d3c158b6ac3e81644c7192c17d6f388b1e2f2b9..de0bb63fa5e58e00232fb980be96a1320788bf96 100644 (file)
@@ -199,6 +199,7 @@ done:   lda tmp1            ; Restore fd
 
         ; Return success
         ldx    #$00
+        stx    __oserror
         rts
 
 freebuffer:
index d850007305d345386bb8ffa781f1fce7664b228d..dccde611f8fff4f5854f141a62b53804a487ba5c 100644 (file)
@@ -47,8 +47,11 @@ _read:
         ldy    #READ_CALL
         jmp    rwcommon
 
-        ; Set counter to zero
+        ; Device succeeds always
 device: lda    #$00
+        sta    __oserror
+
+        ; Set counter to zero
         sta    ptr3
         sta    ptr3+1
 
index e2134e5d49f80c3859256e6110a877c688b1c935..77d986aaec7ee439ede6646b1f94adb63aec16ec 100644 (file)
@@ -46,9 +46,7 @@ _rootdir:
         lda    #$00
         sta    (ptr1),y
         
-        ; Return success
-        tax
-        rts
+        ; Return success       ; A = 0
         
         ; Set __oserror
 oserr:  jmp    __mappederrno
index b9f86dff328b5530f04f673263135cde46a26db2..c1e78c503d29c39251067a5887bb762fc4b4b192 100644 (file)
@@ -51,6 +51,7 @@ rwcommon:
 
 rwepilog:
         ; Return success
+        sta    __oserror       ; A = 0
         lda    mliparam + MLI::RW::TRANS_COUNT
         ldx    mliparam + MLI::RW::TRANS_COUNT+1
         rts
index ec9efa3b77dcd9dff9261bccac3fb312de088d57..d8f7fcd84b4feb8b8f71137c75e29c41fe0f0d3e 100644 (file)
@@ -100,7 +100,8 @@ output: jsr COUT            ; Preserves X and Y
         bpl    next
 
         ; Return success
-done:   jmp    rwepilog
+done:   lda    #$00
+        jmp    rwepilog
 
         ; Load errno code
 einval: lda    #EINVAL