Re: [cc65] Re: readdir bug

From: Oliver Schmidt <>
Date: 2012-09-30 17:10:39

Somehow I must have missed this section in the readdir() doc ;-))

"On several platforms, namely the CBMs and the Atari, the disk drives
get confused when opening/closing files between directory reads. So
for example a program that reads the list of files on a disk, and
after each call to readdir, opens the file to process it, will fail.
Possible solutions are reading the directory into memory before
processing the file list, or to reset the directory by seeking to the
correct position after opening/closing a file:
        seekdir (DIR, telldir (DIR));
Platforms known to work without problems are: Apple."

However now that I read the docs I adjusted the multidemo sample
accordingly. I verified that it runs on the C64, the Apple II, the
Atari and the C128.

Some notes on the C128:
- So far there was no overlay linker config. I added one.
- Roughly half of the C128 extended memory drivers don't work with the
multidemo sample :-(

Here's the output of a typical multidemo session on the C64:
Dbg: Loading overlay 4 from file
Log: Loading extended memory driver
Dbg: Searching for emdrivers
Dbg: Skipping file multdemo
Dbg: Skipping file multdemo.1
Dbg: Skipping file multdemo.2
Dbg: Skipping file multdemo.3
Dbg: Skipping file multdemo.4
Dbg: Memorizing file c64-georam.emd
Dbg: Memorizing file c64-reu.emd
Dbg: Memorizing file c64-ramcart.emd
Dbg: Memorizing file c64-c256k.emd
Dbg: Memorizing file c64-dqbb.emd
Dbg: Memorizing file c64-ram.emd
Dbg: Trying emdriver c64-georam.emd
Dbg: Loaded emdriver c64-georam.emd
Log: Copying overlays into ext. memory
Dbg: Reading overlay file multdemo.1
Dbg: Stored overlay 1 in pages 0-0
Dbg: Reading overlay file multdemo.2
Dbg: Stored overlay 2 in pages 1-1
Dbg: Reading overlay file multdemo.3
Dbg: Stored overlay 3 in pages 2-2
Log: Press any key...
Dbg: Loading overlay 1 from memory
Log: Calling overlay 1 from main
Log: Calling main from overlay 1
Dbg: Loading overlay 2 from memory
Log: Calling overlay 2 from main
Log: Calling main from overlay 2
Dbg: Loading overlay 3 from memory
Log: Calling overlay 3 from main
Log: Calling main from overlay 3
Log: Press any key...

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Sep 30 17:10:48 2012

This archive was generated by hypermail 2.1.8 : 2012-09-30 17:10:52 CEST