ROM file structure

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

Where everything lives in the NDS ROM β€” folders, file counts, and what each directory contains.

The NDS ROM for Tongari Boushi to Oshare na Mahou Tsukai extracts via ndstool into a flat directory tree. Six root-level files hold the executable code and ROM metadata; all game content lives under a single data/ tree with roughly 30 subdirectories.

Root files

Six files sit at the top level of the extracted ROM. These are standard NDS structures present in every retail cartridge.

FileRoleNotes
header.bin ROM header Standard 512-byte NDS header (game code, icon offset, FAT/FNT pointers, etc.)
arm9.bin Main executable BLZ-compressed. 564 KB on-ROM, 723 KB decompressed. Contains the game engine, string tables, and ARM9 overlay dispatch.
arm7.bin Sub-processor executable ARM7 coprocessor code (audio, Wi-Fi, touch). Unmodified by the translation.
y9.bin ARM9 overlay table Describes all 180 overlays: RAM load address, compressed size, decompressed size, BLZ flags.
y7.bin ARM7 overlay table Same structure as y9.bin but for the ARM7 side. Empty in this game (no ARM7 overlays).
banner.bin Icon and title strings The 32x32 icon shown in the DS menu, plus the game title in each language slot.

Overlay directory

overlay/ contains 180 .bin files (overlay_0000.bin through overlay_0179.bin). Each is a BLZ-compressed ARM9 code module that loads into a specific RAM slot at runtime. Overlays implement individual game systems: minigames, menus, NPC AI routines, shop logic, crafting, and so on. The overlay table in y9.bin maps each overlay ID to its load address and size. See the overlay system page for the full decoded function inventory.

Data directory overview

data/ is the main content tree. It holds around 2,500 files organized into purpose-specific subdirectories. Most files are either .ofs (raw RESO containers) or .lzs (LZS-wrapped LZ11-compressed RESO containers). A handful are raw .bin, .dat, or domain-specific formats.

2d/

45 files. UI sprites, fonts, and animation resources. A mix of .lzs compressed containers and .ofs RESO containers. Examples: audition.lzs, bank_in.lzs, buyitem.lzs, and a selwindow/ subdirectory. The 2D art pipeline for menus and HUD elements pulls from these files.

charmake/

2 .ofs files. Character creation UI resources (the screens where the player designs their avatar at game start).

coordinate/

6 files. Coordinate/clothing system resources. crditype.ofs contains 20 SZL-packed sprite sets used by the outfit selection UI.

inputstr/

5 files. Text input UI resources (the keyboard/character picker screens).

item/

14 files. The item database: itemicon.ofs (656 item icons as packed sprites), ItemNoList.itnt, item tables (.itnt, .dat), and binary lookup files that map item IDs to names and categories.

magazine/

66 files. 65 .ofs containers (one per in-game magazine issue) plus 1 .lzs. Magazine composition data and pre-rendered page layouts for the in-game collectible magazine system.

magic/

2 .lzs files. Magic system data. magic.lzs contains the spell database with effect banks, glyph mappings, and recipe data for the wand-drawing system.

map/

40 files across 13 subdirectories:

SubdirectoryContents
attribute/Tile attribute flags
collision/Collision geometry
event_rect/Event trigger rectangles
field/Field map definitions
fish/Fish spawn point tables
insect/Insect spawn point tables
mapitem/Map item placement
mushroom/Mushroom spawn point tables
plane/Ground plane geometry
rep/Map representation data
route/NPC walking routes
shop/Shop zone boundaries
weather/Weather region definitions

message/

Approximately 1,700 .ofs files in a deep category tree. This is where ALL game dialog lives. The directory hierarchy organizes messages by function:

RangeContents
msg00 - msg12System and event dialog
msg20 - msg31Per-NPC personality dialog (12 directories, ~45 files each)
msg32 - msg33Grouped dialog
msg40 - msg52Large groups with 11 subdirectories each; classroom and lesson content
msg98 - msg99System lookups, UI labels, crafting tables, encyclopedia text

