Metadata-Version: 2.5 Name: segacd-python Version: 0.0.0.dev0 Summary: Readable, pure-Python Sega CD / Mega-CD board for megadrive-python's expansion port 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 Classifier: Development Status :: 1 - Planning Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: System :: Emulators Requires-Python: >=3.11 Requires-Dist: m68000-python @ git+https://github.com/alewman/m68000-python@c827cca6617ddcfb82e2735f3f30fe14971335f0 Requires-Dist: megadrive-python @ git+https://github.com/alewman/megadrive-python@5c6d1b752970e49c7e3626925551087c3dd3d687 Provides-Extra: dev Requires-Dist: pytest>=8; extra == 'dev' Requires-Dist: ruff==0.16.8; extra == 'dev' Description-Content-Type: text/markdown # segacd-python A readable, pure-Python **Sega CD / Mega-CD** board that will plug into [megadrive-python](https://github.com/alewman/megadrive-python)'s expansion port. Its sub CPU is a second instance of [m68000-python](https://github.com/alewman/m68000-python). **Status (2026-11-09): milestones 1 and half of 4, of 8.** The gate array, PRG RAM, word RAM in both modes, backup RAM, the timer, the stopwatch, the sub 68000, the RAM cartridge, the CD-ROM decoder with its transfers, the drive's protocol and a BIN/CUE reader are built. Every row of KRIKzz's mcd-verificator passes but one, which fails by a stated choice ([docs/worklog.md](docs/worklog.md)), and a real BIOS reaches its title screen. **No graphics unit, no sound, no measured drive timing yet; no game has been booted.** Local repository; nothing is pushed. ```sh python -m segacd_python --bios mcd-verificator.bin --ram-cart --disc DISC.zip --frames 2000 --text ``` The Sega CD is its own board, not a variant of the Mega Drive: a second 68000 on its own 50 MHz crystal, 512 KB of PRG RAM, 256 KB of word RAM shared by a hand-over protocol, a rotation and scaling unit, a CD-ROM decoder, a drive behind a 10-nibble protocol, PCM and CD-DA. It pins megadrive-python by git revision and copies nothing from it; the sockets it needs are designed in megadrive-python's `docs/expansion-sockets.md`, and [docs/sockets.md](docs/sockets.md) says what the CD needs from each and where that design is wrong or incomplete. ## Read - [docs/start-here.md](docs/start-here.md): the machine. - [docs/sockets.md](docs/sockets.md): the contract with the Mega Drive board. - [docs/timing.md](docs/timing.md), [docs/undocumented-behavior.md](docs/undocumented-behavior.md). - [docs/validation.md](docs/validation.md): every oracle, its tier, and what ran here. - [docs/mame-oracle.md](docs/mame-oracle.md): MAME as a detector. - [docs/handoff-brief.md](docs/handoff-brief.md): the milestones, and the open decisions. - [docs/manual-registers.md](docs/manual-registers.md): the registers re-read against Sega's manual. - [docs/worklog.md](docs/worklog.md): what each build session did and measured. ## BIOS and discs: bring your own Sega's BIOS is **never fetched, committed or vendored**, and neither is any commercial disc. `.gitignore` refuses `bios/`, `*.bin`, `*.cue`, `*.chd` and the rest. KRIKzz's mcd-verificator can stand in for the BIOS (it was written to), so the first milestones need no Sega code at all. ## What is fetched Nothing third-party is committed. `scripts/fetch_references.py` rebuilds `reference/` from `scripts/pinned_files.json` (33 files pinned by SHA-256: Sega's hardware, software, PCM and BIOS manuals, the Model 1 and Model 2 service manuals, the LC8951 and LC7883 datasheets, the CUE specification, forum threads) and `scripts/pinned_repos.json` (21 repositories at full commit SHAs, sparse: mcd-verificator and its real-hardware CDD logs, the MiSTer core's SignalTap captures of a real Mega-CD, Genesis Plus GX, BlastEm, ares, jgenesis, clownmdemu, MAME, PicoDrive, KRIKzz's FPGA core, test programs, a BIOS disassembly with the BIOS image itself left out). ```sh python scripts/fetch_references.py # everything missing (~140 MB) python scripts/fetch_references.py --verify # check what is present python scripts/build_referees.py # Genesis Plus GX and BlastEm libretro cores python scripts/libretro_run.py gpgx DISC.chd --bios-is-verificator --frames 600,7200 python scripts/mame_cd.py DISC.chd --rompath ROMS --frames 300 --trace ``` They need `git`, `make`, a C compiler and, for MAME runs, MAME 0.285. No sudo. ## Licence MIT (see `LICENSE`). The fetched references keep their own licences; several are non-commercial or GPL, and are read and cited, never copied.