1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-09 13:25:06 +00:00

Make use of the new common __directerrno and __mappederrno function.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4720 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc
2010-06-15 20:38:05 +00:00
parent 8806c31e4a
commit 155c5629a9
9 changed files with 21 additions and 44 deletions

View File

@@ -72,7 +72,6 @@ S_OBJS= _scrsize.o \
dosdetect.o \ dosdetect.o \
drives.o \ drives.o \
filedes.o \ filedes.o \
fileerr.o \
filename.o \ filename.o \
get_ostype.o \ get_ostype.o \
gotoxy.o \ gotoxy.o \

View File

@@ -7,9 +7,9 @@
.export _close .export _close
.import closedirect, freebuffer .import closedirect, freebuffer
.import errnoexit, oserrexit
.import return0 .import return0
.include "errno.inc"
.include "filedes.inc" .include "filedes.inc"
_close: _close:
@@ -34,8 +34,8 @@ zerofd: lda #$00
; Return success ; Return success
jmp return0 jmp return0
; Return errno ; Set __errno
errno: jmp errnoexit errno: jmp __directerrno
; Return oserror ; Set __oserror
oserr: jmp oserrexit oserr: jmp __mappederrno

View File

@@ -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

View File

@@ -11,7 +11,6 @@
.destructor closeallfiles, 17 .destructor closeallfiles, 17
.import pushname, popname .import pushname, popname
.import errnoexit, oserrexit
.import iobuf_alloc, iobuf_free .import iobuf_alloc, iobuf_free
.import addysp, incsp4, incaxy, pushax, popax .import addysp, incsp4, incaxy, pushax, popax
@@ -54,8 +53,8 @@ _open:
; Cleanup stack ; Cleanup stack
errno: jsr incsp4 ; Preserves A errno: jsr incsp4 ; Preserves A
; Return errno ; Set __errno
jmp errnoexit jmp __directerrno
; Save fdtab slot ; Save fdtab slot
found: tya found: tya
@@ -138,8 +137,8 @@ oserr1: ldy tmp2 ; Restore fdtab slot
jsr freebuffer jsr freebuffer
pla ; Restore oserror code pla ; Restore oserror code
; Return oserror ; Set __oserror
jmp oserrexit jmp __mappederrno
open: ldy tmp2 ; Restore fdtab slot open: ldy tmp2 ; Restore fdtab slot

View File

@@ -7,7 +7,6 @@
.constructor initprompt .constructor initprompt
.export _read .export _read
.import rwprolog, rwcommon .import rwprolog, rwcommon
.import errnoexit
.import RDKEY, COUT .import RDKEY, COUT
.include "zeropage.inc" .include "zeropage.inc"
@@ -101,5 +100,5 @@ check: lda ptr3
; Load errno code ; Load errno code
einval: lda #EINVAL einval: lda #EINVAL
; Return errno ; Set __errno
errno: jmp errnoexit errno: jmp __directerrno

View File

@@ -5,7 +5,7 @@
; ;
.export _rootdir .export _rootdir
.import popax, oserrexit .import popax
.include "zeropage.inc" .include "zeropage.inc"
.include "errno.inc" .include "errno.inc"
@@ -50,5 +50,5 @@ _rootdir:
tax tax
rts rts
; Return oserror ; Set __oserror
oserr: jmp oserrexit oserr: jmp __mappederrno

View File

@@ -3,10 +3,10 @@
; ;
.export rwprolog, rwcommon, rwepilog .export rwprolog, rwcommon, rwepilog
.import oserrexit
.import popax .import popax
.include "zeropage.inc" .include "zeropage.inc"
.include "errno.inc"
.include "fcntl.inc" .include "fcntl.inc"
.include "mli.inc" .include "mli.inc"
.include "filedes.inc" .include "filedes.inc"
@@ -55,5 +55,5 @@ rwepilog:
ldx mliparam + MLI::RW::TRANS_COUNT+1 ldx mliparam + MLI::RW::TRANS_COUNT+1
rts rts
; Return oserror ; Set __oserror
oserr: jmp oserrexit oserr: jmp __mappederrno

View File

@@ -6,7 +6,6 @@
.export _write .export _write
.import rwprolog, rwcommon, rwepilog .import rwprolog, rwcommon, rwepilog
.import errnoexit, oserrexit
.import COUT .import COUT
.include "zeropage.inc" .include "zeropage.inc"
@@ -106,9 +105,9 @@ done: jmp rwepilog
; Load errno code ; Load errno code
einval: lda #EINVAL einval: lda #EINVAL
; Return errno ; Set __errno
errno: jmp errnoexit errno: jmp __directerrno
; Return oserror ; Set __oserror
oserr: jmp oserrexit oserr: jmp __mappederrno

View File

@@ -75,7 +75,6 @@ S_OBJS= _scrsize.o \
dosdetect.o \ dosdetect.o \
drives.o \ drives.o \
filedes.o \ filedes.o \
fileerr.o \
filename.o \ filename.o \
get_ostype.o \ get_ostype.o \
gotoxy.o \ gotoxy.o \