# config/struct_classes.txt -- the layout class of every struct the layout
# asserts touch (tools/gen_layout_asserts.py, port/test/layout_asserts.c).
#
#   <name> <class> [size=0xNN] [base=0xNN] [pending=<package>] [nosize]  # evidence
#
# class
#   runtime  natural host layout, real pointers: asserted on the 32-bit
#            presets only (the EE layout), free to change on 64-bit
#   overlay  read directly from disc or ELF bytes: frozen on every preset;
#            pointer fields become u32 offsets or are resolved by the loader
#   save     serialised into the save image or the memory card files: frozen
# size=      the struct's size where no header comment gives it
# base=      the header's comments are offsets in an enclosing record, where
#            this struct sits at base
# pending=   a frozen struct whose 64-bit asserts wait for that package to
#            convert its pointer fields. None is pending: the 2C disc-loader
#            structs are converted, and the ELF tables'
#            records with pointers are `runtime`, decoded field by field into
#            the host layout by the table loader (5B).
# nosize     the "N bytes" in the struct's leading comment is not its size
#
# Evidence: "ELF <member>" is a row of config/data_schema.pal.txt (an ELF data
# table, decoded field by field from the user's ELF at boot by
# port/data/tables.c; its EE layout is asserted by the generated
# port/data/gen/table_desc.c on every host for pointer-free records, on a
# 32-bit host for the rest).

