# The boot ROM and the flash Sources: MAME 0.285's romset descriptions (`mame -listxml dc dcjp dceu dcdev dctream`), Comstedt *syscalls*, *ip.bin*, KOS `flashrom.h`, `syscalls.h`, and the census (census.md). Nothing of Sega's is in this repository, and nothing may be: the player's own images are identified by SHA-1. ## The boot ROM (2 MB at 00000000) - Versions MAME names (all 2,097,152 bytes): v1.004 (Japan, `mpr-21068`), v1.01c, v1.01d and v1.022 (World: `mpr-21871`, `mpr-21931`, `mpr-23588`), a Chinese hack of v1.01d (not Sega's), and six development-box (`dcdev`, HKT-0120) images: Katana Set5 v0.41 and v0.71 checkers, v0.972, v0.976, v1.001 (Japan), v1.011 (World). One world ROM serves every region: the region comes from the flash (below). - What it does, as far as we know without Sega's documents: hardware setup (the BSC, Holly), the boot animation, the system menus (file manager for VMUs, CD player, settings, Set Date/Time on first boot), the disc check (it reads IP.BIN, checks the licence-screen code byte for byte, the area symbols, and on GD-ROMs a security exchange with the drive that CD-Rs fail: gdrom.md U21), loading the boot file, and **system calls** that stay resident for games: the GD-ROM driver ("gdc"), flash access (`FLASHROM_INFO`, `_READ`, `_WRITE`, `_DELETE`), the boot-ROM font (`ROMFONT_ADDRESS`, `_LOCK`, `_UNLOCK`, vector 8C0000B4), system information (`SYSINFO_INIT`, `_ICON`, `_ID`) and the rest of Comstedt *syscalls*' list (KOS `syscalls.h` wraps the same calls). - MAME runs v1.01d to its Set Date/Time dialog by frame 600 (frame 300 shows only the background) with an empty flash and NVRAM (mame-oracle.md). ## The flash (128 KB at 00200000) - KOS `flashrom.h` partitions: system (factory settings, read-only, 8 KB), reserved (8 KB of zeros), a block-allocated partition (16 KB), game settings (block-allocated, 32 KB), a second block partition (64 KB). The factory partition holds the console's region and broadcast standard (which is how one world boot ROM knows it is a US or a PAL console: KOS's `flashrom_get_region()` returns Japan, US/Canada or Europe from it; how the boot ROM uses it is to read), the block partitions the user settings (language, sound, date) and network settings. - MAME's factory images: USA NTSC, Japan NTSC, Europe PAL and a PAL alternate, and the Treamcast's. A used console's flash differs from every factory image (its settings blocks change), so the board must accept any 128 KB flash and must not identify flash images by SHA-1 alone: the BIOS pack in our library holds a `dc_flash.bin` that matches none of MAME's (census.md). - The flash chip's command protocol (erase, program; MAME: Fujitsu MBM29LV002TC) is the standard JEDEC-style sequence for that part (to confirm from Fujitsu's data sheet if found: U24). The BIOS writes it when the user changes settings. ## For the board - Machine rows by region: `dc-us` (v1.01d or v1.022 with the USA flash), `dc-jp` (Japan flash; v1.004 optional), `dc-eu` (PAL flash), each naming the boot ROM and the factory flash by SHA-1; the flash file is the player's and is written back (save state names it by hash at load time). - No high-level BIOS in the specification (open decision 4 in the brief and gdrom.md): the boot ROM is the program that tests the board, as the System Card is for pcenginecd-python and the boot ROM for saturn-python.