# Gate 32: Bob-omb Battlefield's living cast.
#
# Nine classes. Six are ENEMY-family, the first the port hosts -- BOB_OMB
# (206), GOOMBA (200), BOB_OMB_BUDDY (181), CHAIN_CHOMP (219), KOOPA_THE_QUICK
# (188) and KING_BOB_OMB (189) -- and three came in because one of those cannot
# run without them: CHAIN_CHOMP_FENCE (41), STUMP (27), which the chomp spawns
# itself and then writes through, and KOOPA_FLAG (205), the other half of the
# race. Everything before this gate was furniture, ambience or a Platform.
#
# ---- what an Enemy costs that an Actor does not ---------------------------
#
# THIRTY-ONE VTABLE SLOTS, not twenty. Actor appends thirteen virtuals of its
# own after ActorBase's eighteen -- OnYoshiTryEat, OnTurnIntoEgg, Virtual50 and
# the nine combat hooks (OnGroundPounded, OnAttacked1/2, OnKicked, OnPushed,
# OnHitByCannonBlastedChar, OnHitByMegaChar, OnHitFromUnderneath) plus the two
# egg ones -- and every one of these classes is reached through them. Read out
# of the ROM's own tables: _ZTV6Goomba (ov084 0x02130948) and _ZTV6BobOmb
# (ov102 0x0214e558) both run 0x7c bytes, and slot 20 in each is
# Actor::Virtual50. The classes the port carried before declared their vtable
# arrays [20] because nothing on the castle grounds dispatched past 19; an
# enemy that Mario can jump on does, so hal/actor_classes_bob_enemy.cpp
# declares [31] and fills all of them.
#
# THE CALLERS COUNT ROM SLOTS. Every ov002 combat path that dispatches one of
# these -- _ZN13BigBrickBlock15OnHitByMegaCharER6Player and its family -- builds a LOCAL SHADOW CLASS
# with thirty-one virtuals and dispatches through that, so the numbering the
# host array is filled in is the numbering the call site uses. It is the
# header-compiled direction that would diverge (MSVC folds D1/D0 into one
# slot, so its OnYoshiTryEat is 17 where the ROM's is 18) and no TU in the
# port's build takes it.
#
# ---- what needed a host copy ----------------------------------------------
#
# SIX OF THE NINE RENDERS. Each dispatches slot 5 of its own ModelAnim through
# a local shadow class, which is the ModelAnim slot-5 collision gates 17, 21
# and 23 already wrote down: _ZTV9ModelAnim cannot be dual-filled the way
# _ZTV5Model can, because MSVC's slot 5 there is Virtual18 and it takes a
# second argument. Bodies in port/unmatched/BobEnemy_Renders.cpp.
# KingBobOmb::Render and the STUMP's are the exceptions -- the king calls
# Model::Render by its Itanium C name rather than through a shadow, and the
# post's shadow lands on _ZTV5Model, which IS dual-filled -- so both come from
# src/ unchanged.

# ============================================================================
# BOB_OMB (actor 206, ov102)
# ============================================================================
#
# The walking black bomb, and the pink one is the SAME CLASS: InitResources
# reads `param1 & 7` into +0x3f5 and switches on it, so type 2 (the one that
# clears the solid-collision bit and starts inert) and type 4 are the defused
# and stationary variants. There is no separate pink class -- the pink
# character in the level is BOB_OMB_BUDDY, which is its own class in ov084.
#
# ov102 IS ALREADY MOUNTED (gate 23 brought it up for the QUESTION_BLOCK), and
# g_profile_BOMBHEI is already in port/ov102_syms.txt, so this class costs no
# overlay work at all. Its SpawnInfo's own +4 halfword reads 206.
#
# Its Behavior dispatches NO pointer-to-member: it is a straight-line body over
# the Enemy helpers and a flag word at +0x3f6. Nothing here needs the gate-16
# treatment.
src/actors/daBmb_c.cpp
# _ZN7daBmb_c6RenderEv IS NOT HERE: the ModelAnim slot-5 case.
# port/unmatched/BobEnemy_Renders.cpp.
# slot 18 (OnYoshiTryEat), slot 19 (OnTurnIntoEgg) and slot 29
# (OnAimedAtWithEgg), all three the class's own
# the bomb's own closure: the fuse, the blast, the throw and the water tests
# func_ov102_0214b248 IS NOT HERE: decl_common.h declares it `(void*)` and its
# own TU defines it `(char*)`, which is one register on the ROM and C2733 to
# MSVC. It goes through hostgen's HEADER_SHADOW, see GATE32_SYMS.

