The console sees at most 4 MiB of cartridge ROM ($000000–$3FFFFF; see the memory map). A cartridge with more, or with save RAM sharing that range,
carries a mapper: hardware on the cartridge that decides which part of its ROM shows in which part of the range, set by the program writing to the cartridge’s own registers in
$A130xx. A ROM image file holds the whole ROM, so a file over 4 MiB can only be read by knowing the mapper. Sources are Plutiedev, Bart Trzynadlowski’s SSFII notes and Genesis Plus GX’s
source; no real cartridge or Sega document was used.
The Sega mapper (Super Street Fighter II)
The only official game that uses it is Super Street Fighter II: The New Challengers, a 5 MiB cartridge (Plutiedev; Trzynadlowski). The ROM is cut into 512 KiB pieces (Plutiedev calls them pages) and the console’s 4 MiB is cut into eight 512 KiB areas (banks). Each bank but the first has a register that says which page shows in it:
| Register | Bank (68000 addresses) | At power-on (page shown) |
|---|---|---|
| none (fixed) | $000000–$07FFFF | page 0, always: the vectors and the header are here so the game can start |
$A130F3 | $080000–$0FFFFF | page 1 |
$A130F5 | $100000–$17FFFF | page 2 |
$A130F7 | $180000–$1FFFFF | page 3 |
$A130F9 | $200000–$27FFFF | page 4 |
$A130FB | $280000–$2FFFFF | page 5 |
$A130FD | $300000–$37FFFF | page 6 |
$A130FF | $380000–$3FFFFF | page 7 |
The register is written with a byte; the value is the page number (Trzynadlowski: six bits, bits 7 and 6 always 0, so up to 64 pages; Genesis Plus GX uses the value shifted left 19 bits as the ROM offset,
masked to the ROM size). The “page 1 to 7 at power-on” column is the arrangement that makes the first 4 MiB look normal, which Plutiedev recommends writing at the start of a program
(move.b #1,($A130F3) … move.b #7,($A130FF)), and which Genesis Plus GX applies on reset; no source read states the real cartridge’s power-on state.
Examples (Trzynadlowski): writing 1 to $A130FF makes page 1 ($080000–$0FFFFF of the file) show at $380000–$3FFFFF; writing 8 to $A130F9
makes the first 512 KiB of the part of the ROM beyond 4 MiB show at $200000. The game’s own start-up checksum adds up the first 4 MiB and then maps pages 8 and 9, the last 1 MiB of the ROM, into
$300000–$3FFFFF.
Reading the registers is not described by any source read (Trzynadlowski saw none). The mapper is on the cartridge, not the console. The Z80 sees the cartridge through its own window, so changing a bank the Z80 reads from needs the Z80’s cooperation; Plutiedev suggests keeping sound data in a bank that does not change.
How an emulator knows
The ROM does not say. Genesis Plus GX picks this mapper when the domestic name in the header contains SUPER STREET FIGHTER2; homebrew uses the system type SEGA SSF instead (below).
Emulators that go by the ROM size or by the first write to a register also exist (Plutiedev). This site’s viewer does not guess: for a file over 4 MiB it shows the first 4 MiB as one linear block, and the
SSF2 bank to show option disassembles a chosen 512 KiB page at a chosen window address.
The SRAM switch ($A130F1)
A cartridge with battery RAM puts it at $200000 by convention, which is where ROM would be in a 4 MiB cartridge, so the RAM must be switched in and out. The register at $A130F1 is a byte:
| Bit | Meaning |
|---|---|
| 0 | 0 = the ROM shows at $200000, 1 = the RAM shows there (Plutiedev: write 1 to unlock, 0 to lock again; Genesis Plus GX maps the RAM when bit 0 is set). |
| 1 | Write protect: 1 = the RAM cannot be written (Trzynadlowski and Genesis Plus GX; Plutiedev’s recipe leaves it 0). |
Plutiedev’s way to save a game: write 1 to $A130F1, read or write the RAM, then write 0. The RAM is on odd bytes only: $200001, $200003, … up to
$20FFFF, which gives 32 KiB; Sega used to warn against using the first and last of those bytes. The header must also announce the RAM (extra memory).
A ROM larger than 2 MiB loses its upper part to the RAM while it is switched in, so the code that touches the RAM must run from the lower 2 MiB or from RAM (Plutiedev). Games known to switch RAM and ROM this way are
named in Genesis Plus GX’s comments (Phantasy Star IV, The Story of Thor / Beyond Oasis, Sonic 3 & Knuckles) and Trzynadlowski believes SSFII writes 0 to the register at start-up (ROM, writable).
The extended SSF mapper (flash cartridges)
Plutiedev: homebrew that wants more than 4 MiB sets the header’s system type to SEGA SSF (padded with spaces) and uses the same registers as above; this turns the mapper on in the Mega Everdrive, Mega SD,
BlastEm and probably others. The maximum size depends on the chip used and emulators may have limits. The Mega Everdrive’s own document for the extension (Krikzz’s “extended_ssf.txt”) could not be read
for this page. In Genesis Plus GX’s implementation of this mapper, any write to $A130xx decodes the bank from address bits 3–1, so $A130F1 selects the bank at $000000 as well as the
odd registers selecting the others (the first bank is therefore not fixed there); the file extension and size are not used. For a cartridge that none of its special cases claims, the same emulator’s default handler for the
/TIME range sends a write below $A13060 to the multi-game mapper (below), a write to $A130F0–$A130F1 to the SRAM switch, and any write above $A130F1 to
this register-per-bank mapper; the comments say this makes some patched or homebrew ROMs work.
Other values of the system type that switch behaviour on emulators and flash cartridges are in the system type table. A header can also say SEGA EVERDRIVE or SEGA MEGAWIFI.
What else lives in $A130xx
Every access to $A13000–$A130FF asserts the cartridge’s /TIME line, so any cartridge hardware may decode it. Plutiedev lists the known uses:
| Addresses | Used by |
|---|---|
$A13000–$A1300F | Private use (Pier Solar’s custom mapper and EEPROM access are here; do not put anything reusable there) |
$A130C0–$A130CF | Mega Wifi |
$A130D0–$A130E7 | Mega Everdrive |
$A130E8 | Proposed for EEPROM, not yet standardised |
$A130EC–$A130EF | 32X signature |
$A130F0–$A130FF | The Sega mapper (above) |
Other mappers
Many unlicensed and special cartridges have their own mappers. Genesis Plus GX implements the ones below, each chosen by text in the header or by a checksum; what follows is the behaviour its source describes in comments and code, not a hardware description.
| Mapper | How Genesis Plus GX selects it | What it does |
|---|---|---|
Multi-game “64 × 64 KiB” (default for writes below $A13060) | Any cartridge that writes there | A write to $A130xx sets the first bank: all 64 areas of 64 KiB show consecutive 64 KiB pieces of the ROM starting at piece (low six bits of the write address). The source names pirate multi-in-one cartridges, A Bug’s Life, King of Fighters ’99, Pocket Monster and Rockman X3 as its users. |
| SF-001, SF-002, SF-004 | Header software type contains SF and the product number 001, 002 or 004 | Registers in the cartridge area itself rather than $A130xx: SF-001 has a cartridge-disable bit (6), an SRAM-and-ROM bank-switch bit (7) and a lock bit (5); SF-002 maps $000000–$1BFFFF over $200000–$3BFFFF when bit 7 of a written byte is set; SF-004 decodes the register from address bits 11–8 and has a bit 7 that maps 32 KiB of static RAM. Not described further here. |
| T-5740xx | Product number contains T-5740 | A cartridge with an SPI EEPROM and its own banking. |
| Realtec, Radica, Super Mario World 64, Flashkit-MD, SGDK flash-save, Mega SD, Sonic & Knuckles lock-on and others | Checksums or header text | Named in Genesis Plus GX’s md_cart.c; not described on this site. |
What the viewer does
The viewer disassembles the first 4 MiB as one block. For a ROM over 4 MiB it adds the option SSF2 bank to show: you pick a 512 KiB page (numbered from 0 at file offset $000000) and the window (1 to 7) it appears
in, and that page is disassembled as if the register for that window held its number. It reads no bank registers from the code, does not detect other mappers and does not model SRAM switching; the
Memory map and Hardware registers tables list the names above.
Sources
- Going beyond 4MB – Plutiedev: pages and banks, the register table, the
SEGA SSFsystem type, the Z80 warning (read in full) - Saving progress with SRAM – Plutiedev: the
$A130F1switch, odd-byte RAM, games over 2 MiB (read in full) - $A130xx area usage – Plutiedev: the table above (read in full)
- SSFII Genesis technical information – Bart Trzynadlowski, second edition (26 July 2000), a Wayback Machine copy (the original site has expired): the registers, the page number, the
$A130F1bits and the checksum routine (read in full) - md_cart.c – Genesis Plus GX: how mappers are chosen,
mapper_sega_w,mapper_512k_w,mapper_ssf2_w, the multi-game mapper and the SF mappers (read the parts named) - Cartridge slot – Plutiedev:
/TIMEand the cartridge’s signals