[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wanted: prodos prog selector2run dos3.3games



In article <lazarus.long-1412950956190001@longgpc.sea.adobe.com>,
Lazarus I. Long <lazarus.long@adobe.com> wrote:
> you all prolly know about the prodos program selector that will run .sys
> files at $2000.  the code is less than a k and resides in some
> out-of-the-way place in memory.

The selector is held at $D100-$D3FF in the second bank of the language
card while it is not in use.  When a ProDOS QUIT call is executed,
this code is copied to $1000-$12FF and executed from there.

> what i want is something exactly like that, perhaps a prodos .sys
> file itself that relocates to some obscure position in memory..  the
> one difference: it will run any binary file at its native location.

This could be tricky.  There are binary files that load in all sorts
of unusual places.  The program would have to be able to relocate
itself to almost anywhere, so that it doesn't get in the way of the
file being loaded.  The loader code can only go in $0300-$03EC or
$0800-$BEFF, and it also needs a 1K page-aligned buffer somewhere in
$0800-$BEFF.

It shouldn't be too hard to modify a program selector to allow BIN
files to be loaded (using the AUXTYPE as the load address), but this
has to fit in with all of the code that is already there (user
interface, etc.).  Having to add relocation code is likely to push the
code size over three pages.

For example, Bird's Better Bye is already close to $0300 bytes (my
modified version, as used in QUITTER.SYSTEM, is $02FF, and I had to
rewrite some code to save space).

Writing a small SYS file that presents a program selector user
interface and supports loading binary files would be much easier.  It
doesn't have the three page limit on code size.

It should be possible to write a BIN-only loader which runs at $B800,
say, with the 1K file buffer at $BB00-$BEFF.  This is the upper part
of the memory used by BASIC.SYSTEM: you would be freeing up $9600 (or
$9200 with a file open?) to $B7FF for loading binary files.

> perhaps someone knows simply how to patch the prodos file selector so that
> it will load the program at its native location instead of $2000?

Well, it has to support loading BIN files first.  SYS files, by
definition, always run at $2000 (the auxiliary type is ignored).

This would only be useful for programs that didn't load over
$1000-$12FF and whereever the standatd loader puts its buffer
(probably in $0800-$0FFF or $1300 to $1FFF).

Followups have been directed to comp.sys.apple2.programmer.
-- 
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand