pub struct ChannelStates {
pub channels: [ChannelState; 3],
pub envelope: EnvelopeState,
pub noise: NoiseState,
pub mixer_raw: u8,
}Expand description
Complete state of all YM2149 channels and generators.
Fields§
§channels: [ChannelState; 3]State of channels A, B, C.
envelope: EnvelopeStateEnvelope generator state.
noise: NoiseStateNoise generator state.
mixer_raw: u8Raw mixer register value (for debugging).
Implementations§
Source§impl ChannelStates
impl ChannelStates
Sourcepub fn from_registers(regs: &[u8; 16]) -> Self
pub fn from_registers(regs: &[u8; 16]) -> Self
Extract channel states from a YM2149 register dump.
This is the main entry point for visualization. It works with any register dump regardless of the source format (YM, AKS, AY, SNDH).
§Arguments
regs- 16-byte register dump fromYm2149Backend::dump_registers()
§Returns
Complete state of all channels and generators.
Sourcepub fn from_registers_with_clock(regs: &[u8; 16], master_clock: f32) -> Self
pub fn from_registers_with_clock(regs: &[u8; 16], master_clock: f32) -> Self
Extract channel states with a custom master clock frequency.
Use this when emulating non-Atari ST systems with different clock rates.
§Arguments
regs- 16-byte register dumpmaster_clock- Master clock frequency in Hz
Sourcepub fn max_amplitude(&self) -> f32
pub fn max_amplitude(&self) -> f32
Get the maximum amplitude across all channels (for VU meter).
Sourcepub fn any_envelope_enabled(&self) -> bool
pub fn any_envelope_enabled(&self) -> bool
Check if any channel has envelope mode enabled.
Sourcepub fn active_channels(&self) -> impl Iterator<Item = (usize, &ChannelState)>
pub fn active_channels(&self) -> impl Iterator<Item = (usize, &ChannelState)>
Get channels that are actively producing sound.
A channel is “active” if it has amplitude > 0 and either tone or noise enabled.
Trait Implementations§
Source§impl Clone for ChannelStates
impl Clone for ChannelStates
Source§fn clone(&self) -> ChannelStates
fn clone(&self) -> ChannelStates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more