# Gate 22: ov100's DOOR, the last class the castle grounds names.
#
# Actor 353 x3 -- the castle's own doors, loaded by LoadDoorObjects (the
# level's kind 0x09, count 3) rather than by the standard or simple loader,
# which is why they carry no position in the object tables the other classes
# come out of. The overlay is already mounted (gate 21, port/ov100_syms.txt).
#
# THE CLASS IS UNNAMED IN CONFIG AND ITS NAME IS TAKEN. daDoor_c_classInit installs
# the vtable at ov100 0x02148188, which config calls _ZTV4Door and
# the ROM's RTTI calls 8daDoor_c; config's `_ZTV4Door` is a DIFFERENT table at
# 0x021483cc whose RTTI reads 12daStarGate_c, and the whole _ZN4Door* method
# family hangs off that one. So the star door wears the door's name and the
# door's own methods are the unnamed func_ov100_02144xxx / 021454xx block.
# The port compiles the files the vtable points at and renames nothing -- the
# gate-17 reading, for the third overlay running.
#
# That is also why port/ov100_syms.txt has to exclude 0x02148188 by address:
# the "_ZTV*" rule cannot see a vtable dsd left as data_ov100_*, and mounting
# it would hand daDoor_c_classInit a table of DS code addresses instead of the host
# array hal/actor_classes.cpp fills.

# ---- the six own slots ----------------------------------------------------
src/d_a_door.c
src/game/actors/d_a_star_gate.cpp
# CleanupResources moved to a HOST COPY at gate 31 (port/unmatched/
# Door_CleanupResources.cpp): it deletes the door's second Model through a
# local shadow class at ROM slot 1, which the port's MSVC-ordered
# _ZTV5Model uses for DoSetFile. Nothing dispatched it until there was a
# level teardown; the first one faulted inside Model::AddToCommonModelDataArr.
# _ZN4Door8BehaviorEv (Behavior) and func_ov100_021453d8 (its callback
# installer) are NOT here: both form an mwcc pointer-to-member of an
# INCOMPLETE class, the gate-16 case for the sixth time, and this is the first
# one whose table is a POINTER THE ACTOR CARRIES (+0x140) rather than an index
# into a fixed array. Host copies plus the fifteen-static seat in
# port/unmatched/Door_Behavior.cpp; all fifteen callbacks are matched src, so
# that file carries no trap.
#
# _ZN4Door6RenderEv (Render) is NOT here either: it dispatches ModelAnim
# slot 5, Model slot 4 and Model slot 5 through local shadow classes, which is
# ROM numbering. Slot 5 the dual fill serves on both classes; SLOT 4 IT CANNOT
# -- MSVC's Model slot 4 is Render where the ROM's is Virtual10. Gate 19's
# cannon hit the same wall one slot lower; host copy in
# port/unmatched/Door_Render.cpp.
#
# THE DESTRUCTORS ARE NOT HERE and slots 16/17 trap by name, the gate-17
# reading: nothing on the castle grounds destroys a door -- the three live
# from the level boot to the level teardown.
src/func_ov100_02145370.c

# ---- the fifteen callbacks the two dispatch sites reach --------------------
# All matched. Nine take (this, arg) and six take (this); the ROM passes both
# in r0/r1 either way, which is the ride-through the seat's one call shape
# relies on.
src/func_ov100_02144730.cpp
src/func_ov100_02144ccc.c
src/func_ov100_02144c6c.c
src/func_ov100_02144bf4.cpp
src/func_ov100_02144c64.c
src/func_ov100_021449c8.cpp
src/func_ov100_02144a38.c
src/func_ov100_02144468.c
src/func_ov100_02144950.c
src/func_ov100_021446f8.c
src/func_ov100_02144528.c
src/func_ov100_021444e8.c
src/func_ov100_02144cf8.c
src/func_ov100_0214491c.c

# --- linkloop round 0 ---
# The door's own five helpers, below the fifteen callbacks.
src/func_ov100_02144f84.c
src/func_ov100_02145080.c
src/func_ov100_02145170.c
src/func_ov100_021451c4.cpp
src/func_ov100_021452e4.c
# The key-model pair InitResources and CleanupResources drive (ov089's
# SharedFilePtr table, which the port already carries as zeroed storage in
# hal/cxx_aliases.cpp -- the castle grounds' three doors take the branch that
# does not read it).
src/LoadKeyModels.cpp
src/UnloadKeyModels.cpp
# THE PLAYER SIDE OF OPENING A DOOR. These are the arm9 entry points the
# door's callbacks call when Mario reaches one: the star check, the two talk
# paths, the big-door open, the character swap and the sound. They link and
# they are matched; what they run into is the message system the port stops
# at, the same wall SIGN_POST's read branch and the RABBIT's catch path meet
# (hal/actor_vtables.cpp). Nothing on the castle grounds reaches them with the
# entrance gate the level boot leaves in place.
src/actors/Player.cpp
src/_ZN6Camera14GoBehindPlayerEj.cpp
src/_ZN8SaveData17SetCharacterIntroEi.cpp
src/func_0201277c.c

# --- linkloop round 1 ---
# func_020ca78c is ov002's own func_ov002_020ca78c; the door's TU declares it
# without the overlay prefix, the same slip as func_02132894 above.
src/SetTouchScreenDelay.c
# CanEnterDoor was the one hole in the door (NONMATCHING, trapped by name in
# port/unmatched/Door_Behavior.cpp) until 2026-08-07, when the div=1 residue
# fell: the +0x48 vcall respelled as real C++ virtual dispatch restores the
# natural arg homing and the plain source matches byte-identically (PR #1223,
# notes/mwccarm-codegen.md 6bc). Matched src, so it compiles like any other.

# ---- ov089's single static initialiser ------------------------------------
# The one thing the fourth overlay is mounted for: it constructs the sixteen
# SharedFilePtrs LoadKeyModels indexes. See port/ov089_syms.txt.
src/__sinit_ov089_021328d4.c
