// SPDX-License-Identifier: MIT //! pokey: a readable, cycle-level model of Atari's POKEY (C012294). //! //! ``` //! use pokey::POKEY; //! //! let mut chip = POKEY::default(); // POKEY(C012294) //! chip.write(0x0F, 0x03); // SKCTL: leave initialisation mode //! chip.tick(); // one period of the O2 pin //! chip.levels(); // the four channel codes, 0-15 each //! ``` //! //! The behaviour, rule by rule with its evidence, is pokey-python's docs/behaviour.md. //! //! A transcription of [pokey-python](https://github.com/alewman/pokey-python) //! (`src/pokey_python/` at 6ed1ffa), module for module: `chip.rs` is `chip.py`, //! `variants.rs` is `variants.py`, `rc.rs` is `rc.py`. The names of Python's `__all__` are //! re-exported here. One module has no Python counterpart: `pyrandom.rs`, the part of Python's //! standard library `power_on(seed)` uses (Rust-forced, see its header). Every module header //! lists what Rust forced. //! //! Save states: `POKEY::snapshot()` returns a [`State`]; with the `serde` feature it (and //! `POKEYVariant`) is `Serialize`/`Deserialize`. Without the feature the crate imports nothing. pub mod chip; mod pyrandom; pub mod rc; pub mod variants; pub use chip::{Look, State, POKEY}; pub use variants::{POKEYVariant, C012294, LINEAR};