Code map
The game’s code is 428 images: the resident executable, the logo program and 426 EMI overlays. This page maps each image family, each address range of the executable and resident game layer, and each asset class to its job and functions. The pages that own each mechanism are under Related; roles that no reader or caller establishes are “not identified”.
Names are labels from this research. An address name such as func_80158F80 means the function has no readable name; a range with no entry points is listed by address only. slus is exe/slus_004_22. A citation reads Name (image@0xADDR); an address is meaningful only inside its image, because overlays share addresses.
Memory map
Section titled “Memory map”The RAM map is in Memory, and the load address of each image family is in Programs and load addresses. Overlays at one address replace one another. slus and the EMI overlays share RAM, so an overlay calls slus and game/00 by address and neither calls back by name. The slot windows are reserved regions of the slus image. The boss, area030/05 and area049/13 images load at the addresses of the windows, so they occupy them.
Image families
Section titled “Image families”21 of the 428 images hold no functions.
| Family | Images / load | Role |
|---|---|---|
exe/slus_004_22 |
1 / 0x80096800 |
Resident engine: boot, frame loop, graphics queue, text, area drawing, actor scripts, sound, EMI loader, party records. Sections below. |
exe/logo |
1 / 0x801CE000 |
Logo player: Logo_Main (exe/logo@0x801CEDFC) streams CAPCOM30.STR through the stream ring and MDEC, fades CD audio, skips on a pad press. 15 game functions, 105 PsyQ. slus runs it with SYS_StartLogo (exe/slus_004_22@0x8014AEE0). |
etc/game/00 |
1 / 0x80195800 |
Resident game layer: actor slots, palette fades, game states, scene dispatch, front-end data tables, record tables. See the subsystem table. |
etc/game/01 |
1 / 0x801D0C00 |
Title screen: Game_UpdateTitle (emi/etc/game/01@0x801D0C04) (“GAME.EMI entry”), title fade timers, selection effect, window glyph primitive. 20 functions, all named. |
etc/start/08 |
1 / 0x801D0C00 |
Front-end menu overlay. It registers Game_UpdateMain (emi/etc/game/00@0x80197068) and holds SAVE_DrawSlots (emi/etc/start/08@0x801E6C68). Its menu bodies are shared with shop, bate and shisu. |
etc/start/09 |
1 / 0x801EEC00 |
Memory card access: SAVE_AccessFile (emi/etc/start/09@0x801EEC30) loads the directory, opens the save file and transfers it. 14 functions. |
etc/shop |
1 / 0x801D0C00 |
Shop overlay: Shop_DrawEquipment (emi/etc/shop/00@0x801D8A0C), stock rows, the shared menu bodies. Stock data is g_GameShopStock (emi/etc/game/00@0x801CA28C) in game/00. |
etc/bate, etc/shisu |
3 / 0x801D0C00, 0x80033A00 |
Menu overlays that carry the same shared menu bodies as shop and start (Menu_DrawStatPanel, Menu_DrawItemRow, Menu_DrawEquipment have equal sizes in all four). What the screens are for is not identified beyond the file names. bate/03 loads at 0x80033A00 and holds no functions. |
etc/sisyou |
1 / 0x801D0C00 |
Master menu: Menu_UpdateMaster (emi/etc/sisyou/00@0x801D25D8) runs the master menu function table by a panel step byte each frame; Menu_ApplyMasterMode (emi/etc/sisyou/00@0x801D3ED0). |
etc/commu00 |
1 / 0x801EEC00 |
Fairy village: Fairy_InitVillage (emi/etc/commu00/00@0x801EECA4) (60 fairy rows), jobs, Fairy_RollExploreReward (emi/etc/commu00/00@0x801F1BC8) (weighted reward table), Fairy_GrantGift. |
etc/commu01-05 |
5 / 0x801D0C00 |
Communication screens. commu02..04 each name one Fairy_AdvanceStep step function. commu01 and commu05 have no readable name. Their role is not identified beyond the file names. |
battle/battle/03 |
1 / 0x801D0C00 |
Battle engine: Battle_Update (emi/battle/battle/03@0x801D1014) (the game phase table calls it each frame), Battle_DispatchStep (emi/battle/battle/03@0x801D11D8), Battle_UpdateEvents (emi/battle/battle/03@0x801DE43C), party and enemy actor update, target picking. |
battle/battle/15 |
1 / 0x80096800 |
Battle-family image at the slus load address, inside the first slot window. 494 functions, 6 named (Effect_ShakeScreen (emi/battle/battle/15@0x800A8EB8), Battle_PickRandomTarget (emi/battle/battle/15@0x800AB760), Menu_SlidePanelLeft (emi/battle/battle/15@0x800B254C), Menu_DrawPanelCursor (emi/battle/battle/15@0x800B20D4) and two bit helpers). Role of the image as a whole: unknown. Message_GetText names its func_8009704C as a caller. |
battle/batl_end, batl_ovr |
2 / 0x801EEC00 |
Battle overlays beside battle/03. No readable name. Role not identified beyond the file names. |
battle/batl_re2/01 |
1 / 0x80036E00 |
Holds no functions. |
boss/* |
35 / 0x800C1800 |
One boss fight each. Every image defines four hooks: Boss_InstallBattleHooks publishes Boss_ChooseBattleEnding, Boss_EndBattle and Boss_HandleBattleEvent into g_BattleChooseEndingHook, g_BattleEndHook and g_BossBattleEventHook, which battle/03 calls. 23 images carry these four names (boss008 and boss014 add numbered variants). |
bmagic/* |
124 / 0x801EEC00 |
One battle effect module each (magic001 to magic151 family names). BMagic_DispatchMode runs the callback the table at D_801EEC00.steps selects with the scratchpad step byte. 112 images are slot 03, 12 are slot 00. 90 images have no readable name. |
plchar/* |
19 / 0x801CE400 |
Field character modules plp012 to plp678. Two shapes, below. |
scenario/sce10eff |
1 / 0x801D0C00 |
Effect overlay: Scene_UpdateEffect (emi/scenario/sce10eff/00@0x801D0C10) (“SCE10EFF.EMI entry”) runs the effect handler the work byte selects. |
scenario/sce15ef0-3 |
4 / 0x801D0C00 |
Four overlays beside sce10eff; no readable name. Role not identified beyond the file names. |
scenario/scena00-19 |
20 / 0x801F6C00 |
Scenario handler blocks. Scene_Start (emi/etc/game/00@0x801A7704) waits for a scenario’s payload and dispatches; Game_UpdateScenario (emi/etc/game/00@0x801A782C) calls entry 0 of the handler table g_SceneScenes (emi/etc/game/00@0x801C8454); entry_04 receives the actor record and entry_10 is optional. scena00 names three of its entries (Scene_DispatchActor (emi/scenario/scena00/00@0x801FC7D0), Scene_CheckStepTrigger (emi/scenario/scena00/00@0x801FC818) and Scene_ClearParty (emi/scenario/scena00/00@0x801FC8FC)). The other 19 hold mostly code with no readable names. |
world00 to world04 |
5 families, 203 images / 0x801F2C00 |
One field area each, grouped by world. Common structure below. |
Members that differ
Section titled “Members that differ”boss/*. 12 images add a name to the common four: Boss_FinishDefeat (boss002, 004, 017,
022; it banks the enemy’s EXP and Zenny and sets the victory bit on the last enemy),
Boss_EndEntrance (boss022), Boss_InitEnemy (boss037, 040, 042, 049), Boss_RunSubStep
(boss036, 052), Effect_ShakeScreen (boss033) and Area_RoundSpriteCoordinate (boss055).
boss002, 004, 008 and 014 carry numbered variants of the hook names (Boss_EndBattle2 and
so on). boss055 is the largest (60 functions). What each boss does beyond the hooks is not identified.
bmagic/*. 20 images name BMagic_DispatchMode; the others name Effect_PlayOnce (magic008,
015, 020, 145, 146), Effect_CountDownTimer (magic006, 009, 039, 040, 059, 126,
145) or Effect_NextStep (magic062, 082). The effect each module draws is not identified.
plchar/*. 7 images (plp012, 015, 016, 025, 026, 034, 056) define the turn shape:
Char_AdvanceScript (emi/plchar/plp012/00@0x801CEC30), Char_SpawnActor (emi/plchar/plp012/00@0x801CEF14) (claims a field record from
g_ActorSlots), Char_StartTurn, and Char_ProbeFacingCell. 11 images
(plp247, 257, 267, 278, 27a, 457, 467, 478, 567, 578, 678) define the walk
shape: Char_WalkStep (emi/plchar/plp478/00@0x801CE898) (“runs one field-character route step”).
plp349 has no readable name. Which character each module drives is not identified.
world0N/*. 38 to 48 areas per world load at 0x801F2C00. Provable differences:
world00/area030/04 loads at 0x801D0C00 (237 functions; it calls
Area_DrawScene (exe/slus_004_22@0x8014BA54) each frame), world00/area030/05 loads at 0x800F5000 and
world01/area049/13 at 0x80117000. 19 areas hold no functions (for example
world00/area006/13, world03/area122/13). The common names are Area_Update (emi/world01/area065/13@0x801F35F0) (“the
area frame update”), Area_UpdateEvent/Message_OpenAnswerMenu (entry 0x801F2C04),
Actor_AdvanceWhenPartyNear, Actor_SlideScreenX, Area_ClearWorkColumn. world04 has the most
named functions (85). Area script content is not identified.
Executable (slus)
Section titled “Executable (slus)”Ranges follow the address-sorted names. A boundary is where the readable names change owner or where a data table lists the functions.
| Address range | Subsystem | Entry points | Notes |
|---|---|---|---|
0x8014AA04..0x8014AAC8 |
crt0 stubs | stup0, stup1, __main |
stup0 calls SYS_Main |
0x8014AAC8..0x8014B3C4 |
Boot, frame loop, display | SYS_Main, SYS_InitRuntime, SYS_InitHardware, SYS_PrepareFrame, SYS_SubmitFrame, SYS_UpdateKeyState, SYS_InitCard |
SYS_Main jal list: SYS_InitRuntime, SYS_UpdateKeyState, GFX_UploadPalette, GFX_UpdateTransferQueue, EMI_Update, SND_UpdateVoiceStatus, SND_Exit, SYS_StartLogo |
0x8014B33C..0x8014B9AC |
Callback threads and the exception screen | CallbackRegister, CallbackRun, CallbackWait, SYS_ShowException (exe/slus_004_22@0x8014B3C4) |
four callback slots (CallbackInitThreads); SYS_ShowException is the trap handler’s register dump |
0x8014BA54..0x8014D290 |
Area drawing: object and actor lists, sprite cells, CLUT | Area_DrawScene, Area_DrawActors, Area_DrawObjectSprite (exe/slus_004_22@0x8014C4D4), Area_BuildClut, Area_DrawSpriteCell, Area_SetDrawMode, Area_AddActor |
Area_SwapObjects names func_8014BC70 as the object-list sort; func_8014C47C has no identified role |
0x8014D4E0..0x8014E0A8 |
Actor script stream | Actor_BeginScript, Actor_SeekScript, Actor_SelectScriptBank, Actor_CopyScriptEntry, Actor_SwitchScript, Area_FindSceneRecord, Actor_ReadValue |
scene table D_801459F4 |
0x8014E0A8..0x8014E22C |
Disc executable read | SYS_ReadCd, SYS_LoadExec |
SYS_StartLogo reads LOGO.EXE in two steps |
0x8014E22C..0x8014E9C0 |
Graphics: palettes, primitives, transfer queue | GFX_UploadPalette, GFX_AddPrim, GFX_UpdateTransferQueue, GFX_ExpandRgb555, GFX_DecodeLzss, GFX_ResetPalette, GFX_ClearRect |
D_80145A04 entry kinds route to GFX_ExpandRgb555 (kind 1), GFX_DecodeLzss (kind 2) or LoadImage |
0x8014EA80..0x8014ED6C |
Front-end start and UI mode | SYS_StartFrontend (exe/slus_004_22@0x8014EA80) (streams FIRST.EMI), SYS_EnterFrontend (streams BIN/ETC/GAME.EMI), UI_SetMode, UI_DispatchLocalMode |
the dispatch copies the table g_UiLocalModeFuncs at 0x801499AC (84 bytes, 21 entries) and calls the current entry with jalr |
0x8014EDF0..0x8014F704 |
24 unnamed functions; 21 are the local-mode callbacks | none named | the 21-entry table at 0x801499AC lists them; what each mode does is not identified |
0x8014F800..0x801501E4 |
Text drawing | UI_DrawText, UI_DrawTextGlyphs (exe/slus_004_22@0x8014F84C), UI_DrawTextString, UI_DrawAsciiString, UI_DrawGlyphString |
control bytes 0x01, 0xFF, 0x15; 8x12 and 8x8 cells |
0x80150224..0x80150304 |
Resource request and area message | Message_StartAreaMessage, Message_Request, Message_GetText |
Message_GetText reads the table at 0x8001A000 |
0x80150304..0x801519F8 |
Message window and choice UI | UI_ResetMessage, UI_UpdateLayout, UI_DrawMessageScript (exe/slus_004_22@0x80150470), UI_HandleChoiceInput, UI_ScrollChoice, UI_UpdateChoice, UI_ClosePanel |
|
0x801507BC..0x80151964 |
25 unnamed helpers between the named choice functions | none | called by UI_UpdateLayout/UI_DrawMessageScript; roles not identified |
0x801519F8..0x801526C8 |
27 unnamed primitive builders | none | callees GetTPage, GetClut, SetPolyFT4, GFX_AddPrim; called from UI_DrawMessageScript |
0x801526F4..0x801527E4 |
Wait marker | UI_DrawWaitMarker |
|
0x801527E4..0x80153DE8 |
9 unnamed cell-grid routines | none | callees Area_RequestCellRows, Area_GetCell, Area_UploadCell, Area_IndexCells; 72 call sites in scenario/* |
0x801541C0..0x80158B24 |
Map cells, height, bundle opcodes, parts | Area_GetCell, Area_UploadCell, Area_IndexCells (56 x 28 grid), Area_SampleHeight, Area_RunBundleOpcodes, Area_RunBundleRecords, Area_DrawParts, Area_DrawPartQuads, Area_DrawGouraudQuads, Area_ApplyPaletteTint |
handler tables D_8017F668, D_8017F8F0, D_8017F8FC |
0x80158C80..0x80158F80 |
Menu panel tasks | Menu_UpdatePanelTasks, Menu_OpenPanelTask, Menu_ResetPanelTasks |
22 slots g_MenuPanelTasks (exe/slus_004_22@0x80148330), the handlers of g_MenuPanelHandlers and g_MenuPanelStateHandlers |
0x80158F80..0x8015A554 |
23 unnamed drawing functions | none | callees GFX_AddPrim, SetLineF4, UI_UpdateLayout; called from scenario/* and world03 |
0x8015A758..0x8015A7E8 |
Party work records | Area_UpdateParty |
|
0x8015A7E8..0x8015B4F4 |
9 unnamed GTE transform helpers | none | callees RotMatrix, SetRotMatrix, SetTransMatrix, RotTrans; 18 call sites in etc/* |
0x8015B580..0x8015B61C |
Flag bit set, clear, test, toggle | SYS_SetFlag, SYS_ClearFlag, SYS_TestFlag, SYS_ToggleFlag |
scenario scripts use them on g_SceneFlags |
0x8015B61C..0x8015BAC4 |
22 unnamed script predicates | none | D_8018217C[21] (exe/slus_004_22@0x8018217C) lists them; the game/00 script interpreter indexes the table; callees SYS_TestFlag, Actor_*Script; 25 call sites in etc/* |
0x8015BBA4..0x8015BEA0 |
Camera angles | Area_TurnCameraX/Y/Z, Area_StepCameraX/Y/Z |
|
0x8015C148..0x8015CB18 |
Actor movement | Actor_GetType, Actor_RunHandler, Actor_InitMovement, Actor_StepMovement, Actor_StepScroll, Actor_ApplyVelocity, Actor_FindFree |
(30 g_Actors records) |
0x8015CD00..0x80161B24 |
Sound engine | SND_Init, SND_Start, SND_Exit, SND_PlayCue (exe/slus_004_22@0x8015DF18), SND_QueueSelectionFx, SND_QueueProximityCue, SND_SetBankLayout (exe/slus_004_22@0x80161808), the sweep and fade functions |
calls SsSep*, SpuSetVoiceAttr |
0x8015E994..0x80161454 |
8 unnamed sound-voice functions | none | callees SpuSetVoiceAttr, SpuGetKeyStatus, csqrt |
0x80161B24..0x80161F58 |
Music (BGM) control | SND_RequestBGM, SND_StartBGM, SND_PlayBgm, SND_FadeOutBgm, SND_PauseBgm, SND_ResumeBgm, SND_InstallSequenceFuncs |
g_SndBgmId |
0x80161F58..0x80163698 |
EMI loader | EMI_Init, EMI_Update (exe/slus_004_22@0x80163010), EMI_CdOnReady (exe/slus_004_22@0x80162230), EMI_LoadToVram/VabHeader/VabBody/VabCues/Sequence, the CD mode steps EMI_LoaderSetCdSpeed to EMI_CdOnPause |
SYS_Main calls EMI_Update; it reads g_EmiServiceMode and calls EMI_UpdateStream for 1 and SND_UpdateXA for 2 |
0x801636A0..0x80164020 |
XA streaming and CD volume | SND_StartXAStream, SND_UpdateXA, nine state functions SND_XaState*, SND_SetCdVolume, SND_FadeCdVolume |
state 1 CdlSeekP, state 3 CdlReadS, state 6 CdlPause |
0x80164028..0x801642CC |
Sector decoder | LZ77_DecodeBegin, LZ77_DecodeStep |
type-1 LZ77; a different decoder from GFX_DecodeLzss (the two routines use different bit layouts) |
0x801642CC..0x80164EF8 |
10 unnamed sprite and window drawing helpers | none | callees GetGraphType, GFX_AddPrim, SetSprt; 80 call sites in etc/*, 19 in battle/* |
0x801650B4..0x80168248 |
Party, inventory, character records | Party_AddItem, Party_CountItem, Party_AddZenny, Party_AddMember, Char_AddHp, Char_LoseHp, Char_GetAbilities, Item_GetDescription |
Party_AddItem caps at 99 (0x63), Party_AddZenny clamps at 0x98967F, Char_AddHp clamps current_hp at max_hp (halfwords at +0x14, +0x1C) |
0x801651DC..0x801660B0 |
20 unnamed party and item helpers | none | callee Char_GetAbilities; 123 call sites in etc/*, 54 in plchar/*, 36 in battle/*; g_VitalItemIds names Party_HasVitalItem and Party_AddVitalItem as its scanners |
0x80166DF4..0x8016728C |
File-not-found screen, loader family start | SYS_ShowFileNotFound, EMI_LoadPartyArchives, EMI_GetArchiveId |
|
0x80167344..0x8016788C |
Scene dispatch and timer | Area_DispatchScene, Area_InitScene, Area_StepSceneTimer, Area_ResetScene |
D_80183A60 table |
0x8016B2AC..0x80178858, 0x8017EEEC..0x8017F3BC |
PsyQ library: sound (Ss*, Spu*), counters, pad |
SsInit, SpuInit, PAD_init, SetRCnt |
library units; not game code |
The three jalr-driven tables named above (0x801499AC, D_8018217C, D_80183A60) hide
their callees from a jal call graph. An address-named function with no caller is often a table
entry.
Resident game layer (emi/etc/game/00)
Section titled “Resident game layer (emi/etc/game/00)”Loads at 0x80195800, stays in RAM, and is visible to slus and every overlay. Its data tables
sit at 0x801C7AC0 to about 0x801CD958.
| Address range | Subsystem | Entry points | Notes |
|---|---|---|---|
0x8019601C..0x80196260 |
Field actor slots (20 records at g_ActorSlots) |
Actor_FindFreeSlot (emi/etc/game/00@0x8019601C), Actor_Create, Actor_Free, Actor_ClearAll |
|
0x8019651C..0x80196F78 |
Palette fades, cells and animations | GFX_AllocPaletteFade, GFX_AllocPaletteCell, GFX_UploadPaletteRows, GFX_StartPaletteAnimation, GFX_StepPaletteAnimation |
(D_80145BD4, D_80145D54, D_80145D94) |
0x80196F78..0x801971E8 |
Game state loop and camp menu load | Game_UpdateMain (emi/etc/game/00@0x80197068) (the g_GameStates selection loop), Game_UpdateCampMenu, Game_LoadCampMenu (slot 0x268), Game_NewGame |
|
0x801971E8..0x80199638 |
52 unnamed front-end flow functions | none | callees CallbackWait, EMI_IsReady, UI_SetMode, EMI_GetArchiveId, Menu_UpdatePanelTasks; the tables g_GameStates, g_MenuPanelHandlers |
0x80199678..0x8019A0E4 |
Panel cursor and slide | Menu_DrawPanelCursor, Menu_SlidePanelLeft |
the slide body is shared with battle and start |
0x8019A194..0x8019A1D4 |
Area handler lookup | Game_FindAreaHandler |
returns 11 when no AreaHandler row’s key equals g_GameAreaId (the loop bound is 11) |
0x8019A1D4..0x801A7330 |
196 unnamed scene and actor helpers | none | callees Area_SampleHeight (33), Actor_Clear (22), Actor_SelectScript (19), Area_FindSceneRecord (18); 852 call sites in scenario/*, 149 in world01 |
0x801A7704..0x801A86D4 |
Scenario and scene dispatch | Scene_Start, Scene_LoadOverlay (streams slot 661 + scenario id), Game_UpdateScenario, Game_DispatchScenarioRecord, Game_CallScenarioHandler, Game_UpdateScene, Scene_UpdateEvent |
tables g_SceneScenes, g_SceneStates, g_SceneEvents[64], g_SceneObjects[66] |
0x801A8714..0x801AED54 |
60 unnamed menu drawing helpers | none | 54 call sites in bate, 48 in shisu, 39 in shop, 36 in start; callees GFX_AddPrim, GFX_DrawLine, Party_AddZenny |
0x801AF0F4..0x801AF20C |
Line primitive | GFX_DrawLine |
|
0x801AF20C..0x801BC000 |
176 unnamed sprite-rectangle and actor movement helpers | none | a UvRect header comment names UI_DrawSprite as the SPRT copier; callees Actor_RequestScript (48), Area_ReadHeight (21); 336 call sites in scenario/*, 324 in plchar/* |
0x801BC3B8..0x801BC4D0 |
Scene timer and reset | Area_StepSceneTimer, Area_ResetScene |
Area_StepSceneTimer is 72 bytes here and in slus, so the two share one body. Area_ResetScene is 208 bytes here and 132 in slus, so they do not |
0x801BC4D0..0x801C7A54 |
138 unnamed actor script and height helpers | none | callees Area_ReadHeight (27), Area_ReadStepHeight (21), Actor_RequestScript (17); 2,374 call sites in scenario/* |
0x801C7AC0..0x801CD958 |
Data tables: game states, menu handlers, scene tables, AreaHandler[11] at 0x801C7F5C, record tables |
g_GameStates (emi/etc/game/00@0x801C7B14), g_MenuPanelHandlers (emi/etc/game/00@0x801C7BEC), g_SceneScenes (emi/etc/game/00@0x801C8454), g_GameShopStock (emi/etc/game/00@0x801CA28C), g_LevelGrowth (emi/etc/game/00@0x801CB8DC) |
the record tables start at 0x801C8964 |
Shared function bodies
Section titled “Shared function bodies”Several images carry one function body. Equal function sizes in the overlays mean one shared body. Sizes diverge where a variant exists (Menu_DrawPortrait is 384 bytes in
sisyou, 332 elsewhere). The scratchpad cell g_SpadWork (0x1F800044) points at an actor row; the
actor record is in field.
| Family | Images sharing the body | Examples |
|---|---|---|
etc |
up to 5 | Menu_DrawStatPanel, Menu_DrawItemRow, Item_GetPrice, Menu_DrawCursorFrame shared by shop, start, bate and shisu |
| menu helpers | up to 5 | Char_GetExpForLevel, Menu_SlidePanelLeft |
boss |
35 | Boss_InstallBattleHooks in all 35 boss images |
bmagic |
24 | BMagic_DispatchMode in 24 images |
plchar |
11 | Char_WalkStep in 11 images |
world, world04 |
up to 22, 10 | area helpers |
battle, scenario |
2 | Battle_PickRandomTarget, Scene_ClearParty |
Asset classes
Section titled “Asset classes”Per class: the function that loads, parses and uses it. Layouts are in the file format pages and editing guides; the disc side is in disc and files.
| Class | Load | Parse | Use | Format |
|---|---|---|---|---|
| UI panels and menus | SYS_EnterFrontend (exe/slus_004_22@0x8014EC64) streams GAME.EMI; Game_LoadCampMenu (emi/etc/game/00@0x80196FFC) (game/00) loads slot 0x268; overlays through EMI_GetArchiveId (exe/slus_004_22@0x8016728C) |
Panel tables g_MenuPanelHandlers (emi/etc/game/00@0x801C7BEC) and g_GameStates (emi/etc/game/00@0x801C7B14) in game/00; UI_UpdateLayout (exe/slus_004_22@0x801503E0) rebuilds the two window cells |
UI_SetMode, UI_DispatchLocalMode, Menu_UpdatePanelTasks (exe/slus_004_22@0x80158C80); the shared Menu_Draw* bodies in etc/start/08, shop, bate, shisu |
UI, screens |
| Fonts and glyphs | Glyph sheet loader not identified | UI_DrawTextGlyphs (exe/slus_004_22@0x8014F84C), UI_DrawTextString (exe/slus_004_22@0x8014FC90) read control bytes 0x01, 0xFF, 0x15 |
UI_DrawGlyphString (exe/slus_004_22@0x80150098) (8x8 cells), UI_DrawAsciiString (exe/slus_004_22@0x8014FF0C) (8x12), GFX_BuildGlyphPrimitive (emi/etc/game/01@0x801D17D8) in game/01 (20-record glyph geometry table) |
game text |
| Strings and messages | Message_Request (exe/slus_004_22@0x80150284), Message_GetText (exe/slus_004_22@0x801502D0) (table at 0x8001A000, asm checked); Message_StartAreaMessage (exe/slus_004_22@0x80150224) |
UI_DrawMessageScript (exe/slus_004_22@0x80150470) walks the message script at D_801490AC; Item_GetDescription (exe/slus_004_22@0x801666C8) returns a resource id from a row table |
UI_DrawText, SYS_CopyString (exe/slus_004_22@0x801501E4) (battle copies item and character names) |
message tables, game text |
| Sound effects | Banks: see soundbanks | Cue records dispatched by SND_PlayCue (exe/slus_004_22@0x8015DF18) (bank and record, interpolated channel values, key-on) |
SND_QueueSelectionFx (exe/slus_004_22@0x8015D71C), SND_QueueCueVolume (exe/slus_004_22@0x8015D7C8) (levels D_80182288), SND_QueueProximityCue (exe/slus_004_22@0x8015DC08), SND_FindFreeFxVoice (exe/slus_004_22@0x8015D660) |
cue records |
| Music (BGM) | EMI_LoadSequence (exe/slus_004_22@0x80162A6C), types 9 and 10 |
PsyQ SsSep* plays the sequence; the format is the SDK’s |
SND_RequestBGM (exe/slus_004_22@0x80161BBC), SND_StartBGM, SND_PlayBgm (exe/slus_004_22@0x80161C20) (resolves the BGM’s two cue bytes), SND_PlaySequence (exe/slus_004_22@0x8015D300), SND_FadeOutBgm, SND_PauseBgm, SND_ResumeBgm |
SEP package |
| Soundbanks | EMI_LoadVabHeader (exe/slus_004_22@0x80162790) (type 6), EMI_LoadVabBody (exe/slus_004_22@0x80162898) (7), EMI_LoadSoundCues (exe/slus_004_22@0x801629F0) (8), EMI_UploadVabBody (exe/slus_004_22@0x80163418) (SsVabTransBodyPartly) |
SND_SetBankLayout (exe/slus_004_22@0x80161808) builds six (pointer, index, size) entries per bank; offset tables g_VabProgramOffsets, g_VabToneOffsets (widths only, no field meaning) |
SND_Init (exe/slus_004_22@0x8015CD00) builds the SE table; SND_Exit closes the seven VAB and SEP banks |
VAB bank |
| XA streams | SND_StartXAStream (exe/slus_004_22@0x801636A0) resets the request block from a packed key |
SND_ResolveXAStream (exe/slus_004_22@0x80163744) resolves the loader entry and bounds |
SND_UpdateXA (exe/slus_004_22@0x801638B0) runs the state functions from EMI_Update mode 2; SND_SetCdVolume, SND_FadeCdVolume |
XA cue tables |
| Sprites and animation | Graphics payloads: EMI_LoadToVram (exe/slus_004_22@0x80162698) (type 3) |
Part lists and animation frames read inside Area_DrawPartAnimation (exe/slus_004_22@0x80156C18) (frame from g_FrameCount), Area_DrawParts (exe/slus_004_22@0x80157358), Area_DrawQuad (exe/slus_004_22@0x80156228) |
Area_DrawObjectSprite (exe/slus_004_22@0x8014C4D4), Area_DrawSpriteCell, Area_DrawSceneSprite (exe/slus_004_22@0x801579A8), Char_WalkStep in plchar |
character sprites |
| Stats and records | The record tables are data inside the resident game/00 image |
No parser: static tables g_LevelGrowth (emi/etc/game/00@0x801CB8DC) (5,544 bytes) and g_GameShopStock (emi/etc/game/00@0x801CA28C) (920 bytes), read by their consumers |
Party_AddItem (exe/slus_004_22@0x801650B4), Party_CountItem (exe/slus_004_22@0x8016628C), Party_AddZenny (exe/slus_004_22@0x8016666C), Char_AddHp (exe/slus_004_22@0x80167FDC), Char_LoseHp (exe/slus_004_22@0x8016813C), Party_AddMember (exe/slus_004_22@0x801667A4); layouts in records |
game records |
| Maps and scripts | Scene_LoadOverlay (emi/etc/game/00@0x801A7804) streams slot 661 + scenario id; the loader path of the area bundle is not identified |
Bundle opcodes Area_RunBundleOpcodes (exe/slus_004_22@0x80157F98) and records Area_RunBundleRecords (exe/slus_004_22@0x801584A4); cell grid Area_IndexCells (exe/slus_004_22@0x80158B24); script stream Actor_SeekScript (exe/slus_004_22@0x8014D910) |
Area_DispatchScene (exe/slus_004_22@0x80167344), Game_UpdateScenario (emi/etc/game/00@0x801A782C), Scene_UpdateEvent (emi/etc/game/00@0x801A7CAC), Area_SampleHeight (exe/slus_004_22@0x8015477C) |
area data |
| Textures and palettes | EMI_UploadSectorImage (exe/slus_004_22@0x80163378) (slot rectangle, LoadImage); GFX_UploadPalette (exe/slus_004_22@0x8014E22C) (0x100 x 0x20 stage) |
LZ77_DecodeStep (exe/slus_004_22@0x80164064) decodes the type-1 LZ77 stream; GFX_DecodeLzss (exe/slus_004_22@0x8014E8FC) decodes transfer kind 2; GFX_ExpandRgb555 (exe/slus_004_22@0x8014E7F8) kind 1 |
Area_LoadPaletteBank (exe/slus_004_22@0x80158550), Area_ApplyPaletteTint (exe/slus_004_22@0x8015822C), GFX_AllocPaletteFade (emi/etc/game/00@0x8019651C) (game/00), GFX_StartPaletteAnimation (emi/etc/game/00@0x80196CF0) |
graphics |
| Saves | SYS_InitCard (exe/slus_004_22@0x8014B1A4) opens the seven card events; SAVE_AccessFile (emi/etc/start/09@0x801EEC30) in etc/start/09 |
SAVE_BuildFileHeader (emi/etc/start/09@0x801EF27C), SAVE_ScanDirectory (emi/etc/start/09@0x801EFCA8), SAVE_TransferFile (emi/etc/start/09@0x801EFB44) |
SAVE_DrawSlots (emi/etc/start/08@0x801E6C68), SAVE_DrawSlot (emi/etc/start/08@0x801E11A8) in etc/start/08; layout in saving |
save format |
Open questions
Section titled “Open questions”battle/batl_end,batl_ovr,batl_re2/01,etc/bate/03,scenario/sce15ef0-3and the 21 images with no functions have no identified role.- Address-named blocks have no identified role: the 22 script predicates, the 21 local-mode callbacks and most of the 681 functions in
game/00. - Script opcodes for
scenarioandworld*.
Sources and confidence
Section titled “Sources and confidence”- Confidence: medium. The family, range and asset-class roles are read from the names, callers and call counts of the images, but many ranges are address-named and have no identified role.
- Evidence: function names and address ranges of all 428 images, callees and call-site counts of each unnamed range, the handler tables behind
jalrcalls, and each asset class’s load, parse and use functions.
Related
Section titled “Related”- Architecture overview: the structure these images implement.
- Programs and load addresses: where each family loads.
- Memory: the RAM map.
- Loading: how the loader fills the windows.
- Asset kinds: formats the asset classes read.
- Game phases: how the resident layer sequences the game.