Bishoujo Senshi Sailor Moon S · SFC · 1994
Where this game keeps everything, and what shape it is in. Four memories, one struct that matters more than the rest, and a great many records walked by generic code.
HiROM, FastROM, no copier header. The whole mapping reduces to one rule, and every offset in this project is written with it in mind:
file offset = SNES address & 0x3FFFFF
Banks $C0-$FF are the cartridge mapped straight through;
$80-$BF is a FastROM mirror of the same bytes, and the
game usually executes from it. That mirror is the single most expensive fact on
this page: a routine documented as $C0:D055 runs as
$80:D055, so a watch on the wrong one sees nothing at all — which
reads exactly like "the game never does this".[1]
The cartridge, on paper
The header declares a 4 MB ROM. The image is
2.5 MB — 40 banks, $C0-$E7. That gap is why every
patch in this project can append banks past the end and still boot, and why they
all target the first free bank, $E8.
Its title field is not ASCII: it is Shift-JIS half-width katakana,
セーラームーンSシュヤクソウダツセン.
Code and tables at the bottom, a long run of character and stage graphics
through the middle, then the manifests and all of the audio at the top. Bar
height is measured packing — how much of each bank is neither 00 nor
FF.
$8A — a mirror of file bank $0A — is the one to know by
heart: it holds every collision box in the game.128 KB, about a third of it used. Low WRAM is mirrored into bank
$00, and direct page is 0 in essentially all game code —
so $8D and $7E:008D are the same byte written two
ways.
Everything that moves is one of these: both fighters, both projectiles, even
the portrait on the report card. Sixteen slots of 0x80 bytes from
$1000, and the same layout for all of them.
Four of these bytes each overturn an assumption a reader is likely to arrive with:
| Byte | Field | Why it matters |
|---|---|---|
+0x00 | charID / object type | 1-9 are fighters, 10-27 are projectile types — and a projectile picks its box table by its own id, never its owner's |
+0x41 | hurtbox index | 0 means invulnerable. Invulnerability in this engine is the absence of a box, not a flag — the backdash is invincible because its animation uses index 0 for all 14 frames |
+0x48 | first-hit defense | Worth one damage column until the character is first hit that round. This is the entire source of the "damage is random" folklore; there is no RNG in damage |
+0x18 | action flags | bit 0 is the engine's own "this act is an attack" answer — a better test than any action-ID range |
Three pointer tables sit next to each other in bank $8A, indexed
by id * 2: hit at $8A:C1F1, hurt at
$8A:C229, collision at $8A:C23D. They are
0x14 bytes apart — the hurt table ends exactly where the collision
table begins.
That adjacency matters: only the hit table was widened to 28 entries for projectiles. Indexing hurt or collision by a projectile's object id runs straight off the end into the neighbouring table. Gameplay never notices, because nothing reads a projectile's hurtbox — but a tool that draws one renders a flickering phantom out of unrelated bytes, and it took a while to work that out.
Per character the three tables are contiguous, and the characters follow in
roster order — Moon's hit boxes at $8A:C251, then her hurt pairs,
then her six push boxes, then Mercury, and so on to Chibi Moon, with the nine
shared projectile tables last.
A box is eight bytes: two (offset, width) pairs — one per facing —
then a signed y_off, a height, and flags for guard height.
The origin is the character's feet and +y is down, so
y_off is normally negative. Height 0 means no box.
One pointer at $E0:0238 + id*2 is where a fighter begins. The
record behind it is small: a defense byte, then pointers to palettes, a win icon,
an object palette, and the payload the loader expands into work RAM.
That very first byte is a real balance value hiding in plain sight — the first-hit defense. Neptune ships with 2, Jupiter with 1, everyone else 0.
The palettes are where a character's identity actually lives. All nine are structured identically — grey, outline, four skin tones, six costume colours, two accents, a shared shade, white — and only those six costume colours differ meaningfully between fighters. Re-hueing that ramp is how this project authors new palette slots — and it is where this page's own palette comes from.
VRAM is the one memory whose layout changes completely between a match and a menu. Two different machines using the same 64 KB.
Two traps worth the ink
A screen transition clears all 64 KB — one fixed-source DMA with a length of zero, meaning 65536 — and the next screen reloads only its own asset list. "It was in VRAM a moment ago" proves nothing.
DMA never surfaces as a CPU write callback. A write-watch on the free window saw zero writes across a whole match while snapshots caught 1416 bytes arriving. Any claim that a region is free needs both instruments, and they have to disagree before you believe either.
The APU has its own 64 KB and it is full: the largest run of zeros in the whole of it is 64 bytes. ROM is not this project's constraint; this is.
Pitch is per-sound note data rather than a per-sample rate: each sound's sequence header carries a transpose byte worth one semitone per unit. That is the whole of patch 101 — and the reason it cannot correct two characters at once, since the transpose lives in a sequence they share.
The clearest way to see what "data-driven" means here: Uranus's crouching light punch, followed from her character id to the pixels of her hitbox. Four table reads, and not one line of code specific to her.
Her id picks an action table.$C0:0000 + 6×2 → $C0:0FF1
The act picks a script
— 02 35 | 03 36 | 80: three frames of pose $35,
four of pose $36, then hold.$C0:0FF1 +
0x53×2 → $C0:122C
The pose is a 4-byte
record — 09 0A 2C 02: class 9, hit box
$0A, hurt pair $2C, push box $02.
$84:809C + 6×2 → $84:8A44, + 0x36×4
The index reads a box
— FC 37 CD 37 CC 14 03 00: 55 px wide starting 4 px behind her
origin, 20 px tall at head height, hitting high and low.$8A:C1F1
+ 6×2 → $8A:E3E1, + 0x0A×8
The startup pose $35 carries hit index 00 —
that is how a startup frame is expressed in this engine: a pose with no attack
box. Change the 02 in step 2 and you have changed her startup. That
is the whole mechanism behind this project's frame-data patches, and the reason
they need no hooks at all.
This is what "data-driven" means in practice. Each of these is walked by generic engine code, and each was confirmed against a real example decoded out of the cartridge — a layout without a worked example is a hypothesis.
y_off is normally
negative; height zero means no box at all. A hurt entry is two of these: body,
then head.(attackID >> 1) × 4 into
$C0:CDD5 and its eight sibling tables, selected by attack and
defender posture. These tables are global — indexed by strength class,
not by character, which is why this project has never edited hitstun here: it
would change every character's move of that class.vram $4000 · len
$3480 · src $C4:2590 · dest $7E:C000, and patch 16 changes
precisely one field of it.$10. Read as "start at the first glyph, stop at zero",
this record looks terminated — and the build made on that reading wrote a
longer name straight through the bottom row into the next stage's header,
corrupting the screen and hanging the game a second after stage select. Two
records side by side would have shown the padding immediately.Three structures, one throw
A throw is decided by three separate records, which is how a character can have all three wrong independently: a 4 × 8-byte table indexed by attack button picks which throw comes out (its last byte is the act), a 5-byte toss record holds the forward velocity (negated when the thrower faces left), and the hold script decides escapability — any step whose byte 5 is non-zero samples the victim's mashing.
Saturn shipped with the first two wrong, inherited from the game she was ported out of. The engine was faithfully executing correct code on incorrect data for thirty years.
The pad is read once per frame and press edges are derived from it.$80:8353 — the canonical per-frame anchor for tooling
Every object runs its state processor, which walks the current action script: it sets the pose, the step duration, and the three box indices.JSL $C1:0000 → $C0:9CCD writes +0x40/41/42
Boxes are tested against each other, read live out of ROM bank $8A — never staged anywhere.$C0:BFC0
On a hit: the on-hit record supplies damage and hitstun, eleven handlers compose a column shift from counter-hit, first-hit defense and A.C.S. stats, the matrix turns it into a number, and one of eight apply sites subtracts it.$C0:CDD5 → 0xCAED-0xCD6D → $80:D055
The reaction is dispatched by posture × hit level, setting pushback or launch velocity and the victim's reaction act.$C1:0E85
The HUD is computed into WRAM staging, then uploaded in the next vblank — a split that lets a patch compute in one place and draw in the other.$C0:D5E8 producer, $C0:D56F uploader
Two things to know before hooking any of this: the HUD producer never runs in Practice mode, so code hooked there is dead in the mode people actually train in — and attacks are not processed on an action's step 0, which puts the engine's effective timing one frame later than the action's start.
Every change bigger than a few bytes has to go somewhere. The inventory, all measured:
| Space | Size | Notes |
|---|---|---|
Appended banks $E8+ | effectively unlimited | The image ends at $E7 and the header declares 4 MB — so
this is free, legal, and where every non-trivial patch puts its code |
ROM hole $C1:BE09 | 63 bytes | The classic free code hole; patches 1 and 2 live in it |
ROM hole $C1:BE85 | 69 bytes | Patch 6 |
WRAM $0816-$09FF | 490 bytes | VS matches only — native Practice uses the whole range |
WRAM $7F:6000+ | ~31 KB | Untouched in steady-state play; four patches keep their state here |
VRAM BG3 CHR 0xC7-0xDF | 25 tiles | Free in every matchup — the in-match font window |
VRAM menu $5C0-$5FF | 64 tiles | Free on every menu screen, gone at match load |
| CGRAM OBJ row 7 | 16 colours | Never loaded, never drawn |
| ARAM | ~0 | The largest zero run in the APU's 64 KB is 64 bytes. Audio is the one hard wall — adding a voice means displacing one |
Two rules about "free"
Unreferenced and unchanging is not free. A 7 KB region of audio RAM passed both tests and was still live — proven only by finding its bytes back in a ROM bank. On this console everything was uploaded from somewhere; ask where it came from.
A write-watch cannot prove a region is free, because DMA is not a CPU write. Snapshot as well, and make the two instruments disagree before you believe either.
[1] Why one routine has three addresses, and why it matters.
There are two different spaces in play, and the rule above converts between
them. The cartridge is a file — 2.5 MB of bytes numbered
0 to 0x27FFFF. The CPU never sees a file; it sees an
address space of 256 banks of 64 KB, which also holds RAM and hardware
registers. The mapping is simply: which byte of the file appears at which CPU
address? The cartridge's wiring decides that, and there were two common
conventions — LoROM and HiROM. This game is HiROM, so a full 64 KB slab of the
file appears in each bank.
& 0x3FFFFF means "throw away everything above the low 22
bits, and what is left is the position in the file". Twenty-two bits, because a
HiROM cartridge tops out at 4 MB and that is all it takes to name any byte of
one. Worked out on the routine named above:
$C0:D055 → 0xC0D055 & 0x3FFFFF = 0x00D055 → c2 30 85 02 a5 00 $80:D055 → 0x80D055 & 0x3FFFFF = 0x00D055 → c2 30 85 02 a5 00 $40:D055 → 0x40D055 & 0x3FFFFF = 0x00D055 → c2 30 85 02 a5 00
Those are not three copies. They are one set of bytes, visible at three addresses. The high bits choose which window you look through, not which byte you get — being wired into the address space several times over was normal on this console.
The game prefers the $80 window for speed: the SNES reads the
cartridge at 2.68 MHz through most windows and at 3.58 MHz through banks
$80-$FF when the cartridge asks for it, which this one does (its
map-mode byte is $31 — HiROM and FastROM). About a third
faster, for free.
And that is where the cost lands: breakpoints and watches are keyed to
an address, not to a byte. Break on $C0:D055 and the CPU
will execute those exact bytes through $80:D055 all day without
tripping it. Your probe prints nothing — and nothing looks identical to "the game
never calls this". Low work RAM has the same sibling trap, visible as both
$7E:1000 and $00:1000.
One last thing the rule assumes: no copier header. Some dumps carry an extra 512 bytes at the front, added by the hardware that made them; with one of those, every offset on this page is wrong by 512. The SHA-1 in the footer is what pins that down. ↩ back