# Boot, the CD check and flashing ## What the BIOS is The 512 KiB flash in the security cartridge. The CPU resets into it: PC `00000400`, SP `02080000` `[ran]`. It is a complete program with its own C runtime (date formatting tables are in it), a SCSI and ISO 9660 reader, a flash programmer for four manufacturers' chips, a bitmap loader and a developer utility. The text below was read from decrypted BIOS images `[rom, ran]`. | BIOS | Build date in the image | Notes | | --- | --- | --- | | `sfiii_euro` | Jan 29 1997 | messages in English, Spanish, Portuguese; names bitmaps `GALS.BMP`, `TIT2.BMP`, `TIT20.BMP`, `TIT10.BMP`, `TOMO.BMP`; volume label `CAP-SF3-0`; "15~20 min. to load" | | `jojo_asia_nocd` | Nov 28 1998 | the later BIOS family | | `sfiii3_euro`, `sfiii3_japan_nocd` | Apr 09 1999 | "SECURITY CASSETTE UTILITY MENU Ver 2.00" | | `jojoba_euro_nocd` | Sep 02 1999 | | Regions named in the 1997 image: DEVELOP, HISPANIC, BRAZIL, OCEANIA (and others not listed by the string scan). ## The sequence, as far as it was observed `[ran]` on MAME 0.285 ([mame-oracle.md](mame-oracle.md)), `[rom]` for the strings, `[mame]` and `[man]` for the operator's view: 1. Reset at `00000400`: set up the stack, clear RAM (an early fill loop at `00000E7C`), program the bus controller and the cache (CCR `10` then `11` `[board]`), write the SS registers and CRTC values, probe `05000A20/24`, `05000C10-18`, `05150000`. 2. (Inferred from the messages, not traced.) Identify the SIMMs: read flash IDs, compare what is populated against what the game needs ("There is not enough memory installed on the PCB"). 3. (Inferred.) Compare the SIMM contents with the game the cartridge expects (a checksum; the utility menu lists "QUICK CHECKSUM" variants). 4. **NO CD BIOS, or SIMMs already hold the right game:** jump to the program in SIMM 1 through the vector table at `06000000` (PC `06001660` for Red Earth). `redearthnr1` is executing at `060018xx` one emulated second after reset, and shows the game's region warning at eight `[ran]`. A game/date/region boot screen was reported by the first session of this phase; no snapshot taken here shows it (1.5 s and 4 s are black) and the decrypted Red Earth BIOS has no such string, so it is not claimed. 5. **CD BIOS with blank or different SIMMs:** start the SCSI drive, read the volume, load the bitmaps and show "A New CD-ROM has been inserted. Do you wish to rewrite the game? ... push PLAYER1 SHOT1 button ... If you wish to cancel, push PLAYER1 SHOT2 button". `sfiii` with empty flash reaches this screen within 8 emulated seconds, with the bitmap background drawn `[ran]`. 6. On SHOT1: erase, write and checksum each SIMM from the CD's files ("ERASING...", "WRITING...", "CHECKSUM...", "Please do not turn the power off"), then boot the game. 7. With the SIMMs already written and no disc in the drive, the operator is asked to insert the CD and can continue with button 1 `[mame]`. A developer path exists in the 1999 BIOS: "PUSH 1P START TO MENU" leads to a utility with flash operations per SIMM (erase all, overerase restore, write test, checksums, "PROGRAM SIMM COPY", "DMA SOURCE SIMM COPY"), a disk browser (dump, eject, device information), and "EXECUTE AS MACRO" on a CD file. "THIS SECURITY CASSETTE IS NOT PRODUCT VERSION" is one of its messages. How it is entered on a production cartridge was not established (U5). How long flashing takes: "15~20 min" by the 1997 BIOS's own text, "25-30 minutes" by MAME's notes, and the 1999 BIOS computes an estimate ("Approximately Min. Sec.") (C6). ## The CD `[ran]` `cap-sf3-3.chd` extracted with `chdman` (one MODE1/2352 track, 22,792 frames, 53.6 MB; no audio): an ISO 9660 volume labelled `CAP-SF3-3`, created 1997-02-04, ten files in the root. | File | Bytes | What it is | | --- | --- | --- | | `10` | 8,388,608 | SIMM 1: equal, byte for byte, to `sfiiin`'s four chip images interleaved (chip `.0` is the most significant byte of each longword) | | `30` | 8,388,608 | SIMM 3, first half: chips `3.0`/`3.1` byte-interleaved (4 MiB), then `3.2`/`3.3` | | `31` | 8,388,608 | SIMM 3, second half: `3.4`/`3.5`, then `3.6`/`3.7` | | `40`, `41` | 8,388,608 each | SIMM 4, the same way: `4.0`/`4.1` then `4.2`/`4.3`; `4.4`/`4.5` then `4.6`/`4.7` | | `50` | 4,194,304 | SIMM 5: `5.0`/`5.1` | | `90`, `91` | 7,222 and 5,174 | Windows BMP, 128×48 and 128×32, 8 bits per pixel | | `92`, `93` | 87,094 each | Windows BMP, 384×224, 8 bits per pixel: the loading screens | So a file name is the SIMM number and a half index, and the content is the flash image the program will see. The program data on the CD is the encrypted form (it equals the chip images). **How this was checked** (2026-11-11 for `10`, `30`, `31`, `50`; repeated for all six data files on 2026-11-12): `chdman extractcd` of `cap-sf3-3.chd` to a raw BIN (git-ignored `trash/`); a throwaway standard-library script read the ISO 9660 primary volume descriptor and root directory from the 2,048-byte user data of each 2,352-byte sector, extracted every file, and compared it with the chip images of MAME's non-merged `sfiiin.zip` (Asia 970204 NO CD): `10` against `simm1.0`-`simm1.3` interleaved one byte from each chip per longword; `30`, `31`, `40`, `41`, `50` against chip pairs interleaved one byte from each chip per 16-bit word, two pairs per file. All six are equal byte for byte. `92` and `93` are the same bitmap (same SHA-1). So for the New Generation disc, **pre-flashed SIMMs can be built from the CD's files without emulating the flashing**: split each file by byte lane into its chips. That the BIOS of a CD set then accepts those SIMMs as already written is not checked (step 7, U7). Only this one disc was opened. The other ten game discs are consistent in size with the same pattern ([census.md](census.md)) but were not opened (U6). ## The practical choice: boot from CD, or start from flashed SIMMs | | From CD and flash | From pre-flashed SIMMs | | --- | --- | --- | | Needs | the SCSI controller, a CD target, ISO files, the flash command set under real BIOS use, the bitmap screens | SIMM images in memory | | Cost in pure Python | the BIOS writes up to 80 MiB byte by byte with status polling: hours | none | | Sets it serves | all 34 CD game sets | the 18 NO CD sets directly; every CD set too, by building the SIMM images from the CD's files | | What it tests | SCSI, flash, the BIOS's whole loader | nothing of those | **Recommendation:** start from flashed SIMMs. For NO CD sets load the chip images from the set. For CD sets, build the same chip images from the CD's files with the lane split above, and store them as the board's flash state. Then the CD-set BIOS finds the right game already in the SIMMs and boots it; whether it insists on a disc being present first is step 7 and needs a minimal drive that answers "not ready" (U7). Keep "boot a blank board from the CD and flash it" as its own late milestone, run once per BIOS family, with the flash write cost made tolerable by a checked fast path. MAME does the same in effect: NO CD sets load chip images; CD sets start blank and keep the flashed result in its `nvram` directory (44 MB for Red Earth). ## The bootleg sets `cps3boot` and seven relatives are replacement BIOS images and multi-game CDs, for a cartridge with a stock SH-2 (no encryption) or for a dead cartridge (zero-key mode). They are present locally. They are aftermarket software, useful for milestone 0 (a BIOS with no cipher) and as evidence about dead-cartridge behaviour, not targets.