An interactive course · Genesis Plus GX & BlastEm

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.

Part I

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.

Modules 01–04Difficulty Absolute beginnerLabs 3 interactive
Module 01 · Part I

What a ROM is

GoalUnderstand, from scratch, what a read-only memory chip actually is — how it differs from RAM, and how handing it an address makes a byte of your game appear.

A Genesis game is not a program that lives “inside the console.” It lives inside the cartridge, in a single chip called a ROMRead-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.

Analogy · A printed book versus a notebook

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.

ROM scope — clock an address in, read a byte outCanvas · simulation
Address $00 Data $00
The 256 bytes are a fixed factory pattern. Every address always returns the same byte — that's what read-only means.
Key takeaways
  • 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.
Module 02 · Part I

The address & data bus

GoalMeet the two bundles of wires that connect the 68000 to everything else, and follow one complete read across them — address out, data back, handshake done.

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.

Analogy · A vast warehouse with numbered bins

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.

Bus lab — one 68000 read cycle, step by stepCanvas · simulation
Phase S0 Address $000100 Data
/AS = address strobe, /UDS /LDS = data strobes, /DTACK = device acknowledges. R/W stays high for a read.
Key takeaways
  • 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.
Module 03 · Part I

Reading a chip

GoalLearn the two small control pins — chip-select and output-enable — that let many chips share one bus without ever shouting over each other.

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.

Analogy · A conference call with a moderator

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.

One chip read, as signal timing (active-low signals drawn low = asserted) ADDR valid address on the bus /CS chip selected (low) /OE outputs enabled (low) DATA ← access time → data valid
The read, timed. A valid address appears; the decoder pulls /CS and then /OE low; and after the ROM's access time the correct byte is finally stable on the data lines, ready for the CPU to latch.
Key takeaways
  • 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.
Module 04 · Part I

Endianness & words

GoalLearn how the 68000 groups bytes into words and longwords, and why the order it stores them in — big-endian — matters for every multi-byte value in a Genesis ROM.

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.

Analogy · Writing the date

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.

Endianness explorer — byte, word & longwordCanvas · simulation
Read value $53454741 As text "SEGA"
Tap a memory cell to move the read start. Try $53454741 and flip to little-endian to watch SEGA become AGES.
Key takeaways
  • 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 SEGA tag reads correctly precisely because the machine is big-endian; ESAG means a byte-swapped dump.
  • Get endianness wrong and every word in the ROM comes out byte-swapped — a mistake emulators guard against on load.
Part II

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.

Modules 05–11Difficulty HardwareLabs 4 interactive
Module 05 · Part II

Inside a cart

GoalOpen a Genesis cartridge and identify every part: the ROM chip, the board, and the edge connector that drops the ROM straight onto the 68000's bus.

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.

Analogy · A book dropped onto the library shelf

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.

Contents
1 chip
usually a single mask ROM
Edge pins
64
the 68000 bus, brought out
Flat window
4 MB
$000000–$3FFFFF
Data width
16-bit
two bytes per access
Boot time
instant
nothing to spin up
Extras
opt.
mapper · SRAM · lock-on
cartridge board MASK ROM your game, frozen in silicon address data /CS /OE Vcc · GND edge connector · 64 contacts = the 68000 bus, brought to the board's edge
A cartridge, laid bare. A single mask ROM wired to a 64-contact edge connector. The connector isn't a special protocol — it's the address bus, the 16 data lines and the control strobes from Modules 02–03, handed straight to the ROM.
Key takeaways
  • 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.
Module 06 · Part II

The memory map

GoalRead the 68000's 16 MB address space like a map: where the cartridge ROM sits, where work RAM lives, and where the Z80, I/O and VDP appear.

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.
Analogy · A city with numbered addresses

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.

Memory-map explorer — who answers at this address?Canvas · simulation
Region Cartridge ROM
Hover the map or enter an address to see which device decodes it.
Key takeaways
  • 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.
Module 08 · Part II

TMSS & region locking

GoalUnderstand the two gatekeepers a cartridge meets on later consoles: the TMSS “write SEGA to a register” check, and region locking by the header's region field.

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.

Analogy · Say the password, and the password is our brand name

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.

Power on boot ROM runs Check header "SEGA" at $100? region field vs console Game writes 'SEGA' → $A14000 TMSS handshake VDP enabled picture appears ✓ The TMSS boot gate (later consoles) Fail the header or region check → console refuses; skip the $A14000 write → screen stays blank.
Two gates, in sequence. The boot ROM checks the header's SEGA string and region; then the game must write 'SEGA' to $A14000 to switch the video on. Both are easy to satisfy technically — their force was licensing and trademark law.
Key takeaways
  • 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.
