# Descriptive names for game functions (USA address -> name), added to the binary as aliases of
# func_<ADDR> by tools/gen_names.py (tools/link.sh): gdb, crash backtraces, the profiler
# (tools/prof_report.py) and `nm` show them; the link itself keeps using the func_<ADDR> names.
# One per line: func_<ADDR> <name> [# note]. Names: <area>_<what>, C identifier characters only.
# Add a name when a function's role is established (BOOT_LOG / a native rewrite's header).

# --- nw::eft particle system (BOOT_LOG 120-121)
func_00111F1C  eft_System_CreateEmitterSetID      # (system, handle, mtx, set id, resource, group, mask)
func_003F7FB0  eft_System_KillEmitterSet
func_003F7D70  eft_System_KillAllEmitters
func_003F7CC4  eft_System_EntryResource           # native wrapper registers the PTCL programs
func_003F6FF4  eft_System_Initialize               # builds the three emitter calcs (+0x494..)
func_003F6FBC  eft_System_BeginFrame
func_003F8250  eft_System_CalcDrawEmitterSet       # native wrapper translates the written blocks
func_003F0080  eft_Emitter_DrawSetup               # program stream, textures, combiner, blend
func_003EF244  eft_FlushDrawBatch                  # copies the prebuilt draw block
func_003EF0F8  eft_SetPassCameraUniforms           # c85 eye, c86-c89 projection, c90-c92 view
func_003F43DC  eft_EmitterSimple_Draw
func_003F4D34  eft_EmitterComplex_Draw
func_003F5498  eft_EmitterChild_Draw
func_003F5734  eft_EmitterChild_DrawStripe
func_005648EC  eft_Resource_SearchEmitterSetID
func_00564908  eft_Resource_SearchEmitterSetName   # strcmp over the resource's set names
func_002E2F78  EffectMgr_Initialize
func_002E32DC  EffectMgr_LoadJackAll
func_002E3494  EffectMgr_LoadDemoEffects
func_002E3DF4  EffectMgr_CalcFrame
func_002E39E8  EffectMgr_DrawPass                  # native wrapper translates the pass
func_004A21F8  EffectKey_ResolveEmitterSets
func_00111188  EffectKey_Start
func_00111AA0  EffectKey_CreateEmitterSet
func_004A2934  EffectKey_Update
func_001FFE2C  EffectKey_ListenerCallback

# --- fog
func_0026EB74  Fog_WriteCommands                   # native wrapper: ROP_FOG
func_003CC288  Fog_BuildLut

# --- animation / materials
func_00169608  SkelAnim_BindByName
func_00169A80  SkelAnim_Calc
func_0016898C  SkelAnim_Request
func_00168E9C  AnimSlots_Update
func_00567588  MaterialAnim_ApplyFrame
func_001699A0  MaterialAnim_ApplyClamped
func_0068FDFC  MaterialAnim_Evaluate
func_0028C8EC  Player_SetFace                      # Link_FaceChange frame (7 = eyes closed)
func_002DD4B0  Player_FaceForAnimation
func_0028C954  Player_CreateAnimations

# --- graphics / sdk
func_0049F3C4  Gfx_ClearRenderTarget
func_004371D8  Lyt_DrawVisitor_Parts
func_003CBC1C  Gr_FragmentLightingOff
func_001139F8  nngx_GetPhysicalAddr
func_00600660  nngxGetVramStartAddr
func_006003D8  nngxGetCmdlistParameteri
func_00601378  nngxMoveCommandbufferPointer
func_0010EE40  nn_os_GetDeviceMemoryAddress
func_001022F4  nn_os_GetDeviceMemorySize
func_004994B0  sead_BufferedSafeString_format
func_0010FBAC  strcmp

# --- pushable / pullable objects: gravestones MojTomb* (BOOT_LOG 160k; native/PUSHABLES.md)
func_00348558  player_InteractionCheck            # contact scan, interaction kind (vt+0x4C), A -> action
func_005244C0  pushable_InteractionKind           # MojTomb vt+0x4C: 15 when stick up and Link south of it
func_003783F4  player_PushPull_Enter               # states 0x73..0x77 enter: anims, SE_PV_PUSH_PULL
func_003786B8  player_PushPull_Update              # 0x73 grip: count push/pull frames -> 0x74 / 0x75 move
func_00176664  pushable_CanMoveDir                 # MojTomb vt+0x58: Link facing up and dir up
func_00325CF4  pushable_CheckMoveTarget            # target = pos + 1 unit in dir -> vt+0x5C
func_001766B4  pushable_CanMoveTo                  # MojTomb vt+0x5C: direction check + 00325DE0
func_00325DE0  pushable_IsTargetFree               # actors in the way, ground height test, sweep 0054EA88
func_0054E224  pushable_HeightTest_thunk           # vt+0x60 (b 0054E650)
func_0054E650  pushable_HeightTest                 # (this, ground, height, tolerance) -> 1 = blocked
func_0054E64C  pushable_HeightTest2                # vt+0x64, same body
func_0052456C  pushable_GripFrames                 # MojTomb vt+0x54: 46 frames of pushing before it moves
func_00176314  pushable_IdleUpdate                 # starts the move when the player is in state 0x74
func_0053F260  player_IsPushMoving                 # player state 0x74 and 005594D0
func_00176370  pushable_MoveEnter                  # SE_TombMOVE, moving flag +0x4CC
func_001767D4  pushable_MoveUpdate                 # 90-frame move animation
func_0054E364  pushable_IsMoving                   # vt+0x6C: byte +0x4CC

