# spc700-rust > **Lineage:** spc700-python → **spc700-rust** · > fixes start in spc700-python and flow down by merges · > [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) A Rust **Sony SPC700** core (the CPU of the SNES's S-SMP sound chip) transcribed from [spc700-python](https://github.com/alewman/spc700-python) at `552b24a` and proven equivalent to it at every processor boundary: boundary kind, cycles, every cycle in order (read, write or internal, address, value, the dummy flag), and all of `CpuState`. It is the sound CPU for a future Rust SNES board (the first step toward a play-snes site). Tier `x-rust` of the charter: "matches the Python" is what this repository proves; how well the Python matches the S-SMP (anomie's documents, SingleStepTests, gilyon's and PeterLemon's hardware-run tests, MAME) is the reference's `docs/validation.md`. The crate is `spc700`, the reference's name without `_python`. Unlike the 65xx cores it has no frame: the S-SMP has no interrupt inputs (the reference's U11). ```rust use spc700::{Bus, Signals, Spc700}; struct Ram(Vec); impl Bus for Ram { fn read(&mut self, address: u16, _: Signals) -> u8 { self.0[address as usize] } fn write(&mut self, address: u16, value: u8, _: Signals) { self.0[address as usize] = value; } // idle(signals): every internal cycle, which has no address; the default touches nothing. } let mut cpu = Spc700::new(Ram(vec![0; 0x10000])); let cycles = cpu.step(); // SPC700 cycles == bus callbacks made ``` The host advances its devices inside `read`, `write` and `idle`, never by adding `step()`'s return value on top: a dummy read of `$FD`-`$FF` clears a timer, and internal cycles take their own wait states when TEST slows the bus. Each callback gets `Signals`: `psw` (current, with P), `opcode`, `cycle` (0 = the fetch), `stopped` and `dummy`, which the reference's host reads off the CPU object. ## Layout Each `src/*.rs` file is the transcription of one `spc700_python/*.py` module, with the same handler names, the same 256-entry handler table and opcode table (generated from the reference's and checked against them on every run) and the comments carried over: `core` (`_core.py`), `flags`, `alu`, `bit`, `word`, `moves`, `control`, `dispatch`, `opcodes`, `cpu`, `state`, `trace` (with `debug.py`'s boundary kinds), `harness` (the host that is not a SNES, with rung 2's and rung 3's drivers) and `replay` (rung 4's MAME replay). Where Rust forced a difference, the module header says so. Not transcribed: the reference's disassembler (beyond the lengths a trace needs), debug session, console and command line. ## Certification Against spc700-python `552b24a`, the gate `scripts/ladder.sh` (commands, numbers and commits in [docs/status.md](docs/status.md)); rungs 0-4 are the reference's own: | Rung | Result | | --- | --- | | 0 the bus schedule: the tables, and the reference's rung 0 states (its generator and seeds) | 256 handlers and 256 opcode rows equal; 76,200 steps, every cycle identical | | 1 SingleStepTests spc700, 256 files x 1,000 | the reference's judge: 0 fail; and all 256,000 unmasked, every cycle identical | | 2 gilyon's spctest in the harness | 1,368 tests in order, the reference's 184,246 cycles and 51,549 instructions | | 3 PeterLemon's seven CPU tests, raw and as snapshots | 162 sub-tests pass in both forms, every line (cycles, instructions, codes) the reference's | | 4 six MAME traces replayed | 45,428,492 instructions, no divergence, every summary the reference's | | 5 trace lockstep: random memory, spctest, PeterLemon's tests | 32 of 32 scenarios identical (5.0 million boundaries) | | 6 the bus contract | 8 tests and the doc test | | 7 seeded faults | 40 of 40 caught (two after a harness I/O scenario closed a blind spot) | `scripts/env.sh` says where the reference and its data are (by environment variable). The provenance of everything here: [docs/provenance.md](docs/provenance.md); notices: [NOTICE.md](NOTICE.md). ## Licence MIT (see `LICENSE`). Nothing third-party is committed: the corpus, the test programs, the IPL ROM and the MAME traces are read in place from the reference's checkout.