NGPC Dev Wiki¶
A developer reference for programming the Neo Geo Pocket Color (NGPC) and its TLCS-900/H CPU: hardware registers, graphics, audio, the CPU/toolchain, and reusable game-programming patterns. Hardware-focused and engine-agnostic — every page documents the machine and the techniques, not any single game or project.
Conventions: addresses are hex (
0x8800), CPU is the Toshiba TLCS-900/H at 6.144 MHz, the display is 160×152 visible with 152 visible scanlines per frame at ~60 Hz.
Hardware¶
- Hardware Registers — Complete register reference: CPU spec table, memory map, timers (prescaler/modes/Timer3-Z80), interrupts (with MicroDMA), OAM, tilemaps, audio, IRQ, and the critical hardware gotchas.
- BIOS — BIOS calls (
SWI), conventions, vectors, register bank 3, and the system library functions.
CPU and Toolchain¶
- TLCS-900/H Reference — High-density CPU reference: registers, ABI / calling convention, data types, memory model, NGPC memory layout, opcode encoding, and the memory-form ALU encoding table.
- Assembly — TLCS-900/H assembly: syntax,
gotchas,
LDIRWpatterns, calling convention. - Build Toolchain — C compiler rules
(C89, far pointers,
volatile, ISR, inline ASM), memory model, the confirmed ABI, known compiler/linker bugs, and the CC900 toolchain internals (pipeline, TAC IR, runtime helpers, assembler/linker syntax).
Graphics¶
- Graphics Overview — The K2GE graphics pipeline at a glance.
- Sprites and OAM — OAM (
0x8800), sprite palettes (0x8C00), metasprites, sprite budget, performance. - Tilemaps and Scrolling — SCR1/SCR2 scroll planes, tilemaps, scrolling, HUD-as-tilemap.
- Colors and Palettes — Color/palette reference, indices, validation notes.
- Effects and Raster — Raster/HBlank effects, palette FX, bitmap mode, text rendering, raster split performance.
- DMA — DMA usage, MicroDMA, raster DMA, performance, pitfalls, and the inline-ASM DMA sequences.
- VRAM Queue — Queued VRAM updates and the
LDIRWcopy contract.
Audio¶
- Audio — Sound hardware, the audio driver, and playback patterns.
Systems¶
- Game Loop — Main loop, VBlank sync, watchdog, frame budget, state-machine patterns.
- Input — Joypad polling, edge detection, menu/game input.
- Storage and Saves — Flash save and RTC, save struct design, and flash hardware pitfalls.
- Collision — AABB and tile collision, shmup patterns, codegen pitfalls.
- Fixed-Point Math — Fixed-point (8.4), LUTs, compression.
- Localization — BIOS language detection (EN/JP), bilingual ROM, string tables, system font.
- Debug Tools — On-device CPU profiler, ring-buffer log, runtime assert.
Pipeline and Patterns¶
- Asset Pipeline — PNG export, compression, runtime loading.
- Gameplay Patterns — State machines, pacing, and genre patterns (shmup, platformer, puzzle, grid, racing, adventure, roguelike/procedural dungeon).
Quick start by task¶
| I want to… | Start here |
|---|---|
| Look up a hardware register or the memory map | Hardware Registers |
| Set up the build / understand the compiler | Build Toolchain |
| Write or read TLCS-900/H assembly | Assembly · TLCS-900/H Reference |
| Draw sprites / scroll a background | Sprites and OAM · Tilemaps and Scrolling |
| Move data fast to VRAM | DMA · VRAM Queue |
| Build a stable main loop | Game Loop |
| Add save support | Storage and Saves |
| Do a raster / HUD split | Effects and Raster |