# --- enemies: hits and knock-back (BOOT_LOG 160l); the graveyard Poe (EnemyGraveyardPoe)
func_0060823C  create_EnemyGraveyardPoe            # alloc 0x9C4, EnemyBase ctor 001AD594, vtables 0x6E12D0 / +0x320
func_001AD140  enemy_Update                        # per-frame enemy update (hits 004F8998, reactions, movement)
func_004F8998  enemy_CheckHits
func_004F8EA8  enemy_ProcessHit                    # hit direction (004FA174), hit record, reaction state
func_004FA174  enemy_HitDirection                  # returns a Vec3 in s0..s2 (albw_s012 natively)
func_0058A7E8  enemy_GetHitRecordDirection         # vt+0x58 base: Vec3 rec+0x0C in s0..s2
func_004F5390  hitRecord_Init
func_002ABDE8  enemyReaction_OnHit                 # reaction state machine at enemy+0x510 (self+0x34 = enemy)
func_002AE780  enemyReaction_CopyHit               # hit record -> knock-back direction +0xF8
func_002B0D7C  enemyReaction_StartKnockBack        # velocity +0x3C = dir * speed
func_002AFEF0  enemyReaction_KnockBackUpdate       # decays x / z of the knock-back velocity
func_004F48F0  enemy_ApplyVelocity                 # pos += own + push, or the reaction's velocity

# --- scene objects: animation sets (BOOT_LOG 160m)
func_004B79BC  scene_SetupObjects                  # per-slot tables; obj->vt[8](obj, table) binds animations
func_001FEA80  animSet_Bind                        # vt[8]: one animation per table entry (00169608 + 00133870)
func_00169608  animSet_SetAnim                     # lookup 00533304(resource, name) -> slot
func_00133870  animSet_AttachSlot                  # slot i -> 0013388C(model binder)
func_0013388C  animSlot_Attach

# --- frame buffers and render-to-texture (BOOT_LOG 160o)
func_00322CF4  renderer_Init                       # records the "bind main buffer" command lists (+0x16C / +0x178)
func_0054D264  renderer_CopyMainTargetBind         # copies that bind list into the frame list (after a render-to-texture pass)
func_0057E870  renderPass_BindTargetIfChanged      # binds the pass's frame buffer unless the cache (data 0x79DF64) says it is bound
func_002FF8A4  renderTexture_Create                # 128x128 colour+depth target; records its bind list (+0x34 / +0x2C)
func_002FF5D0  renderTexture_Draw                  # copies the bind list into the frame list, draws its models
func_002C30E8  renderTexture_DrawAll               # per texture: draw, then renderer_CopyMainTargetBind
func_00561B30  gr_RenderTarget_MakeCommand         # nn::gr: frame-buffer bind command (native: ROP_TARGET, kept in the op pool)
func_0014C108  render_TopScreenPass                # left-eye top-screen pass
func_0014B788  render_BottomScreenPass

# --- cast attachments (BOOT_LOG 160q)
func_004C7A54  castAttachment_Update               # attached model (sword, staff) follows its bone; setAlpha(cast slot alpha)
func_00582C90  castMgr_GetSlotAlpha                # float alpha of a cast slot, 1.0 when empty
func_00582DA4  castMgr_GetSlotBoneMatrix
func_002C3EB4  model_SetAlpha                      # vt+0x18 (model, layer, float alpha): clamps 0..1, switches draw layers
func_004D08D4  model_Construct
func_004CEF4C  model_IsVisibleThisFrame
func_00554F70  castCmd_PlayAnim                    # event command: cast slot animation (vt+4 = castSlot_PlayAnim)
func_004F0864  castSlot_PlayAnim                   # (slot, anim, blend): anims in mask +0x110 also drive the locator layer (+0x44, flag +0x11C)
func_004F1310  castSlot_UpdateTransform            # model matrix = slot pos +0x48 (+ locator bone of +0x40 when +0x11C)
func_004B08FC  castMgr_Update                      # 16 cast slots (+0x1418), attachments (+0x1458)
func_004B7810  castMgr_RunCommands
func_00232F40  mapRoomVis_Update                   # worker thread: per-model room-visibility (+0x35 hidden) from the camera frustum
func_004CF600  model_InFrustum                     # bounding sphere vs frustum planes

# --- grass / bushes (BOOT_LOG 160t)
func_00235ED4  grassMgr_Update                     # bushes / grass: cut, lift, burn (state 2 = burning: fade by curve)
func_00691D68  curve_Evaluate                      # (curve, float t) -> float: data_00715240[kind] handlers

# --- projection / culling (BOOT_LOG 160v)
func_0057F6C0  perspProj_UpdateMatrix              # sead PerspectiveProjection vt+0x14: near +0x94, far +0x98, tan(fovy/2) +0xA8, aspect +0xAC
func_003FB1D0  viewFrustum_Build                   # culling frustum corners / planes from two projection matrices
func_0057D258  proj_GetMatrix                      # rebuilds the matrix (vt+0x14) while dirty (+4), then the device matrix (+5)
func_0057D5C4  proj_GetDeviceMatrix
func_001312BC  scene_SubmitAndCull                 # per frame: views, frustum, model submission, map culling projection
func_003F9B70  eft_System_SetupRenderState         # records the effect pass render state block once (stencil off)
func_00237288  grassMgr_CutOne                     # bush / grass cut, burn or break: XLink effect + SE_Grass_* sound
func_0010DBBC  xlink_EmitByName                    # name-keyed effect / sound event on a user object
func_002611BC  doorway_OnTouch                     # walk-through: route point beyond the doorway -> player walk request
func_00291CF0  player_RequestDoorWalk              # target, direction, distance -> state 0x5F
func_003A762C  playerState_WalkToTarget            # bool: arrived (xz distance <= threshold)
func_001514C8  actor_CollisionChildCheck
