Conversation
Register the .udi extension as a document type so Finder double-click and Open With route it to FuseX.
open_udi scanned to end of file, so the optional description block after the last track was parsed as a track descriptor and failed the type check. Bounding both track loops to the header geometry leaves the description unparsed.
Extended-format TR-DOS disks use 86 cylinders. Accept them as valid geometry.
Disks imaged from protected or marginal originals may present an MFM address mark with only one or two A1 sync marks and no data-field sync, or carry stray bytes in the data-mark gap. Such sectors must read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Open
.udifrom Findermasterdoesn't register.udias a document type, so it can't be opened from Finder. This PR adds the registration and an icon, mirroringfdi(#43); no controller change is needed, since UDI already routes through the sharedDISK_GENERICopen path.Description block rejected on load
A UDI may set header byte 11 bit 0 to flag a NUL-terminated description stored after its last track1.
master'sopen_udiscans tracks to EOF, so it reads the first description byte as a track-type byte, fails the check, and returnsDISK_UNSUP:fusex/peripherals/disk/disk.c
Line 1055 in a0fb141
Both scan loops are bounded to
sides × cylinderstracks, leaving the description unparsed. Spectrofon #09 (SP9_O.udi, header byte 11 =0x01) is rejected onmasterand loads with this change.More than 85 cylinders rejected
The shared
GEOM_CHECKmacro rejects any image over 85 cylinders asDISK_GEOM:fusex/peripherals/disk/disk.c
Lines 831 to 833 in a0fb141
The UDI max-cylinder field is one byte (
0x00–0xFF, up to 256 cylinders)1, and the drive reachesFDD_MAX_TRACK(99), so 85 was below both limits. The cap is raised to 86.GEOM_CHECKis shared by every disk loader and track storage is allocated fromd->cylinders, so the wider cap is safe across formats.Spectrum Expert (
SP_EXP1O.UDI) is an 86-cylinder example: its CRC is valid and it has no description block, somasterrejects it only atGEOM_CHECK, and raising the cap admits it.Sectors with imperfect MFM sync don't read
read_idandread_datamarkrequire textbook MFM sync: three0xffa1marks before the address mark, and inread_datamarka0x00data sync and a gap of only0x4e/0x00. Any stray gap byte errors the read:fusex/peripherals/disk/wd_fdc.c
Lines 297 to 305 in a0fb141
Disks imaged from protected or marginal originals violate this — stray gap bytes, or one or two
0xffa1marks with no0x00sync. A real WD1793 reads them;masterdoes not.The fix scans the gap for the
A1run within the datasheet's data-mark window — 43 byte-times in MFM, 30 in FM2 — then locks onto theA1and the following mark byte. It presets the address-mark CRC to0xcdb4, the value after threeA1bytes, and resumes from the mark byte. The survivingA1count therefore never affects validation: a standard three-A1disk validates identically, and the datasheet's detector keys on a single missing-clockA1regardless2.This lives in shared WD1793 core, so it also covers +D; the FM path is untouched.
Unsupported CRC algorithms
A UDI whose stored CRC32 was computed with a standard algorithm instead of the format's signed-accumulator variant1 is rejected on load; this PR doesn't relax that. Возрождение (
VOZRAZH1.udi) is such an image — its stored CRC matches the textbook algorithm, not the format's.Footnotes
UDI format specification — Alex Makeev, 2002 (Sinclair Wiki transcription). ↩ ↩2 ↩3
WD179X / FD179X datasheet — 1986 Western Digital Storage Management Products Handbook. ↩ ↩2