Bishoujo Senshi Sailor Moon S · SFC · 1994

The data architecture

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.


The address model

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シュヤクソウダツセン.

Map 1 — the cartridge

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.

$C0 — engine core (61% packed) $C0 $C1 — objects + proc blocks (75% packed) $C2 — code/data (76% packed) $C3 — front end (67% packed) $C4 — menu payloads (68% packed) $C4 $C5 — graphics (82% packed) $C6 — graphics (84% packed) $C7 — kanji font (75% packed) $C8 — graphics (74% packed) $C8 $C9 — graphics (76% packed) $CA — graphics (80% packed) $CB — cel tables (74% packed) $CC — graphics (67% packed) $CC $CD — graphics (63% packed) $CE — graphics (67% packed) $CF — graphics (70% packed) $D0 — graphics (70% packed) $D0 $D1 — graphics (74% packed) $D2 — graphics (71% packed) $D3 — graphics (69% packed) $D4 — graphics (67% packed) $D4 $D5 — graphics (70% packed) $D6 — graphics (65% packed) $D7 — graphics (63% packed) $D8 — graphics (59% packed) $D8 $D9 — graphics (64% packed) $DA — graphics (60% packed) $DB — graphics (70% packed) $DC — sparse (25% packed) $DC $DD — sparse (44% packed) $DE — sparse (53% packed) $DF — screen engine (36% packed) $E0 — MANIFESTS + palettes (86% packed) $E0 $E1 — data (90% packed) $E2 — effect tiles (52% packed) $E3 — driver (sparse) (12% packed) $E4 — audio (74% packed) $E4 $E5 — voice banks (94% packed) $E6 — audio (88% packed) $E7 — audio (74% packed) vanilla ends — $E8+ is where patches live
  • engine code
  • tables + manifests
  • graphics
  • front end / fonts
  • sound driver + samples
40 banks. Hover any bank for what it holds. Bank $8A — a mirror of file bank $0A — is the one to know by heart: it holds every collision box in the game.

Map 2 — work RAM

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.

direct page — the engine's working registers; D=0$0000direct page stack — by convention — never probed$0100stack OAM shadow — DMA'd to the sprite table every frame$0200OAM shadow DMA'd to the sprite table every frame CGRAM shadow — 512 B, DMA'd WHOLE every frame$0500CGRAM shadow 512 B, DMA'd WHOLE every frame unmapped — $0700unmapped HUD state — displayed HP, timer, tile staging$0800HUD state free in VS matches — patch 10 lives here — NOT free in Practice$0816free in VS matches camera + draw-order list — $0A00camera + draw-order list ★ THE OBJECT POOL — $1000 P1 · $1080 P2 · $1100/$1180 projectiles$1000★ THE OBJECT POOL $1000 P1 · $1080 P2 · $1100/$1180 projectiles pool slots 4-15 — unmapped — nothing names a user$1200pool slots 4-15 unmapped — nothing names a user menu + A.C.S. state — cursors, stage id, asset job index, stats$1800menu + A.C.S. state cursors, stage id, asset job index, stats
$7E:0000-$1FFF. The two shadow buffers are DMA'd to the PPU every frame — which is why a one-shot colour poke never survives, and why a write-watch on VRAM catches nothing.

The object struct — the centre of it all

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.

