Master cache table
| Symbol | RAM | Refs in arm9 | Role |
|---|---|---|---|
| master cache table | 0x020AA740 | 712 | Indexed pointer-to-asset table; each slot identifies one loaded resource. |
| path string region | 0x020A1000..0x020A8000 | β | ~28 KB of static path strings (131 unique paths). Each path is a NUL-terminated ASCII string like "item/itemicon.ofs". |
| game state struct (pointer) | 0x021A55C0 | 750 | Pointer to runtime game state; most engine functions take this in R0. |
Generic loader
All asset load requests funnel through the generic loader
FUN_02009894:
FUN_02009894(
void *table, // r0 β usually 0x020AA740
const char *path, // r1 β pointer into 0x020A1000..0x020A8000
u16 sub_index, // r2 β TOC entry index inside the container
u32 size, // r3 β expected payload size (or 0 = use TOC length)
u32 flag1, // stack
u32 type_code, // stack β e.g. 0x7800 for item icons
u32 flag2, // stack
u32 flag3 // stack
);
The loader reads the file at path from the NDS filesystem,
decompresses it if LZS-wrapped, walks its RESO TOC to find
sub_index, and writes a pointer/handle into the master
cache table at the slot the caller has prepared.
Documented loader call sites
| Caller | Path | Asset class |
|---|---|---|
| ov003 | 2d/buyitem.lzs | Shop chrome |
| ov003 | 2d/itemorderwnd.lzs | Shop order window |
arm9 0x02052D20 | item/itemicon.ofs | Item icon (per item-icon index) |
arm9 0x02052D20 | global.lzs entry 5 | Item icon palette (256-color) |
| arm9 (boot) | global.lzs entry 0 | Font (NFTR) |
| ov137 | 2d/inputmagic/mgcall.ofs | Magic glyph atlas |
| ov137 | 2d/inputmagic/mgc80.ofs | Magic glyph palette |
| various | data/npc/NpcDataOfs.ofs | NPC personality / portrait data |
| various | data/item/itemname.ofs | Item name strings |
| map overlays | map/static.lzs | 3D map textures |
| map overlays | map/weather/*.ofs | Weather 3D models |
| title screen | 2d/mainmenu/title_pack.ofs | Title-screen background variants (5 seasons) |
| title screen | title/titledata.lzs | Title splash sprites |
Cache table entry layout (inferred)
Each slot in the master table is a struct accessed by:
struct CacheEntry {
u32 flags;
void *data_ptr; // points into a heap-allocated decompressed RESO blob
u32 size;
u32 path_hash_or_id;
...
};
Exact layout has not been fully decoded; the loader and consumers
agree on offsets via LDR/STR with specific
[rN, #imm] offsets (e.g. [r5, #0x84] for the
item-icon sub-index).
Generic asset loader at 0x02052D20
Disassembly (THUMB, item-icon site):
02052D4C LDR R0, [PC, #0x30] ; r0 = 0x020AA740 (master table)
02052D4E LDR R1, [PC, #0x34] ; r1 = 0x020A55D8 ("item/itemicon.ofs")
02052D50 LSLS R3, R3, #0xA ; r3 = 0x7800 (flags / type_code)
02052D52 BLX 0x02009894 ; call generic file-loader
; r2 = u16 sub-index from caller's [r5+0x84]
Source
notes/phaseA_ghidra/DISCOVERIES.mdβ cache + loader analysisarm9_full_plaintext.bin@0x02009894β generic loaderarm9_full_plaintext.bin@0x02052D20β item-icon loader thunk