pub struct TrackEngine { /* private fields */ }Expand description
This is the main interface for interacting with any GCR track data. It maintains the state of the controller, but does not own either the track data or the format information.
Implementations§
Source§impl TrackEngine
impl TrackEngine
Sourcepub fn create(method: Method, nib_filter: bool) -> Self
pub fn create(method: Method, nib_filter: bool) -> Self
create a new track engine, any machine state is lost
Sourcepub fn change_method(&mut self, method: Method)
pub fn change_method(&mut self, method: Method)
change the method used process the data stream
pub fn read_sector( &mut self, cells: &mut FluxCells, hood: &SectorHood, sec: &Sector, fmt: &ZoneFormat, ) -> Result<Vec<u8>, Box<dyn Error>>
pub fn write_sector( &mut self, cells: &mut FluxCells, dat: &[u8], hood: &SectorHood, sec: &Sector, fmt: &ZoneFormat, ) -> Result<(), Box<dyn Error>>
Sourcepub fn to_nibbles(&mut self, cells: &mut FluxCells, fmt: &ZoneFormat) -> Vec<u8> ⓘ
pub fn to_nibbles(&mut self, cells: &mut FluxCells, fmt: &ZoneFormat) -> Vec<u8> ⓘ
dump nibble stream starting on an address prolog continuing through one revolution
Sourcepub fn get_sector_map(
&mut self,
cells: &mut FluxCells,
fmt: &ZoneFormat,
) -> Result<(Vec<[u8; 6]>, Vec<usize>), Box<dyn Error>>
pub fn get_sector_map( &mut self, cells: &mut FluxCells, fmt: &ZoneFormat, ) -> Result<(Vec<[u8; 6]>, Vec<usize>), Box<dyn Error>>
return vectors of sector addresses and sizes in geometric order for user consumption
Sourcepub fn format_track(
&mut self,
hood: SectorHood,
buf_len: usize,
fmt: &ZoneFormat,
) -> Result<FluxCells, Box<dyn Error>>
pub fn format_track( &mut self, hood: SectorHood, buf_len: usize, fmt: &ZoneFormat, ) -> Result<FluxCells, Box<dyn Error>>
Create a GCR track based on the given ZoneFormat (currently Apple only).
- hood - standard address components, in general will be transformed by fmt
- buf_len - length of the buffer in which track bits will be loaded (usually padded, only used as a check)
- fmt - defines the track format to be used
- returns - FluxCells object. There is some special handling to emulate the way different versions of Apple DOS would format the track.
Auto Trait Implementations§
impl Freeze for TrackEngine
impl RefUnwindSafe for TrackEngine
impl Send for TrackEngine
impl Sync for TrackEngine
impl Unpin for TrackEngine
impl UnwindSafe for TrackEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more