Re: [cc65] cl65 -t apple2 works, but cl65 -C apple2.cfg doesn't

From: Oliver Schmidt <ol.sc1web.de>
Date: 2007-09-10 10:52:30
Hi Scott,

> I can edit it to change the start
> address (moving it to $2000 and resaving the binary with type SYS instead of
> $00 creates a file that can be double-clicked from the Finder to launch, though
> it crashes to the Monitor when it exits...there's probably a ProDOS MLI call or
> something that can be hacked in at the end of main() to fix that).

I'd rather stay clear from trying to hack a BIN file into a SYS file...

The contribution section contains a ProDOS loader that is a
less-than-512-byte SYS file loading the BIN files created by the cc65
toolchain.

The benefit of this approach is that the final binary starting at $800
has $1800 more RAM available. Additionally this approach is quite
flexible:

- As long as a cc65 binary doesn't use file I/O it may run as DOS 3.3
binary, as ProDOS binary launched from BASIC.SYSTEM ans via the loader
as ProDOS SYS file.

- If it uses file I/O and therefore depends on the ProDOS MLI it still
can be launched from the BASIC.SYSTEM and via the loader.

- If it is launched via BASIC.SYSTEM it will return to BASIC on exit.
If it is launched via the loader it will call the ProDOS selector at
exit.

- If launched via the loader it has more memory available resulting in
a larger C heap. I.e. the DIODEMO program that copies disks allocates
memory for track storage from the heap. In a single drive scenario it
requires you one time less to swap the floppies if run via the loader.

- The loader supports the ProDOS startup file protocol and delivers
the content as argv[1] to main().

> I can also build and load tgidemo, but it runs into a problem when it tries to
> load the TGI driver.

Works fine for me.

> ld65: Error: File `a2e.hi.tgi' has unknown type

Surely, it's not an object file. It's a dynamically loadable module.
Check out the cc65 docs.

> Since the documentation for the Apple II libraries says file I/O isn't working
> yet, maybe this is to be expected.

You obviously are looking at quite outdated docs.

> Time to unpack the Apple II books so I can
> figure out what I need to do.

Or just grab the latest cc65 snapshot. It has comprehensive file I/O
support based on the ProDOS MLI. The TGIDEMO runs nicely dynamically
loading the .tgi driver.

Generally I'd stop presuming that everything is broken and/or incomplete.

Best, Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Sep 10 10:52:42 2007

This archive was generated by hypermail 2.1.8 : 2007-09-10 10:52:45 CEST