# The Namco customs: five MB88xx chips and the bus controller that feeds them Namco's "custom" I/O and sound parts of 1981-1983 are, with one exception, Fujitsu MB88xx microcontrollers with a mask ROM and a Namco part number printed on top. The exception is the **06xx**, which is not an MCU at all but the bus controller that carries bytes between the main Z80 and up to four of them. Sources for this page: MAME `src/mame/namco/namco{06,50,51,52,53,54}.cpp` and `.h`, `namco/galaga.cpp`, `namco/polepos.cpp`, at `master` fetched 2026-09-12 (BSD-3-Clause, copyright-holders Aaron Giles and Mike Harris; the pin diagrams below are restated from the ASCII art in those files' own headers, which is Namco hardware fact). The Galaga-specific protocol detail is **not re-derived here**: it is taken from `../emu-galaga`'s `docs/custom-io.md` and `docs/sound-hardware.md`, which were written from the same MAME sources plus measurements of a running board, and which that project's Rust implementation reproduces byte for byte against a MAME trace. Where this page says "emu-galaga measured", that is the citation. **No ROM bytes appear in this repository.** The hashes below are MAME's `ROM_START` values and are identifiers, not content. ## At a glance | Part | MCU | Program | Size | CRC32 | SHA-1 | Role | | --- | --- | --- | ---: | --- | --- | --- | | 50xx | MB8842 | `50xx.bin` | 2,048 | `a0acbaf7` | `f03c79451e73b3a93c1591cdb27fedc9f130508d` | score / bonus-life protection | | 51xx | MB8843 | `51xx.bin` | 1,024 | `c2f57ef8` | `50de79e0d6a76bda95ffb02fcce369a79e6abfec` | coin, credit, start, joystick I/O | | 52xx | MB8843 | `52xx.bin` | 1,024 | `3257d11e` | `4883b2fdbc99eb7b9906357fcc53915842c2c186` | sample player | | 53xx | MB8843 | `53xx.bin` | 1,024 | `b326fecb` | `758d8583d658e4f1df93184009d86c3eb8713899` | input multiplexer, 8 modes | | 54xx | MB8844 | `54xx.bin` | 1,024 | `ee7357e0` | `01bdf984a49e8d0cc8761b2cc162fd6434d5afbe` | noise generator | | 06xx | *(not an MCU)* | — | — | — | — | 4-slot bus controller with NMI pacing | The 50xx is the only 2 KB program, and the only MB8842. Everything else is a 1 KB program on a 1 KB part. ## Which board has which From the `machine_config` functions in the two drivers. Every MCU on every board runs at 1.536 MHz (see [timing.md](timing.md)). | Game (parent set) | Driver function | 06xx slots 0 / 1 / 2 / 3 | | --- | --- | --- | | **Galaga** (`galaga`) | `galaga_state::galaga` | 51xx / — / — / 54xx | | **Bosconian** (`bosco`) | `bosco_state::bosco`, **two** 06xx | 06xx_0 (48 kHz): 51xx / — / 50xx_1 / 54xx
06xx_1 (6 kHz, on the sub CPU): 50xx_2 / 52xx / — / — | | **Xevious** (`xevious`) | `xevious_state::xevious` | 51xx / — / 50xx / 54xx | | **Dig Dug** (`digdug`) | `digdug_state::digdug` | 51xx / 53xx (read only) / — / — | | **Pole Position** (`polepos`) | `polepos_state::polepos` | 51xx / 53xx (read) / 52xx (write) / 54xx (write) | | Pole Position II (`polepos2`) | `polepos2_state::polepos2` | as `polepos` | | `topracern`, `polepos2bi`, `grally` (bootlegs) | `topracern`, `polepos2bi` | 51xx only, no other custom | Clone sets follow their parent. `gallag`, `nebulbee`, `xevios`, `battles2`, `dzigzag` and `gatsbee` are bootlegs whose configurations drop or replace customs; `battles` substitutes a Z80 for the 51xx entirely. A MAME code search (`gh api search/code`, 2026-09-12) finds `NAMCO_50XX` … `NAMCO_54XX` referenced in exactly two drivers, `namco/galaga.cpp` and `namco/polepos.cpp`, plus the device files and the two audio files. That is the whole population. ## 06xx bus controller Not an MB88xx. It matters here because it is what raises /IRQ on the MCUs, and a core that is stepped without it will never see an interrupt. Two registers on the main CPU's bus (Galaga: `0x7000`-`0x70ff` data, `0x7100` control). The control byte is: | Bits | Meaning | | --- | --- | | 3-0 | chip selects for slots 0-3; several may be set at once | | 4 | direction: 1 = read (the selected chip drives), 0 = write | | 7-5 | clock-divider exponent *n*; transfer clock = 06xx clock / 2ⁿ; **0 stops everything** | With a non-zero divider the 06xx runs a timer at twice the divided clock and alternates two phases. On the active phase it asserts NMI to the main CPU **and the chip select of every selected slot**; on the idle phase it clears both. One byte moves per transfer-clock period: the CPU's NMI handler reads or writes the data window while the selected chip sees its /IRQ. Reads return the bitwise AND of all selected slots, with `0xff` from an empty one. **The chip select is the MCU's /IRQ.** That is the whole interface from the MB88xx side: a byte arriving is an external interrupt, and the handler reads the byte off K and R0. Galaga's traffic, as emu-galaga measured it: control `0x71` (divider 2³, 6 kHz, read) for 3 bytes from the 51xx; `0xA1` (divider 2⁵, 1.5 kHz, write) for 4 bytes to the 51xx; `0xA8` (same rate, slot 3) for 12 bytes to the 54xx; `0x10` written after every transfer to stop the timer. ## 51xx — MB8843, coin and input manager 42-pin part, so every port exists. `namco51.cpp` binds K, all four R ports, O and P. | MCU port | Dir | Wiring (Galaga) | | --- | --- | --- | | K0-K2 | in | command bits 2-0 of the byte the 06xx latched | | K3 | in | 06xx R/W line (1 = the CPU wants to read) | | O0-O7 | out | the 8-bit reply byte, returned through the 06xx data window | | R0, R1 | in | `IN0` bits 3-0, bits 7-4 | | R2, R3 | in | `IN1` bits 3-0, bits 7-4 | | P0-P3 | out | start-2 lamp, start-1 lamp, coin counter 2, coin counter 1 | | /IRQ (pin 4) | in | 06xx slot-0 chip select | | /TC (pin 8) | in | **screen vblank** — the only Namco use of the timer pin | | /RESET (pin 3) | in | LS259 misc latch bit 3, shared with the 54xx and both sub-Z80s | Because the command arrives on K0-K2, commands and their arguments are **3-bit values**: 0 nop, 1 set coinage (four argument bytes), 2 enter credit mode, 3 disable joystick remapping, 4 enable it, 5 enter switch mode, 6 and 7 nop. Reads return a repeating 3-byte sequence whose contents depend on the mode; commands 2 and 5 restart the sequence. The full reply table, the direction-code lookup, the coin/credit rules and the frame-delay pipeline are in emu-galaga's `docs/custom-io.md`, fitted from its `oracle/reference/game-2400` run and **not** restated here, because a core that runs `51xx.bin` derives all of it. Pole Position wires the same chip differently: R0/R1 carry `DSWB` and R2/R3 carry `IN0`. Dig Dug and Xevious follow Galaga. Worth noting for a core: the 51xx is the one Namco part that uses the external timer clock. Its program enables PIO bit 6 and counts vblank falling edges on /TC. A trace of 2,500 Galaga frames shows it taking 7,140 external interrupts and **no** timer or serial interrupts at all — so it polls VF with `TSTV` rather than vectoring on it. See [mame-oracle.md](mame-oracle.md). ## 54xx — MB8844, noise generator 28-pin part: no P port, no serial, and R is only R0-R10. | MCU pin | Dir | Wiring | | --- | --- | --- | | K0-K3 (24-27) | in | command bits 4-7 (the **high** nibble of the byte) | | R0-R3 (12,13,15,16) | in | command bits 0-3 (the low nibble) | | O0-O3 (4-7) | out | sound output channel 0 | | O4-O7 (8-11) | out | sound output channel 1 | | R4-R7 (17-20) | out | sound output channel 2 | | R8, R9 (21,22) | out | the two RNG bits, **not connected on the board** | | R10 / /IRQ (23) | in | 06xx slot-3 chip select | | /RESET (3) | in | LS259 misc latch bit 3 | The two O-port channels are the dual-4-bit PLA mode described in [start-here.md](start-here.md): one `OUTO` writes channel 0 when CF = 0 and channel 1 when CF = 1. A trace tells them apart by the carry bit and nothing else — see [mame-oracle.md](mame-oracle.md), where every one of 76,295 `OUTO` executions in a 2,500-frame Galaga run had CF set, i.e. every one went to channel 1. Command format, high nibble first: `0x` nop, `1x`/`2x`/`5x` play sound type A/B/C, `3x`/`4x` load four parameter bytes for A/B, `6x` load five for C, `7x` set type-C volume to *x*, `8x`-`Fx` nop. What the parameter bytes mean is not documented anywhere; it lives in `54xx.bin`. That is precisely why this project exists. The three 4-bit outputs feed a discrete R-2R-ish ladder and three band-pass sections; the network, its component values and MAME's `dst_op_amp_filt` coefficients are in emu-galaga's `docs/sound-hardware.md`. Pole Position uses the same chip for the tyre screech; Bosconian for the shoot sound and explosions; Xevious for explosions. ## 50xx — MB8842, score/protection 28-pin part, 2 KB program. Bosconian uses it fully (it keeps the score and decides bonus lives); Xevious only for a start-up protection check. | MCU pin | Dir | Wiring | | --- | --- | --- | | K0-K3 (24-27) | in | command bits 4-7 | | R0-R3 (12,13,15,16) | in | command bits 0-3 | | O0-O7 (4-11) | out | the 8-bit answer | | R8 (21) | in | R/W from the 06xx (1 = read, 0 = write) | | R10 / /IRQ (23) | in | 06xx chip select | | R9 / /TC (22) | — | not connected | Commands (from `namco50.cpp`'s header): `0x` nop, `1x` reset scores, `2x` + 3 bytes set first bonus score, `3x` + 3 bytes set interval bonus, `4x` unknown, `5x` + 3 bytes set high score, `60`/`68` select player 1/2, `70`/`7x` switch to increment/decrement. MAME binds `read_k`, `read_r<0>`, `read_r<2>` and `write_o`. R-port #2 is lines R11-R8, so `read_r<2>` is where the R/W line on pin 21 is read: the device's `R2_r` returns the stored R/W state in bit 0, which is R8. ## 52xx — MB8843, sample player 42-pin part, and the only one of the five that uses the serial pin and both timer clock sources. | MCU port | Dir | Wiring | | --- | --- | --- | | K0-K3 | in | command (which sample to play; 0 = none) | | O0-O7 | out | sample ROM address bits A8-A15 | | R0-R3, R4-R7 | in | sample ROM data D0-D7 | | R8-R15 (ports 2 and 3) | out | sample ROM address A0-A7 | | P0-P3 | out | the 4-bit sound output | | SI | in | **a fixed level**: 0 on Bosconian, 1 on Pole Position, selecting whether O4-O7 are address lines or active-low chip enables | | /TC | in | a 555 astable on Bosconian, ground on Pole Position | | /IRQ | in | 06xx chip select | The SI pin here is a strapping option read as a serial data input, not a serial port in use; the 52xx is why MAME's serial model refuses to consume a bit while SF is set. ## 53xx — MB8843, input multiplexer 42-pin part. K1-K3 are three MOD bits that select one of eight interpretations of the four input ports; O0-O7 is the 8-bit result; P0-P3 are four chip-select outputs. Pole Position hard-wires mode 0 (steering clocks and direction on P0/P1, DIP switches on P2/P3); Dig Dug drives the MOD bits from its misc latch and uses mode 7. Read-only from the 06xx's point of view: `namco53.cpp` binds a chip select and a read, no write. ## What a host must provide, minimally, to run `51xx.bin` and `54xx.bin` 1. **The 06xx as line events, not byte events.** The MCU needs the chip select edge on /IRQ, the R/W line (51xx K3), and the latched byte split across K and R0. A byte-level model that "delivers a command" will never enter the MCU's interrupt handler. 2. **/RESET as a level from the game's LS259 latch**, not a power-on pulse. 3. **/TC from vblank** for the 51xx. 4. **Port callbacks with the PLA mask honoured** for the 54xx, or channel 0 will be clobbered by every channel-1 write. 5. Nothing else. The MCUs have no bus, no shared memory and no DMA.