-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
MAME version
0.282 @ 64ec4fb
System information
arm64 macos Sonoma 14.8.1, M3 Max MacBook Pro, Mac15,8
Emulated system/software
apple2e*, apple2c*
Incorrect behaviour
apple2 machines corrupt 5.25" disks when writing, resulting in the disk becoming unusable. This only affects machines using clock rates different from the default 1021800 Hz.
Once a disk is corrupted:
- it no longer boots
- CiderPress2 can't catalog it ("Unable to recognize disk image contents")
- booting from a good disk with the corrupt disk as
-flop2: CAT,D2 produces "I/O ERROR"
In a DEBUG=1 build, machines using the diskiing emulation hit the assert recently added to wozfdc_device::lss_sync(). In a DEBUG=0 build, proceeding past this assert while writing to a disk results in corruption (read-only access seems to work OK.)
Expected behaviour
- all apple2 machines (regardless of 60/50Hz, or Zip Chip settings) should not corrupt disks
- unless using a Zip Chip, and software disables the slot6 delay, then all bets are off
Steps to reproduce
You can eventually reproduce this by booting ProDOS to BASIC, typing 10 REM and SAVE FOO <repeat as needed>, but for the sake of easy reproducibility and burn-in testing, here are more explicit steps:
- boot A COPY OF Apple IIe Diagnostic v2.1 (this disk is IIc-aware)
- c Choose Tests, <return>
- (e/f) Disk (Card/Port) Test, <return>
- a Disk (Card/Port) Test, <return>, <esc>, <esc>
- d Options, <return>
- a Loop Tests Until ESC is Pressed, <return>, <esc>
- b Execute Selected Tests, <return>
Additional details
Here are some results, across a slice of machines using different disk emulation, with different clock speeds:
machine disk options result
------- ---- ------- ------
apple2ee diskiing 100 iterations OK
apple2ee " <Zip Chip enabled> asserts after 2-3 iterations
apple2eede " asserts 1 second into boot
apple2c A2BUS_DISKIING 100 iterations OK
apple2c " <Zip Chip enabled> asserts after 2-3 iterations
apple2c " -nothrottle 100 iterations OK
apple2cfr " asserts 1 second into boot
apple2c0 A2BUS_IWM 100 iterations OK
apple2c0 " <Zip Chip enabled> 100 iterations OK
apple2c0de " ProDOS error after 1 iteration, disk corrupted
apple2cp IWM <built-in Zip> 100 iterations OK
apple2cp " -nothrottle 100 iterations OK
apple2gs IWM 100 iterations OK
apple2gs " <Zip Chip 16 MHz> 100 iterations OK
(apple2gs using -flop3 "Apple IIgs Diagnostic v3.1" instead)
From these results, we can see:
- 50 Hz fr/de/etc machines immediately corrupt disks when writing
- 60 Hz machines also corrupt disks if configured to use the 4 MHz Zip Chip, but this happens more slowly than the 50 Hz machines
- The //c+
and IIgswork with the Zip Chip (edit: see additional testing below) - The diskiing emulation catches the corruption with an assert, but corruption can also occur with the A2BUS_IWM emulation, where there is no assert
Occurs with:
- local build of master (circa Nov 3 2025 @ 64ec4fb)
- local build of mame0279 tag (circa Jul 30 2025)
- local build of mame0229 tag (circa Feb 23 2021) (using apple2ee Zip Chip, but not with apple2eefr, prior to ff5b73b)
(using buildenv: arm64 macos Sonoma 14.8.1, Apple clang version 15.0.0 (clang-1500.3.9.4) per vanilla Xcode 15.4, no homebrew/MacPorts)

