oplon 1.0.0

A no_std, integer-only OPL2/OPL3 (Yamaha YM3812/YMF262) FM synthesis core with a clean-room, compile-time-generated ROM set
Documentation
//! Feed pseudo-random register writes to the chip and render, asserting it
//! never panics (overflow, index, etc.). Deterministic LCG, no deps.
#![forbid(unsafe_code)]
use oplon::Opl2;

fn main() {
    let mut s: u32 = 0x1234_5678;
    let mut rng = || { s = s.wrapping_mul(1664525).wrapping_add(1013904223); s };
    let mut opl = Opl2::new(48000);
    let mut acc = 0i64;
    for i in 0..100_000u32 {
        let r = rng();
        let reg = (r & 0xFF) as u8;
        let val = ((r >> 8) & 0xFF) as u8;
        if (r >> 16) & 1 == 0 { opl.write_reg(reg, val); } else { opl.write_reg_high(reg, val); }
        if i % 4 == 0 { let (l, rr) = opl.render_frame(); acc = acc.wrapping_add(l as i64 + rr as i64); }
    }
    println!("fuzz chip OK (100k writes, checksum {acc})");
}