Make ADF Program

miker1264 · 227

miker1264

  • Senior Member
  • ****
    • Posts: 422
    • Karma: +14/-1
on: May 04, 2020, 06:39:39 AM
In the last few days I have been trying to come up with a good program to write a Hollywood Plugin for since I intend to purchase Hollywood.

Make ADF will be a very simple program with a few buttons to "Make ADF" and "Make HDF" files.

After researching the ADF file format I realize that making a Common ADF (DD) that is not bootable is very easy.
There are three parts to a blank ADF - BootBlock (1024 bytes) , RootBlock  (512 bytes) and following the RootBlock is the Bitmap (220 bytes).
An ADF (HD) is 1760kb and simply has a different chs geometry. A bootable ADF (DD or HD) has a BootBlock filled with Boot Code.

For a while I was puzzled by the data in the last sector (1759) of ADF's made by ADFOpus and ADFView . What was it?
When you create an empty disk file it has zero bytes. For Set EOF (End of File) both programs were calculating the location of the last block.
Then they both wrote a 512 byte random byte array to that last block to set the End of the File to be precisely 901,120 bytes. WinUAE doesn't.
It probably uses the Windows method of writing a single byte (0) to the last offset of the file to Set EOF using all zeroes instead.

Since I now know the full structure of a Simple ADF it is much easier to write the ADF Plugin and other programs to make blank ADF's.
For example FileMaster which works on AROS has a GUI button called "Make ADF" but it doesn't work yet for some reason. Now it will work.
After I attempt to make the ADF Plugin I might also try to make a Simple MUI Program as well that does the same thing - Make ADF/Make HDF.
But then something like DiskImage GUI which also works on AROS seems to lack the ability to make blank ADF files as well. Lots of possibilities!

I will surely modify my Disk Image Explorer program in C# for Windows to quickly and easily make blank ADF files now that I know the format.
« Last Edit: May 04, 2020, 06:45:13 AM by miker1264 »



miker1264

  • Senior Member
  • ****
    • Posts: 422
    • Karma: +14/-1
Reply #1 on: May 04, 2020, 06:55:27 AM
My C# program is already set up to make ADF files. It just needs the code to make them now. But that's easy enough.  :)



paolone

  • Moderator
  • Senior Member
  • *****
    • Posts: 340
    • Karma: +6/-0
Reply #2 on: May 04, 2020, 09:24:11 AM
Good!


AMIGASYSTEM

  • Member
  • ***
    • Posts: 191
    • Karma: +4/-0
Reply #3 on: May 04, 2020, 11:26:03 PM
Thanks miker, WinUAE also creates good ADFs



miker1264

  • Senior Member
  • ****
    • Posts: 422
    • Karma: +14/-1
Reply #4 on: May 05, 2020, 12:35:56 AM
AMIGASYSTEM

WinUAE makes nice ADF files. The last block in the disk file is filled with zeroes. That's the way it should be.

But if you use ADFOpus or ADFView the last block is filled with 512 bytes of random data because that's how ADFLib crudely sets End of File length.



miker1264

  • Senior Member
  • ****
    • Posts: 422
    • Karma: +14/-1
Reply #5 on: May 07, 2020, 04:45:25 PM
The first place that I will attempt Make ADF is a new Command Button for FileMaster. Then I can put together an MUI GUI for it.