# ---- the Enemy base's own methods -----------------------------------------
# ov002's Enemy tier, which every class in this gate runs through. The
# constructor (src/_ZN12dEnemyBase_cC2Ev.cpp) and the destructor tail
# (src/_ZN12dEnemyBase_cD2Ev.cpp) came in with gate 16 for the 1-up mushroom; these
# five are the per-frame half no earlier class reached.
#
# _ZN12dEnemyBase_c14UpdateYoshiEatER10dBgCh_Actr IS NOT HERE AND CANNOT BE: ov002
# 0x020ade78 is a 0x3cc-byte hole with no C anywhere in src/. It answers "is
# this actor inside Yoshi's mouth right now" and hal/actor_vtables.cpp has
# answered 0 for it since gate 16, which is the ROM's own answer with Mario as
# the character and no Yoshi in the level.
src/_ZN12dEnemyBase_c26UpdateKillByInvincibleCharER10dBgCh_ActrR9ModelAnimj.cpp
src/_ZN12dEnemyBase_c22SpawnMegaCharParticlesER8dActor_cPc.cpp
src/_ZN12dEnemyBase_c27SpawnParticlesIfHitOtherObjER5dCc_c.cpp
src/_ZN12dEnemyBase_c9SpawnCoinEv.cpp
# _ZN12dEnemyBase_c11UpdateDeathER10dBgCh_Actr IS NOT HERE: it dispatches an mwcc
# pointer-to-member out of data_ov002_0210dbc0 whose class is INCOMPLETE at the
# typedef, so MSVC would double the stride -- the gate-16 case for the eighth
# time, and the first that belongs to a base class rather than one actor. Host
# copy plus the eight-static seat in port/unmatched/Enemy_UpdateDeath.cpp.
# All five death bodies the table names are matched, so that file carries no
# trap. __sinit_ov002_02100938, which copies the statics into the bss table,
# has been in the build since gate 10.
src/func_ov002_020ae64c.c
src/func_ov002_020ae608.c
src/func_ov002_020ae4cc.cpp
src/func_ov002_020ae454.cpp
src/func_ov002_020aea24.c
# the two the bomb's Behavior closes over: 020ada40 is the knockback the ROM
# hands an enemy that has just hit something (BobOmb::Behavior spells it
# `func_020ada40`, with no overlay tag; the reloc says ov002 and the alias is
# in hal/bob_enemy_bridges.cpp), and Actor::PoofDust is Enemy::SpawnCoin's last
# line.
src/_ZN12dEnemyBase_c20KillByInvincibleCharERK10Vector3_16R6Player5Fix12IiE.cpp
src/_ZN8dActor_c8PoofDustEv.cpp
src/_ZN8dActor_c10PoofDustAtERK7Vector3.cpp
# the egg lookup and its helper, which the bomb's death branch runs
src/_ZN8dActor_c7FindEggER5dCc_c.cpp
src/func_02010304.cpp

# --- linkloop round 0 ---
# The shared tail of death type 1, and the mega-form kill counter the
# knockback bumps.
src/func_ov002_020ae5c8.c
src/actors/Player.cpp
src/func_ov002_020f0e54.c

# ---- Actor's own tail, slots 20 through 30 --------------------------------
# The nine combat hooks plus Virtual50 and the egg pair. All of them are
# two-line ROM bodies and none was ever in a slice, because no class before
# this one had a vtable long enough to hold them.
src/_ZN8dActor_c9Virtual50Ev.cpp
src/_ZN8dActor_c15OnGroundPoundedERS_.cpp
src/_ZN8dActor_c11OnAttacked1ERS_.cpp
src/_ZN8dActor_c11OnAttacked2ERS_.cpp
src/_ZN8dActor_c8OnKickedERS_.cpp
src/_ZN8dActor_c8OnPushedERS_.cpp
src/_ZN8dActor_c24OnHitByCannonBlastedCharERS_.cpp
src/_ZN8dActor_c15OnHitByMegaCharER6Player.cpp
src/_ZN8dActor_c19OnHitFromUnderneathERS_.cpp