Module 09 · Part II

Bigger than 4 MB: bank switching & mappers

GoalSee how a cartridge fits more ROM than the 68000's 4 MB window by paging banks into view — the Sega SRAM mapper and the SSF2 mapper.

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.

Analogy · A small window onto a long mural

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–$A130FF selecting 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.

Bank-switching playground — page ROM into the windowCanvas · simulation
Slot slot 1 Register $A130F2 ← 8
Slot 0 is locked to bank 0 (it holds the reset vectors & header). Illustrative of the SSF2 mapper at $A130F1–$A130FF.
Key takeaways
  • 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.
Module 10 · Part II

Battery saves (SRAM / EEPROM)

GoalLearn how a read-only cartridge remembers your progress: a writable save chip on the board, kept alive by a battery or held in a serial 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.

Analogy · A diary with its own tiny lamp

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.

PropertyBattery-backed SRAMSerial EEPROM
Keeps data viacoin batterynon-volatile cells
Battery to die?yes — a real failure pointno battery at all
Seen by the CPU asplain RAM in the cart rangea serial device (clock + data)
Typical size2–64 KBtens of bytes – ~2 KB
Write speedfast (memory access)slow (bit-by-bit serial)
Emulator save file.srm / .sav.eep / .srm
Key takeaways
  • 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.
Module 11 · Part II

Lock-on & the edge connector

GoalUnderstand the Sonic & Knuckles passthrough — how one cartridge stacks on another and merges their address spaces — and the expansion edge that fed the Mega-CD and 32X.

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.
Analogy · A base extension that reads whatever you clip on

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.

Lock-on simulator — stack a cart, merge the address spaceCanvas · simulation
Boots as Sonic & Knuckles
Choose a cartridge to lock on and watch the combined address map. Mappings are illustrative of documented lock-on behaviour.

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.

Key takeaways
  • 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.
Part III

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.

Modules 12–13Difficulty EmulationLabs reference
Module 12 · Part III

Loading a ROM

GoalFollow a Genesis emulator as it opens a ROM file: what .bin/.md are, how it reads the header, detects a mapper, and wires up the SRAM save file.

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.

Open file
.bin/.md; de-swap if needed (04)
Read header
"SEGA", title, region, SRAM (07)
Detect mapper
>4 MB? SSF2 / SRAM mapper (09)
Wire saves
alloc SRAM/EEPROM, load .srm (10)
Map & run
ROM at $000000, boot the 68000 (06)

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.

Key takeaways
  • 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.
Module 13 · Part III

Try it in an emulator

GoalTurn the whole course into things you can click in Genesis Plus GX or BlastEm — and trace one byte's full journey from silicon to screen, one last time.

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/.gen dump 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 .srm next 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.
Analogy · A perfect facsimile of the book

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:

Bit
a cell in mask ROM (01)
Address
bus + /CS/OE fetch a byte (02–03)
Map
ROM at $000000, mappers (06, 09)
Header
who this game is (07)
Emulator
a file + a few rules (12)
bit in ROM mask silicon bus fetch addr + /CS/OE memory map $000000 · mappers header name · region · save emulator file + rules real cartridge: silicon on the 68000 bus (01–11) in an emulator: a dump + mapper & save rules (12)
Bit → bus → map → header → emulator. On real hardware every byte a Genesis game touched made the left-hand trip through silicon and the 68000 bus. An emulator reproduces the whole cartridge as a file plus a few mapper and save rules — and because a cartridge is only memory, that's enough. That's the entire course in one sentence.
Course complete ✦
  • 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.

An interactive course built in the spirit of the Genesis Plus GX, BlastEm and Nuked-OPN2 preservation projects. Every ROM, header, bus cycle and memory map on this page is a synthetic simulation drawn on the fly with the Canvas API to illustrate a concept. This page contains no game data and no copyrighted material; the header, ROM contents and lock-on mappings shown are fictional and generated in your browser. Hardware behaviour is grounded in the open-source emulators and published reverse-engineering of the Sega Genesis / Mega Drive; where an exact figure varies by model or source (bus timings, mapper register details, lock-on mappings), the text says so and stays conservative.

Grounded in · Genesis Plus GX · BlastEm · Nuked-OPN2 — Sega, Genesis and Mega Drive are trademarks of Sega; this is an independent, non-commercial project.