Re: [cc65] File I/O on C64

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-11-18 00:26:26


On Sat, Nov 16, 2002 at 02:02:59PM +0100, MagerValp wrote:
> Yes, Ullrich, I do agree with what you're saying (and that /. article
> was interesting but didn't say anything that hadn't been said before),
> but I still think that most people will be better off with cbm.h.
[...]
> But don't misinterpret me, I think it'd be a great thing to have stdio
> support for the CBM machines, I'm just saying that most apps don't
> actually need it -- its absence is not an excuse to not use cc65.

I still think different, but now everyone has a choice: I got so tired from
all these discussions about missing C file I/O for the CBMs that I've added it
yesterday. There was one unexpected problem (if you're reading the cbm-hackers
list, you do probably know about what I'm talking), so I needed a few
additional hours today to fix it. It is mostly complete (plus/minus bugs of
course). Limitations are:

  * Currently files are not closed at the end of the program. I will add
    that soon.

  * Because of limitations of the CBM floppies, you can open a file either for
    reading or for writing, but not for both. Similar, append mode is not
    available.

  * Since the file i/o layer generates its own logical file numbers, using the
    CBM file routines together with C file i/o may give conflicts in some
    situations (because you're choosing the logical file numbers on your own,
    and these may clash with those generated by the C file i/o layer). I'm
    also planing to keep the current input and output channels open until
    there is a change. With this addition (that will improve performance),
    using CBM file i/o together with C file i/o will no longer work. Please
    note that C file i/o does also mean a simple printf! If you need CBM file
    i/o, you will have to use conio only. I'm sorry about that, but there's no
    easy workaround.

And the positive side:

  * Uses only kernal calls, so it should work with all CBMs and with all
    drives, including CMD hardware. I've tested the stuff using x64 (the C64
    emulation of VICE).

It's all in todays snapshot, so please give it a try and send me some
feedback.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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-11-18 00:28:12 CET