2015-09-25 18:06:58 +00:00
|
|
|
;
|
|
|
|
; 2003-08-12, Ullrich von Bassewitz
|
|
|
|
; 2015-09-24, Greg King
|
|
|
|
;
|
|
|
|
; Helper function for several high-level file functions.
|
|
|
|
;
|
|
|
|
|
|
|
|
.include "errno.inc"
|
|
|
|
|
|
|
|
.macpack cpu
|
|
|
|
|
|
|
|
; ----------------------------------------------------------------------------
|
2022-08-28 19:52:53 +00:00
|
|
|
; int __fastcall__ __directerrno (unsigned char code);
|
|
|
|
; /* Set errno to a specific error code, clear __oserror, and return -1. Used
|
2015-09-25 18:06:58 +00:00
|
|
|
; ** by the library.
|
|
|
|
; */
|
|
|
|
|
2022-08-28 19:52:53 +00:00
|
|
|
___directerrno:
|
2022-08-28 20:37:33 +00:00
|
|
|
jsr ___seterrno ; Set errno (returns with .A = 0)
|
|
|
|
sta ___oserror ; Clear ___oserror
|
2015-09-25 18:06:58 +00:00
|
|
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
|
|
|
dec a
|
|
|
|
.else
|
|
|
|
lda #$FF ; Return -1
|
|
|
|
.endif
|
|
|
|
tax
|
|
|
|
rts
|