ov001 general_2d_ui
Bank deposit/withdraw UI — single-purpose banking scene where the player deposits or withdraws Ritch (currency). 6-digit amount entry via DPad or touch. Asymmetric caps: wallet 999,999 vs bank 9,999,999. Loads data/2d/bank_in.lzs (deposit) or bank_out.lzs (withdraw). Zero in-overlay translation surface.
Header
Numeric metadata for this overlay as read from the overlay table at ROM
offset 0x8DE00 (per-entry stride 32 bytes). Function
counts, data-item counts, and the call-graph fan-out are from a Ghidra
11.3.1 headless auto-analysis pass.
Reading the binary
The overlay ships on the cart at file ID 1 under the BLZ code-LZ compression wrapper (the same backward-LZ scheme Nintendo uses for executable ARM9 code).
At load time the engine reads the overlay table entry at ROM offset
0x8DE00 + 1 * 0x20, allocates the destination
RAM region at 0x02155a00, decompresses
the body in-place (if compressed), and resolves any external
relocations.
To inspect this overlay outside the running game, decompress
overlay/overlay_001.bin with
ndspy.codeCompression.decompress() (Python ndspy library)
and load the resulting plaintext into Ghidra or
IDA at base address 0x02155a00. The
raw Ghidra auto-analysis dump used to populate this page lives at
notes/overlay_knowledgebase/raw/ov001.json;
the per-overlay descriptive markdown is at
notes/overlay_knowledgebase/ov001.md.
Embedded strings
1 UTF-16 LE string live inside this overlay's compiled binary. These addresses are absolute (inside the overlay's RAM image after load). The text is stored as little-endian UTF-16 code units, NUL-terminated.
Container references
Distinct container basenames referenced by this overlay. Each is loaded via the content cache by passing the basename string to a lookup that resolves it to a file ID in the ROM's FAT. The path column shows the file's location in the clean extract, where resolved.
-
bank_in→data/2d/bank_in.lzs -
bank_out→data/2d/bank_out.lzs
Unresolved
These container basenames appeared in the overlay's string table but no file of that name was found in the clean extract. Most are false-positive ASCII matches (function names, register maps, fragments of other strings); a few may be containers that the overlay names but never actually opens. Listed for completeness.
-
2d/bank_in.lzs— no matching container found in clean extract -
2d/bank_out.lzs— no matching container found in clean extract
Function list
Functions Ghidra auto-identified inside this overlay's RAM range.
Names prefixed FUN_ are auto-generated from the function's
entry address; size is in bytes; the "calls" column counts both
intra-overlay branches and external ARM9 call targets. The "strings"
column counts how many UTF-16 LE strings each function references.
Show all 30 functions
| # | Address | Size | Calls | Strings | Role hint |
|---|---|---|---|---|---|
| 1 | 0x02155a74 | 66 | 7 | 0 | scene_draw_obj() [vtable 5] — per-frame object draw pass. Releases sprites, draws arrow OAM, releases sound bank |
| 2 | 0x02155af4 | 30 | 2 | 0 | scene_draw_bg() [vtable 4] — per-frame BG pass. Draws amount row + palette setup when in running/exit_delay phase |
| 3 | 0x02155b14 | 14 | 0 | 0 | set_mode(mode) — clamps mode byte to 0 (deposit) or 1 (withdraw) |
| 4 | 0x02155b24 | 132 | 11 | 0 | update_load_phase() — phase-0 substate machine: request file → wait → wait sound → init. 4 substates |
| 5 | 0x02155bac | 66 | 4 | 0 | update_running() — phase-1 dispatcher: touch handler → button or digit input → anim tick |
| 6 | 0x02155bf0 | 30 | 1 | 0 | update_exit_delay() — phase-2: decrements exit_delay counter, advances to teardown at 0 |
| 7 | 0x02155c10 | 24 | 1 | 0 | update_teardown() — phase-3: registers scene-exit slot 10, invokes parent vtable slot 6 |
| 8 | 0x02155c28 | 396 | 29 | 0 | draw_amount_row() — 396 bytes. Composes all on-screen numbers: 6 amount digits, 6 wallet digits, 6 bank digits, OK/CANCEL buttons, cursor highlight |
| 9 | 0x02155db4 | 100 | 2 | 2 | load_lzs_container() — starts async load of bank_in.lzs or bank_out.lzs based on mode byte |
| 10 | 0x02155e28 | 40 | 2 | 0 | bg_layer_alloc_uv_screen() — allocates BG layer 4 at 256×192, clears it |
| 11 | 0x02155e54 | 18 | 2 | 0 | bg_layer_free_uv_screen() — frees BG layer 4 |
| 12 | 0x02155e6c | 10 | 0 | 0 | set_bg0_palette_via_thunk() — palette setter trampoline through loader-patched function pointer |
| 13 | 0x02155e80 | 10 | 0 | 0 | init_bg_palette_zero_or_one() — palette setter trampoline (used by scene_draw_bg) |
| 14 | 0x02155e94 | 100 | 7 | 0 | init_bg_text_layer() — sets up BG text/icon overlays at top of bank screen. Glyph from loaded NCGR + sound-driven face animation |
| 15 | 0x02155efc | 304 | 10 | 4 | init_sprites() — 304 bytes. Builds all 25 sprite handles from bank_in/bank_out NCGR/NCLR/NCER/NANR |
| 16 | 0x02156048 | 68 | 5 | 0 | release_sprites() — frees BG sprite + all 25 sprite handles. Called once at scene exit |
| 17 | 0x0215608c | 158 | 5 | 0 | register_amount_arrow_oam() — registers 20 OAM hit regions: OK, CANCEL, 6 digit columns, 6 up arrows, 6 down arrows |
| 18 | 0x0215612c | 56 | 1 | 0 | oam_register_helper_top() — forwarder to oam_register_object for top screen |
| 19 | 0x02156168 | 56 | 1 | 0 | oam_register_helper_bottom() — forwarder to oam_register_object for bottom screen |
| 20 | 0x021561a4 | 22 | 1 | 0 | release_oam_regions() — releases 20 OAM hit slots |
| 21 | 0x021561c0 | 68 | 4 | 0 | init_amount_clamps() — reads wallet/bank balances, computes max_amount with asymmetric caps |
| 22 | 0x0215620c | 72 | 8 | 0 | commit_transaction() — the actual save-data write. Deposit: wallet -= amount, bank += amount. Withdraw: inverse |
| 23 | 0x02156254 | 368 | 26 | 0 | button_input_handler() — 368 bytes. DPad handler: START→OK, B→CANCEL, LEFT/RIGHT→cursor, UP/DOWN→digit nudge with auto-repeat |
| 24 | 0x021563d4 | 382 | 22 | 0 | digit_input_handler() — 382 bytes. Touch-mode handler: A→confirm, B→back, UP/DOWN→±1, LEFT/RIGHT→cycle OK/CANCEL |
| 25 | 0x02156560 | 574 | 29 | 0 | touch_handler() — 574 bytes. Polls OAM hit regions: OK/CANCEL buttons, 6 digit columns, 6 up arrows, 6 down arrows |
| 26 | 0x021567ac | 184 | 7 | 0 | update_digit_cursor_anim() — drives per-digit highlight animation when cursor moves. Anim 10 = highlighted |
| 27 | 0x02156864 | 262 | 10 | 0 | update_digit_row() — 262 bytes. Clamps amount, updates wallet/bank display previews, renders all digit sprites |
| 28 | 0x0215696c | 230 | 10 | 0 | update_digit_row_no_clamp() — sibling without top-clamp (used at init when amount is known-zero) |
| 29 | 0x02156a54 | 44 | 2 | 0 | anim_tick() — per-frame animation cooldown decrementer. Resets sprite anims after 6 frames |
| 30 | 0x02156a84 | 12 | 1 | 0 | scene_free_heap() [vtable 1] — frees scene_ctx allocation via libc free |
Open questions & conflicts
Open questions / unknowns
- Auto-analysis identified 30 functions covering 3896 of 4608 overlay bytes.
- Function names are auto-generated `FUN_<addr>`. Manual renaming based on call-graph + string-ref analysis is a follow-up.
- BSS size is 0 bytes; Ghidra-imported overlay does not include BSS so any references into the BSS range appear as unresolved.
Conflicts with the prior shallow pass
- No major conflicts detected with prior-pass `overlay_role_final.json` record.
Source
- Per-overlay markdown:
notes/overlay_knowledgebase/ov001.md - Raw Ghidra dump:
notes/overlay_knowledgebase/raw/ov001.json - Overlay-system explainer: overlays system
- Plain-English overlay primer: overlay knowledgebase