The Spectrum+3 uses a version of the Amstrad and CP/M disk layout.
The Speccy version has a directory at the start of the disk after any reserved tracks and it can hold up to 64 files.
Each directory entries has a 32-byte structure. On most disk images I have there is a blank entry after the last entry in the directory, with all 32 bytes either zero or 'e'.
St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al
But some other disks have an entry that looks like random garbage:
FF FF FF FF FF BF BD A5 FF FF FF FF FF 7F 55 5D FF FF FF FF FF FF FF AB FF FF FF FF FF FF FF F7
Yet in the Spectrum emulators, none show any corrupt entry or report any errors. The
St field is status, which tells if the file belongs to a certain user, is deleted, etc. But nothing mentions a special meaning if it's equal to
FFh or if it flags an entry entry.
I'm looking at the +3DOS ROM disassembly and all the docs I can find but none seem to mention anything that would cover this case. Most code refers to an in-RAM structure the OS reads to see how many entries there should be. But I can't locate the code that sets this number. I also can't find it in source code for tools I can find that read or write +3DOS disks or images.
How does the Speccy tell from the disk's layout how many entries are in the directory or which is the last one?