How the Genesis read its games.
We start from the very beginning — how a chip can hold a game as nothing but frozen 1s and 0s — assuming you know nothing about memory. Once the vocabulary is solid, we open up a Sega Genesis (Mega Drive) cartridge and the Motorola 68000 that reads it: the board, the memory map, the header, region locks, mappers, battery saves and the famous lock-on trick. Then we follow the ROM into an emulator. Thirteen modules, each with live simulations so you can watch every idea, not just read it. No game data ships with this page; every ROM you'll see is synthesised in your browser.
ROM media
Mask ROM versus RAM, the address and data bus, chip-select timing, and why the 68000 is big-endian — the universal vocabulary of memory, explained from zero.
The Genesis cartridge
The board and edge connector, the 68000 memory map, the ROM header, TMSS & region locks, mappers & bank switching, battery saves, and lock-on.
Emulating the cartridge
How Genesis Plus GX and BlastEm turn a .bin/.md file back into a cartridge: header detection, mapper detection and save files.
ROM media from zero
This first part is pure fundamentals — nothing about any specific console yet. It's how every read-only memory works, whether that's the chip in a Genesis cartridge, an old arcade board, or the BIOS on a PC. We build the vocabulary one word at a time — bit, byte, address, data, bus, chip-select, big-endian — and you can watch each idea run live in a simulation. If a term is ever used before it's explained, that's a bug; tell us. Everything in Parts II and III is just these four ideas wired together.
What a ROM is
A Genesis game is not a program that lives “inside the console.” It lives inside the cartridge, in a single chip called a ROM — Read-Only Memory. Picture that chip as an enormous grid of tiny cells, each holding one bit: a single 1 or 0, stored as the presence or absence of a connection etched into the silicon at the factory. Group eight bits and you have a byte — a number from 0 to 255. A Genesis cartridge is, at heart, a few million of those bytes, frozen in place and never changing again.
The word that matters most is read-only. The pattern of bits was pressed into the chip when it was manufactured — this style of chip is a mask ROM — and nothing the console does can alter a single one of them. Contrast that with RAM, Random-Access Memory, the console's scratch pad: the 68000 can write to RAM freely, but it forgets everything the moment you switch off. The division is the whole architecture of a cartridge machine — the unchanging game lives in cartridge ROM, the changing state (where Sonic is standing, how many rings you have) lives in console RAM.
A mask ROM is a printed book: the words were set in ink at the printers and are identical in every copy, forever — you can read any page instantly but you cannot change a letter. RAM is the blank notebook beside it: you scribble, erase and rewrite as much as you like, but close the cover (cut the power) and it's blank again next time. The console reads the book and works in the notebook. The cartridge is the book.
Addressing: how you ask for a byte
How does the console get one specific byte out of millions? Every byte in the ROM has a numbered slot, its address — byte 0, byte 1, byte 2, and so on. To read, the console places an address onto the chip's address lines (a set of wires, one per bit of the address), and the chip responds by driving the byte stored there back out on its data lines. There is no searching and no waiting for a mechanism to move — any byte is reachable in the same tiny sliver of time as any other, which is exactly what random access means. Give it an address, get back a byte. That's the entire contract of a ROM, and everything else in this course is built on it.
The lab below is that contract made visible. A little 256-byte ROM sits in the middle as a grid of cells. Set an address on the red address lines — by hand, or let it sweep like a CPU walking through memory — and watch the matching cell light up and drive its byte onto the blue data lines. Nothing moves, nothing wears; the same address always returns the same byte, because the byte was baked in at the factory and can never change.
- A Genesis game is stored as fixed bits in a cartridge mask ROM — set once at the factory, unchangeable forever.
- ROM is read-only and permanent; RAM is read/write but forgets on power-off. Game in ROM, running state in RAM.
- Every byte has an address; you read by placing the address on the address lines and taking the byte off the data lines.
- “Random access” means any byte is reachable equally fast — no seeking, no moving parts.
The address & data bus
Module 01 showed a chip answering an address. Now let's see the wires that carry the question and the answer. A bus is just a shared bundle of wires that several devices connect to. The Genesis's main processor — a Motorola 68000 — talks to the cartridge, the RAM and the video chip over two of them: the address bus and the data bus.
The address bus carries the number of the location the CPU wants. The 68000 has a 24-bit address bus, which means 224 = 16,777,216 distinct addresses — a 16 MB space. (Internally the chip works with 32-bit registers, but only 24 of those bits reach the outside world.) The data bus carries the actual value to or from that location, and it is 16 bits wide: the 68000 is a 16-bit machine on the outside, moving two bytes at a time. One number of wires sets how much you can address; the other sets how much you move per trip.
Think of memory as a warehouse of numbered bins. The address bus is the slip you hand the clerk with a bin number written on it — 24 bits of slip means 16 million possible bins. The data bus is the conveyor that brings the bin's contents back — 16 bits wide, so it carries two bytes per trip. A wider slip means more bins you can name; a wider conveyor means more you can haul each time. The two are independent, and the 68000 chose 24 and 16.
One read, as a handshake
A single read isn't instantaneous — it's a short, strict
conversation timed by the CPU's clock, using a few extra
control signals.
The 68000 first puts the address on the bus and pulls a wire called
/AS (Address Strobe) low to announce “this address
is valid.” It signals a read by holding R/W high,
and uses /UDS and /LDS (Upper/Lower Data
Strobe) to say whether it wants the upper byte, the lower byte, or
both of the 16-bit word. The addressed device — the ROM, say —
decodes the address, drives its data onto the data bus, and pulls
/DTACK (Data Transfer ACKnowledge) low to say
“here it is.” The CPU latches the word and releases the
strobes. That five-beat dance happens millions of times a second,
for every instruction and every byte of every sprite.
The lab runs exactly that handshake in slow motion. Pick a target —
a word in the cartridge, in work RAM, or a video-chip port — and
step or run the cycle. Watch the address travel from the 68000 to
the device, the control strobes light up in order, and the 16-bit
data word travel back, acknowledged by /DTACK. That is
the atom of everything the console does.
- A bus is shared wiring; the 68000 uses an address bus and a data bus to reach every device.
- The address bus is 24 bits → a 16 MB space; the data bus is 16 bits → two bytes moved per access.
- A read is a timed handshake: address + /AS out, data strobes assert, the device drives data and answers with /DTACK.
- Every instruction and asset the console touches is built from millions of these little cycles.
Reading a chip
A bus is a shared set of wires, and that raises an obvious danger. The ROM, the RAM and the video chip are all wired to the same 16 data lines. If two of them tried to drive those lines at once — one pushing a wire high while another pulls it low — you'd get a short and garbage data. So every chip on the bus must stay politely silent until it, and only it, is spoken to. Two tiny control pins arrange that.
The first is chip-select, usually written /CS (the leading slash means “active-low” — the chip is selected when this pin is pulled low). Some external logic, the address decoder, watches the upper address bits and pulls exactly one chip's /CS low per access. An address in the cartridge range selects the ROM; an address in the RAM range selects the RAM; nobody else stirs.
The second is output-enable, /OE, and it controls the chip's mouth. A chip can be selected yet still not driving the bus; only when /OE goes low does it actually connect its outputs and push the byte out. When /OE is high, the outputs sit in a special third state — neither high nor low but high-impedance (“hi-Z”), electrically disconnected, letting go of the wires entirely. That hi-Z state is the secret to sharing: an unselected chip isn't fighting for the bus, it has physically released it.
Everyone is on the same line, so everyone keeps muted by default. The moderator (the address decoder) un-mutes exactly one person for each question: /CS is being un-muted, and /OE is that person actually beginning to speak. Everyone else stays in high-impedance silence, hands off the wires, so the single speaker is heard cleanly. No moderator, and it's just noise.
Access time: the ROM's one performance number
From the moment a valid address and /CS/OE arrive, a mask ROM takes a
small but non-zero time to settle its outputs to the correct byte —
its access time,
quoted in nanoseconds (Genesis-era mask ROMs were commonly around
150–200 ns). The console's bus timing has to allow at least that
long before it latches, which is precisely what /DTACK
from Module 02 is negotiating. A slower chip simply asks the CPU to
wait a beat longer. Nothing here is exotic — it's the reason the
handshake exists at all: the wires are instant, but the silicon at
the far end needs a moment to answer.
- Many chips share one data bus, so all but one must stay electrically silent at any instant.
- /CS (chip-select) picks which chip responds; the address decoder pulls exactly one low per access.
- /OE (output-enable) connects the selected chip's outputs to the bus; unselected chips sit in high-impedance, hands off the wires.
- A ROM's access time (~150–200 ns) is the settling delay the bus handshake (/DTACK) must respect.
Endianness & words
The data bus is 16 bits, so the 68000 naturally thinks in units bigger than a byte. A byte is 8 bits; a word, in 68000 terms, is 16 bits (two bytes); a longword is 32 bits (four bytes). Addresses, jump targets and the header fields you'll meet in Module 07 are mostly words and longwords. But the moment a value spans more than one byte, a question appears that has started real arguments between real engineers: which byte goes first?
Take the 32-bit value $53454741. It's built from four
bytes: $53, $45, $47,
$41. When you store it at some address, do you put the
most-significant byte ($53) at the lowest
address, or the least-significant one ($41)?
The first choice is called big-endian;
the second is little-endian.
The Motorola 68000 is big-endian: the big end goes
first, at the lowest address — exactly the order we write numbers on
paper. This is not a small footnote; it is baked into every
multi-byte number in every Genesis ROM.
Endianness is the byte-level version of an argument you already know: is today 2024-01-31 (year first, biggest unit first) or 31/01/2024 (day first, smallest unit first)? Neither is “wrong” — but if a writer and a reader disagree about the convention, they'll read January as the 31st month and get nonsense. The 68000 always writes the biggest unit first: big-endian. A tool that assumes the other order will read every word in the ROM byte-swapped — a real and common bug.
There's a lovely, concrete reason this matters for Genesis
preservation. The very first bytes of a cartridge's readable header
spell SEGA in ASCII: $53 $45 $47 $41.
Because the 68000 stores them big-endian, dumping the ROM and reading
the bytes in address order gives you the letters S E G A
in the right order. If you ever open a ROM and see ESAG,
you're looking at a byte-swapped dump — a classic sign of a tool that
got the endianness wrong, and something Module 12's loaders actively
check for.
The lab lets you play both sides. Type a 32-bit value, choose
big-endian (the 68000) or little-endian, and watch the four bytes
drop into memory. Then read them back as a byte, a word, or a
longword — and tap a cell to move where the read starts. Leave it on
the default $53454741 and flip the endianness to see
SEGA turn into AGES before your eyes.
- 68000 sizes: byte = 8 bits, word = 16 bits, longword = 32 bits.
- Endianness is the order multi-byte values are stored in; the 68000 is big-endian — most-significant byte at the lowest address.
- The header's
SEGAtag reads correctly precisely because the machine is big-endian;ESAGmeans a byte-swapped dump. - Get endianness wrong and every word in the ROM comes out byte-swapped — a mistake emulators guard against on load.
The Genesis cartridge
Now we put the Part I toolkit into a real machine. A Sega Genesis cartridge is a small circuit board that wires one or more ROM chips — and sometimes a save chip and a mapper — to a 64-pin edge connector that plugs straight onto the 68000's bus. These seven modules cover the board itself, the 24-bit memory map the ROM lives in, the header that describes the game, the TMSS region lock, the mappers that break the 4 MB ceiling, battery-backed saves, and the ingenious lock-on passthrough. From here on we name real hardware, but every piece maps back to a fundamental you already know.
Inside a cart
Crack open a Genesis cartridge and there is startlingly little inside: a small printed circuit board, usually one big mask ROM chip, and a row of gold-plated fingers along the bottom edge. That's often the entire game. There's no processor in the cartridge, no operating system, no drive — the cartridge is pure memory, and the console supplies everything else. Compared to the optical drives and custom silicon of later consoles, a Genesis cart is almost brutally simple, and that simplicity is exactly why it starts a game the instant you flick the power switch: there is nothing to spin up and nothing to load.
The row of fingers is the edge connector: 64 contacts that mate with the slot inside the console. Crucially, those contacts are not some abstract “cartridge protocol” — they are, almost literally, the 68000's own bus brought out to the edge of the board. The address lines, the 16 data lines, the control strobes from Module 02, power and ground: all of it runs to the pins. When you insert a cartridge, you are physically extending the console's memory bus onto the cartridge's ROM chip. The ROM appears in the machine's address space (Module 06 draws exactly where), and the CPU reads it with the same handshake it uses for its own RAM.
The console is a library with a numbered shelving system but no books of its own. A cartridge is a book whose spine is printed with the exact call numbers of an empty section of shelf. Slot it in and its pages instantly “exist” at those call numbers — the librarian (the 68000) can walk straight to any page. The edge connector is the spine label lining up with the shelf's numbering. Nothing is copied or installed; the book simply becomes part of the library's address space.
What else can live on the board
Most carts are just ROM, but the board has room for more, and the rest of Part II is a tour of the extras:
- Extra ROM + a mapper. Games bigger than the 68000's flat 4 MB cartridge window carry additional ROM plus a small chip that swaps chunks of it into view — bank switching, the subject of Module 09.
- A save chip + battery. RPGs and sports games add battery-backed SRAM (or a serial EEPROM) so your progress survives the power switch — Module 10.
- A passthrough slot. One remarkable cartridge, Sonic & Knuckles, has a second slot on top to accept another cart and combine with it — the lock-on trick of Module 11.
But hold the simple picture in your head first: a board, a ROM, and 64 gold fingers that are the CPU bus itself. Everything else is an addition to that foundation.
- A Genesis cartridge is usually just a board with one mask ROM and a 64-contact edge connector — no CPU of its own.
- The edge connector is the 68000's bus, extended onto the board; inserting a cart maps its ROM into the console's address space.
- That directness is why cartridge games boot instantly: nothing loads or spins up.
- Optional extras — a mapper, a save chip + battery, or a lock-on passthrough — sit on the same board, and fill the rest of Part II.
The memory map
The 68000's 24-bit bus gives it one flat 16 MB address space, and the Genesis hardware designers divided that space into regions, each assigned to a different device by the address decoder of Module 03. This layout — the memory map — is the single most important diagram in the whole system, because it tells you what answers when the CPU touches any given address. Learn it and the rest of Part II falls into place.
Here are the landmarks, low addresses first:
- $000000–$3FFFFF — cartridge ROM. The cartridge occupies the bottom 4 MB. The 68000 starts here: the first eight bytes are the reset vectors (initial stack pointer, then the address of the first instruction), so at power-on the CPU literally begins executing out of your cartridge. Larger games reach beyond 4 MB with mappers (Module 09).
- $A00000–$A0FFFF — the Z80 area. The Z80 sound CPU's 8 KB RAM and the sound chips appear here, in a window the 68000 can reach after requesting the Z80's bus.
- $A10000+ — I/O and control. The controller ports and a version register sit at $A10000; Z80 bus-request and reset are at $A11000; and — important later — the mapper/TIME registers at $A130xx and the TMSS register at $A14000.
- $C00000–$C0001F — the VDP. The video chip's data & control ports, the HV counter and the PSG live here.
- $FF0000–$FFFFFF — 68000 work RAM. The console's 64 KB of read/write memory — the only big scratch pad the 68000 owns directly, and where all the game's running state lives.
The 16 MB space is one long street of numbered doors. Most of the low-numbered blocks are the cartridge (a huge printed archive you can only read); way up at the top of the street, $FF0000 onward, is the console's own house — small, but the only place it can write. Scattered in between are a few special service doors: knock at $C00000 and the video chip answers; knock at $A10000 and you're talking to the controllers. The address decoder is the postal system that makes sure your knock reaches the right door.
Mirroring: the same house at many numbers
One subtlety trips up newcomers. The work RAM is only 64 KB, which needs just 16 address bits to cover — but the region reserved for it is far larger. The extra high address bits simply aren't decoded, so the same 64 KB of RAM appears to repeat, over and over, across the whole upper range. This is mirroring: reading $FF0000 and $FF0000 minus 64 KB hits the identical byte. It isn't a bug — it's what naturally happens when you don't bother decoding address lines you don't need, and emulators must reproduce it faithfully because some code relies on it.
The lab is the whole map, live. Type an address or jump to a landmark, and the region that would answer lights up with a plain-English note on which device responds. Poke around the tiny I/O and VDP ranges wedged between the giant ROM and RAM blocks, and land inside the RAM mirror range to see the mirroring note.
- The 68000's flat 16 MB space is carved into device regions by the address decoder — the memory map.
- Cartridge ROM sits at $000000 (reset vectors first, so the CPU boots from the cart); work RAM is $FF0000–$FFFFFF (64 KB).
- The Z80 area is at $A00000, I/O and control registers at $A10000+, and the VDP at $C00000.
- Mirroring makes the small RAM repeat across its reserved range, because unused high address bits aren't decoded.
The ROM header
Right after the reset vectors, every Genesis ROM carries a fixed
header: a 256-byte block, from $000100
to $0001FF, laid out to a standard format so that the
console — and, decades later, an emulator — can learn what the
cartridge is without running it. It is a little index card glued to
the front of the game, and it's remarkably human-readable: much of it
is plain ASCII text you can spot in a hex editor at a glance.
The header opens with the string the whole system hangs on:
"SEGA MEGA DRIVE " (or
"SEGA GENESIS" on some releases), sixteen bytes
at $100. Then a copyright and build-date field, the game's
title in both a domestic (Japanese) and an overseas form, a serial
number, a checksum, a code describing which controllers it supports,
the ROM and RAM address ranges from Module 06, an optional
SRAM descriptor,
and finally a region field.
Each field sits at a known offset, so reading the header is just
Module 01's game — fetch bytes at fixed addresses and interpret them.
Before the story starts, a book has a title page: title, author, publisher, edition, ISBN, the country it's licensed for. You can learn everything you need to shelve and catalogue the book without reading a word of the actual text. The ROM header is that title page. The console reads it to check the game is genuine and boots it; a preservation database reads it to identify a dump; an emulator reads it to size the ROM and set up saves — all before executing a single instruction of the game.
The checksum, and why it's mostly ceremony
Two bytes at $18E hold a
checksum:
a 16-bit sum of every word of the ROM from $000200 to the
end. In principle it's an integrity check — recompute the sum, compare
it to the stored value, and a mismatch means a corrupt cartridge. In
practice most Genesis games never bother to verify it (a few famously
do), so a “wrong” checksum usually runs fine on hardware.
It matters more to tooling: ROM utilities recompute and
display it, and a handful of games and copy-protection tricks lean on
it, which is why emulators and fixers still compute it.
The lab is a live hex dump of a synthetic-but-structurally-real
header. Move your cursor over the bytes and each field lights up with
its name and a decoded explanation — find the SEGA tag,
the title, the region code, the SRAM descriptor and the checksum, and
watch the ASCII column on the right spell the text fields out.
- Every Genesis ROM has a standard 256-byte header at $000100–$0001FF, much of it human-readable ASCII.
- It opens with
"SEGA MEGA DRIVE "/"SEGA GENESIS"and describes title, serial, I/O support, ROM/RAM ranges, SRAM and region. - Reading the header is just fixed-offset byte reads — no need to run the game.
- The 16-bit checksum at $18E sums the ROM from $200 on, but most games never verify it; it matters mainly to tools.
TMSS & region locking
The earliest Genesis consoles booted any cartridge that presented a
sane reset vector. Later revisions added a gate called
TMSS — the Trademark Security System — and
its mechanism is delightfully on-the-nose. When the console powers up,
its own small boot ROM checks that the cartridge's header contains the
"SEGA" string (Module 07), and then requires the
game itself to write the ASCII letters ‘SEGA’ to a
hardware register at $A14000 early in start-up.
Only after that write does the console enable the VDP and let the game
display anything. Skip the write and the screen stays blank.
Why so theatrical? The clever part is legal, not technical. Writing the letters “SEGA” and displaying the Sega trademark was something an unlicensed manufacturer couldn't do without reproducing Sega's trademark — turning a trivial technical check into a trademark tripwire. It was less an unbreakable lock and more a “you must show our logo to boot, and if you do, we can sue you for it” trap. Technically it's just a register write; the teeth were in court, not silicon.
Imagine a members' club whose door only opens if you say a specific word aloud — and the word happens to be the club's registered brand. Anyone can say it, so it's a feeble lock; but saying it in your own product means printing their brand in your product, and that they can take you to court over. TMSS is exactly this: the ‘SEGA’ write to $A14000 is easy to perform but hard to perform legally without a licence.
Region locking: a separate gate
TMSS is about authenticity; region locking is about geography, and it's a different mechanism. The console has a hardware region (Japan / Americas / Europe), readable by software at the version register in the $A10000 I/O range. Region enforcement can come from two directions: some games check the console's region themselves and refuse to run on a mismatch, and some consoles refuse cartridges whose header region field doesn't include the console's region. There are also PAL/NTSC differences underneath — a European console runs the 68000 slightly slower (~7.60 vs 7.67 MHz) and draws 240 lines instead of 224 — so an out-of-region game might run too fast, too slow, or with a squashed or bordered picture even when it boots. This is why the retro scene is full of region-mod switches: they flip the console's reported region and video standard.
- TMSS on later consoles requires the game to write the ASCII
"SEGA"to $A14000 to enable the VDP — no write, no picture. - It was really a trademark tripwire: technically trivial, legally sharp, aimed at unlicensed publishers.
- Region locking is separate: the console has a region (readable in the $A10000 range), and games and/or consoles can refuse a mismatch.
- PAL vs NTSC also changes CPU speed (~7.60 vs 7.67 MHz) and line count (240 vs 224) — so out-of-region games can look or run wrong even when they boot.
Bigger than 4 MB: bank switching & mappers
Module 06 gave the cartridge a fixed 4 MB window,
$000000–$3FFFFF. For most of the Genesis's life that was
plenty. But late, ambitious games — Super Street Fighter II
most famously — carried more ROM than 4 MB, and
the 68000 simply has no address lines to reach it. You cannot make the
window bigger without a wider bus. So instead you make the ROM take
turns being visible through the window you have. That trick is
bank switching,
and the little chip on the cart that arranges it is a
mapper.
The idea is exactly the paged version of Module 01. Divide the big physical ROM into equal-sized banks — say 512 KB each. The 4 MB window is divided into slots of the same size. A set of mapper registers records, for each slot, which physical bank currently appears there. When the CPU reads an address in a slot, the mapper looks up that slot's bank number and fetches from the right chunk of the big ROM. Want different data? Write a new bank number to the register, and the bytes visible through that slot change instantly — no data is copied, the mapper just re-points the window.
You have an enormous mural but a narrow window to view it through. You can't widen the window — but you can slide the mural behind it. A mapper register is the crank that positions the mural: turn it and a different panel fills the frame. The 68000 always looks at the same window addresses; the mapper decides which slice of the 8 MB mural is behind it right now. Nothing moves in memory — only the choice of what's shown.
Two real mappers
- The Sega SSF2 mapper. Used by Super Street Fighter II (a 5 MB game), it divides the window into eight 512 KB slots, with registers around
$A130F1–$A130FFselecting which physical 512 KB bank each slot shows. Slot 0 is left fixed to bank 0 so the reset vectors and header always stay put. This is the mapper the lab below models. - The Sega SRAM mapper. A simpler, extremely common scheme centred on
$A130F1: a single register that toggles between mapping cartridge ROM or the cartridge's battery-backed SRAM into a slice of the upper cartridge region. It's less about “more ROM” and more about “let the save chip and the ROM share an address range,” which is Module 10's business.
The lab is a bank-switching playground built on the SSF2 model. On the left is an 8 MB ROM as sixteen 512 KB banks; on the right is the CPU's 4 MB window as eight slots. Pick a slot, choose a bank, and “write the register” — watch the connection re-point and the sweeping CPU-read cursor start returning bytes from a different bank. Slot 0 stays locked to bank 0, because that's where the machine starts every time.
- The 68000's cartridge window is a fixed 4 MB; larger games can't widen it, so they page banks of a bigger ROM through it.
- A mapper chip holds registers recording which physical bank appears in each window slot; writing a register re-points the view instantly.
- The SSF2 mapper uses eight 512 KB slots via registers at $A130F1–$A130FF, keeping slot 0 fixed for the vectors.
- The simpler Sega SRAM mapper ($A130F1) swaps ROM and battery SRAM into an address range — the bridge to Module 10.
Battery saves (SRAM / EEPROM)
Here's a puzzle the whole course has been circling. The cartridge is ROM — read-only, unchangeable. The console's RAM is writable but forgets on power-off. So where does your Phantasy Star save live, surviving weeks between play sessions? The answer is a third kind of memory added to the board specifically for the job. The commonest is battery-backed SRAM: a small static-RAM chip plus a coin-cell battery. While you play, the console powers the SRAM and the game reads and writes it like any RAM; when you switch off, the battery keeps just that chip alive, sipping a trickle of current, so the bytes persist.
The SRAM lives in the cartridge's address range, and how it appears
varies. Often it sits in the upper part of the cartridge space (many
games map it around $200000), and on carts using the
Sega SRAM mapper from Module 09 it shares an address
region with ROM, toggled in and out by writing the mapper register at
$A130F1 — write a 1 to expose the save memory, write a 0
to see ROM again. The header's SRAM descriptor (Module 07) is what tells
the console and the emulator that a save chip is present, where it lives,
and whether it uses only even bytes, only odd, or both.
The printed book (the ROM) can't be written in. The console's notebook (RAM) gets wiped every night. So the cartridge carries a diary with a tiny battery-powered lamp of its own: when the house lights go out, the diary's own lamp stays lit just enough to keep the ink from fading. Years later the entries are still there. When the little battery finally dies — and after thirty years many have — the diary goes blank, which is exactly why old save-heavy carts “forget” and need a battery replacement.
The other option: serial EEPROM
Some cartridges skip the battery entirely and use a small serial EEPROM instead. An EEPROM is genuinely non-volatile — it keeps its data with no power at all, so there's no battery to die — but it's written through a slow serial protocol (an I²C-style clock-and-data line), a few bits at a time, rather than being mapped as plain RAM. It typically holds far less than an SRAM (a handful of bytes to a couple of kilobytes) and is common in sports and puzzle games that only need to store a little. Emulators have to recognise which scheme a game uses, because “write a byte to this address” and “clock these bits out on a serial line” are completely different jobs — a distinction Module 12 returns to.
| Property | Battery-backed SRAM | Serial EEPROM |
|---|---|---|
| Keeps data via | coin battery | non-volatile cells |
| Battery to die? | yes — a real failure point | no battery at all |
| Seen by the CPU as | plain RAM in the cart range | a serial device (clock + data) |
| Typical size | 2–64 KB | tens of bytes – ~2 KB |
| Write speed | fast (memory access) | slow (bit-by-bit serial) |
| Emulator save file | .srm / .sav | .eep / .srm |
- Saves need writable, persistent memory — neither the ROM (read-only) nor the console RAM (volatile) can do it, so the cartridge adds a save chip.
- Battery-backed SRAM is read/written like normal RAM in the cartridge range, kept alive off-power by a coin cell that eventually dies.
- Some carts use the Sega SRAM mapper ($A130F1) to swap SRAM and ROM into a shared address range; the header's SRAM descriptor declares it.
- Serial EEPROM is battery-free and non-volatile but small and slow, written bit-by-bit over an I²C-style line — a different beast for emulators to model.
Lock-on & the edge connector
The most audacious cartridge Sega ever shipped was Sonic & Knuckles in 1994. Its case has a hinged flap on top hiding a second cartridge slot, and Sega called the trick lock-on technology. Plug another Genesis game into that top slot and the two carts combine. It works because, as Module 05 taught, the edge connector is just the 68000's bus — so S&K's board can pass that bus straight through to the cartridge above it, while its own mapper hardware decides how the two ROMs share the address space below.
What you get depends on which game sits on top, and S&K's hardware has three documented behaviours (the exact mappings below are illustrative):
- Lock on Sonic 3 and the two fuse into Sonic 3 & Knuckles: Sonic 3's ROM maps low at
$000000, S&K's own ROM sits above it, and the combined 4 MB behaves as one enormous game that neither cart could hold alone. This was the intended headline act — the two halves of a game split across two release dates. - Lock on Sonic 2 and you get Knuckles in Sonic 2: S&K overlays its Knuckles character and controls onto Sonic 2 using its own code plus a small patch region.
- Lock on almost anything else and S&K notices it doesn't recognise the cart and unlocks a hidden bonus — the “No Way?” Blue Sphere game — feeding the other cartridge's bytes in as level-generation data, so a different top cart literally makes different levels.
Think of Sonic & Knuckles as a docking base that passes power and signal through to whatever module you clip on top. If it recognises the module (Sonic 3), the two act as one designed-together device. If it half-recognises it (Sonic 2), it patches in a new feature. And if it doesn't recognise it at all, it doesn't give up — it treats the stranger's contents as raw seed data and generates a puzzle from them. One passthrough slot, three personalities.
The lab makes S&K the base cartridge and lets you clip different
games onto its passthrough. Choose the top cart and watch the combined
68000 address map redraw — which ROM lands at $000000,
where S&K's own ROM goes, and what game the combination boots as.
The other expansion edge: Mega-CD & 32X
The cartridge slot wasn't the console's only bus door. The Genesis also
exposed an expansion connector that gave add-ons direct
access to the same 68000 bus, and two famous ones used it. The
Mega-CD (Sega CD)
bolted on underneath, bringing a whole second 68000, more RAM and a
CD-ROM drive, and claimed a slice of the reserved $400000-ish
region. The 32X
plugged into the cartridge slot itself, adding two 32-bit SH-2 processors
and its own video hardware, and mapped its resources into the upper
cartridge/expansion space. Both are proof of the same principle you've
followed all course: on the Genesis, everything — a game, a save chip, a
passthrough cart, an entire CD-ROM subsystem — ultimately appears as
regions on one shared 68000 bus.
- Lock-on works because the cartridge edge is the 68000 bus: Sonic & Knuckles passes it through to a second, stacked cartridge and merges the two ROMs into the address space.
- Sonic 3 fuses into Sonic 3 & Knuckles; Sonic 2 becomes Knuckles in Sonic 2; other carts unlock the procedural Blue Sphere.
- A separate expansion connector exposed the same bus to the Mega-CD and, via the cartridge slot, the 32X.
- Everything on the Genesis — carts, saves, add-ons — resolves to regions on one shared 68000 bus.
Emulating the cartridge
Finally: how does software on your PC stand in for a chip full of frozen bits? A cartridge is the easiest part of a console to emulate — it's just memory — but “just load the file” hides real decisions: detecting the header, figuring out whether a game needs a mapper or a save chip, and where the save file goes. These two modules ground the whole course in the open-source emulators Genesis Plus GX and BlastEm, and turn everything you've learned into files and settings you can actually click.
Loading a ROM
To an emulator, a cartridge is its ROM dump: a plain file that
is a byte-for-byte copy of the mask ROM's contents, starting at the
reset vectors, then the header, then the code and data. You'll see two
common extensions. A .bin (or .gen) file is
the straightforward dump in the 68000's natural
big-endian
order. A .md file is a historical oddity from one family
of dumpers that stored the ROM byte-swapped (interleaved), so
loaders detect and de-interleave it. Both are covered by the
endianness lesson of Module 04 — and a byte-swapped ROM is exactly the
ESAG-instead-of-SEGA symptom you saw there.
Step one: read the header
The first thing an emulator like Genesis Plus GX or
BlastEm does is check offset $100 for the
"SEGA" string (Module 07). Finding it confirms the
byte order is right (if it sees the swapped form, it de-interleaves and
tries again) and unlocks the rest of the header: the title for the UI,
the region field to pick a default video standard, the ROM/RAM ranges,
and the SRAM descriptor. All of this is Module 01's read-a-byte-at-a-
fixed-offset, done in software over the file instead of over silicon.
Step two: detect the mapper and the save
Next the emulator decides how the cartridge behaves. If the ROM is
larger than 4 MB, or its serial/known-database entry matches a
game that uses one, it enables the right
mapper
— the SSF2 registers at $A130F1–$A130FF, the Sega SRAM
mapper, or one of the unofficial mappers used by certain unlicensed
carts. It also reads the SRAM descriptor (or matches a known game) to
decide whether to allocate battery-backed SRAM or an EEPROM, and where
in the address map to place it. Because a few carts declare this
incorrectly or use quirky hardware, accurate emulators keep an internal
database keyed on the game's checksum and serial to override the header
when needed — the reason those Module 07 fields matter to tooling.
Step three: the save file
When the game writes to its save memory, the emulator captures those
bytes and, on exit, writes them to a companion file next to the ROM —
conventionally .srm for SRAM saves (and formats like
.eep for EEPROM). Load the ROM again and the emulator reads
that file back into the emulated save chip, so your progress persists
exactly as the coin-cell battery did on real hardware (Module 10) —
except it never runs out. Back up the .srm and you've done
what a battery replacement does on a real cart, without a soldering iron.
Grounded in real code. Genesis Plus GX keeps a cartridge-hardware layer that recognises the standard mappers and a long list of per-game save and mapper quirks; BlastEm leans on ROM detection plus a configuration database for the same job. Neither invents behaviour — they reproduce the header, mapper registers and save hardware this course has walked through.
- A ROM file (
.bin/.gen, big-endian;.md, byte-swapped) is a literal copy of the cartridge's mask ROM. - Loaders check
"SEGA"at $100 to confirm byte order and read title, region, ROM/RAM ranges and the SRAM descriptor. - They detect the mapper (size > 4 MB → SSF2/SRAM mapper) and the save type, often overriding the header from a checksum/serial database.
- Save memory is mirrored to a companion file (
.srm/.eep) that persists forever — a battery that never dies.
Try it in an emulator
You now know what a Genesis cartridge is, so let's put the knowledge to work. (Menu wording differs between emulators and versions; everything below is described by function, so you can find it whatever it's called.)
- Open a ROM. Point the emulator at a
.bin/.md/.gendump of a cartridge you own. The title, region and any warnings it shows come straight from Module 07's header, parsed live as Module 12 described. - Watch the region default. Emulators pick NTSC or PAL from the header's region field (Module 08) — and let you override it. Force the “wrong” one and you'll see exactly the speed and picture-size effects that module warned about.
- Find the save file. After you save in-game and quit, look for a
.srmnext to the ROM — that's your battery-backed SRAM (Module 10), captured to disk. Delete it and your save is gone, just like a dead coin cell. - Try a big game. Load a >4 MB game like Super Street Fighter II and know that behind the scenes the emulator is servicing the SSF2 mapper's bank registers (Module 09) on every write to $A130Fx.
- Stack a lock-on. Good emulators let you specify Sonic & Knuckles plus a second ROM to reproduce lock-on (Module 11) — try it with Sonic 3, then with something random to unlock Blue Sphere.
- Open the debugger. BlastEm ships a capable debugger and Genesis Plus GX forks expose RAM/VRAM views — poke around $FF0000 work RAM and $C00000 VDP ports (Module 06) and watch the map you learned come alive.
Emulating a cartridge isn't restoring a machine so much as reprinting a book: because the cartridge is only memory, a faithful copy of its bytes plus the handful of rules for mappers and saves reproduces it completely. There is no laser to model, no motor to time — the whole cartridge is data and a few register behaviours. That is why Genesis emulation matured early and runs on almost anything: the hard parts of the console are the CPU, video and sound; the cartridge, the thing you've spent twelve modules on, is the part that hands itself over most willingly.
The whole journey, one last time
Here is the entire course as a single chain — worth tracing with your finger, because every link is now a module you've done:
- You can narrate a byte's full journey: bit in mask ROM → bus fetch (/CS, /OE) → memory map → header → emulator.
- You know why the cartridge boots instantly, why the 68000 is big-endian, and how mappers break the 4 MB ceiling.
- You understand TMSS, region locks, battery saves and the Sonic & Knuckles lock-on — and where each lives in the address map.
- You can open a ROM in Genesis Plus GX or BlastEm and explain every step it takes to become a running cartridge.