Re: [cc65] Atari file i/o functions

Date view Thread view Subject view

From: Shawn Jefferson (sjefferson_at_sd62.bc.ca)
Date: 2002-04-23 23:01:17


>Maybe Christian can answer this in more detail, but as far as I understand 
>the
>sources, lseek is just a dummy function that returns an error code.
>

Yes, that is correct and is also the reason that doing an fseek wasn't working in my program... which I 
was going crazy over until I figured I would look at the library source code!

>Apart from this, the implementation seems to be correct: lseek as defined 
>by
>POSIX returns the current file position as a side effect. This side effect 
>is
>used in ftell(), while fseek() is based on the main function of lseek
>(positioning the file pointer).
>
>The Atari is currently the only system that has a working standard file 
>I/O,
>so if there were changes, they wouldn't break anything. But as it looks for
>me, the current implementation is correct, the only problem is that the 
>(Atari
>specific) lseek function is currently not implemented.

Ok.  We will have to do a bunch of stuff in the lseek function to implement it properly, in assembly... ugh.  The Atari has the fseek and ftell functions built into the DOS, called POINT and NOTE.  We have to call point after working out the offset from whence, call CIO with the command for point and then call CIO again with the command for note to return the file position.  All in assembly... not my forte unfortunately.. I will have to do some quick learning! ;)

In that vein, where is the return value from a function placed?  On the stack?

Is Christian still around?  He coded this stuff in 2000, but didn't code the fseek and ftell functions which really cripples any file i/o you might use.  It is better than what the C64 has now though, so I should count my blessings, I guess!


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-04-23 23:01:54 CEST