# The public surface The reference's docs/api.md (a2600-python `28fb095`), in this crate's spelling: the same names, module for module (`a2600_python.x.Y` is `a2600::x::Y`). `tests/misc.rs` (`every_listed_name_exists`) names each of them, so a missing one fails to compile. The differences Rust forced: | Reference | Here | | --- | --- | | `Board(machine, cartridge, *, tia=None, riot=None, cycles=0)` | `Board::new(machine, cartridge, tia: Option, riot: Option>>, cycles) -> Result` (the RIOT is shared: a keypad reads its port when the TIA is read; a 7800 host keeps its own `Rc`) | | `System(cartridge, machine, *, board=None, cpu=None)` | `System::new(cartridge, machine, None)`, `System::with_board(board, machine)`; with `cpu=`, `System::with_cpu(board, machine, cpu: MOS6507) -> (System, old board)` (the running CPU's `bus` is replaced, no power-on); `system.board` is `system.board()` / `board_mut()` (the CPU owns its bus) | | `System.from_rom(rom, machine, **options)` | `System::from_rom(Rom, machine, scheme, Options)`, `System::from_path`; the row's `cpu_hz` goes to the cartridge unless `Options::cpu_hz` names one | | `Audio.on_sample(sample)` | a boxed closure given the sample only (it runs inside the TIA's step, so it cannot read `TIA::hclock`) | | `RIOT.input_a`, `out_a`, `ddr_a`, `out_b`, `ddr_b` (read only) | public fields; read only by contract (write port A through `set_input_a`, the rest through the bus) | | `cartridge.load(..., cpu_hz=)`, `build(..., cpu_hz=)`, `CLOCKED` | `Options::cpu_hz`, handed to the `CLOCKED` schemes (`["DPC"]`) and dropped for the rest | | `gates.timer_roms(root, *, system_factory, machine=VCS_NTSC)`, `gates.smoke_names(root)` | `gates::timer_roms(root, factory, machine)`, `gates::smoke_names(root) -> Result>` | | `MOS6507` (a subclass) | `type MOS6507 = Mos6502` | | `TIA.on_line(pixels)`, `TIA.pad_source()`, `TIA.on_vsync(frame)` | boxed closures; `on_line` and `pad_source` are handed the TIA (`&TIA`) | | `RIOT.port_a_listener(levels, cycle)` | a boxed closure handed the RIOT (`&mut RIOT, levels, cycle`) | | `Board.bus_observers` `(kind, address, value, cycle)` | boxed closures, kind `'R'` / `'W'` | | controllers holding the TIA and RIOT | methods take them: `Joystick::set(tia, riot, Stick)`, `DrivingController::turn(tia, riot, n)` | | `Paddles.position[i]`, `Keypads.pressed[port]` | shared cells: `position.borrow_mut()[i] = Some(x)` | | `palettes.PALETTES[name]` | `palettes::palette(name)`, `palettes::palettes()` | | `machine.MACHINES[name]` and the other dictionaries | arrays of rows; `machine::machine(name)`, `tia_revision(name)`, `console_row(key)` | | `cartridge.load(rom, *, scheme, super_chip, mame_hash, **options)` | `cartridge::load(Rom, scheme, super_chip, &mame_hash(), Options) -> Result` | | gates' `system_factory`, `tia_factory` | closures (`&dyn Fn(Box, Machine) -> System`, `&mut dyn FnMut() -> TIA`) | Added here, not in the reference: `state::save_state` / `load_state` (save states), `Cartridge::save_state` / `load_state` / `as_any`, and the binaries `a2600`, `a2600-play` (feature `frontend`), `a2600-trace`, `a2600-gates`.