+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F 00 +0x00 — charID / obj type00 +0x01 — action01 +0x02 — action02 +0x03 — action03 +0x04 — action04 +0x05 — pose / tick / frame05 +0x06 — pose / tick / frame06 +0x07 — pose / tick / frame07 +0x08 — pal+prio / facing08 +0x09 — pal+prio / facing09 +0x0A — cel pointers + sizes0A +0x0B — cel pointers + sizes0B +0x0C — cel pointers + sizes0C +0x0D — cel pointers + sizes0D +0x0E — cel pointers + sizes0E +0x0F — cel pointers + sizes0F 10 +0x10 — cel pointers + sizes10 +0x11 — cel pointers + sizes11 +0x12 — cel pointers + sizes12 +0x13 — cel pointers + sizes13 +0x14 — cel pointers + sizes14 +0x15 — cel pointers + sizes15 +0x16 — flags16 +0x17 — unmapped17 +0x18 — action flags (bit0 = attack)18 +0x19 — unmapped19 +0x1A — unmapped1A +0x1B — unmapped1B +0x1C — unmapped1C +0x1D — unmapped1D +0x1E — unmapped1E +0x1F — unmapped1F 20 +0x20 — X / Y position (32-bit subpixel)20 +0x21 — X / Y position (32-bit subpixel)21 +0x22 — X / Y position (32-bit subpixel)22 +0x23 — X / Y position (32-bit subpixel)23 +0x24 — X / Y position (32-bit subpixel)24 +0x25 — X / Y position (32-bit subpixel)25 +0x26 — X / Y position (32-bit subpixel)26 +0x27 — X / Y position (32-bit subpixel)27 +0x28 — screen pos28 +0x29 — unmapped29 +0x2A — screen pos2A +0x2B — unmapped2B +0x2C — unmapped2C +0x2D — unmapped2D +0x2E — unmapped2E +0x2F — unmapped2F 30 +0x30 — velocity / gravity30 +0x31 — velocity / gravity31 +0x32 — velocity / gravity32 +0x33 — velocity / gravity33 +0x34 — velocity / gravity34 +0x35 — velocity / gravity35 +0x36 — velocity / gravity36 +0x37 — unmapped37 +0x38 — integrator38 +0x39 — unmapped39 +0x3A — pushback3A +0x3B — unmapped3B +0x3C — unmapped3C +0x3D — unmapped3D +0x3E — unmapped3E +0x3F — unmapped3F 40 +0x40 — hit / hurt / coll index40 +0x41 — hit / hurt / coll index41 +0x42 — hit / hurt / coll index42 +0x43 — connected / attackID / damage43 +0x44 — connected / attackID / damage44 +0x45 — connected / attackID / damage45 +0x46 — hurt state / d48 / HP46 +0x47 — hurt state / d48 / HP47 +0x48 — hurt state / d48 / HP48 +0x49 — hurt state / d48 / HP49 +0x4A — hurt state / d48 / HP4A +0x4B — unmapped4B +0x4C — unmapped4C +0x4D — hitstop4D +0x4E — unmapped4E +0x4F — unmapped4F 50 +0x50 — buttons / commands50 +0x51 — buttons / commands51 +0x52 — buttons / commands52 +0x53 — buttons / commands53 +0x54 — buttons / commands54 +0x55 — unmapped55 +0x56 — throw mash count56 +0x57 — unmapped57 +0x58 — unmapped58 +0x59 — unmapped59 +0x5A — unmapped5A +0x5B — recognizer timer/state pairs5B +0x5C — recognizer timer/state pairs5C +0x5D — recognizer timer/state pairs5D +0x5E — recognizer timer/state pairs5E +0x5F — recognizer timer/state pairs5F 60 +0x60 — recognizer timer/state pairs60 +0x61 — recognizer timer/state pairs61 +0x62 — recognizer timer/state pairs62 +0x63 — recognizer timer/state pairs63 +0x64 — recognizer timer/state pairs64 +0x65 — recognizer timer/state pairs65 +0x66 — recognizer timer/state pairs66 +0x67 — recognizer timer/state pairs67 +0x68 — recognizer timer/state pairs68 +0x69 — unmapped69 +0x6A — unmapped6A +0x6B — unmapped6B +0x6C — unmapped6C +0x6D — unmapped6D +0x6E — unmapped6E +0x6F — unmapped6F 70 +0x70 — A.C.S. stats70 +0x71 — A.C.S. stats71 +0x72 — A.C.S. stats72 +0x73 — A.C.S. stats73 +0x74 — A.C.S. stats74 +0x75 — A.C.S. stats75 +0x76 — update sel / strength76 +0x77 — update sel / strength77 +0x78 — sound id78 +0x79 — unmapped79 +0x7A — unmapped7A +0x7B — unmapped7B +0x7C — unmapped7C +0x7D — unmapped7D +0x7E — unmapped7E +0x7F — unmapped7F
  • identity
  • state + input
  • animation + drawing
  • position + velocity
  • box indices
  • unmapped
128 bytes, byte by byte. Hover for each field. The pale cells are genuinely unmapped — about a third of the struct — and are shown as unknown rather than guessed at.

Four of these bytes each overturn an assumption a reader is likely to arrive with:

ByteFieldWhy it matters
+0x00charID / object type1-9 are fighters, 10-27 are projectile types — and a projectile picks its box table by its own id, never its owner's
+0x41hurtbox index0 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
+0x48first-hit defenseWorth 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
+0x18action flagsbit 0 is the engine's own "this act is an attack" answer — a better test than any action-ID range

Box data — the table you will read most

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.

A character is a manifest

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.

Map 3 — video memory

VRAM is the one memory whose layout changes completely between a match and a menu. Two different machines using the same 64 KB.

