# Inputs, region, volume and the add-on presence bits All from MAME 0.285 `capcom/cps2.cpp` (tier 5; port layouts "mapped according to the test mode" by Stephh, i.e. checked against each game's own input test screen, which makes the bit positions tier 3 by that check) unless marked. Active low unless stated. ## The three input words | Port | Bits 0-7 | Bits 8-15 | | --- | --- | --- | | `804000` IN0 | P1 right, left, down, up, button 1-4 | P2 right, left, down, up, button 1-4 | | `804010` IN1 | P3 right, left, down, up, button 1-4 (2-player 6-button games: P1 buttons 4-6 in bits 0-2, P2 buttons 4-5 in bits 4-5) | P4 right, left, down, up, button 1-4 | | `804020` IN2 | bit 0 **EEPROM DO (active high)**, bit 1 service/test switch (SW1 on the A-board), bit 2 service coin, bits 3-7 unknown | start 1-4 (bits 8-11), coin 1-4 (bits 12-15); 2-player 6-button games: P2 button 6 in bit 14 | MAME's 14 port layouts and how many of the 323 sets use each (counted from the `GAME` lines): `cps2_2p6b` 182, `cps2_2p3b` 33, `cps2_2p2b` 28, `cps2_4p4b` 27, `cps2_3p3b` 16, `cps2_2p1b` 9, `ecofghtr` 7, `pzloop2` 5, `cybots` 5, `cps2_4p2b` 4, `cps2_2p6bt` 3 (ticket dispenser: IN1 bit 13 "Ticket Empty"), `choko` 2, `qndream` 1 (buttons instead of joysticks), `cps2_1p2b` 1. The board should take the layout as per-game data (a table), not code. ## Special controllers - **Puzz Loop 2** (`pzloop2`): paddles. The game writes `804040` bit 1 (normally coin counter 2) to choose: when set, `804000` reads IN0; when clear, `804000` reads paddle 1 in bits 0-7 and paddle 2 in bits 8-15 (`joy_or_paddle_r`). Stephh: "the paddle can't be tested in the test mode". - **Eco Fighters** (`ecofghtr`): two dials. `804040` bit 8 selects; IN1 bit 4 says whether the dial is enabled; MAME derives a direction bit from successive 12-bit dial readings and folds it into IN0 bits 5 and 13 (`joy_or_paddle_ecofghtr_r`). How the real dial hardware presents rotation is not documented anywhere read (U12): MAME's direction logic is a reconstruction. - **Development DIP switches** `8040B0-8040B2`: three 8-way banks on development hardware only; production boards read `FF` (MAME's "HW_TYPE" configuration). Some games have debug features on them (`sudden-desu.net`, not fetched). ## Outputs at `804040` (low byte) Bit 0 coin counter 1, bit 1 coin counter 2 (Puzz Loop 2: paddle select), bit 3 **Z80 reset release**, bits 4-7 coin lockouts 1-4 (inverted except on Mars Matrix, where MAME notes the lockout sense "seems to" be reversed). High byte: EEPROM ([eeprom.md](eeprom.md)). ## `804030`: volume and what is plugged in Read only. MAME returns one of 40 codes (`F010` ... `E021`) for the digital volume level (A-board SW2/SW3 volume buttons, which MAME polls on a timer), `D000` for the single-board sets (no volume display), `2021` when the network adapter is enabled. Bits: **14 = 0: the extra RAM at `660000` is present; 15 = 0: the network adapter is present** (the comment names SSF2 Tournament Battle as the only known user of both). The encoding of the volume codes is MAME's table; its relation to the TC9185P is not documented (U13). ## Region There is **no region input** on the board: no jumper, no DIP, nothing in the `804xxx` space (MAME's map has none). Each regional release is its own set of program ROMs **and its own key** (176 distinct key files for 322 keyed sets; for example `1944.key` Europe and `1944j.key` Japan share their first 12 bytes and differ in the last 8). The region code the game tests lives in the program; the board only has to load the right ROMs and key. Census by region: [census.md](census.md). ## Inputs the board must model as data Joysticks, buttons, starts, coins, service, test, the EEPROM line, paddles, dials, the ticket line, and three configuration facts per machine: extra RAM present, network adapter present, digital volume present. All belong in the per-game machine table.