remove extra spaces
This commit is contained in:
@@ -73,7 +73,7 @@ oserr: jsr ___mappederrno
|
|||||||
iny
|
iny
|
||||||
lda #$00
|
lda #$00
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
sta ___oserror ; Clear __oserror
|
sta ___oserror ; Clear __oserror
|
||||||
|
|
||||||
; Success, return buf
|
; Success, return buf
|
||||||
lda ptr1
|
lda ptr1
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
_dio_query_sectsize:
|
_dio_query_sectsize:
|
||||||
; Clear error
|
; Clear error
|
||||||
stx ___oserror ; X = 0
|
stx ___oserror ; X = 0
|
||||||
|
|
||||||
; Return ProDOS 8 block size
|
; Return ProDOS 8 block size
|
||||||
txa ; X = 0
|
txa ; X = 0
|
||||||
|
|||||||
@@ -107,13 +107,13 @@ seek_common:
|
|||||||
einval: lda #EINVAL
|
einval: lda #EINVAL
|
||||||
|
|
||||||
; Set __errno
|
; Set __errno
|
||||||
errno: jsr ___directerrno ; leaves -1 in AX
|
errno: jsr ___directerrno ; leaves -1 in AX
|
||||||
stx sreg ; extend return value to 32 bits
|
stx sreg ; extend return value to 32 bits
|
||||||
stx sreg+1
|
stx sreg+1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Set ___oserror
|
; Set ___oserror
|
||||||
oserr: jsr ___mappederrno ; leaves -1 in AX
|
oserr: jsr ___mappederrno ; leaves -1 in AX
|
||||||
stx sreg ; extend return value to 32 bits
|
stx sreg ; extend return value to 32 bits
|
||||||
stx sreg+1
|
stx sreg+1
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ rwcommon:
|
|||||||
|
|
||||||
rwepilog:
|
rwepilog:
|
||||||
; Return success
|
; Return success
|
||||||
sta ___oserror ; A = 0
|
sta ___oserror ; A = 0
|
||||||
lda mliparam + MLI::RW::TRANS_COUNT
|
lda mliparam + MLI::RW::TRANS_COUNT
|
||||||
ldx mliparam + MLI::RW::TRANS_COUNT+1
|
ldx mliparam + MLI::RW::TRANS_COUNT+1
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
jsr CIOV
|
jsr CIOV
|
||||||
bmi closerr
|
bmi closerr
|
||||||
ok: ldx #0
|
ok: ldx #0
|
||||||
stx ___oserror ; clear system specific error code
|
stx ___oserror ; clear system specific error code
|
||||||
txa
|
txa
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ _dio_open:
|
|||||||
sta sectsizetab+sst_flag,x ; set flag that drive is "open"
|
sta sectsizetab+sst_flag,x ; set flag that drive is "open"
|
||||||
lda #0
|
lda #0
|
||||||
sta sectsizetab+sst_sectsize+1,x
|
sta sectsizetab+sst_sectsize+1,x
|
||||||
sta ___oserror ; success
|
sta ___oserror ; success
|
||||||
tya
|
tya
|
||||||
sta sectsizetab+sst_driveno,x
|
sta sectsizetab+sst_driveno,x
|
||||||
stx ptr2
|
stx ptr2
|
||||||
@@ -156,7 +156,7 @@ s128: lda #128
|
|||||||
lda #0
|
lda #0
|
||||||
ldy #sst_flag
|
ldy #sst_flag
|
||||||
sta (ptr2),y
|
sta (ptr2),y
|
||||||
sta ___oserror ; success
|
sta ___oserror ; success
|
||||||
tax
|
tax
|
||||||
rts ; return no error
|
rts ; return no error
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ copycd: lda #ATEOL
|
|||||||
pha ; remember error code
|
pha ; remember error code
|
||||||
jsr close ; close the IOCB (required even if open failed)
|
jsr close ; close the IOCB (required even if open failed)
|
||||||
pla ; put error code back into A
|
pla ; put error code back into A
|
||||||
setmerr:jmp ___mappederrno ; update errno from OS specific error code in A
|
setmerr:jmp ___mappederrno ; update errno from OS specific error code in A
|
||||||
|
|
||||||
openok: lda #>buf
|
openok: lda #>buf
|
||||||
sta ICBAH,x ; set buffer address
|
sta ICBAH,x ; set buffer address
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ parmok: jsr findfreeiocb
|
|||||||
beq iocbok ; we found one
|
beq iocbok ; we found one
|
||||||
|
|
||||||
lda #<EMFILE ; "too many open files"
|
lda #<EMFILE ; "too many open files"
|
||||||
seterr: jsr ___mappederrno ; @@@ probably not correct to set errno here @@@
|
seterr: jsr ___mappederrno ; @@@ probably not correct to set errno here @@@
|
||||||
rts ; return -1
|
rts ; return -1
|
||||||
|
|
||||||
;invmode:ldx #>EINVAL
|
;invmode:ldx #>EINVAL
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
; seeking not supported, return -1 and ENOSYS errno value
|
; seeking not supported, return -1 and ENOSYS errno value
|
||||||
no_supp:jsr incsp6
|
no_supp:jsr incsp6
|
||||||
lda #<ENOSYS
|
lda #<ENOSYS
|
||||||
jsr ___directerrno ; returns with $FFFF in AX
|
jsr ___directerrno ; returns with $FFFF in AX
|
||||||
sta sreg
|
sta sreg
|
||||||
sta sreg+1
|
sta sreg+1
|
||||||
rts
|
rts
|
||||||
@@ -94,7 +94,7 @@ xxerr: tya
|
|||||||
pha
|
pha
|
||||||
jsr incsp6
|
jsr incsp6
|
||||||
pla
|
pla
|
||||||
jsr ___mappederrno ; returns with $FFFF in AX
|
jsr ___mappederrno ; returns with $FFFF in AX
|
||||||
sta sreg
|
sta sreg
|
||||||
sta sreg+1
|
sta sreg+1
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ done: lda ICBLL,x ; buf len lo
|
|||||||
lda ICBLH,x ; get buf len hi
|
lda ICBLH,x ; get buf len hi
|
||||||
tax ; to X
|
tax ; to X
|
||||||
okdone: lda #0
|
okdone: lda #0
|
||||||
sta ___oserror ; clear system dependend error code
|
sta ___oserror ; clear system dependend error code
|
||||||
pla ; get buf len lo
|
pla ; get buf len lo
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ write9:
|
|||||||
lda ICBLH,x ; buf len high
|
lda ICBLH,x ; buf len high
|
||||||
tax
|
tax
|
||||||
lda #0
|
lda #0
|
||||||
sta ___oserror ; clear system dependend error code
|
sta ___oserror ; clear system dependend error code
|
||||||
pla
|
pla
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,12 @@
|
|||||||
ldx unittab,y
|
ldx unittab,y
|
||||||
jsr closecmdchannel ; Close the disk command channel
|
jsr closecmdchannel ; Close the disk command channel
|
||||||
pla ; Get the error code from the disk
|
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
|
; Error entry: The given file descriptor is not valid or not open
|
||||||
|
|
||||||
invalidfd:
|
invalidfd:
|
||||||
lda #EBADF
|
lda #EBADF
|
||||||
jmp ___directerrno ; Set _errno, clear __oserror, return -1
|
jmp ___directerrno ; Set _errno, clear __oserror, return -1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ fail: lda #0 ; Return NULL
|
|||||||
|
|
||||||
okay: lda fnunit ; Set by diskinit
|
okay: lda fnunit ; Set by diskinit
|
||||||
jsr devicestr ; Returns 0 in A
|
jsr devicestr ; Returns 0 in A
|
||||||
sta ___oserror ; Clear __oserror
|
sta ___oserror ; Clear __oserror
|
||||||
|
|
||||||
; Success, return buf
|
; Success, return buf
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ nofile: ; ... else use SA=0 (read)
|
|||||||
|
|
||||||
txa ; Handle
|
txa ; Handle
|
||||||
ldx #0
|
ldx #0
|
||||||
stx ___oserror ; Clear __oserror
|
stx ___oserror ; Clear __oserror
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
jsr CHKIN
|
jsr CHKIN
|
||||||
bcc @L3 ; Branch if ok
|
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
|
; Read the next byte
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ devnotpresent:
|
|||||||
|
|
||||||
invalidfd:
|
invalidfd:
|
||||||
lda #EBADF
|
lda #EBADF
|
||||||
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
jsr CKOUT
|
jsr CKOUT
|
||||||
bcc @L2
|
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
|
; Output the next character from the buffer
|
||||||
|
|
||||||
@@ -112,6 +112,6 @@ devnotpresent:
|
|||||||
|
|
||||||
invalidfd:
|
invalidfd:
|
||||||
lda #EBADF
|
lda #EBADF
|
||||||
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
; */
|
; */
|
||||||
|
|
||||||
___directerrno:
|
___directerrno:
|
||||||
jsr ___seterrno ; Set errno (returns with .A = 0)
|
jsr ___seterrno ; Set errno (returns with .A = 0)
|
||||||
sta ___oserror ; Clear ___oserror
|
sta ___oserror ; Clear ___oserror
|
||||||
.if (.cpu .bitand CPU_ISET_65SC02)
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
||||||
dec a
|
dec a
|
||||||
.else
|
.else
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
invmode:
|
invmode:
|
||||||
lda #EINVAL
|
lda #EINVAL
|
||||||
jsr ___seterrno ; Set __errno, returns zero in A
|
jsr ___seterrno ; Set __errno, returns zero in A
|
||||||
tax ; a/x = 0
|
tax ; a/x = 0
|
||||||
jmp incsp4
|
jmp incsp4
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
; */
|
; */
|
||||||
|
|
||||||
___mappederrno:
|
___mappederrno:
|
||||||
sta ___oserror ; Store the error code
|
sta ___oserror ; Store the error code
|
||||||
tax ; Did we have an error?
|
tax ; Did we have an error?
|
||||||
bze ok ; Branch if no
|
bze ok ; Branch if no
|
||||||
jsr ___osmaperrno ; Map OS error into errno code
|
jsr ___osmaperrno ; Map OS error into errno code
|
||||||
jsr ___seterrno ; Save in errno (returns with .A = 0)
|
jsr ___seterrno ; Save in errno (returns with .A = 0)
|
||||||
.if (.cpu .bitand CPU_ISET_65SC02)
|
.if (.cpu .bitand CPU_ISET_65SC02)
|
||||||
dec a
|
dec a
|
||||||
.else
|
.else
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
.proc _chdir
|
.proc _chdir
|
||||||
|
|
||||||
jsr __syschdir ; Call the machine specific function
|
jsr __syschdir ; Call the machine specific function
|
||||||
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
; Failed to allocate a file stream
|
; Failed to allocate a file stream
|
||||||
|
|
||||||
lda #EMFILE
|
lda #EMFILE
|
||||||
jsr ___seterrno ; Set __errno, will return 0 in A
|
jsr ___seterrno ; Set __errno, will return 0 in A
|
||||||
tax
|
tax
|
||||||
rts ; Return zero
|
rts ; Return zero
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
; File not open
|
; File not open
|
||||||
|
|
||||||
@L1: lda #EBADF
|
@L1: lda #EBADF
|
||||||
jsr ___seterrno ; Returns with A = 0
|
jsr ___seterrno ; Returns with A = 0
|
||||||
tax ; A = X = 0
|
tax ; A = X = 0
|
||||||
jmp incsp6
|
jmp incsp6
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,6 @@
|
|||||||
.proc _mkdir
|
.proc _mkdir
|
||||||
|
|
||||||
jsr __sysmkdir ; Call the machine specific function
|
jsr __sysmkdir ; Call the machine specific function
|
||||||
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
.proc _remove
|
.proc _remove
|
||||||
|
|
||||||
jsr __sysremove ; Call the machine specific function
|
jsr __sysremove ; Call the machine specific function
|
||||||
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,6 @@
|
|||||||
.proc _rmdir
|
.proc _rmdir
|
||||||
|
|
||||||
jsr __sysrmdir ; Call the machine specific function
|
jsr __sysrmdir ; Call the machine specific function
|
||||||
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ ___sig_ign:
|
|||||||
|
|
||||||
invalidsig:
|
invalidsig:
|
||||||
lda #<EINVAL
|
lda #<EINVAL
|
||||||
jsr ___seterrno ; Returns 0 in A
|
jsr ___seterrno ; Returns 0 in A
|
||||||
tax ; A/X = 0
|
tax ; A/X = 0
|
||||||
___sig_dfl:
|
___sig_dfl:
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
.data
|
.data
|
||||||
|
|
||||||
sigtable:
|
sigtable:
|
||||||
.word ___sig_dfl ; SIGABRT
|
.word ___sig_dfl ; SIGABRT
|
||||||
.word ___sig_dfl ; SIGFPE
|
.word ___sig_dfl ; SIGFPE
|
||||||
.word ___sig_dfl ; SIGILL
|
.word ___sig_dfl ; SIGILL
|
||||||
.word ___sig_dfl ; SIGINT
|
.word ___sig_dfl ; SIGINT
|
||||||
.word ___sig_dfl ; SIGSEGV
|
.word ___sig_dfl ; SIGSEGV
|
||||||
.word ___sig_dfl ; SIGTERM
|
.word ___sig_dfl ; SIGTERM
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
.proc _uname
|
.proc _uname
|
||||||
|
|
||||||
jsr __sysuname ; Call the machine specific function
|
jsr __sysuname ; Call the machine specific function
|
||||||
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
jmp ___mappederrno ; Store into __oserror, set errno, return 0/-1
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ L0: ldy #EINVAL
|
|||||||
pla ; Drop ap
|
pla ; Drop ap
|
||||||
pla
|
pla
|
||||||
tya
|
tya
|
||||||
jsr ___directerrno ; Return -1
|
jsr ___directerrno ; Return -1
|
||||||
jmp incsp6 ; Drop parameters
|
jmp incsp6 ; Drop parameters
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,6 @@ _dio_close:
|
|||||||
lda #0
|
lda #0
|
||||||
ldy #sst_flag
|
ldy #sst_flag
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
sta ___oserror ; success
|
sta ___oserror ; success
|
||||||
tax
|
tax
|
||||||
rts ; return no error
|
rts ; return no error
|
||||||
|
|||||||
@@ -75,14 +75,14 @@ _open:
|
|||||||
.byte $2c ; skip
|
.byte $2c ; skip
|
||||||
@alreadyopen:
|
@alreadyopen:
|
||||||
lda #EMFILE ; too many opened files (there can be only one)
|
lda #EMFILE ; too many opened files (there can be only one)
|
||||||
jmp ___directerrno ; set errno, clear oserror, return -1
|
jmp ___directerrno ; set errno, clear oserror, return -1
|
||||||
@oserror:
|
@oserror:
|
||||||
jmp ___mappederrno ; set platform error code, return -1
|
jmp ___mappederrno ; set platform error code, return -1
|
||||||
|
|
||||||
_close:
|
_close:
|
||||||
lda #0
|
lda #0
|
||||||
sta ___oserror
|
sta ___oserror
|
||||||
jsr ___seterrno ; clear errors
|
jsr ___seterrno ; clear errors
|
||||||
lda #0 ; clear fd
|
lda #0 ; clear fd
|
||||||
sta filedesc
|
sta filedesc
|
||||||
tax
|
tax
|
||||||
@@ -111,13 +111,13 @@ _read:
|
|||||||
|
|
||||||
@filenotopen:
|
@filenotopen:
|
||||||
lda #EBADF
|
lda #EBADF
|
||||||
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
jmp ___directerrno ; Sets _errno, clears __oserror, returns -1
|
||||||
|
|
||||||
@fileok:
|
@fileok:
|
||||||
lda #0
|
lda #0
|
||||||
sta ptr3
|
sta ptr3
|
||||||
sta ptr3+1 ; put 0 into ptr3 (number of bytes read)
|
sta ptr3+1 ; put 0 into ptr3 (number of bytes read)
|
||||||
sta ___oserror ; clear error flags
|
sta ___oserror ; clear error flags
|
||||||
jsr ___seterrno
|
jsr ___seterrno
|
||||||
|
|
||||||
lda f_track ; restore stuff for ReadByte
|
lda f_track ; restore stuff for ReadByte
|
||||||
@@ -147,11 +147,11 @@ _read:
|
|||||||
bne @L2
|
bne @L2
|
||||||
inc ptr3+1
|
inc ptr3+1
|
||||||
|
|
||||||
@L2: lda ___oserror ; was there error ?
|
@L2: lda ___oserror ; was there error ?
|
||||||
beq @L3
|
beq @L3
|
||||||
cmp #BFR_OVERFLOW ; EOF?
|
cmp #BFR_OVERFLOW ; EOF?
|
||||||
beq @done ; yes, we're done
|
beq @done ; yes, we're done
|
||||||
jmp ___mappederrno ; no, we're screwed
|
jmp ___mappederrno ; no, we're screwed
|
||||||
|
|
||||||
@L3: dec ptr1 ; decrement the count
|
@L3: dec ptr1 ; decrement the count
|
||||||
bne @L0
|
bne @L0
|
||||||
|
|||||||
Reference in New Issue
Block a user