# SPDX-License-Identifier: MIT """The machines as data: every field names its source and evidence tag. A machine is a frozen row; the board reads its fields and nothing else decides region or revision behaviour (docs/start-here.md "The machines"). """ from __future__ import annotations from dataclasses import dataclass, replace @dataclass(frozen=True) class Machine: """One console row.""" name: str # DOC: fullsnes "SNES Timings" and wiki/Timing "Master Clock": # 21.477272 MHz NTSC (6 x colour burst), 21.281370 MHz PAL. master_hz: float # DOC: wiki/Timing "Scanline": 262 lines NTSC, 312 PAL (one more on # interlaced even fields). lines: int pal: bool # DOC: fullsnes "4210h - RDNMI" bits 3-0, "version 2 exists"; the console # here reads version 1 (tests/console, MEASURED 2026-10-24). cpu_version: int # DOC: fullsnes "213Eh/213Fh": PPU1 version 1 only, PPU2 versions 1-3. ppu1_version: int ppu2_version: int # DOC: wiki/Timing "Audio": the S-SMP resonator, 24.576 MHz nominal. # MEASURED on Aubrey's console 2026-10-24: +2,700 to +2,990 ppm # (docs/undocumented-behavior.md U8); the default row stays nominal. apu_hz: float = 24_576_000.0 # The reference row: CPU version 2, PPU2 version 3 (Aubrey's decision of # 2026-10-21, docs/handoff-brief.md "Decided by the user", item 2). NTSC = Machine( name="ntsc", master_hz=21_477_272.0, lines=262, pal=False, cpu_version=2, ppu1_version=1, ppu2_version=3, ) # Aubrey's Super Famicom (serial S10387319): CPU version 1, PPU1 1, PPU2 1 # (MEASURED: tests/console/probe-00-revision-2026-10-24.srm). SFC_V1 = replace(NTSC, name="sfc_v1", cpu_version=1, ppu2_version=1) PAL = replace(NTSC, name="pal", master_hz=21_281_370.0, lines=312, pal=True) MACHINES = {m.name: m for m in (NTSC, SFC_V1, PAL)} __all__ = ["MACHINES", "NTSC", "PAL", "SFC_V1", "Machine"]