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

Re: Fast or direct load from disk. New tool: c2d.



On Feb 22, 4:04 pm, Hugh Hood <hughh...@earthlink.net> wrote:
> Egan,
>
> See Tom Weishaar's letter response under "Running without filenames" on Page
> 7 of the January, 1985 issue of Open-Apple.
>
> He describes a technique that should do exactly what you're asking.
>
> If you don't have your old paper copy, here's the link to an online pdf
> copy:
>
> <http://apple2online.com/web_documents/Open%20Apple%20Vol1No00.pdf>
>
> Hugh Hood ...
>
> in article
> 4adff58c-05e5-4a34-9f29-b2989771f...@jn12g2000pbb.googlegroups.com, Egan
> Ford at dataj...@gmail.com wrote on 2/22/12 10:49 AM:
>
>
>
>
>
>
>
> > Hello all,
>
> > I am looking for any code or suggestions on how to load a single
> > binary to a specific address and execute it directly from disk
> > (booting required) without DOS or ProDOS loading first.
>
> > I've seen some games load very fast.  Is there a general method for
> > doing this floating around?
>
> > Thanks.

Hugh, perfect.  A simple solution for a lazy programmer.  It may not
be the fastest solution, but it was the fastest to implement.  Thanks
again for everyone's help.

I just posted c2d (code to disk) to http://asciiexpress.net/files.  I
included the source with OS/X and Windows binaries.

c2d will take a single binary (with or without 4-byte DOS header) or a
text monitor listing and create a bootable diskette (dsk) image.

usage:  c2d [-vh?]
        c2d [-m]   input[.mon],[load_address] output.dsk

        -h|? this help
        -m jump to monitor after booting
        -v print version number and exit

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

input with a .mon extension expected input format:

        0800: A2 FF 9A 20 8C 02 20 4F
        0808: 03 4C 00 FF 20 9E 02 A9

Examples:

        c2d hello hello.dsk
        c2d hello.mon hello.dsk
        c2d hello,800 hello.dsk
        c2d -m test,300 test.dsk



Example Sessions:

$ c2d air_cars,6000 air.dsk

Reading air_cars, type BINARY, start: $6000, length: 8192

Number of sectors:    32
Sector page range:    $60 - $7F
After boot, jump to:  $6000

Writing air_cars to T:01/S:00 - T:02/S:15 on air.dsk


$ c2d moon.patrol,801 moon.dsk

Reading moon.patrol, type BINARY, start: $0801, length: 18460

Number of sectors:    73
Sector page range:    $08 - $50
After boot, jump to:  $0801

Writing moon.patrol to T:01/S:00 - T:05/S:08 on moon.dsk