# Start here ## Source tags Every fact in these documents carries one of these tags. The tag is the tier ([validation.md](validation.md)). | Tag | Source | Tier | | --- | --- | --- | | `[board]` | Dunkley and XeD's measurements on one physical CPS-3 (DP, DN) | 1, one board | | `[rom]` | read here from the games' own BIOS or CD (decrypted text, file lists), or from the byte-exact 3rd Strike decompilation (AGPL-3.0, read in Phase 0, not fetched since 2026-11-24; facts taken only from it are to be re-checked in the game's own program) | fact about the software | | `[HM]` | Hitachi SH7604 hardware manual (pinned by sh2-python) | 2 | | `[WD]` | Western Digital WD33C93A data book | 2 | | `[man]` | Capcom operator's manuals | 2, operator level only | | `[sch]` | JTCPS3's KiCad schematics (provenance not stated in the tree) | 3 at best | | `[jt]`, `[fpga2]` | JTCPS3 HDL; the second FPGA core (both GPL-3.0, read in Phase 0, not fetched since 2026-11-24: what they do is HYPOTHESIS, for review) | 4 | | `[mame]`, `[fbn]` | MAME 0.285 `cps3.cpp`; FinalBurn Neo (non-commercial, read in Phase 0, not fetched since 2026-11-24: HYPOTHESIS) | 5 | | `[ran]` | run or computed in this phase | says what it ran on | ## The machine A main board (95682A-4) with five Capcom ASICs, a plug-in **security cartridge** that holds the CPU and the boot flash, up to seven 72-pin **flash SIMMs**, and a **SCSI CD-ROM drive** used only to fill the SIMMs. `[mame]` board notes unless tagged otherwise. | Part | Device | Notes | | --- | --- | --- | | CPU (in the cartridge) | Capcom DL-3229 "SCU", an SH-2 with fetch decryption; 6.25 MHz crystal ×4 = 25 MHz | decap: "HD6417099 variant" `[mame]` (C4); 25.0046 MHz ± 165 ppm on a stock replacement part, timed with an uncalibrated phone video `[board]` | | Boot flash (cartridge) | Fujitsu 29F400TA, 512 KiB, 8-bit bus | the "BIOS"; encrypted | | Key store | static RAM on the CPU die, battery-backed | lost on tamper or flat battery: the "suicide" | | Cartridge NVRAM | Ramtron FM1208S (types A-C) | purpose unknown (U21) | | PPU | DL-2729 (QFP304) | sprites, tilemaps, zoom, CRTC | | CCU | DL-2829 (QFP208) | work RAM hangs off it | | IOU | DL-2929 (QFP208) | inputs, EEPROM; 3.6864 MHz crystal beside it | | SSU | DL-3329 (QFP144) | sound, and the "SS" score-screen text layer; 32 KiB SRAM | | GLL1 | DL-3429 (QFP144) | DMA and bus controller | | GLL2 | DL-3529 (QFP80) | SIMM bank selection | | SCSI | AMD 33C93A-16 (WD33C93A second source) | | | Work RAM | HM514260 256K×16 DRAM | 512 KiB | | Sprite RAM | HM514260 256K×16 DRAM | 512 KiB; sprite lists and tilemaps | | Character RAM | 4 × TC5118160 1M×16 DRAM | 8 MiB; filled by the decompressing DMA; JTCPS3's schematics call these four the frame buffer (C15) | | Colour RAM | 2 × KM681002 128K×8 SRAM | 0x20000 15-bit colours | | SS RAM | 62256 32K×8 SRAM | 8 bits wide `[board]` | | EEPROM | 93C46 | settings | | Video DAC | MC44200 triple 8-bit; low 3 bits of each grounded | 15-bit colour | | Audio DAC | TDA1306T, clocked at 42.9545/3 = 14.318 MHz | | | Crystals | 42.9545 MHz (video, sound), 60 MHz, 3.6864 MHz; 6.25 MHz in the cartridge | CPU and video clocks are independent | ## Clocks - CPU: 25 MHz nominal. `[board]` 25.0046 MHz ± 165 ppm. - Pixel clock: 42.954545 MHz / 5 (384 wide) or / 4 (wide mode) `[mame]`, measured on the DAC as 8.602 and 10.73 MHz (a MAME comment; who measured is not stated). - Line: 455 counts of 42.954545 MHz / 6 = 15,734.26 Hz; 264 lines; **59.5995 Hz nominal** `[mame]`. `[board]` 59.604 ± 0.011 Hz on one cabinet. The 59.583 Hz often quoted is about two standard deviations below that measurement (C3). - CPU clocks per frame: 419,467 nominal; 419,512 ± 40 derived from the board's records with an estimator calibrated on the authors' emulator, assuming the FRT period OCRA + 1 `[board, infer]`. The ratio belongs to one cartridge in one board, because the two crystals sit on different boards. - Sound: output rate (42.954545 MHz / 3) / 384 = 37,286 Hz `[mame]`. ## The six games (machines as data) One board class, one table row per game. The key pair and the SIMM population are the whole difference in hardware. `[mame]`; keys checked `[ran]` ([encryption.md](encryption.md)). | Game | MAME parent | key1 | key2 | SIMMs populated | Sets | | --- | --- | --- | --- | --- | --- | | Red Earth / War-Zard (1996) | `redearth` | `9e300ab1` | `a175b82c` | 1, 3, 4, 5 (5 half) | 6 | | Street Fighter III: New Generation (1997) | `sfiii` | `b5fe053e` | `fc03925a` | 1, 3, 4, 5 (5 half) | 7 | | Street Fighter III 2nd Impact (1997) | `sfiii2` | `00000000` | `00000000` (dead-cart mode) | 1, 2, 3, 4, 5 | 4 | | JoJo's Venture (1998) | `jojo` | `02203ee3` | `01301972` | 1, 2, 3, 4, 5 (5 half) | 15 | | Street Fighter III 3rd Strike (1999) | `sfiii3` | `a55432b4` | `0c129981` | 1, 2, 3, 4, 5, 6 | 10 | | JoJo's Bizarre Adventure (1999) | `jojoba` | `23323ee3` | `03021972` | 1, 2, 3, 4, 5 | 10 | SIMM 1 and 2 are 8 MiB each (4 chips, program). SIMM 3 to 6 are 16 MiB each (8 chips); a "half" SIMM 5 has 2 chips (4 MiB). No game uses SIMM 7. ## Module shape (proposed) ``` cps3/ machine.py the six rows above; region and NO CD are BIOS properties, not rows board.py CPS3: owns the timeline, the address decode, interrupts; embeds sh2_python.SH7604 cartridge.py SecurityCart: BIOS image, key pair, mode (live key, dead, none), the mask function simm.py Flash29F016A and Simm (4 or 8 chips, byte lanes), the bank register dma.py GLL1: character DMA (three modes and the table), palette DMA with fade, sprite-list latch ppu.py registers, CRTC, sprite list walk, tilemap lines, zoom, the picture buffer (C1) ssu.py the score-screen layer and the 16-voice sound unit io.py inputs, outputs, EEPROM window scsi.py WD33C93 register model, a SCSI CD target disc.py the image reader (open decision 6) ``` The board owns time. It steps the SH7604 one instruction at a time, reads `chip.clock` in its bus callbacks, and schedules VBlank and DMA completion on that clock. ## Speed, frankly **Measured here** (2026-11-12, sh2-python at the pin `8755c3a`, its own `benchmarks/harness_speed.py`: a mixed loop of loads, stores, ALU, `MULS.W`, `STS` and a delayed branch in area 3, cache off, 200,000 steps, best of three, load average ~80 on this shared machine): **160,000 instructions/s on CPython 3.14.4, 252,000 on PyPy 3.11.15.** The core's own record gives 185,000-215,000 (CPython) and 87,000-114,000 (PyPy) at loads 40-60 since its pipeline scheduler landed, against 610,000 and 2.4 M before; it calls the PyPy figure a JIT pathology, not investigated. The chip object has 91 instance attributes, past PyPy's 80. **What real time needs.** The board's CPU never idles: after the game pass it spins through the scheduler until VBlank (DP 3.1). Per frame of 3rd Strike's attract fight, the instruction table (one clock per instruction, which DP shows is right for cached code) charges about 53,700 clocks for the game pass and 24,000 for the VBlank handler (DP table 4, Fightcade column × 8), so about 78,000 instructions of work; the remaining ~16,000 ticks (130,000 clocks) of idle spin are cached code at one to two clocks an instruction, another 65,000-130,000 instructions. **About 140,000 to 210,000 instructions per frame, 8 to 12 M instructions per second.** At 160,000-250,000 per second the CPU alone is **30 to 75 times slower than real time**; one emulated second costs about a minute, before any drawing. Note the trap: an emulator that charges one clock per instruction everywhere (MAME, and this board before M11) executes 419,000 instructions per frame, because the idle spin then gets the whole remaining frame at one clock each. That is 25 M instructions per second, about twice the board's count. The board-cost model (M11) is cheaper to run than the instruction-table model. The plan follows from it: - lockstep against MAME in windows of a few hundred thousand instructions, not minutes; - start from pre-flashed SIMMs, because flashing from CD is 15 to 30 real minutes on hardware; - save states early, so later milestones do not replay the boot; - sprite drawing in Python comes on top (3rd Strike fills most of a 384×224 screen with zoomed 8-bit sprites every frame): draw once per frame from the latched list, not per pixel per access; - raise the PyPy question on sh2-python (core quality of life), not here. ## Floors and rules Python 3.11 floor, PyPy must work, ruff `py311`. Nothing third-party committed. No code copied from a sibling: sh2-python is pinned by commit. Compare pictures at the palette-index or 15-bit colour level, never at RGB.