# --- common/include/charFileManager.h ---------------------------------------
TexRec               overlay   # ELF texture-path
PObjMdl              overlay   size=0x10C # ELF model-path: 0x8C bytes on the disc, then the port's host-only modelPath and shadowPath (the USA disc's, config/data_schema.ntsc.txt extend rows); the loader copies field by field
# --- common/include/kanban.h -------------------------------------------------
Kanban               runtime   # kanban.c's sign list, allocated per sign (kanbanReqAdd)
# --- common/include/layout_texture.h -----------------------------------------
LtProperty           runtime   # ELF tex-property, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. texData is a run-time pointer slot, null in the ROM
LtProp               runtime   # ELF texture-layout, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. proc is a function pointer
# --- common/include/sceneManager.h -------------------------------------------
SObjSimpleSetting    runtime   # built on the stack and in InitialSObjSimpleSetting (sceneManager.c), handed to constructors
EnemyMdlRec          overlay   # ELF enemy-model-grp
# --- common/include/typedef.h ------------------------------------------------
DObjNode             runtime   # Sub15C + 0x870's per-node display records, iosMalloc'd (DObj.c)
GObj                 runtime   # the game object, gobj.c's table
MotOriReq            runtime   # orient request passed by value (SetMotionRequest)
HandRec              runtime   # MotRoot's hand records
MotRoot              runtime   # embedded in Sub15C at 0xA0
MotCtrl              runtime   # embedded in Sub15C at 0x470
SkelNode             overlay   # .skb file records, kept as loaded and checksummed byte for byte (charFileManager.c ReadSkeltonFile)
MotIk                runtime   # Sub15C nodeRotElem, allocated per skeleton
Sub15C               runtime   # the display object, CSVSYSTEM_InitDObj
StageSetting         overlay  size=0x1D0   # .ssb memcpy'd into GlobalStageSetting (sizeof = 0x1D0, ReadStageSettingFile)
BrainTarget          runtime   # the girl brain's target list (Brain)
GsysObjInfo          save      # debug.c's view of a gameSysObjInfo record, written to the save image by gamesysObjInfoSave (0x2D80 bytes)
McDirEnt             save      # memory card directory entry (sceMcTblGetDir view), filled by libmc from the card
PadState             runtime   # keyInput.c's per-pad state
ObjKindEnt           runtime   # ELF obj-kind-data, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. 11 function pointers
StgPre               runtime   # ELF stage-all, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. initproc, endproc
ClipWork             runtime   # collision query on the stack (ClipWall, ClipFloor)
Brain                runtime   # the girl's brain work
ViTs                 runtime   # movie time stamp pair (mv_*)
Pad                  runtime   # head of a pad record (keyInput.c)
ExitData             overlay   # ELF exit-data
ActMail              runtime   # actor mail table rows; entry points are code addresses built into actor TUs' static tables
WVTObj               runtime   # guide-way work block, iosMalloc'd (way_sys.c) and embedded in Act at 0x360
WayRequest           runtime   # way search request (act-way.c)
ActEnv               runtime   # embedded in Act at 0x4B0
Act                  runtime   # the actor record, actInitialize's allocation
GenGeo               runtime   # ELF obj-layout, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. proc (function), outGObj (object). Its flags and reviveCount are also packed into the save by MakeGeneratorPacket, field by field
OaRecB               overlay   # ELF obj-action
McFileInfo           save     nosize   # McProductFile.file[], written to the card by product_write (mcard.c); the 0x1F0 in its comment is McProductFile's size
McProductFile        save     size=0x1F0   # the card's product file, moved whole by product_write/product_read (mcard.c)
McMgr                runtime   # memory-card manager block (mcard.c, kanbanBoot.c)
# --- fumi/include/act-game.h -------------------------------------------------
ActWork              runtime   # Act.work, the actor's character work, iosMalloc'd per actor
LookTarget           overlay   # ELF look-target-data
# --- fumi/include/act-parallel-control.h -------------------------------------
ParallelMotionRow    overlay   # ELF parallel-motion-tbl
# --- fumi/include/act.h ------------------------------------------------------
ActModeRec           runtime   size=0x54 # 0x50 on the disc, then the port's host-only word of the USA disc's bits (holdDir, saveInfo, pullUp, stopMail: config/data_schema.ntsc.txt extend rows); ELF act-mode-def, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. ent[].act is a function pointer
IntrMail             runtime   # ELF act-intrlist, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. accept, extra, handler, motion are function pointers
# --- fumi/include/adpcm_init.h -----------------------------------------------
AdpcmOpenReq         runtime   # soundDataOpen's request, in memory only
AdpcmChReq           runtime   # adpcm_init.c's channel request
AdpcmStream          runtime   # adpcm_init.c's stream state
AdpcmDataRec         overlay   # ELF adpcmfile
# --- fumi/include/cdvd.h -----------------------------------------------------
CdvdBgReq            runtime   # cdvd.c's seven background read slots
PackKind             runtime   # ELF init-func, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. func is a function pointer
# --- fumi/include/commonact.h ------------------------------------------------
IdlingDef            overlay   # ELF idle-mot-def
IdleRangeRec         overlay   # ELF act-data-tbl
ClingRec             overlay   # ELF node-fix-ofs
BecPair              overlay   # ELF pair-motion
# --- fumi/include/enemy_act.h ------------------------------------------------
EnemyBattleWork      runtime   # Act.enemy, the enemy work (enemy_act.c)
BossPart             runtime   # EnemyBattleWork.boss, a boss's gathering-effect part (enemy_act.c)
ActEffRec            runtime   # ActWork.effRec, ACTGetEnvironment's position and direction records
HandModeCmd           runtime   size=0x8   # EnemyBattleWork.handConnect and handDisconnect (act-game.c)
HandClInfo            runtime   # ActWork.handCl, the hand-link wall probes (act-game.c)
# --- fumi/include/fieldCollision.h -------------------------------------------
FcWallEnt            overlay  size=0x50   # .cl wall table (0x50 stride, `wcl`); normal at 0x4C is an EE address word ReadCollisionFile stores
FcColl               overlay   # .cl file head; wcl fcl wblk fblk ofs relocated in place as EE words (charFileManager.c ReadCollisionFile)
FcFloorEnt           overlay   # .cl floor table (0x70 stride `fcl`)
# --- fumi/include/girl_act.h -------------------------------------------------
EscapeRange          overlay   # ELF param-escape-run
EscortPoint          overlay   # ELF auto-escort
# --- fumi/include/gobj_process.h ---------------------------------------------
GProc                runtime   # process node of a game object, gobj_process.c's pool
# --- fumi/include/jimaku.h ---------------------------------------------------
JimakuSub            runtime  base=0xC   # subtitle request body; its comments are JimakuArg offsets (jimaku.h)
JimakuArg            runtime   # subtitle request message (jimaku.c, script TUs)
JimakuFileName       overlay   # ELF unmapped_0055FBD0 (jimakuFileName)
# --- fumi/include/mcard.h ----------------------------------------------------
IconFile             overlay   # ELF iconfile
# --- fumi/include/mcdata.h ---------------------------------------------------
sceMcIconSys         overlay   size=0x3C4 # ELF mc-icon-sys (the June 2001 demo's extra table, config/data_schema.jun26.txt); pointer-free, copied field by field by the table loader
# --- fumi/include/memory.h ---------------------------------------------------
IosMemPart           runtime  size=0x48   # partition record at the head of each heap partition (memory.c); 80-byte header slot
IosMemNode           runtime  size=0x40   # block header in front of every allocation (memory.c); 0x50 on 64-bit hosts
# --- fumi/include/message.h --------------------------------------------------
IosMsgQueue          runtime   # message.c's queue record
# --- fumi/include/pad.h ------------------------------------------------------
IosPadBuf            runtime   # libpad's DMA buffer as pad.c reads it, filled by port/ libpad
IosPadShock          runtime   # pad.c's device record
IosPadDevRec         runtime   # pad.c's device record
IosPadCtx            runtime   # caller's pad handle (iosPadConnect)
IosPadStick          runtime   # iosPadGetStick's result
PadAct               runtime   # actuator request (iosPadActRequest)
PadActDef            overlay   # ELF shocklist
# --- fumi/include/s_init.h ---------------------------------------------------
SqEntry              runtime   # soundDataTbl rows hold EE addresses as int
SeDef                runtime   # ELF sedef, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. check is a function pointer
SeEnvDef             runtime   # ELF se-env, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. proc is a function pointer
SeSlot               runtime   # seSlotTbl rows (fumi/sound/s_init.c), filled at run time; req, pos, src and env are real pointers, so the host row is larger than the EE's 0x40
SeBank               overlay   # ELF sefile
SeKind               overlay   # ELF selist
# --- fumi/include/shockdriver.h ----------------------------------------------
ShockParam           runtime   # shockdriver.c's voice parameter
VibDecode            runtime   # shockdriver.c's pattern decoder
SHOCKREQUEST         runtime   # ShockRequest pool slot
ShockRequestBox      runtime   # per-player request list
ShockReq             runtime   # motor state
ShockVoiceSet        runtime   # header the loader puts in front of a .svd image, pointers into it
ShockVoiceFile       runtime   # loaded voice-set file: header + image
# --- fumi/include/thread.h ---------------------------------------------------
IOSThread            runtime   # thread.c's thread object
IosSema              runtime   # thread.c's semaphore object
# --- fumi/include/way_llf.h --------------------------------------------------
WayPoint             runtime   # built from WaySrcPt by ExtractWayData (way_tool.c)
WayGroup             runtime   # built from WaySrcGrp by ExtractWayData (way_tool.c)
# --- fumi/include/way_tool.h -------------------------------------------------
WaySrcPt             overlay   # ELF way-point
WaySrcGrp            overlay   # ELF way-group
# --- fumi/include/way_util.h -------------------------------------------------
WgAll                runtime   # WayUtilWorkAlloc's path-search work block
# --- ito/include ------------------------------------------------------------
BirdWork             runtime   # act_bird.c's work, on Sub15C work
GObjMailEntry        runtime   # GObj mail box entry (itou_common.h's view)
GObjMailQueue        runtime   # GObj mail box at 0x54 (itou_common.h's view)
LightningNode        runtime  nosize   # caller's node array (lightning.c); "16-byte position" is a member
AudioDec             runtime   # movie audio decoder record (mv_audiodec.c)
MvDispEnv            runtime   # movie display environment
ReadBuf              runtime   # movie read ring
MvCbStr              runtime   # libmpeg callback data
ViBuf                runtime  nosize   # movie video-input ring; "2048-byte sectors" is the ring's unit
VideoDec             runtime   # movie video decoder
MvCbErr              runtime   # libmpeg callback data
MvCbTs               runtime   # libmpeg callback data
VoTag                runtime   # movie video-out DMA tags
VoBuf                runtime   # movie video-out ring
# --- omori/include -----------------------------------------------------------
AttackKindEntry      overlay   # ELF attack-def
PinRec               overlay   # .gcm camera pin, 0x5C, copied whole (camera-ico2.c ReadCameraSet)
CamGroup             overlay   # .gcm camera group, 0x4C stride; items at 0x48 is an EE address word into the converted copy (eeword.h)
CamSetFile           overlay  size=0x10   # .gcm file head and the converted block's head (camera-ico2.c ReadCameraSet)
MenuThread           runtime   # camera editor menu (debug)
EBSlot               runtime   # ebrain.c's slot
ObjActMailEnt        overlay   # ELF obj-trigger
# --- script/include ----------------------------------------------------------
EffectArg            runtime   # effect argument on the stack (e3.c)
WarpRec              overlay   # ELF girl-warp-list
# --- seki/include ------------------------------------------------------------
EnemyKindRec         runtime   size=0x8 # ELF enemy-model*-kinds (the June 2001 demo's extra tables, config/data_schema.jun26.txt), filled by the table loader; list points into an enemy-model*-kindlist table
EnemyModelSet        runtime   size=0x10 # ELF enemy-model*-set and EnemyInit.c's model 01 set; kinds and pos point at the set's tables
EnemySet             runtime   size=0x8 # ELF enemy-set-table (the June 2001 demo's), EnemyInit.c's one-row PAL table; list points at a set list
BgaAnim              runtime   # bga_InitData's 0x30-byte allocation
BgaHeader            overlay   # .bga file head, relocated in place; dobjs, roots and anim are EE address words (eeword.h)
BgaEnvEnt            overlay   # .bga envelope entry; data is an EE word relocated in place
BgaDObjEnt           overlay   # .bga node record; u, env, child, sibling, motion are EE words
BgaKey               overlay   # .bga type-6 envelope key, floats normalised in place at load
BgaMotion            overlay   # .bga envelope motion; key is an EE word
BgaPtKey             overlay   # .bga particle/lightning motion key
BgaPtMotion          overlay   # .bga particle motion; key is an EE word
BgaExtKey            overlay   # .bga one-value envelope key
BgaExtMotion         overlay   # .bga one-value envelope motion; key is an EE word
BgaSdfKey            overlay   # .cam SDF camera key, used as loaded
BgaSdfCam            overlay  nosize   # .cam SDF camera head, frame and mode written at run time; key[] runs on
PObjMorph            overlay   # .p2o morph table entries, relocated image
PObjMatDef           overlay   # .p2o material definitions
PObjTexDef           overlay   # .p2o texture definitions
PObjPart             runtime   # PObjModel.parts; the host decodes each file ObjRec into it field by field (PObj.c DecodePObjPart)
ObjHdr               overlay  size=0x18   # .p2o file head, objTbl and texTbl relocated in place as EE words (PObj.c AllocPObj)
ObjEnt               overlay   # .p2o polygon table entry, p relocated in place as an EE word
ObjRec               overlay   # .p2o part record in the image, addresses as EE words
PObjMaterial         runtime   # built by pac_makeMaterialTable into the model's group
PObjTexInfo          runtime   # filled by pac_getTextureInfo
PObjGroup            runtime   # per-part group record built at load
PObjModel            runtime   # the model record AllocPObj builds
LightMatrix          runtime   # Sub15C + 0x874's light matrices (Light.c)
ObjLight             overlay   # ELF obj-light
PacHeader            runtime   # pac_makePacket's packets
PacLine              runtime   # pac_makePacket's line records
PacLineSet           runtime   # line part's set record
Mesh3D               runtime   # prim_InitMesh3D's allocation
Fan2DVtx             runtime   # 2D fan vertex (Primitive.c)
Fan2D                runtime  size=12   # 2D fan; prim_InitFan2D allocates 12 bytes (Primitive.c:30)
PrimParticleBuf      runtime   # particle packet buffer
PrimParticleObj      runtime  nosize   # VU1 particle object buffer; "32 bytes a particle" is the element
PrimParticle         runtime   # particle object (0x198 bytes); prim_InitParticle allocates 416, the size rounded to a quadword (Primitive.c:685)
StageAnimDef         runtime   # ELF stage-anim, filled by the table loader (port/data/tables.c, 5B); EE layout asserted by port/data/gen/table_desc.c. data is a run-time object pointer slot
StgObjDat            overlay   # ELF stage-anim-model
BgaPlayNode          runtime   # bgaPlayList node (StageAnimation.c)
Tim2Picture          overlay  size=0x30   # .tm2 picture header, read in place and copied into TexData.pic (Texture.c tex_makeTexturePacket)
Tim2Mipmap           overlay  size=0x30   # .tm2 mipmap header after the picture header, copied into TexData.mip
# --- sugipon/include ---------------------------------------------------------
MotFileHdr           overlay  nosize   # .mob header, words 1-4 relocated in place as EE words (motionFileManager.c relocMotionFile); the comment's "16-byte header" is the header without the facial word at 0x10
FacialRec            overlay   # .mob facial block; tbl and its entries relocated in place as EE words
NodeRec              overlay   # .mob format 3/6 node; nTable and lastTable relocated in place as EE words
LayoutClothDef       overlay   # ELF layout-cloth-def
AccessaryRec         overlay   # ELF accessary
MotSyncPair          overlay   # ELF unmapped_00533FC0 (motSyncPairs)
ClipColReq           runtime   # clip-collision thread request
ExW                  runtime   # cloth chain extended weight
ChainNode            runtime   # InitChains' chain points
ChainParam           runtime   # chain parameters
ClothCfg             runtime   # InitClothes config built by clothTest.c and flag.c
ClothRec             runtime   # InitClothes' cloth
ClothHangCfg         runtime   # InitCloth4D's table rows, static data in the actor TUs
Cloth4DCol           runtime   # cloth collision (clothAnimation.c)
Cloth4DCfg           runtime   # cloth mesh head (clothAnimation.c)
ClothPoint           runtime   # InitCloth4D's scaled copy of a ClothHangCfg row
Cloth4D              runtime  size=0x300   # InitCloth4D's cloth, iosMallocDebug(..., 0x300) (clothAnimation.c:1880)
EnemyKindRange       overlay   # ELF enemy-random-def
EnemyDef             overlay   # ELF enemy-def
EnemyEye             runtime   # InitEnemyEye's allocation
EnemyFootPrint       runtime   # enemyParts.c footprint slot
EnemyFootPrintHead   runtime   # enemyParts.c footprint list head
SePackage            overlay   # ELF prog-se-link
SERandEntry          overlay   # ELF motion-se-random-def
SECondEntry          overlay   # ELF motion-se-condition-def
EffEntry             overlay   # ELF motion-eff-def
VibCondEntry         overlay   # ELF motion-eff-condition-def
HandModeRow          overlay   # ELF motion-ik-eff-def
ItemBreakRec         overlay   # ELF item-kind-def
MotionOrientEntry    overlay   # ELF motion-orient
MotOriParallelEnt    overlay   # ELF parallel-motion-orient
MotOriAlt            overlay   # ELF mirror-motion-def
MotOriName           overlay   # ELF motion-orient-def, moviefile
MotOriSub            overlay   # ELF blend-motion-def
MotOriLimit          overlay   # ELF motion-limit-def (written at run time)
FDSSlot              overlay   # element of MotionDef (ELF motion-def)
MotionDef            overlay   # ELF motion-def
BgaDisp              runtime   # multiBgaManager.c slot
BgaAnimeState        runtime   # multiBgaManager.c initial slot state
PEPackage            overlay   # .pef file copied into a 160-byte slot
PEPartRec            runtime   # particle record (particleEffect.c)
PEGeo                runtime   # SetParticleEffectByPartition's allocation
ParticleEffectFile   overlay   # ELF particle-effect
PoolMesh             runtime   # pool reflection mesh (pool.c)
SpiderKindRec        overlay   # ELF spider-def
StormTestWork        runtime   # InitStormTestGeo's allocation
StreamMotionFile     overlay   # ELF stream-motion-def
LeverGeoWork         runtime   # InitFloorLeverGeo's block
WaterDot             runtime   # waterDot.c's record
WeaponDef            overlay   # ELF weapon-def
FumbleRow            overlay   # ELF weapon-fumble-def

# --- size only (no offset comments in the header) ---------------------------
GamesysObjInfo       save     size=0x40   # gameSysObjInfo[182], written whole as 0x2D80 bytes by gamesysObjInfoSave (gamesys.c)