minigame/

5 files. Minigame-specific resources.

model/

Approximately 200 files across several sub-trees holding all 3D assets:

SubdirectoryContents
item/Item 3D models
map/World geometry: ground/, obj/, plane/, fish/
npc/NPC models and textures, including tex/face/ for face meshes
player/Player character models
shop/Shop interior models
ucc/User-created content models
uma/Horse models
meffect/Magic effects: mefftex.ofs (854 BTX0 textures), meffect.ofs (854 BMD0 models)
odori/Dance animations

mydesign/

2 files. Player custom design system resources.

npc/

29 files. The NPC data layer:

npcstamp/

2 files. npcstamp.ofs (140 SZL-packed RGCN personality stamps for the rumor board) and npcstpcmn.lzs (shared NCER + NCLR palette data).

onemsg/

12 .ofs files. One-shot floating messages rendered as speech bubbles above characters' heads. These tooltip/hint messages have a 32-character page cap.

pc_shop/

14 files across subdirectories: foodmenu/, redecoration/inner/, redecoration/outer/, selling/. Shop menu layout and pricing data.

recipe/

3 files. The crafting recipe system: recipedata.lzs (RESC v3.11 container with the recipe database), recipemsg.lzs (recipe narration strings), mgcinfo.lzs (magic info lookup table). See the recipe files page.

script/

383 .ofs files. Game event scripts containing bytecode programs that drive cutscenes, triggered events, and scripted sequences.

shop/

2 .bin files. Shop inventory configuration data.

start/

13 files. Game startup and intro sequence resources.

talk/

1 file: word.dat. The banned/swear-word filter list used by the text input system.

talkstart/

40 .ofs files. Dialog trigger tables. Each file represents a scenario type (greeting, shopping, weather chat, etc.); records within each file map (scenario, zone) pairs to specific message files in message/.

title/

1 file. Title screen resources.

topic/

4 files. Conversation topic data for the NPC dialog system.

trendranking/

2 files. Trend ranking system resources.

ucc/

27+ files plus act/, brush/, and dishup/ subdirectories. User-created content resources for the dress-up and custom item systems.

uwasa/

1 .bin file. Rumor (uwasa) system data.

Loose files at data/ root

About two dozen .lzs files sit directly in data/ rather than in a subdirectory. These are global resources used across multiple game systems:

sound_data.sdat

33 MB. Nintendo SDAT sound bank containing all game audio: background music, sound effects, and jingles. Standard SDAT format shared across most DS games.

File addressing at runtime

The game engine never references files by path at runtime. Instead, it uses numeric file IDs from the NDS File Allocation Table (FAT). The File Name Table (FNT) maps these IDs back to human-readable paths at extraction time, but the running code only ever works with ID numbers.

Key file ID ranges:

ID rangeContent
511 - 1838Message files (data/message/)
2122 - 2133One-shot messages (data/onemsg/)
2151 - 2533Script files (data/script/)
2550 - 2589Talkstart files (data/talkstart/)

This means that adding or removing files from the ROM would shift every ID above the insertion point, breaking all hardcoded references in the ARM9 binary and overlays. The translation patch modifies file contents in place without adding or removing any files.

3DS version (TBAF archives)

The 3DS port of the game uses TBAF (.tarc) archives instead of the NDS flat directory layout. TBAF is a simple archive format that bundles the same underlying game data into larger container files. The actual file formats inside the archives are identical to the NDS versions -- .ofs RESO containers, .lzs compressed wrappers, and the same Nitro graphics formats.

global.lzs is byte-identical between the NDS and 3DS ROMs except for a single entry within the RESO container. The translation patch targets the NDS ROM; the 3DS version is a separate extraction and repackaging problem due to the TBAF wrapper.

Cross-references