# The system ROM, its bookkeeping, backup RAM, the calendar and the memory card The system ROM ("BIOS") is the Neo Geo's operating system: it boots, tests the board, shows the eye-catcher, runs the coin and credit logic, the soft DIPs, the bookkeeping, the slot switching and the memory card for the game, through a table of entry points the game calls. The board emulates none of this; it runs the ROM. This page is what the board must get right for the ROM to work, and what a test can check. Citation keys: **[SNK pN]** PDF page N of `NG.pdf` (paraphrased; never copy); **[CM:L]** `mvstech.txt` line L; **[MAME L]** `src/mame/neogeo/neogeo.cpp` line L; **[MC]** `ng_memcard.cpp`; **[census]** `tests/census/census-2026-11-12.txt`. **[HYPOTHESIS: was wiki Page]**: taken in Phase 0 from that Neo Geo Development Wiki page, set aside on 2026-11-26 out of respect for its main author's objection to AI use; no other source read here states it, so it needs new evidence ([provenance.md](provenance.md), "Author respect"). Gathered on 2026-11-12 by a research pass over these sources, spot-checked against MAME where marked. ## Variants - The ROM's own bytes say what it is: `$C00400` type (0 AES, `$80` MVS), `$C00401` nationality (0 Japan, 1 US, 2 Europe) [HYPOTHESIS: was wiki System ROM]; the ROM copies them to MVS_FLAG and COUNTRY in its work RAM [SNK p50]. - MAME 0.285 lists 16 MVS ROMs by region and revision (Europe `sp-s2` default, `sp-s`; Asia `sp-45`, `sp-s3`; US `sp-u2`, `sp-e`, `sp1-u2`, `sp1-u4`, `sp1-u3`; Japan `vs-bios`, `sp-j2`, `sp1.jipan.1024`, `japan-j3`, `sp1-j3`, `sp-j3`; the "hotel" `sp-1v1_3db8c`), 15 Universe BIOS versions, and for the AES `neo-epo` (Asia), `neo-po` (Japan) and `neodebug.rom` (development) [MAME 2257-2297, 2406-2416], [census]. All are 128 KiB except the MV1C mask ROMs `sp-45` and `sp-j3` (512 KiB). `irrmaze` has its own trackball BIOS `236-bios.sp1` [MAME 8037-8041]. - All 37 are held locally with matching SHA-1s; the AES three only in `roms-retrobat/neogeo/neogeo.zip` [census]. - Regional behaviour differs in coin and start rules (Japan: either chute credits either player; US: chute per player, "continue service" price, the FBI/drug screen; Europe: coins 3/4 with hard DIP 2) and the crosshatch colour at boot [SNK p112]; the colours conflict between sources (C14). - Universe BIOS is a patched MVS ROM that also runs on the AES from 1.3 on [MAME 2196]; that its checksum starts at `$C00086` where SNK's start at `$C00082` is [HYPOTHESIS: was wiki Boot process]. It is a useful detector (region and mode switching, P ROM checksums), not a judge. ## Reset and vectors Reset SSP `$10F300`, reset PC `$C00402` [SNK p29, p34]; MAME's first traced instruction is at `$C00404` ([mame-oracle.md](mame-oracle.md)) because the instruction at `$C00402` is the reset target and the trace logs from the first completed step (to check in M1: U-list). The game's own vector table must point the error vectors at the ROM's monitor stubs `$C00408`, `$C0040E` ... `$C00432` [SNK p29]. ## The boot sequence (MVS, `sp-e`) The whole sequence below is [HYPOTHESIS: was wiki Boot process, System self-test] (the wiki's trace of `sp-e`), except where a step cites another source. Our own MAME trace of the `euro` ROM (`scripts/mame_trace.py`, a closed-box run) is what will replace it. In order: 1. Interrupts off and acknowledged, watchdog kicked, `$4000` to `$3C0006`, LED latches `$FF`, system vectors and board fix/SM1 selected, coin lockouts set. 2. Work RAM: `$5555`, `$AAAA`, then an incrementing pattern, each read back. 3. Backup RAM: with all DIPs on, an endless backup-RAM test; else look for `"BACKUP RAM OK !",$80` at `$D00010`, and if absent test it, clear it, write the signature and default settings, and lock it. 4. Palette RAM banks 0 and 1. 5. VRAM `$0000-$7FFF` and `$8000-$85FF`. 6. Calendar: time the uPD4990A's 1 Hz pulse in frames (below). 7. Checksum: 8-bit sum of the vector bytes and `$C00082-$C1FFFF`, against `$C00080`. 8. Z80: command `$01` must be answered [SNK p78], else "Z80 ERROR" and a stop ([sound.md](sound.md)). 9. Memory card name (`CARD`); clear variables, read the calendar, roll the daily books. The AES ROM tests only when no cartridge is present, and has no backup RAM, calendar or Z80 test [HYPOTHESIS: was wiki System self-test]. Every step is a milestone exit: the board passes when the real system ROM reaches the game without an error screen, and the **diagnostics BIOS** (pinned in `tests/test_roms/`) gives a second, more talkative opinion on the same hardware. ## The cartridge header [SNK p30-31]: | Offset | Contents | | --- | --- | | `$100` | `"NEO-GEO"`, then system version 0 at `$107` | | `$108` | NGH number, BCD (`$0000` forbidden) | | `$10A` | P ROM size (long) | | `$10E`, `$112` | pointer to and size (at most `$1000`) of the game's backup block | | `$114` | eye-catcher: 0 the ROM draws it, 1 the game does, 2 none | | `$115` | upper byte of the sprite tile numbers the ROM's logo uses | | `$116`, `$11A`, `$11E` | soft-DIP layouts for Japan, US, Europe | | `$122`, `$128`, `$12E`, `$134` | `JMP`s to `USER`, `PLAYER_START`, `DEMO_END`, `COIN_SOUND` | | `$182` | pointer to the security ("recognition") code [SNK p31]; that the ROM compares it word by word with its own copy is [HYPOTHESIS: was wiki 68k program header] | `USER` is entered with SR `$2700`, the game's vectors, sound command `$03` already sent, the fix cleared and sprites hidden; `USER_REQUEST` (`$10FDAE`) says why: 0 initialise, 1 eye-catcher, 2 demo or game, 3 title with the MVS forced-start countdown [SNK p34-35]. A game returns through `SYSTEM_RETURN` (`$C00444`) and calls `SYSTEM_IO` (`$C0044A`) once a frame. ## Entry points the ROM offers [SNK p44-49]: `$C00438` SYSTEM_INT1 (the ROM's own vblank), `$C0043E` SYSTEM_INT2, `$C00444` SYSTEM_RETURN, `$C0044A` SYSTEM_IO, `$C00450` CREDIT_CHECK, `$C00456` CREDIT_DOWN, `$C0045C` READ_CALENDAR, `$C00462` SETUP_CALENDAR (both return at once on the AES), `$C00468` CARD, `$C0046E` CARD_ERROR (C15: one SNK page says `$C00462/$C00468`), `$C00474` HOW_TO_PLAY, `$C004C2` FIX_CLEAR, `$C004C8` LSP_1st, `$C004CE` MESS_OUT, `$C004D4` CONTROLLER_SETUP. The ROM's variables live at `$10F300-$10FFFF`: `$10FD80` SYSTEM_MODE, `$10FD82` MVS_FLAG (0 home), `$10FD83` COUNTRY, `$10FD94-$10FDAB` the four players' input blocks, `$10FDAE` USER_REQUEST, `$10FDAF` USER_MODE, `$10FDB4` START_FLAG, `$10FDD2-$10FDD8` the date and time [SNK p50-56]. Nothing in the board depends on these, but the debugger and the tests do: they are how a test knows "the game reached `USER` with request 2". A game's vblank handler must kick the watchdog, acknowledge `$3C000C` and call `SYSTEM_IO` (about 300 µs, registers not saved) [SNK p46], or jump to `SYSTEM_INT1` while SYSTEM_MODE bit 7 is 0 [SNK p44]. ## The eye-catcher The ROM draws the eye-catcher when header byte `$114` is 0, with sprites from the bank in `$115` [SNK p28, p31], and asks the Z80 for the jingle with command `$02` [SNK p78, p216]. The details (58 tiles, `$xxFF` blank, "MAX 330 MEGA / PRO-GEAR SPEC" from fix banks 0-1, the SNK logo from fix bank 2, palette 15 faded) are [HYPOTHESIS: was wiki Eyecatcher, Boot music]. It is the first picture every boot shows, so it is milestone M3's first picture test. ## Soft DIPs and bookkeeping Soft DIPs: a 16-byte title, four special entries (two time values, a count, a continue count), up to ten choice bytes (high nibble default, low nibble count), then the 12-byte strings; copied to `$10FD84-$10FD93` on entry to `USER`; the AES always uses the defaults [SNK p38-43]. ## Backup RAM (MVS only) 64 KiB at `$D00000`, mirrored to `$DFFFFF` [MAME 1739], two battery-backed 32 KiB SRAMs [CM:29], write-locked by latch bit 6 (`$3A000D` lock, `$3A001D` unlock); MAME drops writes while locked [MAME 1049-1053]. Reserved for the system ROM [SNK p26]. Layout (`sp-s2`) [HYPOTHESIS: was wiki Backup RAM; a MAME closed-box run's saved NVRAM will check it]: signature at `$D00010`; coin edge data and counter `$D00020-$D00025`; credits `$D00034`; settings `$D0003A-$D00048`; clock `$D0005A`; date `$D00104`; the slot table (NGH and block per slot) `$D00124-$D00143`; soft DIPs for eight games at `$D00220`; their names at `$D002A0`; the games' own backup blocks, `$1000` each, from `$D00320`; the books `$D08320-$D0A49F`. The board persists the 64 KiB as one file per machine (git-ignored `*.nv`). ## The calendar: uPD4990A With its own 32.768 kHz crystal [CM:60-62, 71]; that it is wired in serial mode (C0-C2 and CS/OE tied high) is [HYPOTHESIS: was wiki UPD4990], consistent with MAME driving only DATA IN, CLK and STB. `$380051` write: bit 0 DATA IN, bit 1 CLK, bit 2 STB; `$320001` read: bit 7 DATA OUT, bit 6 TP [MAME 956-961, 1849-1857]. Each CLK rising edge shifts DATA IN into a 4-bit command register; in shift mode the 48-bit time register (sec, min, hour, day in BCD; month << 4 | weekday; year BCD) shifts out LSB first on DATA OUT; STB rising executes the command. Commands: 0 hold (DATA OUT = 1 Hz), 1 shift, 2 set time and hold, 3 read time, 4-7 TP at 64/256/2048/4096 Hz, 8-B TP every 1/10/30/60 s, C/D/E interval reset/run/stop, F test (NEC's command set as MAME's `upd1990a.cpp` implements it). The boot test sets a 1 s TP and counts frames between falling edges: fewer than 57 or more than 64 gives "CALENDAR ERROR"; if TP never toggles the ROM hangs on the crosshatch ("calendar freeze", a code oversight) [HYPOTHESIS: was wiki Boot process, Calendar freeze]. **Needs new evidence (2026-11-26):** the 57-64 window was M1's exit figure and no other source we hold states it (MacDonald names only the chip and its crystal [CM:60-62, 71]). What would settle it, cheapest first: (1) a closed-box MAME 0.285 run of the `euro` system ROM under `scripts/mame_trace.py` through the calendar test, reading the frame count and the two compare values the executed instructions use from the trace (OBSERVED; a short trace, one process); (2) the same run with the emulated TP period lengthened and shortened until "CALENDAR ERROR" appears, which bounds the window by behaviour (OBSERVED); (3) the board's own M1 run, once it exists, against (1). Until then M1's exit asks only that the test passes at the nominal ratio (1 Hz against the board's own frame rate), which needs no window. Post-1998 games read the calendar as part of a slot check and fail if the month is above 13 [HYPOTHESIS: was wiki Slot check security]. The calendar must run in **emulated** time against the frame rate in any case (MAME's device counts emulated time), with the wall-clock date only as its power-on value. The chip is used by other arcade boards in MAME; in the family only this board would use it today, so it stays in-board (chip rule; open decision). **Pin gap:** `scripts/pinned_repos.json` sparse-checks `src/devices/machine/upd4990a.*`, which does not exist; the device is `upd1990a.cpp`. The research read it from another local MAME tree (`../mame-nes-theklap`), a fork of a different version. Fix the sparse path in M1. ## The memory card JEIDA V3 SRAM card, 8-bit on D15-D8 (enabled by /UDS), in a 4 MiB window at `$800000-$BFFFFF`, bank `$380011` bits 2-0, 2 wait states [SNK p11-12], [CM:283], [MAME 1068-1090]. Detection on `$380000` bits 5-4 (00 = inserted), write protect bit 6. Writes need latch bits 2 = 0 and 3 = 1 (`$3A0005` and `$3A0017`); latch bit 4 (`$3A0009`) selects attribute memory [SNK p11], [MAME 1984-1985, MC]. SNK's own card is 2 KiB [CM:328-329], [SNK p12]; that the system ROM handles 2-16 KiB cards is [HYPOTHESIS: was wiki Memory card]; MAME loads only 2 KiB images and always reports the card writable [MC], [MAME 1063-1068]. The ROM's card format: 64-byte blocks, a header block, a directory (sub-number, NGH, first block), two FATs, the first 20 bytes of each save a title; `CARD` commands 0-7 and errors `$80-$85` [SNK p71-77, p124]. Games must never require a card [SNK p104]. Which machines have a slot (MAME's table [MAME 160-172] and rows [2023-2112]): AES yes; MV-2F on board; MV-1, MV-4, MV-6 by header; MV-1F, MV-1FZ, MV-1A/B/C none.