Overlay system

DS game only γ¨γ‚“γŒγ‚Šγƒœγ‚¦γ‚·γ¨γŠγ—γ‚ƒγ‚Œγͺまほう぀かい The field guide documents the DS game's internals.

180 dynamically loaded ARM9 overlays. Shared RAM slots, controller/body pattern, persistent rendering engines.

Overlay table

Shared RAM slots

Many overlays map to the same RAM address β€” only one is resident at a time. The slot is selected by the game mode dispatcher in arm9.

RAM addressOverlays sharingRole
0x02155A0066Game-mode body / controller overlays
0x021597A025Body / renderer slot 1
0x0215C54020Body / renderer slot 2
0x021FB3C018Body / renderer slot 3
0x021B6080(ov156/157)Body / renderer slot 4
0x021C3420(ov158/159)Body / renderer slot 5

Persistent engines

Overlay RAM Size BSS Role
ov137 0x0216DA40 0x20860 0x27E0 2D rendering engine (sprite API, OAM transfer, VBlank handler). Loaded persistently across most game modes.
ov138 0x0216DA40 (shares slot) varies β€” Tongari 3D map engine. Alternates with ov137 depending on game mode.

The VBlank handler at 0x02185BF8 in ov137 transfers shadow OAM to 0x07000000/0x07000400. The ARM9 VBlank handler at 0x0207001C handles the wider system (DMA timing, audio buffer, etc.).

Controller / body pattern

UI screens use a two-overlay pattern: a controller (state machine + asset loading) plus a body (per-screen sprite placement + interaction logic). The controller calls into the body at FUN_xxxxxxxx entry points; the body reads its sprite-placement table from .rodata.

Known controller β†’ body mappings

ContainerControllerBodyBody init function
2d/buyitem.lzsov003ov070FUN_02159828 @ 0x02159828
2d/itemorderwnd.lzsov003 (shared)ov070same
2d/chest.lzsov013TBDβ€”
2d/dustbox.lzsov013TBDβ€”

Per-overlay roles (excerpt)

Full table in notes/phaseA_ghidra/overlay_role_final.json. Highlights:

OverlayRAMRole
ov0030x02155A00Buyitem controller (shop state machine)
ov010, ov041, ...0x02155A00Game-mode controllers (66 share this slot)
ov0700x021597A0Buyitem body (renderer)
ov1370x0216DA402D rendering engine (persistent)
ov1380x0216DA403D map engine
ov156/1570x021B6080Slot 4 bodies
ov158/1590x021C3420Slot 5 bodies

Nintendo DWC (wireless)

The VBlank handler in ov137 is the game engine. The other VBlank handler that appears in some Konami DS builds is Nintendo DWC (wireless library) β€” not present here.

Source