# Memory map, I/O map, interrupts, timer, pads, backup memory Keys as in [start-here.md](start-here.md). U and C numbers are the brief's. ## Memory (DOC: PGN "PCFX Memory Map"; T15 "Memory Map") | Range | What | | --- | --- | | 00000000-001FFFFF | 2 MB RAM. 0000-7FFF is the BIOS's work area (pad state at 0000-00C7, interrupt vectors at 7FC0-7FFF, font addresses at 7F20-7F37, the RAM size at 7F5C: T15); programs load at 8000 (PGN) | | 00200000- | more RAM on expanded units (T15: "Additional RAM is assigned to 0x00200000") | | 80000000-8FFFFFFF | the I/O ports again, as memory (PGN: "I/O address 0 is memory address 80000000h"; T15 says 80000000-80FFFFFF "Ports Write": C6) | | 80700000-807FFFFF | EXTIO ROM, an expansion boot ROM: "PC-FX EXTIO Boot" at 807FFFC0, its entry vector at 807FFFDC (T15, "probably") | | A0000000-AFFFFFFF | **read** ports 304h (HuC6261), 404h (VDC A), 504h (VDC B), 604h (KING), one 64 MB window each (T15) | | B0000000-BFFFFFFF | the same four ports for **writes** (T15) | | E0000000-E7FFFFFF | internal backup RAM, 32 KB, every second byte (PGN, T15) | | E8000000-EFFFFFFF | external backup memory (FX-BMP), 8 MB window; EA000000 the BMP battery bit (PGN) | | F8000002-FFEFFFFF | PIO (T15; PC-FXGA's backup goes through it) | | FFF00000-FFFFFFFF | BIOS ROM, 1 MB; FFF00000/04 reset entries (EXTIO bootable or not), FFF00008 the system-function vector, FFF0000C the font vector, FFFFFD00 the debugger vector, FFFFFE00 the interrupt table, FFFFFFF0 the reset entry (T15) | The A/B windows let a program reach a chip's data port with a plain load or store at any address in the window, so a block move can stream into VRAM or KRAM. ## I/O map (DOC: T15 "I/O Map"; PGN "I/O Map") | Ports | Chip | | --- | --- | | 000-0FF | pads (port 0 control/status 000, data 040; port 1 at 080/0C0) | | 100-1FF | HuC6230 SoundBox | | 200-2FF | HuC6271 Rainbow | | 300-3FF | HuC6261 | | 400-4FF, 500-5FF | HuC6270 A, HuC6270 B | | 600-6FF | HuC6272 KING | | 700-7FF | unknown ("ExBusReset?", T15; "Miscellaneous Onboard Register", PGN): U19 | | C00-C43 | "HuC6270 (#0 & #1)" (PGN only): U22 | | C80-C83 | backup memory access control (bits 0-1 "External/Internal access control?", T15) | | CC0-CC3 | gate array version register (PGN only): U23 | | E00-EFF | interrupt controller | | F00-FFF | timer | | 500000-5FFFFF | HuC6273 Aurora (PC-FXGA only) | Each chip is a register-select port plus 16-bit data ports (KING also a 32-bit status), accessed with IN.H/OUT.H or IN.W/OUT.W. MAME's boot run wrote 87,399 and 102,890 times to the two VDCs' ports and 131,144 to the KING's in 600 frames of the BIOS (OBSERVED). ## Interrupt controller (DOC: T15 "Interrupt") Eight sources on PC-FX levels 8-15: 15 HuC6273, 14 VDC B, 13 KING, 12 VDC A, 11 pad, 10 "EX (?)", 9 timer, 8 reset. **Level-triggered**: a source stays asserted until its chip is acknowledged. Registers: mask E40h (bit 0 = level 15 ... bit 7 = level 8), priority E80h (levels 12-15) and EC0h (levels 8-11), 3 bits each, "correspond to the V810 interrupt levels on INTV0-INTV3". So each source is given a V810 level 0-7 by software; how ties and the mapping to INTV work exactly is U15. The vectors are in ROM, but the BIOS forwards through RAM vectors at 7FC0h + level x 4 (T15). ## Timer (DOC: T15 "Timer") Control F00h (interrupt enable, run, pending), period F80h, counter FC0h. It counts once per 15 CPU clocks (698.4128 ns: consistent with a 21.47727 MHz clock); a new period takes effect at the next reload. ## Pads (DOC: PFI "FX_Controllers", MEASURED traces; T15 "Pad") Two ports, each a hardware-driven **32-bit serial scan** in both directions; the top nibble identifies the device (15 pad, 14 multitap, 13 mouse, 0 none). The pad has six buttons, Run, Select, the d-pad and two mode switches (bits 12 and 14). The bits are inverted between the wire and the register (pull-ups; PFI). The mouse's layout differs between the sources (C4): PFI (with traces) puts X in bits 15-8, Y in 7-0, the right button in bit 16 and the left in 17; T15 has Y at bit 0, X at bit 8, left at 16, right at 17. PFI wins (tier 1 traces over tier 3 translation). The multitap answers on successive scans (up to 5). Scan timing comes from PFI's traces (U17 for the exact figures, to read off the images). ## Backup memory (DOC: T15 "Backup Memory"; PFI "FX-BMP") 32 KB internal SRAM (supercapacitor-backed) and the FX-BMP card (128 KB as sold; "designed to allow for cartridges up to 2MB", verified with a 2 MB test cartridge, FAT12, or FAT16 for 1-2 MB: PFI "FX-BMP"), both on odd or even bytes only ("only uses every second byte", PGN); halfword access is needed "for all the data to come through" (T15). A FAT-like file system with 128-byte sectors, "PCFXSram"/"PCFXCard" labels, and a "PCFXBOOT" record that lets the BIOS boot from the BMP (T15; PFI documents the format and which games use it). The board keeps both as battery files; the access-control register C80h is U18.