# ============================================================================
# GOOMBA (actor 200, ov084) and BOB_OMB_BUDDY (actor 181, ov084)
# ============================================================================
#
# ov084 is a new mount for the port -- the sixth actor overlay -- and it
# carries eight ids across four classes: BOB_OMB_BUDDY(181), GOOMBA(200),
# GOOMBA_SMALL(201), GOOMBA_LARGE(202), PIRANHA_PLANT(250) and the three fire
# piranhas. The Goomba's one class body serves its three ids and switches on
# mGoombaType, which InitResources reads out of the object record's param.
#
# THE CONFIG'S NAMES CHECK OUT. daKrb_c_classInit_KURIBO's literal pool installs
# ov084 0x02130948 and the ROM's RTTI for that table reads daKrb_c -- kuribo,
# the goomba -- while daRedBombhei_c_classInit installs 0x02130a38, RTTI
# daRedBombhei_c, the red bomb-hei. Both SpawnInfo records carry their own id
# in the +4 halfword (200 and 181), which is the registry's own cross-check.
src/d_a_krb_kuribo.c
src/_ZN7daKrb_c13InitResourcesEv.cpp
src/_ZN7daKrb_c8BehaviorEv.cpp
# _ZN7daKrb_c6RenderEv IS NOT HERE: the ModelAnim slot-5 case.
# port/unmatched/BobEnemy_Renders.cpp.
src/_ZN7daKrb_c16CleanupResourcesEv.cpp
src/_ZN7daKrb_c16OnPendingDestroyEv.cpp
src/_ZN7daKrb_cD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN7daKrb_cD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN7daKrb_cD0Ev.cpp
# slots 18, 19 and 29, all three the class's own
src/_ZN7daKrb_c13OnYoshiTryEatEv.cpp
src/func_ov084_0212b344.cpp
src/_ZN7daKrb_c16OnAimedAtWithEggEv.cpp
# the goomba's own closure: the walk, the squash, the death and the spawner
src/func_ov084_021290d4.c
src/func_ov084_02129168.cpp
src/func_ov084_02129238.cpp
src/func_ov084_0212934c.c
src/func_ov084_02129498.c
src/func_ov084_021294d0.cpp
src/func_ov084_021296cc.c
src/func_ov084_02129864.c
# func_ov084_021298d0 IS NOT HERE: C++ inside a .c (the gate-9 case). It goes
# through hostgen, see GATE32_SYMS.
src/func_ov084_02129a00.c
src/func_ov084_02129c9c.c
src/func_ov084_02129ed4.c
src/func_ov084_0212a580.cpp

# ---- BOB_OMB_BUDDY (actor 181) --------------------------------------------
# The friendly pink one that opens the cannons. Three states of two halves
# each, dispatched out of data_ov084_02130dc4 -- see the host copy note below.
src/d_a_red_bombhei.c
src/_ZN11BobOmbBuddy13InitResourcesEv.cpp
src/_ZN11BobOmbBuddy8BehaviorEv.cpp
# _ZN11BobOmbBuddy6RenderEv IS NOT HERE: the ModelAnim slot-5 case again.
src/_ZN11BobOmbBuddy16CleanupResourcesEv.cpp
# _ZN11BobOmbBuddyD1Ev IS NOT HERE: it is a real C++ destructor over a shadow
# class, so MSVC emits ??1BobOmbBuddy@@UAE@XZ and calls three member dtors that
# exist nowhere. Slot 16 is hosted in hal/actor_classes_bob_enemy.cpp as the D0
# body minus its final Deallocate -- the Bird's treatment.
# RETIRED at SLICE1: body now in src/_ZN11BobOmbBuddyD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN11BobOmbBuddyD0Ev.cpp
# the three states, both halves, all matched -- no hole and no trap
src/func_ov084_0212c92c.cpp
src/func_ov084_0212c8b0.cpp
src/func_ov084_0212c89c.c
src/func_ov084_0212c508.cpp
src/func_ov084_0212c4a0.c
src/func_ov084_0212c1a0.c
# func_ov084_0212c960 and func_ov084_0212c9a8 ARE NOT HERE: the pair that
# changes state and runs the current one, and both form an mwcc
# pointer-to-member over an INCOMPLETE class -- the gate-16 case for the ninth
# time. Host copies plus the six-static seat in
# port/unmatched/BobOmbBuddy_States.cpp.
# the buddy's own closure
src/func_ov084_0212c9f0.c
src/func_ov084_0212ca60.c
src/func_ov084_0212caa8.c
src/func_ov084_0212cac0.c
src/func_ov084_0212cae0.c
src/func_ov084_0212ccb4.cpp
src/func_ov084_0212cda0.c
src/func_ov084_0212ce50.cpp

# ---- ov084's own static initialisers --------------------------------------
# All three, in ROM order.
src/__sinit_ov084_0213035c.c
src/__sinit_ov084_02130558.c
src/__sinit_ov084_02130654.c

# ---- what these two reach into that no earlier class did ------------------
src/_ZN12dEnemyBase_c15IsGoingOffCliffER10dBgCh_Actrisbbi.cpp
# RETIRED at SLICE1: body now in src/_ZN11dCapEnemy_cD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN11dCapEnemy_cD2Ev.cpp
src/game/actors/d_a_obj_cannon_shutter.cpp
src/_ZN6Player20RegisterEggCoinCountEjbb.cpp
src/_ZN6Player6BounceE5Fix12IiE.cpp
src/UnloadSilverStarAndNumber.c

