A cartridge ROM image is what the 68000 sees from address 0; this page is
about everything else the program can address. The first table follows Plutiedev’s memory
map and cartridge-slot pages, with details checked against the Genesis Plus GX emulator’s
source. Sega’s own hardware manuals were not among the sources read, so where this page
says how the console behaves it is describing what the community documents and what an
emulator implements. Addresses are written $ followed by hexadecimal.
68000 address space
The 68000 has 24 address lines, so 16 MiB. The console divides it like this:
| Range | Area | What is there |
|---|---|---|
$000000–$3FFFFF | Cartridge slot | Up to 4 MiB of ROM, the vector table at $000000 and the header at $000100. A cartridge can map more ROM into this range with a mapper; it can also put save RAM here. |
$400000–$7FFFFF | Expansion slot | Used by the Mega CD add-on’s memory. |
$800000–$9FFFFF | 32X memory | Used by the 32X add-on. The console does not acknowledge accesses here itself (see address decoding). |
$A00000–$A0FFFF | Z80 bus | The Z80’s memory seen from the 68000, usable only while the 68000 owns the Z80 bus. See the Z80’s view and Z80 bus control. |
$A10000–$A10FFF | I/O, etc. | The version register and the controller ports: version register, I/O ports. |
$A11000–$A11FFF | Z80 bus control | Bus request at $A11100, reset at $A11200. See Z80 bus control. |
$A12000–$A120FF | Expansion slot extra | Mega CD ports (the whole $A12000–$A12FFF range is reserved for the Mega CD). |
$A13000–$A130FF | Cartridge slot extra | Each access asserts the cartridge’s /TIME line, so a cartridge’s own hardware (mapper, EEPROM, flash) decodes it. See mappers. |
$A14000–$A14FFF | TMSS ports | The Trademark Security System register at $A14000. See TMSS. |
$A15000–$A15FFF | 32X and SVP ports | Reserved by add-ons (32X) and cartridge hardware (the SVP chip). |
$C00000–$DFFFFF | VDP | The video chip’s ports, mirrored every $40 bytes; see below and VDP ports and registers. |
$E00000–$FFFFFF | Work RAM | 64 KiB of RAM at $FF0000–$FFFFFF, repeated through the whole range. The header’s RAM range and the usual initial stack pointer are in it. |
Ranges not listed are not decoded by the console (some are claimed by the Tera Drive:
$AE0000–$BFFFFF). Reading or writing a range that nothing
answers is a hardware matter this page does not cover; Plutiedev notes that an access to
$C00020–$C0003F hangs the console.
The viewer’s Memory map table lists these ranges for the program being disassembled, and the code view names the addresses in the register tables.
VDP port addresses
All VDP ports are mirrored every other word, so that a longword access reaches the same
port twice (the VDP sees two word accesses). For example the control port is at both
$C00004 and $C00006. The whole group repeats every $40
bytes up to $DFFFFF.
| Address | Port |
|---|---|
$C00000 | VDP data port |
$C00004 | VDP control port |
$C00008, $C0000C | VDP HV counter |
$C00010, $C00014 | PSG (sound chip) port, normally written as a byte at $C00011 |
$C00018 | VDP debug address port |
$C0001C | VDP debug data port |
What the ports do is on VDP ports and registers.
Cartridge-slot decoding
The cartridge slot carries the full 68000 address, so a cartridge may answer at any address. For ordinary use only a few signals matter (Plutiedev’s cartridge-slot page):
| Signal | Function |
|---|---|
/CE_0 | Chip enable for $000000–$3FFFFF (follows the state of /CART, below) |
/TIME | Chip enable for $A13000–$A130FF |
/CAS0 | Output enable for $000000–$DFFFFF; not asserted for work RAM |
/UWR, /LWR | Write enables for the upper (even) and lower (odd) byte of a word; both for a word write |
/CART | Pulled low by a cartridge that the console should boot from |
/M3 | Left floating for a Mega Drive game, pulled low for Master System mode |
/DTACK | The console acknowledges the cartridge and expansion ranges itself; for $800000–$9FFFFF, $A15000–$A15FFF and $B00000–$BFFFFF (and others) a cartridge that uses them must pull it low itself. The 32X does this. |
A read always fetches a word and the 68000 picks the bytes it wants.
The /CART line
The console can boot from the cartridge or the expansion slot. /CART chooses:
/CART | Cartridge slot at | Expansion slot at |
|---|---|---|
| Low | $000000–$3FFFFF | $400000–$7FFFFF |
| High | $400000–$7FFFFF | $000000–$3FFFFF |
A bootable cartridge pulls it low. The Mega CD’s backup-RAM cartridges are not bootable and show up at
$400000.
The Z80’s view
The Z80 has its own 16-bit address space, of which the Mega Drive uses these parts
(Plutiedev’s Using the Z80 and Genesis Plus GX’s memz80.c):
| Z80 range | Use | 68000 address |
|---|---|---|
$0000–$1FFF | The Z80’s 8 KiB of RAM. The sound program runs from $0000. Mirrored at $2000–$3FFF. | $A00000–$A01FFF (mirror at $A02000–$A03FFF) |
$4000–$5FFF | The YM2612 sound chip: four byte addresses, address and data for bank 0 and bank 1 ($4000 to $4003), repeated through the range. | $A04000–$A04003 |
$6000–$60FF | The bank register: see Z80 bank register. | $A06000 |
$7F00–$7FFF | The VDP area ($C00000–$C0FFFF on the 68000 side); the sound chip (PSG) is at $7F11. | reached through the 68000’s $C0xxxx |
$8000–$FFFF | A 32 KiB window onto the 68000’s address space, chosen by the bank register. | — |
Facts to know when reading or writing the Z80’s memory (Plutiedev): the Z80 program must run from address
$0000 and fit in 8 KiB; the 68000 must use byte accesses to Z80 RAM (word accesses do not work);
Z80 RAM cannot be reached while the Z80 is in reset or running, so the 68000 requests the bus first; the
YM2612 is on the Z80 bus too, so the 68000 must own the bus to use it. Z80 DMA clashes: a video DMA started while the
Z80 reads the 68000 bus can load garbage on some console revisions (it never happens in emulators), and the usual
workaround is to hold the Z80 bus while a DMA runs.
The Z80 sound program is a block of Z80 code in the ROM that the 68000 copies into Z80 RAM; nothing in the header marks where it is. The viewer therefore disassembles it only where you give its offset and length.
Sources
- Memory map – Plutiedev: the 68000 address-space table and the VDP port list (read in full)
- Cartridge slot – Plutiedev: the signals, standard and advanced decoding,
/CART,/M3, ranges reserved by the Mega CD, 32X and Tera Drive - Using the Z80 – Plutiedev: Z80 RAM at
$A00000, byte accesses, the bus handshake, DMA clash - Hardware issues – Plutiedev: YM2612 status read at
$A04000/$4000, the PSG on the 68000 bus - memz80.c – Genesis Plus GX: how the Z80 map is decoded (
$0000–$3FFFRAM mirrored,$4000–$5FFFYM2612,$6000bank register,$7F00–$7FFFVDP,$8000–$FFFFbanked)
Not from a source read here, so inferred: that the 68000’s $A00000–$A0FFFF window shows the Z80’s $0000–$7FFF at the same low address (Plutiedev gives only $A00000 for RAM and $A04000 for the YM2612, which agree with that).