pub fn parse_fds(bytes: &[u8]) -> Result<FdsDisk, RomError>Expand description
Parse a .fds / fwNES disk image into an FdsDisk.
Accepts:
- The fwNES container: a 16-byte header (
"FDS\x1A"+ byte4 = side count), followed byside_count×FDS_SIDE_LEN-byte sides. - The headerless raw form: 1+ concatenated sides, the first of which opens
with
\x01*NINTENDO-HVC*(the disk-info block).
QD-style 65536-byte sides are accepted and truncated to the 65500-byte read window (Stage 1 does not consume CRC/gap bytes).
§Errors
RomError::BadMagicif the bytes are neither a fwNES container nor a recognizable raw disk side.RomError::Truncatedif the declared side count would run past the end of the file, or the file is too short to hold a single side.