# --- linkloop round 1 ---
# The CAP TIER. The goomba is the first class the port carries that can wear
# Mario's cap: InitResources calls CapEnemy::AddCap and DestroyIfCapNotNeeded,
# Behavior asks GetCapState and releases it on death, and Render draws the cap
# model. Nine arm9 methods, one ov002 destructor and the six ov001 helpers the
# cap's own archive load reaches.
src/_ZN11dCapEnemy_cC2Ev.cpp
src/_ZN11dCapEnemy_cD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN11dCapEnemy_cD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN11dCapEnemy_cD0Ev.cpp
src/_ZN11dCapEnemy_c6AddCapEj.cpp
src/_ZN11dCapEnemy_c21DestroyIfCapNotNeededEv.cpp
src/_ZN11dCapEnemy_c11GetCapStateEv.cpp
src/_ZN11dCapEnemy_c15RespawnIfHasCapEv.cpp
src/_ZN11dCapEnemy_c10ReleaseCapERK7Vector3.cpp
src/_ZN11dCapEnemy_c12Unk_02005d94Ev.cpp
src/_ZN11dCapEnemy_c14UnloadCapModelEv.cpp
src/_ZN11dCapEnemy_c14RenderCapModelEPK7Vector3.cpp
src/func_02005e28.c
src/func_02005ed8.c
src/func_ov001_020aa6b0.c
src/func_ov001_020aa6cc.c
src/_ZN10dCapIcon_c6UnlinkEv.cpp
src/func_ov001_020ab228.c
src/_ZN10dCapIcon_cD1Ev.cpp
src/_ZN10dCapIcon_cC1Ev.cpp
# the material animation the goomba plays over its own model, and the blue
# coin it can be carrying
src/_ZN15MaterialChanger7PrepareER8BMD_FileR8BMA_File.cpp
src/_ZN15MaterialChanger7SetFileER8BMA_Filei5Fix12IiEj.c
src/_ZN15MaterialChanger6UpdateER15ModelComponents.cpp
src/LoadBlueCoinModel.c
src/UnloadBlueCoinModel.c
# and the four engine leaves its Behavior reaches
src/_ZN8dActor_c19MakeVanishLuigiWorkER5dCc_c.cpp
src/_ZN8dActor_c22IsTooFarAwayFromPlayerE5Fix12IiE.cpp
src/_ZN10dBgCh_Actr12Unk_0203589cEv.cpp
src/_ZN10dBgCh_Actr22ClearJustHitGroundFlagEv.cpp

# --- linkloop round 2 ---
# The material-animation leaves, the death-table's ENTER half (eight more
# bodies -- func_ov002_020aea30 dispatches data_ov002_0210db80 the same way
# Enemy::UpdateDeath dispatches 0210dbc0, and it is hosted in the same file),
# and three more Actor leaves.
src/func_02046e28.c
src/func_020470e8.c
src/_ZN8dActor_c19UntrackInDeathTableEv.cpp
src/_ZN8dActor_c13SmallPoofDustEv.cpp
# func_ov002_020aea30 IS NOT HERE: the pointer-to-member case again.
src/func_ov002_020ae9f8.c
src/func_ov002_020ae954.c
src/func_ov002_020ae890.c
src/func_ov002_020ae87c.c
src/func_ov002_020ae844.c
src/func_ov002_020ae80c.c
src/func_ov002_020ae73c.c
src/func_ov002_020aea2c.c

# --- linkloop round 3 ---
# The cap's own position update, the two shared tails of the enter-death
# bodies, the death-table clear, the cannon-open pair the buddy reads and
# writes, and the coin leaves.
src/_ZN11dCapEnemy_c12UpdateCapPosERK7Vector3RK10Vector3_16.cpp
src/func_ov002_020ae8b8.c
src/func_ov002_020ae968.c
src/DeathTable_ClearBit.c
src/OpenCannonInCurLevel.c
src/IsCannonOpenInCurLevel.c
src/NumRedCoins.c
src/_ZN8dActor_c15GivePlayerCoinsER6Playerhj.cpp

# --- linkloop round 4 ---
src/_ZN11dCapEnemy_c16GetCapEatenOffItERK7Vector3.cpp
src/IsCannonOpenInLevel.c
src/OpenCannonInLevel.c
src/IsCannonOpen.c
src/OpenCannon.c

# --- linkloop round 5 ---
# THE GOOMBA'S FIVE STATES. Goomba::Behavior dispatches
# data_ov084_02130d74[state * 2] by reading the pair as two plain ints, so it
# needs no host copy -- only the seat, which is in
# port/unmatched/BobOmbBuddy_States.cpp with the buddy's. Measured: unseated,
# a spawned goomba jumped straight to 0x0212b2dc in the overlay image.
src/func_ov084_0212b2dc.c
src/func_ov084_0212ab48.c
src/func_ov084_0212aab0.cpp
src/func_ov084_0212a774.c
src/func_ov084_0212a6f8.c
src/func_ov084_0212abd4.c
src/func_ov084_0212af74.c
src/_ZN8dActor_c15HugeLandingDustEb.cpp
src/_ZN8dActor_c11LandingDustEb.cpp
src/_ZN8dActor_c13LandingDustAtER7Vector3b.cpp
src/_ZN12dEnemyBase_c24AngleAwayFromWallOrCliffER10dBgCh_ActrRs.cpp
# func_ov084_02129cf4: SEATED by run link100 wave 15 lane SEAT15B. The r0-passthrough
# reason is stale -- src/func_ov084_02129cf4.c:16 passes the ClosestPlayer receiver
# itself now (`(c)`), so the host copy in
# port/unmatched/Actor_ClosestPlayer_OverlayReaders.cpp is retired.
src/func_ov084_02129cf4.c
# One ov074 body: the goomba's knocked-back state asks the GOOMBOSS overlay for
# a launch vector. ov074 is not mounted -- this is CODE only, and the function
# reads nothing out of its own overlay's data.
src/actors/Goomboss.cpp

