MOSSoundInterfaceDevice

Struct MOSSoundInterfaceDevice 

Source
#[repr(C, packed(1))]
pub struct MOSSoundInterfaceDevice { pub channel1: Voice, pub channel2: Voice, pub channel3: Voice, pub filter_cutoff: WO<u16>, pub resonance_and_filter_setup: WO<u8>, pub volume_filter_mode: WO<u8>, pub potentiometer_x: RO<u8>, pub potentiometer_y: RO<u8>, pub channel3_oscillator: RO<u8>, pub channel3_envelope: RO<u8>, }
Expand description

MOS Technology Sound Interface Device (SID)

Fields§

§channel1: Voice§channel2: Voice§channel3: Voice§filter_cutoff: WO<u16>§resonance_and_filter_setup: WO<u8>

RESON Filter resonance control (0x17)

§volume_filter_mode: WO<u8>

SIGVOL Volume and filter select (0x18)

§potentiometer_x: RO<u8>§potentiometer_y: RO<u8>§channel3_oscillator: RO<u8>§channel3_envelope: RO<u8>

Implementations§

Source§

impl MOSSoundInterfaceDevice

Source

pub fn start_random_generator(&self)

Start noise generation on SID channel 3.

Example:

c64::sid().start_random_generator();
let random_byte = c64::sid().rand8(20);

More information here.

Source

pub fn rand8(&self, max_value: u8) -> u8

Random byte in the interval (0, max_value)

Source

pub fn random_byte(&self) -> u8

Random byte in the interval (0, 255)

§Examples
c64::sid().start_random_generator();
let value = c64::sid().random_byte();

More information here. Currently there’s no way to select the subsong as this requires that the accumulator is set. Possibly this can be done wrapping function pointers to raw assembler code.

Source

pub fn rand16(&self, max_value: u16) -> u16

Random word in the interval (0, max_value)

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> 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, 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.