[][src]Struct cpclib_disc::edsk::DiscInformation

pub struct DiscInformation { /* fields omitted */ }

Disc image files consist of a 0x100-byte disc info block and for each track a 0x100-byte track info block, followed by the data for every sector in that track. The new extended disk format is intended for some copy protected disks. Parts which are new in the extended format are marked with "E" (from our "Extended DISK Format Proposal, Rev.5").

The Disc Information block Byte (Hex): Meaning: 00 - 21 "MV - CPCEMU Disk-File\r\nDisk-Info\r\n" ("MV - CPC" is characteristic)

E -- "EXTENDED CPC DSK File\r\n\Disk-Info\r\n" ("EXTENDED" is characteristic) 22 - 2F unused (0)

E -- DSK creator (name of the utility) (no ending \0 needed!) 30 number of tracks (40, 42, maybe 80) 31 number of heads (1 or 2) 32 - 33 size of one track (including 0x100-byte track info) With 9 sectors * 0x200 bytes + 0x100 byte track info = 0x1300.

E -- unused (0) 34 - FF unused (0)

E -- high bytes of track sizes for all tracks (computed in the same way as 32-33 for the normal format).

For single sided formats the table contains track sizes of just one side, otherwise for two alternating sides. A size of value 0 indicates an unformatted track. Actual track data length = table value * 256. Keep in mind that the image contains additional 256 bytes for each track info.

Implementations

impl DiscInformation[src]

pub fn creator_name(&self) -> &String[src]

Specific to edsk

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

Number of tracks

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

Number of heads

pub fn track_size_table(&self) -> &Vec<u8>[src]

high bytes of track sizes for all tracks

impl DiscInformation[src]

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

Build an eDSK from a buffer of bytes TODO manage the case of standard dsk

pub fn is_double_head(&self) -> bool[src]

Check if the dsk is double sided

pub fn is_single_head(&self) -> bool[src]

Check if the dsk is single sided

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

Returns the length of the track including the track information block

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

Check if the wanted track is formatted

pub fn track_length_at_idx(&self, idx: usize) -> u16[src]

Get the lenght of the required track

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

Sum all the tracks lenght

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

Provide the number of different tracks

Trait Implementations

impl Clone for DiscInformation[src]

impl Debug for DiscInformation[src]

impl Default for DiscInformation[src]

impl PartialEq<DiscInformation> for DiscInformation[src]

impl StructuralPartialEq for DiscInformation[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.