Jump to content
IGNORED

Accessing file from cc65 and beeping issue


Recommended Posts

Hi!  I am working on a port of MadLib for the Atari 8-bit and ran into two problems: 1. the emulated computer beeps many time rapidly upon start-up, and 2. the program crashes after the first screen.  I don't know what's causing the beeping--is this normal?  But, I think I know what's causing the system crash: the overlays aren't loading properly.  I am using cc65 and know how to use fopen() and other ANSI file functions.  How do I access a file?

Link to comment
Share on other sites

The 'beeping' is probably the file access noise that is part of OS when reading data from a file, it's probably the boot disk loading.

You access a file in CC65 the same way you do in any C environment - you use fopen, fread, fwrite, or fscanf, etc., depending on what you want to do.

FILE *f;

f=fopen("d1:filename.dat", "r");

...

fread(buffer,len,1,f);

 

and so forth. There are lower levels of access such as the Atari CIO mechanism and even a lower level from C, but that's how you do it in straight C. Then D1: is the 'drive' specification, D1: is teh first drive, D2: is the second, etc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...