# w65c02-rust > **Lineage:** w65c02-python → **w65c02-rust** · > fixes start in w65c02-python and flow down by merges · > [family charter](https://github.com/alewman/emulator-lineage/blob/main/docs/charter.md) A Rust CMOS 65C02 core transcribed from [w65c02-python](https://github.com/alewman/w65c02-python) at `e49aceb` and proven equivalent to it at every processor boundary: boundary kind, cycles, every bus access in order with its kind, and all of `CPUState`. It is the CPU for a future Rust Atari Lynx board. Tier `x-rust` of the charter: "matches the Python" is what this repository proves; how well the Python matches real 65C02s (two of them captured cycle by cycle) is the reference's `docs/validation.md`. The crate is `w65c02` (the reference's name without `_python`). It is built on 6502-rust's 65xx-family frame (`sixfiveohtwo::frame::{Frame, Part}`), as the reference is built on 6502-python's `CPUFrame`. ```rust use w65c02::{Bus, Cmos65c02, Frame, Signals, G65SC02}; struct Ram(Vec); impl Bus for Ram { fn read(&mut self, address: u16, _: &mut Frame, _: Signals) -> u8 { self.0[address as usize] } fn write(&mut self, address: u16, value: u8, _: &mut Frame, _: Signals) { self.0[address as usize] = value; } } let mut cpu = Cmos65c02::new(G65SC02, Ram(vec![0; 0x10000])); // the Lynx I's cell cpu.frame.request_reset(); let cycles = cpu.step(); // 7: reset, one bus call per cycle ``` Every cycle is one bus call, dummy reads included, in the chip's order. Each call gets the CPU's `Frame` (to raise or drop IRQ and NMI in the cycle it happens, or `note_stall()` when RDY holds a read or a write) and `Signals`: `sync` (an opcode fetch, and the first cycle of an interrupt entry and of reset), `fetch` (a read of the instruction stream at PC), `opcode` (the instruction in progress) and `pc`; the Lynx's Mikey needs the first three to tell page-mode fetches from data. ## The parts, as rows | Row | Part | `RMB SMB BBR BBS` | `WAI` `STP` | Reset's stack cycles | | --- | --- | --- | --- | --- | | `W65C02S` | WDC W65C02S | yes | yes | reads (U1) | | `R65C02` | Rockwell R65C02 | yes | no | reads | | `G65SC02` | GTE/CMD G65SC02/G65SC12, NCR, VLSI; the Lynx I's cell | no | no | writes | | `LYNX2_CELL` | the Lynx II's cell (`Lynx2Cell`) | yes | no | writes (U2) | A `Row` is a value: a board can build its own. ## Certification Against w65c02-python `e49aceb`, the gate `scripts/ladder.sh` (numbers and commits in `docs/status.md`): | Rung | Result | | --- | --- | | 1 trace lockstep, short programs, every row | 16/16 traces identical; all 4 tables equal the reference's | | 2 SingleStepTests, three CMOS sets | 7,660,000 cases, 0 fail, every named-contradiction count equal to the reference's | | 3 Dormann's and Clark's tests natively | 12/12 succeed with the reference's instruction and cycle counts | | 4 real-chip captures (G65SC12, R65C02, Foot's) and interrupt/WAI/STP scenarios | all 168M instructions, 0 mismatches, reports identical; 80/80 traces identical | | 5 the frame carries the rows, no NMOS code linked | 10 tests; no `Mos6502` symbol in any binary | | 6 seeded faults | 46/46 caught, none by the corpus alone | `scripts/env.sh` says where the reference and its data are (by environment variable). How to resume: `docs/build-progress.md`; the brief: `docs/handoff-brief.md`; requests to 6502-rust (none needed): `docs/requests.md`; provenance: `docs/provenance.md`. ## Licence MIT (see `LICENSE`). Nothing third-party is committed: the corpus, the test programs and the captures are read in place from the reference's `reference/` directory, found by environment variable (`scripts/env.sh`).