fix errno related underscores in all libsrc/*.s files
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
.include "cbm.inc"
|
||||
|
||||
.export _cbm_k_load
|
||||
.import __oserror
|
||||
.import ___oserror
|
||||
.import popa
|
||||
.importzp ptr1
|
||||
|
||||
@@ -19,7 +19,7 @@ _cbm_k_load:
|
||||
ldy ptr1+1
|
||||
jsr LOAD
|
||||
bcc @Ok
|
||||
sta __oserror
|
||||
sta ___oserror
|
||||
ldx ptr1
|
||||
ldy ptr1+1
|
||||
@Ok: txa
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
; {
|
||||
; cbm_k_setlfs(lfn, device, sec_addr);
|
||||
; cbm_k_setnam(name);
|
||||
; return _oserror = cbm_k_open();
|
||||
; return __oserror = cbm_k_open();
|
||||
; }
|
||||
;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
.import popa
|
||||
.import _cbm_k_setlfs, _cbm_k_setnam, _cbm_k_open
|
||||
.import __oserror
|
||||
.import ___oserror
|
||||
|
||||
_cbm_open:
|
||||
jsr _cbm_k_setnam
|
||||
@@ -32,5 +32,5 @@ _cbm_open:
|
||||
jsr _cbm_k_setlfs ; Call SETLFS, pop all args
|
||||
|
||||
jsr _cbm_k_open
|
||||
sta __oserror
|
||||
sta ___oserror
|
||||
rts
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
; int __fastcall__ cbm_read (unsigned char lfn, void* buffer, unsigned int size)
|
||||
; /* Reads up to "size" bytes from a file to "buffer".
|
||||
; ** Returns the number of actually read bytes, 0 if there are no bytes left
|
||||
; ** (EOF) or -1 in case of an error. _oserror contains an errorcode then (see
|
||||
; ** (EOF) or -1 in case of an error. __oserror contains an errorcode then (see
|
||||
; ** table below).
|
||||
; */
|
||||
; {
|
||||
@@ -14,7 +14,7 @@
|
||||
; static unsigned char tmp;
|
||||
;
|
||||
; /* if we can't change to the inputchannel #lfn then return an error */
|
||||
; if (_oserror = cbm_k_chkin(lfn)) return -1;
|
||||
; if (__oserror = cbm_k_chkin(lfn)) return -1;
|
||||
;
|
||||
; bytesread = 0;
|
||||
;
|
||||
@@ -41,7 +41,7 @@
|
||||
.export _cbm_read
|
||||
.importzp ptr1, ptr2, ptr3, tmp1
|
||||
.import popax, popa
|
||||
.import __oserror
|
||||
.import ___oserror
|
||||
|
||||
|
||||
_cbm_read:
|
||||
@@ -106,7 +106,7 @@ _cbm_read:
|
||||
|
||||
; CHKIN failed
|
||||
|
||||
@E1: sta __oserror
|
||||
@E1: sta ___oserror
|
||||
lda #$FF
|
||||
tax
|
||||
rts ; return -1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
; static unsigned int byteswritten;
|
||||
;
|
||||
; /* if we can't change to the outputchannel #lfn then return an error */
|
||||
; if (_oserror = cbm_k_ckout(lfn)) return -1;
|
||||
; if (__oserror = cbm_k_ckout(lfn)) return -1;
|
||||
;
|
||||
; byteswritten = 0;
|
||||
;
|
||||
@@ -18,7 +18,7 @@
|
||||
; }
|
||||
;
|
||||
; if (cbm_k_readst()) {
|
||||
; _oserror = 5; /* device not present */
|
||||
; __oserror = 5; /* device not present */
|
||||
; byteswritten = -1;
|
||||
; }
|
||||
;
|
||||
@@ -33,7 +33,7 @@
|
||||
.export _cbm_write
|
||||
.importzp ptr1, ptr2, ptr3
|
||||
.import popax, popa
|
||||
.import __oserror
|
||||
.import ___oserror
|
||||
|
||||
|
||||
_cbm_write:
|
||||
@@ -87,7 +87,7 @@ _cbm_write:
|
||||
|
||||
; Error entry, error code is in A
|
||||
|
||||
@E2: sta __oserror
|
||||
@E2: sta ___oserror
|
||||
lda #$FF
|
||||
tax
|
||||
rts ; return -1
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
ldx unittab,y
|
||||
jsr closecmdchannel ; Close the disk command channel
|
||||
pla ; Get the error code from the disk
|
||||
jmp __mappederrno ; Set _oserror and _errno, return 0/-1
|
||||
jmp ___mappederrno ; Set __oserror and _errno, return 0/-1
|
||||
|
||||
; Error entry: The given file descriptor is not valid or not open
|
||||
|
||||
invalidfd:
|
||||
lda #EBADF
|
||||
jmp __directerrno ; Set _errno, clear _oserror, return -1
|
||||
jmp ___directerrno ; Set _errno, clear __oserror, return -1
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
jsr popa
|
||||
jsr diskinit
|
||||
beq size
|
||||
jsr __mappederrno
|
||||
jsr ___mappederrno
|
||||
bne fail ; Branch always
|
||||
|
||||
; Check for sufficient buf size
|
||||
@@ -43,7 +43,7 @@ size: lda ptr3+1
|
||||
cmp #3
|
||||
bcs okay ; Buf >= 3
|
||||
lda #<ERANGE
|
||||
jsr __directerrno
|
||||
jsr ___directerrno
|
||||
fail: lda #0 ; Return NULL
|
||||
tax
|
||||
rts
|
||||
@@ -52,7 +52,7 @@ fail: lda #0 ; Return NULL
|
||||
|
||||
okay: lda fnunit ; Set by diskinit
|
||||
jsr devicestr ; Returns 0 in A
|
||||
sta __oserror ; Clear _oserror
|
||||
sta ___oserror ; Clear __oserror
|
||||
|
||||
; Success, return buf
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@ parmok: jsr popax ; Get flags
|
||||
|
||||
lda #EINVAL
|
||||
|
||||
; Error entry. Sets _errno, clears _oserror, returns -1
|
||||
; Error entry. Sets _errno, clears __oserror, returns -1
|
||||
|
||||
seterrno:
|
||||
jmp __directerrno
|
||||
jmp ___directerrno
|
||||
|
||||
; Error entry: Close the file and exit. OS error code is in A on entry
|
||||
|
||||
@@ -113,7 +113,7 @@ closeandexit:
|
||||
|
||||
; Error entry: Set oserror and errno using error code in A and return -1
|
||||
|
||||
oserror:jmp __mappederrno
|
||||
oserror:jmp ___mappederrno
|
||||
|
||||
; Read bit is set. Add an 'r' to the name
|
||||
|
||||
@@ -189,7 +189,7 @@ nofile: ; ... else use SA=0 (read)
|
||||
|
||||
txa ; Handle
|
||||
ldx #0
|
||||
stx __oserror ; Clear _oserror
|
||||
stx ___oserror ; Clear __oserror
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
; 2000-05-17, Ullrich von Bassewitz
|
||||
; 2014-05-28, Greg King
|
||||
;
|
||||
; int __fastcall__ _osmaperrno (unsigned char oserror);
|
||||
; int __fastcall__ __osmaperrno (unsigned char oserror);
|
||||
; /* Map a system-specific error into a system-independent code. */
|
||||
;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
.code
|
||||
|
||||
__osmaperrno:
|
||||
___osmaperrno:
|
||||
ldx #ErrTabSize
|
||||
@L1: cmp ErrTab-2,x ; Search for the error code
|
||||
beq @L2 ; Jump if found
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
jsr CHKIN
|
||||
bcc @L3 ; Branch if ok
|
||||
jmp __mappederrno ; Store into __oserror, map to errno, return -1
|
||||
jmp ___mappederrno ; Store into ___oserror, map to errno, return -1
|
||||
|
||||
; Read the next byte
|
||||
|
||||
@@ -123,10 +123,10 @@
|
||||
|
||||
done: jsr CLRCH
|
||||
|
||||
; Clear _oserror and return the number of chars read
|
||||
; Clear __oserror and return the number of chars read
|
||||
|
||||
eof: lda #0
|
||||
sta __oserror
|
||||
sta ___oserror
|
||||
lda ptr3
|
||||
ldx ptr3+1
|
||||
rts
|
||||
@@ -141,7 +141,7 @@ devnotpresent:
|
||||
|
||||
invalidfd:
|
||||
lda #EBADF
|
||||
jmp __directerrno ; Sets _errno, clears _oserror, returns -1
|
||||
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
jsr CKOUT
|
||||
bcc @L2
|
||||
@error: jmp __mappederrno ; Store into __oserror, map to errno, return -1
|
||||
@error: jmp ___mappederrno ; Store into ___oserror, map to errno, return -1
|
||||
|
||||
; Output the next character from the buffer
|
||||
|
||||
@@ -92,10 +92,10 @@
|
||||
|
||||
@L3: jsr CLRCH
|
||||
|
||||
; Clear _oserror and return the number of chars written
|
||||
; Clear __oserror and return the number of chars written
|
||||
|
||||
lda #0
|
||||
sta __oserror
|
||||
sta ___oserror
|
||||
lda ptr3
|
||||
ldx ptr3+1
|
||||
rts
|
||||
@@ -112,6 +112,6 @@ devnotpresent:
|
||||
|
||||
invalidfd:
|
||||
lda #EBADF
|
||||
jmp __directerrno ; Sets _errno, clears _oserror, returns -1
|
||||
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
||||
|
||||
.endproc
|
||||
|
||||
Reference in New Issue
Block a user