pub struct Mmio { /* private fields */ }Expand description
The CD-ROM controller, through the SDK’s register steps.
Trait Implementations§
Source§impl CdHw for Mmio
impl CdHw for Mmio
Source§const TRACE: bool = true
const TRACE: bool = true
Whether to record controller events through
trace.
Constant per implementation so the unused event words fold away.Source§fn issue(&mut self, command: u8, params: &[u8]) -> bool
fn issue(&mut self, command: u8, params: &[u8]) -> bool
Send one drive command and arm the controller to interrupt for its
responses. Returns
false when the parameter FIFO never had room (the
command is not sent). Read moreSource§fn interrupt_code(&mut self) -> u8
fn interrupt_code(&mut self) -> u8
The controller’s current interrupt flag (0 none, 1 data ready, 2
complete, 3 acknowledge, 5 error).
Source§fn error_response(&mut self) -> (u8, u8)
fn error_response(&mut self) -> (u8, u8)
The first two response bytes of a drive error: status and error code.
Source§fn discard_response(&mut self)
fn discard_response(&mut self)
Pop and discard the response FIFO.
Source§fn acknowledge(&mut self, bits: u8)
fn acknowledge(&mut self, bits: u8)
Acknowledge interrupt flag
bits on the controller and the CPU-side
pending bit. acknowledge(0) only clears the CPU-side bit.Source§fn silence_output(&mut self)
fn silence_output(&mut self)
Mask the controller’s interrupt output, so nothing more is raised
until the next
issue.Source§fn drop_data_request(&mut self)
fn drop_data_request(&mut self)
Drop a data request left armed by the previous transfer. Called
before the first command of a transfer that did not start from a
recovery pause.
Source§unsafe fn pop_sector(
&mut self,
destination: *mut u32,
store_words: usize,
) -> bool
unsafe fn pop_sector( &mut self, destination: *mut u32, store_words: usize, ) -> bool
Pop one sector’s 2048 bytes from the data FIFO as 512 little-endian
words, storing the first
store_words of them at destination.
The rest are popped and dropped (the FIFO has to be emptied either
way). Arms the data request and waits a bounded time for the FIFO to
fill; false if it never does. Read moreSource§fn set_source_enabled(&mut self, enabled: bool)
fn set_source_enabled(&mut self, enabled: bool)
Let the CD interrupt source reach the CPU (or not). Read more
Source§fn vblank_count(&mut self) -> u32
fn vblank_count(&mut self) -> u32
Monotonic VBlank count, the clock the no-progress timeout runs on.