rill-lofi 0.5.0-beta.7

Lo-fi audio emulation: 8-bit, 12-bit, NES, AY-3-8910, Akai S900
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! ChipEmulator trait — control interface for audio chip emulators.
//!
//! Complements `Algorithm<f32>` for chips that receive register writes
//! from external player modules (e.g. STC player, NSF player).

/// Control interface for audio chip emulators (AY-3-8910, NES APU, etc.).
///
/// Implementors maintain internal chip state and produce audio via
/// [`Algorithm::process`](rill_core::traits::Algorithm::process).
/// This trait adds the register-write control path.
pub trait ChipEmulator {
    /// Write a batch of chip registers.
    ///
    /// The slice length and encoding are chip-specific.  For AY-3-8910
    /// it is exactly 14 bytes (registers 0–13).  The implementor parses
    /// the bytes and updates internal state.
    fn write_registers(&mut self, regs: &[u8]);
}