# ============================================================================
# CHAIN_CHOMP (actor 219, ov014) and CHAIN_CHOMP_FENCE (actor 41, ov014)
# ============================================================================
#
# ov014 is BOB-OMB BATTLEFIELD'S OWN LEVEL OVERLAY, so it is mounted twice --
# whole for the loaders (PORT_LEVEL_OVERLAYS, the level-boot stream's) and per
# symbol for these two classes' SharedFilePtrs and their state table. That is
# gate 17's treatment of ov009 applied to the second level.
#
# Both ids read back out of their own SpawnInfo's +4 halfword: 219 and 41. The
# third class in this overlay is SHUTTER_BOB (40), which is not part of this
# gate.
# daWanwan_c_classInit IS NOT HERE: an ARM r0 RIDE-THROUGH, and the first one in
# a spawn factory. Its matched source calls Enemy's constructor as
# `func_020aed98()` with no argument, because operator new left the object in
# r0 and the constructor wants `this` there. MSVC passes nothing, so the
# constructor read the frame and ActorBase faulted on 0x000000db -- the actor
# id in the spawn spine's stack slot. Host copy in
# port/unmatched/ChainChomp_Spawn_hostcopy.cpp.
# HELD AGAIN at SYNC6, and NOT for a compile family: this TU compiles on the
# host now (main #2663/#2669), but seating it duplicates _daWanwan_c_classInit
# against port/unmatched/ChainChomp_Spawn_hostcopy.cpp, which is a FACTORY host
# copy. The ARM r0 ride-through its ruling names IS fixed in main's text
# (_ZN12dEnemyBase_cC2Ev(c) at line 112 passes the object), but the two spell
# the vptr store differently -- main writes &_ZTV10daWanwan_c[2], the Itanium
# address point, and the host copy writes _ZTV10daWanwan_c, slot 0 of a host
# array -- which is exactly the OPEN QUESTION in out/FACES2/bugs.md section 6
# and out/FACES2/hostgen_rulings.txt. The brief for this lane forbids retiring a
# factory host copy until that is settled, and a factory's vptr store is a
# dispatch change that no tree can capture until it links. So the TU waits; it
# is a sixth row for that list, not a compile-family quarantine.
#src/game/actors/d_a_wanwan.cpp
# _ZN10daWanwan_c6RenderEv IS NOT HERE: the ModelAnim slot-5 case, and the
# longest of them -- it draws the head plus seven chain links.
# the twelve state halves, all matched -- no hole and no trap
# func_ov014_02111ebc and func_ov014_02111f08 ARE NOT HERE: the change-state
# and run-state pair, both mwcc pointer-to-member over an INCOMPLETE class --
# the gate-16 case for the tenth time. Host copies plus the twelve-static seat
# in port/unmatched/ChainChomp_States.cpp.
# the chomp's own closure
# ---- CHAIN_CHOMP_FENCE (actor 41) -----------------------------------------
# The post the chomp is chained to, and a Platform: it carries its own
# MovingMeshCollider and breaks when the chomp pulls hard enough.
src/game/actors/d_a_obj_wanwan_shutter.cpp
# _ZN20daObjWanwanShutter_c6RenderEv IS NOT HERE either: its shadow's six methods
# all return int where Model::Render returns void, which MSVC decorates
# differently even though the SLOT is the dual-filled one.
# ---- ov014's own static initialisers ---------------------------------------
src/__sinit_ov014_021130ac.c
src/__sinit_ov014_02113118.c
src/__sinit_ov014_021132fc.c
# ---- what these two reach that no earlier class did ------------------------
# The player state the chomp's lunge forces when it catches him, and the
# rotation matrix its seven chain links are placed with.
#
# Particle::System::NewSimple, which the breaking fence also calls, IS NOT
# HERE. hal/reverse_bridges.cpp has answered 0 for the whole particle tier
# since gate 10 -- the real bodies walk a manager the host never seats -- so
# the fence's decorated reference is faced onto that stub in
# hal/bob_enemy_shadow_faces.cpp rather than onto src/.
src/Matrix4x3_FromRotationXYZExt.c

