Skip to content

Apple2 (diskiing, diskiiiwm): cannot boot ProDOS 2.5 floppy image #7707

Closed
@leesaudan2

Description

@leesaudan2

The Apple II emulation (apple2, apple2p, apple2e, apple2ee, apple2ep, apple2gs) fails to boot ProDOS 2.5 floppy image when emulating floppy drives with diskiing and diskiiiwm.

To repeat

Download the ProDOS 2.5 floppy image (.dsk format), and boot with command:

mame apple2ep -flop1 ProDOS_2_5_a8_143k.dsk

Instead of booting into ProDOS 2.5 menu, one gets thrown into the
monitor:

099F-       A=AE X=FF Y=FF P=B4 S=F9
*




PRODOS
.

This happens to floppy controllers emulated by diskiing as well as diskiiiwm. However, switching to diskii, the problem goes away and ProDOS 2.5 boots up and shows the menu!

Diagnosis

I have traced the booting process with the help of -debug, and found that the system successfully loads the boot sector (256 bytes) into memory region $800-$8FF. The code there (entry point: $801) then takes over, and tries to load the 2nd stage loader (3 more sectors) into $900--$BFF. However, these 3 sectors are not loaded correctly. When the boot sector code finally transfers control to the 2nd stage loader by jumping to address $99E, a zero byte is there. This is the 6502 opcode for BRK, which causes the monitor ROM code to take control and show the "*" prompt

I have done a similar tracing in another Apple II emulator linapple. It correctly loads the second stage loader into $900-$BFF and transfers the control there properly to complete the boot process, showing the ProDOS 2.5 menu.

Further tracing of the loading process in the emulated machine reveals that the nibbles being read by the emulated code in MAME are different from those in linapple, suggesting that MAME is generating the wrong nibbles. Since the .dsk format stores the disk data in high-level bytes, which get converted into nibbles (actually a bit stream reflecting magnetic flux changes) by MAME to emulate the floppy media, I suspect that the culprit is in MAME's nibbilization code.

To verify this, I have converted the .dsk file into WOZ2 format using a tool called dsk2woz2. This format stores the disk data as bitstreams reflecting magnetic flux changes. Using MAME with the resulting .woz file, ProDOS 2.5 successfully boots up and shows the menu.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions