pub struct CdUnit {Show 13 fields
pub switches: UnitSwitches,
pub bus: ScsiBus,
pub adpcm: Adpcm,
pub ram: Vec<u8>,
pub bram: Vec<u8>,
pub bram_locked: bool,
pub arcade: Option<ArcadeCard>,
pub enable: u8,
pub active: u8,
pub reset_register: u8,
pub right_channel: bool,
pub sample_latch: u16,
pub mclk: i64,
/* private fields */
}Expand description
CD RAM, backup RAM, the registers, the SCSI bus and the CD-DA player.
Fields§
§switches: UnitSwitches§bus: ScsiBus§adpcm: Adpcm§ram: Vec<u8>§bram: Vec<u8>§bram_locked: bool[hw: pcetech 8] locked at power-up
arcade: Option<ArcadeCard>the Arcade Card, if fitted: banks $40-$43 and $1A00-$1AFF (arcade.rs)
enable: u8§active: u8§reset_register: u8§right_channel: bool§sample_latch: u16§mclk: i64Implementations§
Source§impl CdUnit
impl CdUnit
pub fn new(disc: Option<Disc>) -> CdUnit
Sourcepub fn with(
disc: Option<Disc>,
bram: Option<&[u8]>,
arcade: Option<ArcadeCard>,
) -> Result<CdUnit, String>
pub fn with( disc: Option<Disc>, bram: Option<&[u8]>, arcade: Option<ArcadeCard>, ) -> Result<CdUnit, String>
bram: the backup RAM’s first bytes (None: the formatted-empty header, U36); more than
2 KiB is an error (the RAM is 2 KiB, pcetech 8; the reference’s issue 0001).
pub fn disc(&self) -> Option<&Rc<Disc>>
pub fn insert(&mut self, disc: Option<Disc>)
Sourcepub fn cdda(&mut self) -> &mut CddaPlayer
pub fn cdda(&mut self) -> &mut CddaPlayer
The CD-DA player (the reference’s unit.cdda).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CdUnit
impl<'de> Deserialize<'de> for CdUnit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl DeviceState for CdUnit
impl DeviceState for CdUnit
Source§fn state_identity(&self) -> String
fn state_identity(&self) -> String
What the unit is and which media it holds: the disc by its table of contents (never its sectors), and whether the Arcade Card is fitted.
Source§impl PortDevice for CdUnit
impl PortDevice for CdUnit
Source§fn audio_sources(&mut self) -> Vec<&mut dyn AudioSource>
fn audio_sources(&mut self) -> Vec<&mut dyn AudioSource>
Socket 9: CD-DA, then ADPCM (the order the reference appends them to the board’s list).
fn claims(&self) -> Vec<(usize, usize)>
Source§fn catch_up(&mut self, mclk: i64, pins: &mut BoardPins<'_>)
fn catch_up(&mut self, mclk: i64, pins: &mut BoardPins<'_>)
Socket 5: the device keeps its own rational ratio and remainder and runs up to
mclk
when asked; the board asks at every advance (the reference’s issue 0002).fn reset(&mut self, kind: ResetKind, pins: &mut BoardPins<'_>)
fn as_any_mut(&mut self) -> &mut dyn Any
Auto Trait Implementations§
impl Freeze for CdUnit
impl !RefUnwindSafe for CdUnit
impl !Send for CdUnit
impl !Sync for CdUnit
impl Unpin for CdUnit
impl !UnwindSafe for CdUnit
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