From: Patrick Pelletier Date: Sun, 19 Aug 2018 23:04:42 +0000 (-0700) Subject: Fix ftell() on Apple II to return the correct value. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=68a115cacf588b64a5e098497d2e6a2c2139f33e;p=cc65 Fix ftell() on Apple II to return the correct value. Fixes this issue: https://github.com/cc65/cc65/issues/722 ftell() returns the value returned by lseek(), and lseek() for the Apple II wasn't returning a value. --- diff --git a/libsrc/apple2/lseek.s b/libsrc/apple2/lseek.s index 22bcbee30..b1b7b6afb 100644 --- a/libsrc/apple2/lseek.s +++ b/libsrc/apple2/lseek.s @@ -84,6 +84,14 @@ seek_common: jsr callmli bcs oserr + ; Need to return the position in EAX + lda #0 + sta sreg+1 + lda mliparam + MLI::MARK::POSITION+2 + sta sreg + ldx mliparam + MLI::MARK::POSITION+1 + lda mliparam + MLI::MARK::POSITION + rts ; Load errno code