dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
306 stars 25 forks source link

Add support for HD diskettes #430

Closed dirkwhoffmann closed 3 years ago

dirkwhoffmann commented 4 years ago

In v0.9.14, rudimentary support for OFS and FFS has been added. I.e., it is now possible to create a logical OFS or FFS volume, add files and directories, and create an ADF out of it. In v0.9.14, this functionality is utilized to enable drag and drop for plain Amiga EXE files. When such file is dragged in, an OFS volume is created that contains the provided EXE file. Furthermore, a boot block is installed and a startup-sequence added which loads the EXE file. After that, the volume is converted into an ADF and inserted into the drive.

I’d like to make my file system library more robust by adding HD disk support to vAmiga.

Here are three test files created with adftools (which uses adflib):

HD disk, OFS formatted, Kick 1.x bootblock hdofs.adf.zip

DD disk, FSS formatted, Kick 2.x bootblock ddffs.adf.zip

HD disk, FSS formatted, Kick 2.x bootblock hdffs.adf.zip

User story (this must be possible in vAmiga):

In UAE, hdofs boots just fine. Interestingly, booting the FFS volumes causes trouble:

ddffs: Boots, but the demo is corrupted hdffs: Doesn’t boot

I don’t think it’s an issue with the disks, because the demo runs just fine when launched from the CLI (for all three disks). My guess is that there might be a boot block issue. Maybe FFS media require a special bootblock. 🤔

dirkwhoffmann commented 4 years ago

Successfully booted from an HD disk for the first time (Kick 2.04, disk in df1:) 😎

Bildschirmfoto 2020-11-01 um 19 52 30
mithrendal commented 4 years ago

Maybe we can install classicwb. It comes with a webbrowser I think AWeb. 🤠

Edit: I looked into the hardware requirements.

http://classicwb.abime.net/classicweb/requirements.htm

At least the GAAE Edition should be possible no? Maybe the 68k edition too?

dirkwhoffmann commented 4 years ago

Things are shaping up. In the current version, it's already possible to drag in EXE files. In the next version, it will be possible to drag in directories, too. In this case, vAmiga tries to create an ADF containing all files in the host directory. If the directory fits on a single 3.5"DD disk, it can be mounted as usual:

Bildschirmfoto 2020-11-07 um 14 13 28

If the directory is too large, vAmiga automatically tries to put the files onto a 3.5"HD disk. Note that HD disks can only be inserted into drives that are configured as HD drives (df0 is always a DD drive).

Bildschirmfoto 2020-11-07 um 14 14 03

If no HD drive is connected, a warning message is displayed:

Bildschirmfoto 2020-11-07 um 14 13 44
dirkwhoffmann commented 4 years ago

At least the GAAE Edition should be possible no?

No, it requires a 80MB Hard Drive

mithrendal commented 4 years ago

Oh my fault. I did not look carefully enough and was confused by the HD acronym. It stands not for HardDrive in this context but for HighDensity right?

dirkwhoffmann commented 4 years ago

Yes, with HD I mean HD diskettes with a HUUUUGE capacity of 1,7MB. The classicWB editions also require an ECS machine 😢.

dirkwhoffmann commented 3 years ago

In the next version, vAmiga will have a nice feature for browsing and debugging the file system of an ADF. If "Export Disk..." is selected, a dialog will come up (instead of a save panel):

Bildschirmfoto 2020-11-20 um 14 22 05

The user will be able to view the contents of all blocks. vAmiga automatically scans the block, informs the user about the role of each byte, and reports back any detected inconsistency. There is still some work to do. The beta code reports errors for intact disks 🙈 (e.g., the disk used in the above example is perfectly fine). Anyway, false positives are good for debugging...

dirkwhoffmann commented 3 years ago

My new toy turns out to be a nice tool. I’ve analyzed a couple of ADFs and found out that almost all of them contain a file system that is corrupted in one or the other way. E.g., here is „Gods“ with a wrong checksum in the bitmap block 🤭:

Bildschirmfoto 2020-11-20 um 19 16 16

This is a block from „Defender of The Crown“ 😬:

Bildschirmfoto 2020-11-20 um 17 37 37

The displayed block is a „File List Block“. Such blocks contains a reference to the corresponding „File Header Block“ at the end. Instead of referencing this block, a pointer to the bitmap block is stored.

And finally, the world’s best Pac Man clone ever made… with lot’s of errors in the data block headers 😳:

Bildschirmfoto 2020-11-20 um 17 48 25

Again, the bitmap block is referenced instead of the file header block.

To cope with this situation, I think I should add a checkbox called „Strict checking“ and ignore a couple of common mistakes. Otherwise, the disk exporter would classify nearly every real-life ADF as being corrupted. 🤔

dirkwhoffmann commented 3 years ago

With the latest code changes, vAmiga can export disks to the Mac file system (i.e., all files and directories on the Amiga disk will be saved as single files and directories on the Mac). To export to a directory, simply select "Directory" as output format:

Bildschirmfoto 2020-11-22 um 14 34 05

After exporting this disk (Workbench 1.2), all files are accessible on the Mac:

Bildschirmfoto 2020-11-22 um 14 19 59
dirkwhoffmann commented 3 years ago

Part of v0.9.15