# Memory and I/O maps The maps below are **MAME 0.285's address maps as the running binary builds them**, dumped with `scripts/mame_maps.lua` (`python -I scripts/mame_trace.py --maps`; raw dumps in `reference/mame/maps/`, git-ignored). That is a closed-box observation (tier 5): it says where MAME puts a device, not what the PAL decoders on the board do, and MAME's handlers are anonymous (`delegate`), so the meaning of each entry comes from the cited document or is marked HYPOTHESIS. The board's PAL equations (M92DOC `.eqn` files for the M92; the M72's PALs are in MAME's sets as dumps only) are the judge for decoding once a milestone needs mirrors and open bus. ## M72 (`rtype`) | Space | Range | MAME kind | Meaning (evidence) | | --- | --- | --- | --- | | program | 00000-3FFFF | ROM | program ROMs, two 16-bit pairs (`-listxml`: even/odd byte ROMs) | | program | 40000-43FFF | RAM | work RAM (i8086-python timing.md) | | program | C0000-C03FF | RAM, share `spriteram` | sprite RAM; MAME's device is a *buffered* sprite RAM (`-listdevices`), copied by a DMA trigger (port 04h, i8086-python timing.md) | | program | C8000-C8BFF, CC000-CCBFF | handler, shares `paletteram1/2` | two palette RAMs; MAME's palette has 512 entries (Lua `machine.palettes`, OBSERVED) | | program | D0000-D3FFF, D8000-DBFFF | RAM read, handler write, shares `videoram1/2` | the two tile layers' video RAM | | program | E0000-EFFFF | handler | a window onto the sound Z80's 64 KB RAM: on R-Type the Z80 has **no ROM** (its program space is one 64 KB RAM, share `soundram`), so the V30 loads the sound program (MAME map, OBSERVED; the mechanism is U5) | | program | FFFF0-FFFFF | ROM | the reset vector, mapped from the program ROM | | I/O | 00-05 read | ports IN0, IN1, DSW | inputs and DIP switches (RTMAN documents the switches) | | I/O | 00, 02, 04, 06-07 write | handlers | sound latch, coin counters / sound reset, sprite DMA trigger, raster interrupt line (i8086-python timing.md) | | I/O | 40-43 | handler | µPD71059C interrupt controller (`-listdevices`: "upd71059c Intel 8259 PIC") | | I/O | 80-87 write | handlers | scroll registers, two words per layer (i8086-python timing.md) | | Z80 I/O | 00-01 | handler | YM2151 | | Z80 I/O | 02 read, 06 write | handlers | sound latch read, interrupt acknowledge (HYPOTHESIS from the map's shape) | ## M72 with MCU (`nspirit`, `bchopper`) As `rtype`, plus: program A0000-A3FFF RAM (work RAM moved), **B0000-B0FFF** a handler shared with the i8751's external data space C000-CFFF (MAME's device list names an `mb8421_mb8431_16` dual-port RAM, OBSERVED), and I/O C0h write (HYPOTHESIS: MCU control). The MCU's program space 0000-0FFF is its 4 KB internal ROM (the `mcu` region in MAME's set, dumped); its data space also has handlers at 0000-0002 (HYPOTHESIS: the sample port, U6). The Z80 side on these sets has I/O 80h-84h for the sample DAC. ## M84 (`rtype2`, `hharry`) Program ROM 00000-7FFFF, work RAM E0000-E3FFF (`rtype2`) or A0000-A3FFF (`hharry`), sprite RAM C0000-C03FF, palettes C8000 and CC000 (or D8000), video RAM D0000-D3FFF and D4000-D7FFF (`rtype2`) or D8000 (`hharry`), write-only registers at B0000, B4000, BC000. The Z80 has its own ROM at 0000-EFFF and RAM at F000-FFFF (MAME map; M84SCH sheet 7 shows a 27512 "SP" ROM on the Z80, DOC). No E0000 window: the main CPU no longer loads the sound program. ## M72 with V35 main (`cosmccop`) ROM 00000-7FFFF, **video RAM 80000-83FFF / 84000-87FFF**, palettes A0000 / A8000, write registers B0000-BC000, sprite RAM C0000-C03FF, work RAM E0000-E3FFF; the V35's internal data area (256-byte RAM and special-function registers 100h-1FFh, VDB91 V35) appears as MAME's `data` space. ## M92 (`gunforce`) | Space | Range | MAME kind | Meaning (evidence) | | --- | --- | --- | --- | | program | 00000-BFFFF | ROM | program ROMs | | program | C0000-CFFFF | ROM | a window into the program ROM (HYPOTHESIS: bank switching, M92DOC `bank_switching.kicad_sch`) | | program | D0000-DFFFF | RAM read, handler write, share `vram_data` | 64 KB video RAM for the tile layers | | program | E0000-EFFFF | RAM | work RAM | | program | F8000-F87FF, F8800-F8FFF | handlers | sprite (OBJ) buffer and palette (M92DOC ic_notes: buffer RAM IC37/38 reached only through IC42, palette RAM IC15/16) | | program | F9000-F900F | write, share `dmacontrol` | sprite/palette DMA control (M92DOC ic_notes: IC42 copies buffer RAM into OBJ and palette RAM) | | program | F9800-F9801 | write | video control (HYPOTHESIS) | | I/O | 00-07 read | P1_P2, COINS_DSW3, DSW, P3_P4 | inputs (M92DOC ic_notes: IC3-IC7, IC12, IC13, IC55 '244 buffers by byte lane) | | I/O | 00, 02 write; 08 read | handlers | sound latch, coin counters; sound status (MAME has `soundlatch` and `soundlatch2`) | | I/O | 40-43 | handler | µPD71059C | | I/O | 80-9F write | handlers | per-layer scroll and control, four 8-byte groups (HYPOTHESIS) | | I/O | C0-C1 write | handler | sound reset (HYPOTHESIS) | | I/O | **FF00-FF7F**, FF80 | RAM `v33_transtable`, read handler | the **V33's address-expansion page registers and XAM** (VDB91 V33: 64 page registers in I/O space at FF00h, XAM read-only status; MAME agrees) | | V35 program | 00000-1FFFF | ROM | sound program (translated, [protection.md](protection.md)) | | V35 program | A0000-A3FFF | RAM | sound work RAM (M92DOC `audio_cpu`: CXK5863 SRAMs) | | V35 program | A8000-A803F | handler | GA20 registers | | V35 program | A8040-A8043 | handler | YM2151 | | V35 program | A8044, A8046 | handlers | sound latch from the V33, reply latch to the V33 | | V35 data | 000-0FF RAM, 100-1FF SFRs | | the V35's internal RAM and special-function registers (VDB91 V35) | ## M107 (`airass`) Program ROM 00000-BFFFF, video RAM D0000-DFFFF, work RAM E0000-EFFFF, **sprite RAM F8000-F8FFF and palette F9000-F9FFF as plain RAM** (no DMA-control share, unlike the M92), the same V33 page registers at FF00h, the same sound side as the M92.