Metadata-Version: 2.5 Name: snes-python Version: 0.1.0.dev0 Summary: Readable, pure-Python Super Nintendo emulator built on 65816-python Author: alewman License: MIT License Copyright (c) 2026 alewman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License-File: LICENSE Requires-Python: >=3.11 Requires-Dist: 65816-python Provides-Extra: dev Requires-Dist: pytest>=8; extra == 'dev' Requires-Dist: ruff==0.16.8; extra == 'dev' Description-Content-Type: text/markdown # snes-python A readable, pure-Python emulator of the **Super Nintendo Entertainment System / Super Famicom**, to be built as a board on the family's cores: [65816-python](../65816-python) for the S-CPU's 65C816 and the SA-1, and [spc700-python](../spc700-python) for the S-SMP's SPC700. The cores own their instruction sets; this repository will own everything around them: the S-CPU's address decoder and its 6/8/12-clock bus cycles, DMA and HDMA, the multiplier and divider, the H/V IRQ and NMI timer, the joypad auto-read, WRAM, both picture chips dot by dot, the rest of the S-SMP (IPL ROM, timers, ports), the **S-DSP** as an in-board module, the cartridge maps and coprocessors, and the master clock that ties them together. **Status (2026-10-21): Phase 0, groundwork only, no emulator code.** The documents in [`docs/`](docs/README.md) hold what the build needs, every fact with its source and tier; [docs/handoff-brief.md](docs/handoff-brief.md) is the plan. Measured while gathering: MAME 0.285 passes gilyon's 65C816 and SPC700 test ROMs and matches 60 of krom's 137 reference pictures exactly; Mesen2 (famicom-python's headless build) passes the same gilyon ROMs; the two disagree on 18 of undisbeliever's 29 hardware-glitch probes; 95.3 % of the licensed No-Intro set needs no coprocessor. ## Scope | Machine | Phase | | --- | --- | | SNS-001 / SHVC-001 with 5A22-02 (CPU v2), NTSC: the reference | 1 | | CPU v1, PPU2 v1-3, 1CHIP consoles | 1, as fields | | PAL | later, as machine data | | Coprocessors: DSP-1..4, SA-1, S-DD1, SPC7110, OBC1, S-RTC | after the base board | | Super FX, Cx4, ST018, Super Game Boy, MSU-1, Satellaview | later (own cores where programmable) | ## What is fetched Nothing third-party is committed; ROMs, the IPL ROM and coprocessor programs are bring-your-own. `scripts/fetch_references.py` rebuilds `reference/` and `tests/test_roms/` from `scripts/pinned_files.json` (74 files by SHA-256: fullsnes, anomie's register/timing/memory-map documents, 65 SNESdev wiki pages, gilyon's v1.4 release, undisbeliever's v20210217 release, blargg's 2010 probes, NovaSquirrel's gradient test) and `scripts/pinned_repos.json` (16 repositories at full commit SHAs, sparse where large: bsnes, ares, Mesen2, MesenCE, snes9x, MAME 0.285, krom's SNES tests, undisbeliever's and gilyon's sources, rainwarrior's SNES_stuff, SnesSpeedTest, the 240p suite, SPLA, SNES_MiSTer, Pan Docs' SGB chapters, SameBoy's SGB code): ```sh python -I scripts/fetch_references.py # everything missing (~85 MB) python -I scripts/fetch_references.py --verify # check what is present ``` It needs `git` and `curl`. Wiki pages and fullsnes are live: a changed page is reported and kept; everything else must match its hash. ## Scripts | Script | What | | --- | --- | | `scripts/fetch_references.py` | the pinned references and test ROMs | | `scripts/mame_trace.py` | MAME 0.285 per-instruction 5A22 trace (master clocks, H/V, frame), B-bus and CPU-register log, optional S-SMP trace, ROM-string result detector ([docs/mame-oracle.md](docs/mame-oracle.md)) | | `scripts/mame_screens.py` | test ROMs with a reference picture run on MAME, frames compared at 5 bits per channel | | `scripts/mesen_run.py` | a ROM on famicom-python's headless Mesen2 build, final frame to PNG ([docs/validation.md](docs/validation.md)) | | `scripts/count_carts.py` | memory maps and coprocessors over a local No-Intro set, read in place ([docs/cartridge.md](docs/cartridge.md)) | Run them with `python -I`; `mame_screens.py` and `mesen_run.py` need Pillow, `mame_trace.py` needs `/usr/games/mame`, `7z` and a `snes.zip` holding the IPL ROM. ## Licence MIT (see `LICENSE`), for what is in this repository. The fetched material keeps its own terms, recorded per file in the pin lists.