*** DISCLAIMER: The information on these pages is not an official instruction or documentation. No responsibility will be taken. Use at your own risk. ***

Sunday, March 8, 2020

How do you convert lha to ADF?

The contents of the files are completely different:

lha file is a compressed image of one or more AmigaDOS files (files, folders).
ADF is a raw track-by-track image of an AmigaDOS floppy disk, that might, or might not be bootable.

To use the contents of an lha file from an ADF ("convert to ADF"), you have to extract the lha file, and write it's contents to an ADF.  
(This implies that the contents of the lha file must fit onto a floppy disk - if they don't, extra work is required, which is beyond the scope of this article.)

You can do so for example by inserting some ADF (a copy!) to your Amiga emulator. Make sure your emulator settings allow for writing to ADF files. Format the disk (ADF), then extract lha to that disk. Example:

> format drive df0: name my_floppy_disk
> lha x myarchive.lha df0:

Note that every good archive - if it contains more than one file - should contain a root folder. Let's assume your archive is a good one, and let's assume the name of the root folder inside the archive is "rootfolder". For your disk (ADF), you probably want the disk itself to be the root folder. So instead of the above steps, directly extracting your lha file to disk, you might want to extract, then copy folder contents. Example:

> format drive df0: name my_floppy_disk
> makedir RAM:adfdir
> lha x myarchive.lha RAM:adfdir
> copy RAM:adfdir/rootfolder/#? df0: all clone


If you're using an emulator, you're done. The contents of your lha archive are now stored in an ADF file. Quit emulator, use ADF as desired.

Using a hardware Amiga with physical floppy, you'll need to read the floppy to ADF - you can use transadf from AmiNet, or any other ADF-reading tool. Example:

> transadf df0: my_adf.adf


To make the disk (ADF) bootable:

Run "install" from a shell. example:

> install df0:

Then create a text file "s/startup-sequence" that contains the commands to be run on boot - you can use AmigaOS's ed, or any other text editor. Example:

> ed df0:s/startup-sequence

Example: If you want to run "mygame" from folder "myfolder", put this line into the "startup-sequence" file:

myfolder/mygame

No comments:

Post a Comment

Your comment will published after it has been reviewed.