# Keyboard, joysticks, cartridges and the BIOS ## Keyboard (BORIS 1.2 and App. A; VG003 ch. II sec. 5) - Enable the scanner with P1.2 = 0 (P1.3 and P1.4 high). Write a row number to P2.0-P2.2; read P2: P2.4 = 0 means a key is down in that row, P2.5-P2.7 give its column. - Rows 0-5 by 8 columns: `0-7`; `8 9 . . SPC ? L P`; `+ W E R T U I O`; `Q S D F G H J K`; `A Z X C V B M .`; `- * / = YES NO CLR ENT` (BORIS App. A). The reset key is wired to the 8048's reset and cannot be read. - P2.0-P2.3 are also the upper address lines A8-A11 during external fetches, so the scan works "only through the BIOS" (BORIS): a cartridge fetch would disturb the row select. The board must model the port's pins as the 8048 drives them during /PSEN cycles (U15). - The G7400 keyboard and the French AZERTY layouts differ (MAME has separate input ports); which matrix positions change is U16. ## Joysticks (BORIS 5.0) With P1.3 = P1.4 = 1 and P1.2 = 0, P2.0-P2.2 = 0 puts the right stick on the bus, P2.0-P2.1 = 0 and P2.2 = 1 the left; `INS A,BUS` reads bit 0 up, 1 right, 2 down, 3 left, 4 fire (active level per BORIS's routine: 0 = pressed, to check, U15). Like the keyboard, only code in the internal ROM can read the bus this way, because a cartridge fetch would drive the bus at the same time. "The system did not have a well defined player 1 or player 2 controller" (the MiSTer core's README; games differ). ## The cartridge port (BORIS 2.0) 30 contacts: `~WR` (disabled when P1.6 = 1), GND, +5 V, E (external RAM enable), `~PSEN`, A0-A9, A11, T0 (pin 1), DB0-DB7, P1.4 (pin 11), P1.1 (pin 12), P1.0 (pin 13), and pin B (the G7400's blanking control, see videopac-plus.md). **A10 is not wired**: the internal ROM occupies 000h-3FFh, so a cartridge sees 400h as its first byte. Derived, to be checked against VG003: with `SEL MB1` (A11 = 1) the 8048 reaches C00h-FFFh as the cartridge's second kilobyte, so a 2 KB cartridge appears as 1 KB at 400h-7FFh and 1 KB at C00h-FFFh. ## Cartridge types (MAME 0.285 software list `videopac.xml`, CC0-1.0) | MAME slot device | Entries | ROM | What it is | | --- | ---: | --- | --- | | `o2_rom` | 187 | 2, 4, 8 KB | plain ROM; P1.0 (4 KB) or P1.0 + P1.1 (8 KB) select banks (BORIS 2.0) | | `o2_rally` | 4 | 16 KB | Videopac+ titles (Trans American Rally, Air Battle, Neutron Star, Helicopter Rescue); its own bank scheme (U17) | | `o2_4in1` | 3 | 4 KB + an external ROM ("XROM": 4 in 1 Row, 4 en 1 Ligne, Musician) | data read from a separate ROM (U17) | | `o2_ktaa` | 1 | 12 KB | Soren Gust's KTAA homebrew (three banks) | | `o2_voice` | 1 | none + speech ROMs | The Voice (the-voice.md) | | `o2_test`, `o2_testpl` | 1 + 1 | 2 KB, 8 KB | Philips's Service Test Cartridges (G7000, G7400) | | `o2_chess` | 1 | 2 KB + 8 KB exrom | C7010 Chess Module (NSC800) | | `o2_homecomp` | 1 | 2 KB + 16 KB exrom | C7420 Home Computer Module (Z80) | The `b_pin` feature (47 entries) marks cartridges that leave pin B ungrounded. Programs written to the BIOS of one region misbehave on another ("on the real console you can still play them, just with more glitches", the list's own header), so a cartridge never selects the machine row: the player does. ## The BIOS (one 1 KB ROM per row, inside the 8048) Identified by SHA-1 only (census.md); never fetched, copied or committed. Firmware listings (the commented disassembly on Boris's site; any listing in VG003) are not read (the 2026-11-25 L5 rule). What the board needs is only the interface the cartridges use, which documents state as facts: - Reset: the BIOS jumps to 400h (the cartridge's first instruction); external interrupt vector at 402h, timer interrupt at 404h, VBL service at 406h, after SELECT GAME at 408h, VBL continuation at 40Ah (BORIS 6.1). The MAME trace shows the first three instructions: 000h `jmp 400h`, a cartridge's `jmp 2C3h` (SELECT GAME), and so on (docs/mame-oracle.md). - On the G7400, `plusselectgame` continues in bank 1 rather than bank 3 (GUST 14.2). No free replacement BIOS is known to exist for this console. Writing one would be its own project (open decision 6).