# ============================================================================
# STUMP (actor 27, ov091) -- the post the chomp is chained to
# ============================================================================
#
# ChainChomp::InitResources spawns actor 27 itself and reads a word back out
# of what it gets, so the chomp cannot run without this class. Measured: with
# it unregistered the spawn returned null and InitResources faulted writing
# through it.
#
# THE CONFIG'S CLASS NAMES ARE ON THE WRONG TABLE HERE. g_profile_PILE's +4
# halfword reads 27 and daObjPile_c_classInit is its factory, but that factory installs
# ov091 0x021352bc whose RTTI is daObjPile_c, while _ZTV5Stump at 0x021353ac
# has RTTI daHyuhyu_c and is FWOOSH's -- actor 231's. So the six _ZN5Stump*
# bodies are Fwoosh's methods, none of them are here, and what IS here is the
# unnamed func_ov091_* block the real table points at. Same shape as ov100's
# DOOR, gate 22.
#
# It is a Platform, so its table is THIRTY-TWO slots: slot 31 is
# Platform::Kill. It is also the ground-pound target -- InitResources sets the
# hit counter at +0x31e to 3 and slots 21 and 27 take one off it.
src/d_a_obj_pile.c
src/_ZN6Fwoosh13InitResourcesEv.cpp
src/_ZN6Fwoosh8BehaviorEv.cpp
src/_ZN6Fwoosh6RenderEv.cpp
src/_ZN6Fwoosh16CleanupResourcesEv.cpp
src/_ZN6FwooshD1Ev.cpp
# _ZN5StumpD0Ev IS NOT HERE: the deleting destructor, written over the
# shared header's VT0/VT1/G0 placeholders. Those are single global names in
# this build, so it would install another TU's vtable and free against another
# TU's heap. Slot 17 traps instead; nothing on this level destroys a post
# through the deleting form.
src/_ZN5Stump15OnGroundPoundedER8dActor_c.cpp
src/_ZN5Stump15OnHitByMegaCharER6Player.cpp
src/func_ov091_021334b8.cpp
src/func_ov091_02133498.c
src/actors/dBgActor_c.cpp
# ---- ov091's own static initialisers, all six in ROM order -----------------
src/__sinit_ov091_02134524.c
src/__sinit_ov091_021345dc.c
src/__sinit_ov091_021346e8.c
src/__sinit_ov091_02134930.c
src/__sinit_ov091_021349c4.c
src/__sinit_ov091_02134a30.c

# ============================================================================
# KOOPA_THE_QUICK (actor 188, ov062)
# ============================================================================
#
# The racing koopa. The seventh actor overlay, which also carries CHUCKYA, the
# two koopas, the koopa's flag and KLEPTO; only this one is registered.
#
# HE IS NOT IN BOB'S DEFAULT OBJECT TABLE. The level names him in a star group
# the boot's filter does not load, so the way to see him run is the spawn hook
# (SM64DS_SPAWN_ACTOR=188). His id reads back out of his own SpawnInfo's +4
# halfword and his table's RTTI is daRNk_c, the racing nokonoko.
#
# NOTHING NEEDS A HOST COPY BUT THE RENDER: his Behavior dispatches no
# pointer-to-member at all, which makes him the simplest class in this gate.
src/d_a_r_nk.c
src/_ZN13KoopaTheQuick13InitResourcesEv.cpp
src/_ZN13KoopaTheQuick8BehaviorEv.cpp
# _ZN13KoopaTheQuick6RenderEv IS NOT HERE: the ModelAnim slot-5 case.
src/_ZN13KoopaTheQuick16CleanupResourcesEv.cpp
src/_ZN13KoopaTheQuickD1Ev.cpp
# RETIRED at SLICE1: body now in src/_ZN13KoopaTheQuickD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN13KoopaTheQuickD0Ev.cpp
src/func_ov062_0211aac0.c
# Model::HideMaterial, which his Render is the port's first caller of.
src/_ZN5Model12HideMaterialEii.cpp
# ---- HIS SIX STATES --------------------------------------------------------
# KoopaTheQuick::Behavior dispatches data_ov062_0211e0a4[state] the way the
# Butterfly's matched source does -- it reads the pair as two plain ints and
# does the virtual-bit and this-adjustment arithmetic itself -- so MSVC's
# pointer-to-member representation never comes into it and there is no host
# copy. What it does need is the SEAT: __sinit_ov062_0211d4a0 copies six
# 8-byte statics into that table and every one of them is a DS code address.
# Measured: unseated, a spawned koopa jumped straight to 0x0211a9c4, which is
# state 0's own body in the overlay image. The seat is in
# hal/actor_overlays.cpp with the butterfly's and the rabbit's.
src/func_ov062_0211a9c4.c
src/func_ov062_0211a740.cpp
src/func_ov062_0211a1f4.c
src/func_ov062_0211a168.c
src/func_ov062_0211a0f0.c
src/func_ov062_02119be0.c
src/func_ov062_02119af0.cpp
src/func_ov062_021199ac.c
src/func_ov062_02119954.c
src/func_ov062_02119800.cpp
# ...and the five leaves the race reaches that no earlier class did: the
# player state the koopa forces when he talks, the music layer the race
# starts, the star the win spawns, and the two Actor searches his states run.
src/_ZN5Sound22LoadAndSetMusic_Layer2Ej.cpp
src/_ZN8dActor_c14GetSubtractionEss.cpp
src/_ZN8dActor_c19UntrackAndSpawnStarERajRK7Vector3h.cpp
src/_ZN8dActor_c18ClosestWithActorIDEj.cpp

