AdpcmSwitches

Struct AdpcmSwitches 

Source
pub struct AdpcmSwitches {
    pub base_hz: f64,
    pub read_clocks: i64,
    pub write_clocks: i64,
    pub saturate: bool,
    pub output_scale: i32,
    pub end_on_write_at_zero: bool,
}
Expand description

Switches: behaviours only tier 5 gives, or undecidable between sources (the reference’s docs/m8-record.md; its Adpcm class attributes, with its defaults).

Fields§

§base_hz: f64

Playback rate base: f = base_hz / (16 - n). [hw: pcetech 8; mfr: BIOS manual AD_PLAY “fKHz=32/(16-n)”] 32 kHz; Mednafen uses 32087.5 (a crystal-derived guess, tier 5).

§read_clocks: i64

Master clocks until $180C bit 7 clears after a $180A read. [hw: pcetech 8: “about 24 cycles in high-speed mode”] 24 CPU cycles x 3. Mednafen: 57 clocks; Mesen2: a RAM slot model (30 cycles minimum, 32 safe); 0 = immediate.

§write_clocks: i64

The same for a $180A write (bit 2). [emu: Mesen2: 22 cycles minimum, 24 safe; Mednafen 33 clocks] pcetech: the BIOS polls bit 2 after each write, no time given.

§saturate: bool

The 12-bit signal saturates at -2048..2047 (MAME’s MSM5205 model) or wraps (Mesen2, Geargrafx).

§output_scale: i32

16-bit output per signal unit. 16 would be full scale; Mesen2 and Geargrafx use 10 (headroom for the PSG and CD-DA). Tier 5.

§end_on_write_at_zero: bool

A write to RAM while the length is zero raises the end flag [emu: Mesen2, Geargrafx]; the BIOS clears it with the length latch afterwards. Mednafen has no such rule.

Trait Implementations§

Source§

impl Clone for AdpcmSwitches

Source§

fn clone(&self) -> AdpcmSwitches

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AdpcmSwitches

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AdpcmSwitches

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AdpcmSwitches

Source§

fn eq(&self, other: &AdpcmSwitches) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for AdpcmSwitches

Source§

impl StructuralPartialEq for AdpcmSwitches

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.