]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/lseek.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / atari / lseek.s
index 69e83da310f7992c03a5d65b49579696b176d309..244095969f26d6a571396d99cb6c5297112e1d49 100644 (file)
@@ -10,7 +10,7 @@
        .export         _lseek
        .import         incsp6,__oserror
        .import         __inviocb,ldax0sp,ldaxysp,fdtoiocb
-       .import         __seterrno,__dos_type
+       .import         __dos_type
        .import         fd_table
        .importzp       sreg,ptr1,ptr2,ptr3,ptr4
        .importzp       tmp1,tmp2,tmp3
 ; seeking not supported, return -1 and ENOSYS errno value
 no_supp:jsr    incsp6
        lda     #<ENOSYS
-       ldx     #>ENOSYS
-       jsr     __seterrno
-       ldx     #0
-       stx     __oserror
-       dex
-       txa
+       jsr     __directerrno   ; returns with $FFFF in AX
        sta     sreg
        sta     sreg+1
        rts
@@ -95,8 +90,14 @@ end: ldx     tmp3
        bpl     l01
 
 ; error returned from CIO
-xxerr: sty     __oserror
-       bmi     iocberr
+xxerr: tya
+       pha
+       jsr     incsp6
+       pla
+       jsr     __mappederrno   ; returns with $FFFF in AX
+       sta     sreg
+       sta     sreg+1
+       rts
 
 ; check for offset 0, SEEK_CUR (get current position)
 cont:  ldy     #3