# ---- KOOPA_FLAG (actor 205, ov062) ----------------------------------------
# The flag at the top of the mountain, and the other half of the race: its
# Behavior asks Actor::FindWithID for the id it was given and watches for that
# actor's own id word to read 0xbf, which is PLAYER. When it does, the flag
# stops the timer and starts a ninety-frame victory sound.
#
# The config's names check out: g_profile_RACE_FLAG's +4 halfword reads 205,
# daRFlag_c_classInit installs ov062 0x0211dc54, and that table's RTTI is
# daRFlag_c (the racing flag) with all six method slots spelled _ZN9KoopaFlag*.
#
# HE IS NOT IN BOB'S DEFAULT OBJECT TABLE either, for the same reason the
# koopa is not: the level names both in a star group the boot's filter does
# not load. SM64DS_SPAWN_ACTOR=205 is how to see one.
src/d_a_r_flag.c
src/_ZN9KoopaFlag13InitResourcesEv.cpp
src/_ZN9KoopaFlag8BehaviorEv.cpp
# _ZN9KoopaFlag6RenderEv IS NOT HERE: the ModelAnim slot-5 case for the sixth
# time in this gate. port/unmatched/BobEnemy_Renders.cpp.
src/_ZN9KoopaFlag16CleanupResourcesEv.cpp
# _ZN9KoopaFlagD1Ev IS NOT HERE: a real C++ destructor over a shadow class
# with two members, so MSVC emits ??1KoopaFlag@@UAE@XZ and calls two member
# dtors that exist nowhere. Slot 16 is hosted in
# hal/actor_classes_bob_enemy.cpp as the D0 body minus its final Deallocate --
# the Bird's treatment, and the bob-omb buddy's.
src/_ZN9KoopaFlagD0Ev.cpp
src/func_ov062_0211afbc.c
# ---- ov062's own static initialisers ---------------------------------------
src/__sinit_ov062_0211cf30.c
src/__sinit_ov062_0211d2d8.c
src/__sinit_ov062_0211d4a0.c
src/__sinit_ov062_0211d690.c
src/__sinit_ov062_0211d6fc.c

# --- linkloop round 6 ---
src/_ZN5Sound22StopLoadedMusic_Layer2Ev.cpp
src/_ZN5Sound15PlaySecretSoundEP8dActor_cPt.cpp

