pub struct Adpcm {Show 32 fields
pub switches: AdpcmSwitches,
pub irq_changes: Vec<(u8, bool)>,
pub fader: Rc<Cell<Fader>>,
pub ram: Vec<u8>,
pub latch: u16,
pub read_ptr: u16,
pub write_ptr: u16,
pub read_buffer: u8,
pub control: u8,
pub dma: u8,
pub rate: u8,
pub length: u32,
pub half: bool,
pub end: bool,
pub playing: bool,
pub play_request: bool,
pub high_nibble_next: bool,
pub signal: i32,
pub index: i32,
pub read_due: Option<i64>,
pub write_due: Option<i64>,
pub write_value: u8,
pub sample_at: i64,
pub record: bool,
pub events: Vec<(i64, i32)>,
pub last_output: i32,
pub sample_count: u64,
pub end_count: u64,
pub origin: Option<i64>,
pub taken: i64,
pub held: i32,
pub gain: f64,
}Expand description
RAM, pointers, flags and the decoder. Time comes from the unit (run(mclk) and the now
of each register access); the unit calls run for every event from next_event.
Fields§
§switches: AdpcmSwitches§irq_changes: Vec<(u8, bool)>§fader: Rc<Cell<Fader>>§ram: Vec<u8>§latch: u16§read_ptr: u16§write_ptr: u16§read_buffer: u8§control: u8§dma: u8§rate: u8§length: u32§half: bool§end: bool§playing: bool§play_request: bool§high_nibble_next: boolthe next sample is the high nibble of the byte at read_ptr
signal: i32§index: i32§read_due: Option<i64>§write_due: Option<i64>§write_value: u8§sample_at: i6416.16 fixed-point master clocks
record: boolthe audio source wants (time, output) events
events: Vec<(i64, i32)>§last_output: i32§sample_count: u64decoded samples (statistics)
end_count: u64times the end flag was raised (statistics)
origin: Option<i64>§taken: i64§held: i32§gain: f64AudioSource socket: the mixer’s gain for this source
Implementations§
Source§impl Adpcm
impl Adpcm
pub fn new(fader: Rc<Cell<Fader>>) -> Adpcm
pub fn write_busy(&self) -> bool
pub fn read_busy(&self) -> bool
Sourcepub fn period_fixed(&self) -> i64
pub fn period_fixed(&self) -> i64
Master clocks per sample, 16.16 fixed point.
Sourcepub fn power_on(&mut self, at: i64)
pub fn power_on(&mut self, at: i64)
Power-on at master clock at (the output goes idle then, the reference’s issue 0001
item 3).
pub fn write(&mut self, reg: u8, value: u8, now: i64)
pub fn read(&mut self, reg: u8, now: i64) -> u8
Sourcepub fn dma_write(&mut self, value: u8, now: i64) -> bool
pub fn dma_write(&mut self, value: u8, now: i64) -> bool
One byte from the CD-to-ADPCM DMA, through the same write path as $180A. False if
the previous write is still in progress (the DMA retries).
pub fn next_event(&self) -> Option<i64>
Trait Implementations§
Source§impl AudioSource for Adpcm
The ADPCM audio for the board’s mixer (socket 9): the decoder output held, sampled at 44.1
kHz at exact master-clock times, with the $180F fader when it is aimed at ADPCM.
impl AudioSource for Adpcm
The ADPCM audio for the board’s mixer (socket 9): the decoder output held, sampled at 44.1
kHz at exact master-clock times, with the $180F fader when it is aimed at ADPCM.
fn rate_hz(&self) -> f64
fn gain(&self) -> f64
Source§fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>
fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>
mclk since the last call.