# Controllers and memory cards (SIO0), and SIO1 Sources: psx-spx `controllersandmemorycards.md`, `serialinterfacessio.md` at `6d7d1bc` (tier 3); psxdev `wiki_eng/controller.md`, `sio.md`, the Sanyo memory-card MCU data sheet in `docs/` (tier 2); spicyjpeg/ps1-bare-metal (MIT) for a controller example. ## SIO0 (DOC psx-spx) 1F801040h data, 44h status, 48h mode, 4Ah control, 4Eh baud. Two ports selected by /DTR (two pins, port A and B: psxdev cpu.md), a shared clock and data, and an **/ACK** line from the device after each byte; the kernel's baud is ~250 kHz (psx-spx); the device pulls /ACK "within the first 2-3 us (100 cycles) of the last SCK pulse", and the kernel waits about 100 cycles before acting, so "emulators can't trigger IRQ7 immediately" (psx-spx). IRQ7 on byte received with /ACK. ## Devices - Digital pad (ID 5A41h), analog/DualShock (73h/53h modes, configuration commands 40h-4Fh, vibration), mouse, NeGcon and racing wheels, GunCon (reads GPU timing through the controller port with an 8 MHz counter, psx-spx), Konami Justifier (IRQ10), multitap (psx-spx describes ~15 more devices). First milestone: **digital pad + memory card**, then DualShock (many late games need its analog mode), then the rest. - Memory card: 128 KB flash in 1024 frames of 128 bytes, commands Read (52h), Write (57h), Get ID (53h), the FLAG byte, checksums; the BIOS's directory format (psx-spx "Memory Card Data Format"); file images `.mcr`/`.mcd` (raw 128 KB). Write timing (the card answers slowly while writing) matters to the BIOS's timeouts (U1). ## SIO1 The serial port (1F801050h), absent on PSone. Link cable games only; low priority. ## Modelling level **Byte transactions** with per-byte timing (baud rate x 8 bits + the /ACK delay) on the CPU's clock, inside the CPU domain (domains.md): too fine and too CPU-coupled to be worth its own domain. ## Unknowns - U1 Memory card write busy times (the Sanyo MCU's flash timing; data sheet, untested). - U2 /ACK delay distributions per device.