# The I/O chip: controls, keypad, pots and the music processor The chip stays in this board. Its other users are the Bally/Midway arcade boards (Gorf and Wizard of Wor carry two, MAME's `astrocade0`/`astrocade1`: OBSERVED, `mame -listdevices`), all covered here as rows; no other family board uses it, so no `astrocade-io-python` repository is proposed (the chip rule). ## Inputs (SYS 101, 117) - An 8 x 8 switch matrix: an input instruction drives one of the scan lines SO0-SO7 and reads SI0-SI7 (SYS 117). The four hand controls (four directions and the trigger) are ports 10-13; the 24-key keypad is ports 14-17, bits 5-0, one column each. More than one key down gives data to ignore, and the keypad reads wrongly while any hand control switch is closed (SYS 101): the matrix's ghosting is a fact to model, not a bug to fix. - Four pots, converted continuously into an on-chip RAM the Z80 reads at ports 1C-1F (SYS 101, 117). The conversion rate and its timing are **U7**. ## The music processor (SYS 103-104, 119-120) | Block | Rule | Source | | --- | --- | --- | | master oscillator | F_m = 1789 kHz / (port10 + modulation + 1) | SYS 103 | | modulation | port 15 bit 4 = 1: noise, the 8-bit noise word ANDed with port 17; bit 4 = 0: vibrato, alternating between 0 and the 6-bit depth (port 14 bits 5-0) at a rate from port 14 bits 7-6 (00 fastest) | SYS 103, 119 | | tones A, B, C | F = F_m / (2 (port + 1)) | SYS 104 | | volumes | 4 bits each: A port 16 bits 3-0, B bits 7-4, C port 15 bits 3-0; noise into the output when port 15 bit 5 is set, at volume port 17 bits 7-4 | SYS 104, 120 | | outputs | each tone is a square wave between 0 and its volume, through a DAC; the four DACs are summed | SYS 120 | Unknowns: the noise generator's construction (length, taps) (**U8**); the vibrato rates in hertz (**U9**); the DAC curve (**U10**); whether a frequency write restarts a tone's counter (**U11**). The family's sound rule (Aubrey, 2026-11-13: sound may be less exact than pictures) applies; each is a FITTED constant in one table. MAME's `sound/astrocde.cpp` is BSD-3-Clause (Aaron Giles, Frank Palazzolo; `license:` line read 2026-11-26) and would be a lawful comparator for these unknowns. This Phase 0 did not open it: a BSD file is code we may use with its notice, but the board's own rules should come from SYS and the patents first, and MAME's numbers enter only as detector values, cited.