BG1 tilemap — the stage$0000BG1 tilemap BG2 tilemap — the stage$0800BG2 tilemap BG3 tilemap — the HUD — bars, nameplates, timer$1000BG3 tilemap — the HUD bars, nameplates, timer BG1/BG2 CHR — stage art, 4bpp$2000BG1/BG2 CHR stage art, 4bpp BG3 CHR (2bpp) — timer digits, A-Z, and 0xC7-0xDF free$5000BG3 CHR (2bpp) timer digits, A-Z, and 0xC7-0xDF free OBJ — sprite cels + effects — P1 $6000 · P2 $6500 · fx $6A00/$7300$6000OBJ — sprite cels + effects P1 $6000 · P2 $6500 · fx $6A00/$7300
In a match. The HUD is BG3, 2bpp, and its priority bit puts those tiles above the sprites — which is how an in-match overlay is possible without touching the sprite engine at all.
screen tilemaps — $0000screen tilemaps the menu font sheet — 418 tiles, staged via $7E:C000$0400the menu font sheet 418 tiles, staged via $7E:C000 FREE — 64 tiles — patch 16's half-width alphabet$05B6FREE — 64 tiles screen art — $0600screen art FREE — 136 tiles — unused$0738FREE — 136 tiles screen art — $07C0screen art
On a menu. Addresses are tiles, not words. The 64 free tiles above the font sheet are where patch 16's half-width alphabet lives — free on every menu screen, overwritten the moment a match loads.

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.

Map 4 — audio memory

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.

IPL / boot — $0000IPL / boot the sound driver — its ROM home is file 0x23F804$0800the sound driver its ROM home is file 0x23F804 sequence data — swapped per scene$2800sequence data BRR sample directory — 64 × [start, loop]$3400BRR sample directory ★ per-character voice directory — $34C0 + (charID-1)*32, resident from boot$34C0★ per-character voice directory resident instrument samples — $3800resident instrument samples swappable sample slot — per scene$8E00swappable sample slot looks free — is NOT — passed both freedom tests and was live$9B92looks free — is NOT passed both freedom tests and was live ★ P1's voice bank — directory entries 48-55$B700★ P1's voice bank directory entries 48-55 ★ P2's voice bank — directory entries 56-63$DB00★ P2's voice bank directory entries 56-63 the end — largest zero run in all of ARAM: 64 bytes$FE8Bthe end
The APU's 64 KB. A fighter's voice is uploaded per player, not per character — two fixed banks near the top, filled with whoever is on screen — while a nine-character directory sits resident from boot.

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.

One move, end to end

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.

1

Her id picks an action table.$C0:0000 + 6×2 → $C0:0FF1

2

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

3

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

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.

The record catalogue

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.

A collision box — 8 bytes

x_off R — 1 bytex_off R 1 w R — 1 bytew R 1 x_off L — 1 bytex_off L 1 w L — 1 bytew L 1 y_off — 1 bytey_off 1 h — 1 byteh 1 flags — 1 byteflags 1 -- — 1 byte-- 1
Two (offset, width) pairs — one per facing — then a signed vertical offset, a height, and guard-height flags. The origin is the character's feet and +y is down, so y_off is normally negative; height zero means no box at all. A hurt entry is two of these: body, then head.

An on-hit record — 4 bytes

damage — 1 bytedamage 1 hitstun — 1 bytehitstun 1 hit level — 1 bytehit level 1 flags — 1 byteflags 1
Indexed by (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.

An asset job — 10 bytes

vram — 2 bytesvram 2 len — 2 byteslen 2 src24 — 3 bytessrc24 3 dest24 — 3 bytesdest24 3
The record that drives every menu upload. The length sits two bytes before the source pointer — read the other way round, you pair record N's length with record N+1's source, which is exactly why three separate attempts to grow one transfer "changed nothing": they were quietly lengthening an unrelated upload. The menu font's record reads vram $4000 · len $3480 · src $C4:2590 · dest $7E:C000, and patch 16 changes precisely one field of it.

A stage name — 102 bytes

header — 6 bytesheader 6 TOP row - 24 words, name centred by zero padding — 48 bytesTOP row - 24 words, name centred by zero padding 48 BOTTOM row - the same glyphs + $10 — 48 bytesBOTTOM row - the same glyphs + $10 48
There is no terminator. The name is centred in a fixed 24-word field by leading and trailing zero words, and the bottom row is the top row plus $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.

What happens in one frame

1

The pad is read once per frame and press edges are derived from it.$80:8353 — the canonical per-frame anchor for tooling

2

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

3

Boxes are tested against each other, read live out of ROM bank $8A — never staged anywhere.$C0:BFC0

4

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

5

The reaction is dispatched by posture × hit level, setting pushback or launch velocity and the victim's reaction act.$C1:0E85

6

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.

Where there is room

Every change bigger than a few bytes has to go somewhere. The inventory, all measured:

SpaceSizeNotes
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:BE0963 bytes The classic free code hole; patches 1 and 2 live in it
ROM hole $C1:BE8569 bytesPatch 6
WRAM $0816-$09FF490 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-0xDF25 tiles Free in every matchup — the in-match font window
VRAM menu $5C0-$5FF64 tiles Free on every menu screen, gone at match load
CGRAM OBJ row 716 coloursNever 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.

Footnote

[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