Struct spectrusty::chip::ay_player::AyPlayer
source · pub struct AyPlayer<P> {
pub frames: Wrapping<u64>,
pub tsc: TsCounter<FTs>,
pub memory: Memory64k,
pub ay_sound: Ay3_891xAudio,
pub ay_io: Ay3_8913Io<FTs>,
pub earmic_changes: Vec<FTsData2>,
pub last_earmic: u8,
pub prev_earmic: u8,
/* private fields */
}
Fields§
§frames: Wrapping<u64>
§tsc: TsCounter<FTs>
§memory: Memory64k
§ay_sound: Ay3_891xAudio
§ay_io: Ay3_8913Io<FTs>
§earmic_changes: Vec<FTsData2>
§last_earmic: u8
§prev_earmic: u8
Implementations§
source§impl<P: AyPortDecode> AyPlayer<P>
impl<P: AyPortDecode> AyPlayer<P>
pub fn cpu_clock_rate(&self) -> u32
pub fn frame_cycle_count(&self) -> FTs
pub fn frame_duration_nanos(&self) -> u32
pub fn ensure_audio_frame_time<B: Blep>(&self, blep: &mut B, sample_rate: u32)
sourcepub fn set_host_config<H: HostConfig>(&mut self)
pub fn set_host_config<H: HostConfig>(&mut self)
Changes the cpu clock frequency and the duration of frames.
sourcepub fn set_config(&mut self, cpu_rate: u32, frame_tstates: FTs)
pub fn set_config(&mut self, cpu_rate: u32, frame_tstates: FTs)
Changes the cpu clock frequency and the duration of frames.
sourcepub fn reset_frames(&mut self)
pub fn reset_frames(&mut self)
Resets the frames counter.
Trait Implementations§
source§impl<P, A: Blep> AudioFrame<A> for AyPlayer<P>
impl<P, A: Blep> AudioFrame<A> for AyPlayer<P>
source§fn get_audio_frame_end_time(&self) -> FTs
fn get_audio_frame_end_time(&self) -> FTs
source§fn end_audio_frame(&self, blep: &mut B) -> usize
fn end_audio_frame(&self, blep: &mut B) -> usize
Calls Blep::end_frame to finalize the frame and prepare it for rendition. Read more
source§impl<P, A> AyAudioFrame<A> for AyPlayer<P>where
A: Blep,
impl<P, A> AyAudioFrame<A> for AyPlayer<P>where
A: Blep,
source§fn render_ay_audio_frame<V: AmpLevels<A::SampleDelta>>(
&mut self,
blep: &mut A,
chans: [usize; 3]
)
fn render_ay_audio_frame<V: AmpLevels<A::SampleDelta>>(
&mut self,
blep: &mut A,
chans: [usize; 3]
)
source§impl<P: AyPortDecode> ControlUnit for AyPlayer<P>
impl<P: AyPortDecode> ControlUnit for AyPlayer<P>
§type BusDevice = NullDevice<i32>
type BusDevice = NullDevice<i32>
A type of a chain of emulated peripheral devices should be declared here. Read more
source§fn bus_device_mut(&mut self) -> &mut Self::BusDevice
fn bus_device_mut(&mut self) -> &mut Self::BusDevice
Returns a mutable reference to the instance of the first bus device in the device chain.
source§fn bus_device_ref(&self) -> &Self::BusDevice
fn bus_device_ref(&self) -> &Self::BusDevice
Returns a reference to the the instance of the first bus device in the device chain.
source§fn into_bus_device(self) -> Self::BusDevice
fn into_bus_device(self) -> Self::BusDevice
Destructs self and returns the instance of the bus device.
source§fn nmi<C: Cpu>(&mut self, cpu: &mut C) -> bool
fn nmi<C: Cpu>(&mut self, cpu: &mut C) -> bool
Triggers a non-maskable interrupt. Returns
true
if NMI was accepted. Read moresource§fn execute_next_frame<C: Cpu>(&mut self, cpu: &mut C)
fn execute_next_frame<C: Cpu>(&mut self, cpu: &mut C)
Conditionally prepares the internal state for the next frame and executes instructions on the
cpu
as fast as possible, until the near end of that frame. Read moresource§fn ensure_next_frame(&mut self)
fn ensure_next_frame(&mut self)
Conditionally prepares the internal state for the next frame, advances the frame counter, and wraps
the T-state counter if it is near the end of a frame. Read more
source§impl<'de, P> Deserialize<'de> for AyPlayer<P>
impl<'de, P> Deserialize<'de> for AyPlayer<P>
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<P, A, L> EarMicOutAudioFrame<A> for AyPlayer<P>where
A: Blep<SampleDelta = L>,
L: SampleDelta,
impl<P, A, L> EarMicOutAudioFrame<A> for AyPlayer<P>where
A: Blep<SampleDelta = L>,
L: SampleDelta,
source§impl<P: AyPortDecode> FrameState for AyPlayer<P>
impl<P: AyPortDecode> FrameState for AyPlayer<P>
source§fn current_frame(&self) -> u64
fn current_frame(&self) -> u64
Returns the value of the current execution frame counter. The FrameState implementation should
count passing frames infinitely wrapping at 2^64. Read more
source§fn set_frame_counter(&mut self, fc: u64)
fn set_frame_counter(&mut self, fc: u64)
Sets the frame counter to the specified value.
source§fn frame_tstate(&self) -> (u64, FTs)
fn frame_tstate(&self) -> (u64, FTs)
Returns a normalized frame counter and a T-state counter as a tuple. Read more
source§fn current_tstate(&self) -> FTs
fn current_tstate(&self) -> FTs
Returns the current value of the T-state counter. Read more
source§fn set_frame_tstate(&mut self, ts: FTs)
fn set_frame_tstate(&mut self, ts: FTs)
Sets the T-state counter to the specified value modulo
<Self as Video>::FRAME_TSTATES_COUNT
.source§fn is_frame_over(&self) -> bool
fn is_frame_over(&self) -> bool
Returns
true
if the value of the current T-state counter has reached a certain arbitrary limit which
is very close to the maximum number of T-states per frame. Read moresource§impl<P> Io for AyPlayer<P>where
P: AyPortDecode,
impl<P> Io for AyPlayer<P>where
P: AyPortDecode,
§type Timestamp = i32
type Timestamp = i32
This type is being used for timestamping I/O operations. See also [Clock::Timestamp].
§type WrIoBreak = ()
type WrIoBreak = ()
A value of this type is returned when a break is being requested by [Io::write_io].
source§impl<P> Memory for AyPlayer<P>
impl<P> Memory for AyPlayer<P>
§type Timestamp = i32
type Timestamp = i32
This type is being used for timestamping memory operations. See also [Clock::Timestamp].
source§fn read_debug(&self, addr: u16) -> u8
fn read_debug(&self, addr: u16) -> u8
Should return a single byte read from the memory present at the given
address
. Read moresource§fn read_mem(&self, addr: u16, _ts: FTs) -> u8
fn read_mem(&self, addr: u16, _ts: FTs) -> u8
Should return a single byte read from the memory present at the given
address
. Read moresource§fn read_mem16(&self, addr: u16, _ts: FTs) -> u16
fn read_mem16(&self, addr: u16, _ts: FTs) -> u16
Should return the unaligned, 2 consecutive bytes from the memory present at the given
address
as a 16-bit unsigned integer in a LE
(least significant byte first) order. Read moreAuto Trait Implementations§
impl<P> RefUnwindSafe for AyPlayer<P>where
P: RefUnwindSafe,
impl<P> Send for AyPlayer<P>where
P: Send,
impl<P> Sync for AyPlayer<P>where
P: Sync,
impl<P> Unpin for AyPlayer<P>where
P: Unpin,
impl<P> UnwindSafe for AyPlayer<P>where
P: UnwindSafe,
Blanket Implementations§
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
source§impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
source§fn into_sample(self) -> S
fn into_sample(self) -> S
Convert to
S
a sample type from self
.§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Calls
.tap_ref()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more