# Inputs, outputs, DIP switches and the EEPROMs All `[mame: cps1.cpp]` unless marked: no hardware-tier source describes the controls beyond the PAL decode of the ports ([memory-map.md](memory-map.md)) and the A-board schematic, which was not read for the connector pin-out (U17). Every input is active low. ## Standard ports | Port | Address | Bits | | --- | --- | --- | | IN1 | `800000` (word) | low byte player 1, high byte player 2: right, left, down, up, button 1, 2, 3, (4: unused on 3-button games) | | IN0 | `800018` high byte | coin 1, coin 2, service coin, -, start 1, start 2, test (service mode), - | | DSWA, DSWB, DSWC | `80001A`, `80001C`, `80001E` high byte | three 8-position DIP banks; MAME returns `FF` in the low byte | | coin control | `800030` high byte (write) | bit 8/9 coin counters 1/2, bit 10/11 coin lockouts 1/2 (active low); bit 15 "CPS-A custom reset?" (U6) | DIP meanings are per game and come from the games' manuals (where MAME cites them) and MAME's port definitions: per-set data, carried as MAME's `PORT_DIP*` tables are, with the source named. ## Extra controls by board | Kind | Sets | How | | --- | --- | --- | | **6-button** (Street Fighter II family) | sf2, sf2ce, sf2hf, clones | buttons 4-6 of both players on IN2, read through the CPS-B window at `800176` (CPS-B offset `36`): decoded by the C-board's C632 PAL, not by the CPS-B `[mame: cps1_config_table in2_addr]` | | **3 players** | mercs, knights | IN2 at offset `36`; a third coin counter/lockout as OUT2 at `34` (C628/C632 PAL) | | **4 players** | captcomm | IN2 at `36`, IN3 at `38`, OUT2 at `34` | | quiz games | cworld2j, qad, qtono2j | IN2 (and IN3/OUT2) at `36`/`38`/`34`: MAME suspects some are "leftover input code from another game" | | **Forgotten Worlds dial** | forgottn and clones (10 sets) | a NEC uPD4701A on the B-board (connector CN-MOWS), decoded by the LWIO PAL: reset X at `800041`, reset Y at `800049` (byte writes), X counter `800052-55`, Y counter `80005A-5D` (low bytes) `[mame: forgottn_map]`. Each player's rotary joystick is a quadrature encoder counted by the 4701's 12-bit up/down counter | | QSound boards | wof, dino, punisher, slammast, mbombrd | IN2 (player 3) at `F1C000`, IN3 (player 4) at `F1C002`, second coin control at `F1C004` (bits 0-3: counters and lockouts 3-4); the DIP positions read fixed values | | CPS Changer | sfzch, sfach, sfzbch, wofch | IN0 carries buttons 5-6 and Select for both players instead of coins (`INPUT_PORTS_START(sfzch)`); DIP banks read `FF` | | Ganbare!, Puchi Monster | ganbare, pmonster | medal games: a hopper (MAME: Puchi Monster "needs hopper emulation", not working) | The uPD4701A is a Forgotten-Worlds-only chip on one B-board: it stays in the board (chip rule). MAME's own `upd4701` device is the detector; NEC's data sheet (not fetched) would be the tier-2 source (U17). ## EEPROMs | Board | Part | Where | Protocol | | --- | --- | --- | --- | | QSound (5 parents, wofch) | 93C46 in **8-bit** mode (128 x 8) | `F1C006`: read bit 0 = DO; write bit 0 = DI, bit 6 = CLK, bit 7 = CS | standard Microwire `[mame: EEPROM_93C46_8BIT]` | | Pang! 3 | 93C46 in **16-bit** mode (64 x 16) | `80017A` through the Mach215 PLD, which switches the serial lines onto the data bus | same bit layout `[mame: init_pang3b, EEPROM_93C46_16BIT]` | | Ganbare!, Puchi Monster | M48T35 timekeeper (32 KiB NVRAM + real-time clock) | low byte of work RAM `FF0000-FFFFFF` | `[mame: ganbare_ram_r/w]` | The 93C46 is also used by CPS-2 (16-bit mode there per the cps2 agent) and by many other boards. It is not a CPU and has more than one user in the family plan; the chip rule allows a shared repository, but it is a few dozen lines: [cps2-sharing.md](cps2-sharing.md) puts it with the other shared pieces (open decision 3). Without its EEPROM contents a QSound game starts from a blank EEPROM and writes its defaults (MAME ships no default EEPROM for these sets: the region is absent from the ROM definitions read). **Pang! 3's code is encrypted** by the Mach215: the low byte of every word in `080000-0FFFFF` is scrambled by a fixed bit permutation and XOR, and the Mach215 must be "kicked" by a read of `80017A` every vblank or it stops decrypting `[mame: init_pang3]`. The board decrypts at load (MAME's function is a fixed 8-bit table) and documents the kick as unmodelled (U18).