Introduction
A .ngp or .ngc file is a copy of the ROM in a cartridge for the SNK Neo Geo Pocket (1998, monochrome) and
Neo Geo Pocket Color (1999). The two extensions name the same format: .ngp is customarily used for monochrome games and
.ngc for colour ones, but the mode is in the file, not in the name (the two public-domain homebrew ROMs read for this page, Snake and Fractal, are colour games named .ngp).
The program it holds runs on a Toshiba TLCS-900/H (the TMP95C061) at 6.144 MHz; a Zilog Z80 plays the sound.
There is no header added by the dumping tool. The first 64 bytes of the file are SNK’s header: a licence line, the address where the CPU starts, the game’s catalogue number, the mode and the name. Many games follow it with a table of 18 interrupt handler addresses.
Structure
The console maps the cartridge at 0x200000 (a second 2 MiB at 0x800000 for a 4 MiB cartridge), so the file’s first byte is at the address 0x200000 and the
header’s start address names a place in the ROM (0x00200089 in Snake). See the memory map.
0x00licence text “ LICENSED BY SNK CORPORATION” (or “COPYRIGHT BY SNK CORPORATION”)28 bytes0x1Cstart address, little-endian4 bytes0x20catalogue number and sub-catalogue2 + 1 bytes0x23mode:0x00monochrome,0x10colour1 byte0x24game name, ASCII12 bytes0x30reserved16 bytes0x40interrupt handler table (not in every ROM)72 bytes- after the headerthe program and datavaries
The viewer
The explorer opens .ngp and .ngc files (and any file whose bytes 0x09 to 0x1B read “ BY SNK CORPORATION”, the test the RACE emulator makes). It shows the header field by field,
the handler table with the first instruction of each handler, the memory map, the system calls, the register names, and the code disassembled for the TLCS-900/H from the start address, with
the I/O and video registers, the BIOS variables and the handlers named. The options bar offers the mode, the load address, the entry point, a Z80 program to disassemble (file offset and size: the header does not say where the sound
program lies), the number syntax and the bank names.
Not described
The header, the memory map and the BIOS and interrupts are written. What remains:
Known
- The header layout and the meaning of its fields, read from two real ROMs and from the RACE emulator’s checks.
- The interrupt handler table of Snake and how its start-up code uses it; the 18 interrupts in the order RACE’s replacement BIOS uses.
- The address map as the RACE emulator models it, and the system calls it implements.
Unknown
- A real SNK BIOS image was not read: the system call numbers beyond the ten RACE implements, and the addresses of the real BIOS routines, are not given. The first call in the header table is the one RACE’s authors needed, not SNK’s full list.
- Commercial ROMs: none was found on this machine, so the viewer was tested on the two homebrew ROMs and on built files. The
COPYRIGHT BY SNK CORPORATIONspelling and the catalogue-number conventions of retail games are from the RACE emulator’s test and the brief, not from a ROM. - Flash save data, how a cartridge’s save flash is laid out, and the K2GE graphics (tiles, sprites, palettes) are not decoded: later work.
- The Z80 sound program: the viewer disassembles a Z80 program you point at; it does not find it. It was not tested on a real sound driver.
- The viewer was not run in a browser by its author; it follows no jumps (every byte is decoded as an instruction) and does not separate code from data.
Links
Software
- RACE – the Neo Geo Pocket emulator whose source (
tlcs900h.c,main.c,race-memory.c) this page and the decoder were checked against - NGPC emulator – RACE compiled to WebAssembly, on emulators.org, which runs the two homebrew ROMs
Reference
- NgpCraft developer reference – an unofficial Neo Geo Pocket Color developer reference (not used for facts: it contradicts itself in places)
- TMP95C061 data sheet – Toshiba, the CPU (named, not read in full)