[][src]Struct cpclib_disc::edsk::TrackInformation

pub struct TrackInformation { /* fields omitted */ }

Byte (Hex) Meaning: 00 - 0C Track-Info\r\n 0D - 0F unused (0) 10 track number (0 to number of tracks-1) 11 head number (0 or 1) 12 - 13 unused (0) Format track parameters: 14 BPS (bytes per sector) (2 for 0x200 bytes) 15 SPT (sectors per track) (9, at the most 18) 16 GAP#3 format (gap for formatting; 0x4E) 17 Filling byte (filling byte for formatting; 0xE5) Sector info (for every sector at a time): 18+i track number (sector ID information) 19+i head number (sector ID information) 1A+i sector number (sector ID information) 1B+i BPS (sector ID information) 1C+i state 1 error code (0) 1D+i state 2 error code (0) 1E+i,1F+i unused (0)

E -- sector data length in bytes (little endian notation). This allows different sector sizes in a track. It is computed as (0x0080 << real_BPS).

Annotations:

  • The sector data must follow the track information block in the order of the sector IDs. No track or sector may be omitted.
  • With double sided formats, the tracks are alternating, e.g. track 0 head 0, track 0 head 1, track 1 ...
  • Use CPCTRANS to copy CPC discs into this format.

Implementations

impl TrackInformation[src]

Extend TrackInformation with the ability to extract its configuration

pub fn to_cfg(&self, double_head: bool) -> TrackGroup[src]

impl TrackInformation[src]

pub fn track_number(&self) -> &u8[src]

track number (0 to number of tracks-1)

pub fn head_number(&self) -> &u8[src]

head number (0 or 1)

pub fn sector_size(&self) -> &u8[src]

BPS (bytes per sector) (2 for 0x200 bytes)

pub fn number_of_sectors(&self) -> &u8[src]

SPT (sectors per track) (9, at the most 18)

pub fn gap3_length(&self) -> &u8[src]

GAP#3 format (gap for formatting; 0x4E)

pub fn filler_byte(&self) -> &u8[src]

Filling byte (filling byte for formatting; 0xE5)

pub fn data_rate(&self) -> &DataRate[src]

Returns the data rate

pub fn recording_mode(&self) -> &RecordingMode[src]

Returns the recordingmode

pub fn sector_information_list(&self) -> &SectorInformationList[src]

List of sectors

pub fn track_size(&self) -> &u16[src]

The size taken by the track + header in the dsk. This is a duplicated information obtained in the DiscInformation bloc

impl TrackInformation[src]

pub fn unformatted() -> Self[src]

TODO find a nicer (with Either ?) way to manipulate unformatted tracks

pub fn real_track_size(&self) -> u16[src]

Returns the real size of the track (i.e. after removing the header)

impl TrackInformation[src]

pub fn sector_size_human_readable(&self) -> u16[src]

👎 Deprecated:

Note sure it should be used as each sector store this information and different sizes are possible

pub fn next_sector_id(&self, sector: u8) -> Option<u8>[src]

Returns the ID of the sector following this one

pub fn min_sector(&self) -> u8[src]

Fail if the track has no sector

pub fn data_sum(&self) -> usize[src]

Compute the sum of data contained by all the sectors. Only serves for debug purposes

pub fn corresponds_to(&self, track: u8, head: u8) -> bool[src]

pub fn from_buffer(buffer: &[u8]) -> Self[src]

pub fn to_buffer(&self, buffer: &mut Vec<u8>)[src]

http://www.cpcwiki.eu/index.php/Format:DSK_disk_image_file_format#TRACK_INFORMATION_BLOCK_2

offset description bytes 00 - 0b "Track-Info\r\n" 12 0c - 0f unused 4 10 track number 1 11 Head number 1 12 - 13 unused 2 14 sector size 1 15 number of sectors 1 16 GAP#3 length 1 17 filler byte 1 18 - xx Sector Information List xx

Extensions offset description bytes 12 Data rate. (See note 1 and note 3) 1 13 Recording mode. (See note 2 and note 3) 1

pub fn total_size(&self) -> usize[src]

TODO remove this method or set it private

pub fn compute_track_size(&self) -> usize[src]

Track size has it should be written in the DSK

pub fn sector(&self, sector_id: u8) -> Option<&Sector>[src]

pub fn sector_mut(&mut self, sector_id: u8) -> Option<&mut Sector>[src]

Trait Implementations

impl Clone for TrackInformation[src]

impl Debug for TrackInformation[src]

impl Default for TrackInformation[src]

impl PartialEq<TrackInformation> for TrackInformation[src]

impl StructuralPartialEq for TrackInformation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.