naTmeg / ScriptedAmigaEmulator

Amiga Emulator in javascript and HTML5
331 stars 63 forks source link

Formatting HD disks ( floppy_get_rootblock) #27

Closed dirkwhoffmann closed 5 years ago

dirkwhoffmann commented 5 years ago

Hi there. I stumbled across the following code snippet in function floppy_get_rootblock(dst, block, label, type):

if (type == SAEC_Disk_Create_Type_35_DD)
            dst[512 + 0x72] = 0x3f;
        else
            dst[512 + 0xdc] = 0x3f;

If a HD disk is selected, byte $DC in the bitmap block is set to $3F to mark the root and bitmap block as being used.

As far as I know, the root block is located at 1760 for HDs, so shouldn’t be

(1760 / 8) + 4 = 224 = $E0 the correct location for the 0x3f byte? (The +4 is for skipping the checksum long word).

naTmeg commented 5 years ago

Hi Dirk, nice find! I've checked that and you're right.

Because I've ported the code from WinUAE (disk.cpp), it's also an error there and an "Issue" should be opened as well..

Thanks.