// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : IFloppyImage.cs // Author(s) : Natalia Portillo // // Component : Disc image plugins. // // --[ Description ] ---------------------------------------------------------- // // Defines interface to be implemented by floppy image plugins. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Structs; namespace DiscImageChef.CommonTypes.Interfaces { /// /// Abstract class to implement disk image reading plugins that can contain floppy images. /// This interface is needed because floppy formatting characteristics are not necesarily compatible with the whole. /// LBA-oriented interface is defined by . /// All data returned by these methods is already decoded from its corresponding bitstream. /// public interface IFloppyImage : IMediaImage { /// /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, track density, /// etc... /// FloppyInfo FloppyInfo { get; } /// /// Reads a sector's user data. /// /// /// If is one of the duplicates is returned /// randomly. /// If is or /// random data is returned. /// If is null is returned. /// Otherwise, whatever is in the sector is returned. /// /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of request. byte[] ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status); /// /// Reads a sector's tag. /// /// /// If is one of the duplicates is returned /// randomly. /// If is or /// random data is returned. /// If is null is returned. /// Otherwise, whatever tag is in the sector is returned. /// /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of request. byte[] ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status, SectorTagType tag); /// /// Reads a whole track. It includes all gaps, address marks, sectors data, etc. /// /// The track data. /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). byte[] ReadTrack(ushort track, byte head); /// /// Reads a sector's data including all tags, address mark, and so, in a format dependent of represented media. /// /// /// If is one of the duplicates is returned /// randomly. /// If is or /// random data is returned. /// If is null is returned. /// Otherwise, whatever is in the sector is returned. /// /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of request. byte[] ReadSectorLong(ushort track, byte head, ushort sector, out FloppySectorStatus status); /// /// Verifies a track. /// /// True if correct, false if incorrect, null if uncheckable. /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). bool? VerifyTrack(ushort track, byte head); /// /// Verifies a sector, relative to track. /// /// True if correct, false if incorrect, null if uncheckable. /// Physical track (position of the heads over the floppy media, 0-based). /// Physical head (0-based). /// Logical sector ID. /// Status of request. bool? VerifySector(ushort track, byte head, ushort sector); } }