PsgSwitches

Struct PsgSwitches 

Source
pub struct PsgSwitches {
Show 13 fields pub write_wave_while_playing: bool, pub dda_latch_needs_on: bool, pub r6_overrides_sample_while_on: bool, pub keyon_mode: KeyOnMode, pub lfo_requires_ch2_on: bool, pub lfo_zero_multiplier: i64, pub lfo_mask12: bool, pub lf_trg_halts_always: bool, pub scale_table_quirk: bool, pub silent_units: usize, pub render_audio: bool, pub noise_zero_period: i64, pub noise_free_running: bool,
}
Expand description

The points on which the manual and pcetech are silent or the two readable emulators differ (docs/m4-record.md, C13-C23). Each default below follows the manual or pcetech where they speak, else the larger share of the sources; variant flips them to one emulator’s way.

Fields§

§write_wave_while_playing: bool

C13: data written to R6 while a channel is ON and not DDA. pcetech: ignored, the index does not move. MAME and Mednafen store it in the waveform. True follows the two emulators.

§dda_latch_needs_on: bool

C16: R6 in DDA mode loads the DAC latch: the manual says whenever DDA is set (also with the channel off); Mednafen only with the channel on, and it also lets an R6 write while playing override the sample until the next address step (“tested on a SuperGrafx”).

§r6_overrides_sample_while_on: bool§keyon_mode: KeyOnMode

C22: neither reading is in the manual.

§lfo_requires_ch2_on: bool

C18: the LFO acts only when channel 2 is on (manual); MAME modulates whatever channel 2 is.

§lfo_zero_multiplier: i64

C19: the LFO frequency register 0: 256 (Mednafen) or 1 (MAME’s zero-length counter).

§lfo_mask12: bool

U6: the modulated frequency wraps in 12 bits (Mednafen) or not (MAME).

§lf_trg_halts_always: bool

C23: LF TRG (R9 bit 7) halts channel 2 whatever LF CTL holds (Mednafen); MAME only with LF CTL non-zero.

§scale_table_quirk: bool

C15: R1/R5’s table: the manual says 3 dB a step; both emulators share a table in which the step from 7 to 8 is 1.5 dB and from 8 to 9 4.5 dB (index 8 costs 15 units, not 14). The sixteen values in scale are that table, as in MAME’s c6280.cpp (BSD-3-Clause, Charles MacDonald; see the reference’s NOTICE.md).

§silent_units: usize

C14: attenuation at which a channel goes silent, in 1.5 dB units. The manual: 45 dB (30). Both emulators keep a 31st step (46.5 dB) that is still audible.

§render_audio: bool

False skips the host-rate output.

§noise_zero_period: i64

C17: noise frequency NF’ = 0 (“undefined” in the manual). MAME clocks the shift register every step; Mednafen every 32. 32 here.

§noise_free_running: bool

C20: the noise shift register runs whether or not noise is selected (Mednafen); MAME runs it only while a channel is playing noise.

Implementations§

Source§

impl PsgSwitches

Source

pub fn variant(name: &str) -> Option<PsgSwitches>

Each readable emulator’s way on the disputed points (the reference’s VARIANTS): "manual" (the defaults), "mame", "mednafen".

Trait Implementations§

Source§

impl Clone for PsgSwitches

Source§

fn clone(&self) -> PsgSwitches

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 PsgSwitches

Source§

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

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

impl Default for PsgSwitches

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for PsgSwitches

Source§

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 PartialEq for PsgSwitches

Source§

fn eq(&self, other: &PsgSwitches) -> 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 Serialize for PsgSwitches

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for PsgSwitches

Source§

impl Eq for PsgSwitches

Source§

impl StructuralPartialEq for PsgSwitches

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,