datajerk / c2t

Retro Code (Apple II, Cosmac VIP) to Tape/Text
BSD 3-Clause "New" or "Revised" License
64 stars 11 forks source link

Support for AppleSingle input files #17

Open ryandesign opened 2 years ago

ryandesign commented 2 years ago

cc65 now outputs AppleSingle files. These encapsulate both the executable program and its metadata such as its load address. AppleCommander can add such AppleSingle files to a disk image properly.

But to use these files with c2t, I first have to decode the file (applesingle file.as -o file) and then give the decoded file to c2t, telling it what load address to use.

Might c2t be enhanced to natively support AppleSingle input files so that manually specifying the load address would not be necessary?

snoglobe commented 2 years ago

I agree, this would be amazing. What program are you using to decode the file? I can't find it anywhere.

datajerk commented 2 years ago

That support is already there, unless AppleSingle headers are not the same a DOS headers:

From c2t -h:

input(s) without a .mon or .dsk extension is assumed to be a binary with a 4
byte header.  If the header is missing then you must append ,load_address to
each binary input missing a header, e.g. filename,800.  The load address
will be read as hex.

If a binary is ripped from disk it should have the 4 byte header (load address and size).

If AppleSingle has a different header then I'd need the spec and examples to consider adding support.

c2d (https://github.com/datajerk/c2d) works the same way and will create bootable disks (without DOS) for single binaries.

ryandesign commented 10 months ago

AppleSingle is unrelated to DOS headers and information about the format should not be difficult to find. One place to start is https://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats.

ryandesign commented 10 months ago

What program are you using to decode the file? I can't find it anywhere.

Are you asking about where to get the applesingle program I mentioned? It is part of the Darwin operating system that is the heart of macOS. I don't know what alternatives exist for non-Mac operating systems.

ryandesign commented 10 months ago

@datajerk I found the AppleCommander issue filed by the developer of cc65 explaining the motivation for using AppleSingle as the interchange format:

https://github.com/AppleCommander/AppleCommander/issues/20

@snoglobe I also found the AppleCommander subproject that implements AppleSingle support in a Java library and command-line utility; maybe it is of use to you:

https://github.com/AppleCommander/applesingle