Re: [cc65] C64 - how to use disk I/O?

From: Adrian Siekierka <asiekierka1gmail.com>
Date: 2008-11-26 07:22:39
2008/11/25, Andreas Koch <email@kochandreas.com>:
>
>
> Hello. I'm a newcomer to cc65 and C64 programming in general.
>> The question is, how to get disk I/O for the C64 to work?
>> I tried CBM commands - fail.
>> Standard C I/O - fail.
>> I just want to read a PRG file (with no load address, just data) into
>> memory! Or any other kind of file.
>> It's for my BF interpreter, so it should be possible (with my way) to just
>> rename a TXT file and add it to a d64.
>> Anyone knows how to read files from a 15x1 with cc65 code on a c64?
>>
>
> From an older posting of mine:
>
> ***file TEST.C start***
> /*demo for cbm_load */
>
> #include <stdio.h>
> #include <time.h>
> #include <conio.h>
> #include <cbm.h>
> #include <dbg.h>
> #include <stdlib.h>
> #include "cbm.h"
>
> unsigned char memory[1024];
>
> int main()
> {
>   unsigned char drive = 8;
>
>   cbm_load("TEST.C",drive,memory);
>   memory[40]=0;
>   printf("Result:\n%s",memory);
>   cgetc();
> }
> ***file TEST.C end****
>
> This will print "demo for ...", as cbm_load assumes the first 2 byte to be
> the address so they aren't loaded.
>
> hope that helps,
>  Andreas


Yes, thank you. But one more thing, i don't know how large the file will be,
it may be 200 bytes or 12 kilobytes... Any tips on THAT?

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Nov 26 07:22:47 2008

This archive was generated by hypermail 2.1.8 : 2008-11-26 07:22:49 CET