# ============================================================================
# KING_BOB_OMB (actor 189, ov078)
# ============================================================================
#
# LEVEL 6 IS THE ONLY LEVEL OF THE FIFTY-TWO THAT LOADS ov078, and the whole
# overlay is his: fifty-three functions, one class, one vtable, one sinit. He
# IS in the level's default object table, so unlike the koopa he comes up on
# the boot without the spawn hook.
#
# The config's names check out three ways. g_profile_BOMBKING's +4 halfword
# reads 189, daBombking_c_classInit's literal pool installs ov078 0x02126e4c, and
# that table's RTTI name is daBombking_c.
#
# HIS STATE IS A POINTER, NOT AN INDEX. +0x420 holds the address of a two-PMF
# record and eighteen of them live in ov078's bss, built by the sinit out of
# thirty-six 8-byte statics. Both dispatchers -- KingBobOmb_SetState and his
# own Behavior -- form an mwcc pointer-to-member over an INCOMPLETE class, the
# gate-16 case for the eleventh time, and Behavior also does POINTER ARITHMETIC
# on it (`pp + 1` for the main half) and COMPARES the state pointer against
# four of the records by address. Host copies plus the thirty-six-static seat:
# port/unmatched/KingBobOmb_States.cpp and hal/actor_overlays.cpp.
src/actors/daBombking_c.cpp
# _ZN12daBombking_c8BehaviorEv IS NOT HERE: the pointer-to-member case.
# slot 29, his own
# KingBobOmb_SetState IS NOT HERE either: the same pointer-to-member.
# the two his Behavior closes over every frame -- the carry matrix and the
# shadow's own raycast
# ---- his eighteen states, thirty-six halves, all matched -------------------
# func_ov078_02124cf4 IS NOT HERE: decl_common.h declares func_0200fa8c
# `(void*, int)` and func_ov078_02125c24 `(char*, int)` while that TU declares
# both `(void*, int)`. One register on the ROM, two C2733s to MSVC. It goes
# through hostgen's HEADER_SHADOW, see GATE32_SYMS.
# func_ov078_02123f1c: HOST COPY at unmatched/KingBobOmb_HeldHealthCheck.cpp (wired in
# CMakeLists). The matched C calls Player::GetHealth() with no argument and relies on
# the held Player (c->field_494) being live in ARM r0; cdecl drops it, so the host copy
# passes c->field_494 explicitly. See that file's header.
# ---- ov078's one static initialiser ---------------------------------------
src/__sinit_ov078_02126660.c
# ---- what the king reaches that no earlier class did -----------------------
# His own overlay's three shared helpers (the throw, the sound-and-shake and
# the carry release), the ov102 body one of his states borrows, and the
# CommonModel his factory constructs. Gate 24's whole BlendModelAnim tier
# comes in with him -- see SLICE24_SOURCES in port/CMakeLists.txt, which this
# gate is the first build to link into a live level.
src/_ZN11CommonModelC1Ev.cpp
src/_ZN11CommonModelD1Ev.cpp
src/func_0200fa8c.c
src/func_02011cfc.c
src/func_02011d44.c
src/func_02035550.c
src/_ZN5Sound22LoadAndSetMusic_Layer3Ej.cpp
src/_ZN5Sound22StopLoadedMusic_Layer3Ev.cpp
# ---- gate 24's BlendModelAnim tier, live for the first time ----------------
# The king is the first actor the port carries that owns one. Gate 24 landed
# the class and its vtable (hal/blend_vtable.cpp) and said out loud that
# nothing in a live level exercised it yet; he is what changes that. These are
# slice_gate24.txt's ten BlendModelAnim TUs, listed here rather than linking
# that whole slice, because its tail (LenVec3, Memory::operator_delete2, the
# four D2s) is already in this build from earlier gates.
src/_ZN14BlendModelAnimC1Ev.cpp
# QUARANTINED at the main->port sync (lane SYNC5, the wave-7 fold merge): MSVC
# refuses main's shape for this TU (C2600, the model family's destructor TUs:
# main defines X::~X() where the host header spells the destructor as two
# plain virtuals; port/unmatched/ModelFamily_Dtors_HostCopy.c carries the
# merge base's own bodies instead). It is a decomp-side item, not a port one:
# see runs/link100/out/SYNC5/decomp_side.md. The row returns when main lands
# the fix.
#src/_ZN14BlendModelAnimD0Ev.cpp
src/_ZN14BlendModelAnimD1Ev.cpp
src/_ZN14BlendModelAnim9DoSetFileEPcii.cpp
src/_ZN14BlendModelAnim11UpdateVertsEv.cpp
src/_ZN14BlendModelAnim9Virtual10ER9Matrix4x3.cpp
src/_ZN14BlendModelAnim6RenderEPK7Vector3.cpp
src/_ZN14BlendModelAnim9Virtual18EjPK7Vector3.cpp
src/_ZN14BlendModelAnim7AdvanceEv.cpp
src/_ZN14BlendModelAnim7SetAnimER8BCA_Fileii5Fix12IiEt.cpp
src/func_0204531c.c
src/func_020165c4.c
# ---- CommonModel, likewise -------------------------------------------------
# His factory constructs one at +0x3bc. Its ROM table is arm9 0x0208e8a4 and it
# is three slots -- D1, D0, DoSetFile -- so the host array is [3] and
# hal/actor_classes_bob_enemy.cpp fills all of them.
# QUARANTINED at the main->port sync (lane SYNC5, the wave-7 fold merge): MSVC
# refuses main's shape for this TU (C2600, the model family's destructor TUs:
# main defines X::~X() where the host header spells the destructor as two
# plain virtuals; port/unmatched/ModelFamily_Dtors_HostCopy.c carries the
# merge base's own bodies instead). It is a decomp-side item, not a port one:
# see runs/link100/out/SYNC5/decomp_side.md. The row returns when main lands
# the fix.
#src/_ZN11CommonModelD0Ev.cpp
src/_ZN11CommonModel9DoSetFileEPcii.cpp
src/func_0200fa04.c
src/_ZN5Sound13Func_02048eb4Ev.cpp
src/func_02048f14.c
# RETIRED at SLICE1: body now in src/_ZN9ModelAnimD1Ev.cpp. MSVC folds the ROM destructor variants into one symbol, so only one of a class two per-function destructor TUs can be compiled.
#src/_ZN9ModelAnimD2Ev.cpp
# src/func_0203cbc0.c is HOSTED in port/unmatched/func_02073244_hostcopy.c, which
# defines it beside func_02073244. Its ROM form is `void func_0203cbc0(void)`
# calling _ZdlPv() with no argument -- right on ARM, where the pointer is
# already in r0, and wrong under cdecl, where the callee reads the stack for
# an argument nobody declared. Listed here it links twice and MSVC says so.
src/func_020462b4.c
src/func_020462bc.c
src/func_02047910.c
src/_ZN11CommonModel12SetPolygonIDEj.cpp
src/_ZN11CommonModel13Func_020160ACEj.cpp
src/func_02016e70.c
