All three dispatch tables decode, and the check that matters is the remainder
Finished the dispatch-table work by decoding the two I had not looked at. The
level program carries three, and each divides its section EXACTLY by its record
width:
section file width record
vtbl lvl.vtbl 3 oClass, UpdateMoby_<oClass>, auxiliary
camvtbl lvl.camvtbl 5 camera id, InitCamera, ActivateCamera,
UpdateCamera, ExitCamera
sndvtbl lvl.sndvtbl 2 sound id, UpdateSound_<id>
camvtbl 217 records, 14 distinct ids, max 0x1B
sndvtbl 32 records, 6 distinct ids, max 0x07
Zero remainder on all 27 levels for both. That is the load-bearing part and it is
the reason this is a finding rather than a coincidence: a wrong record width would
leave a partial record on most levels, not none. Section sizes run 40..52 words
for the camera tables and 0..8 for the sound tables, so the test is not passing
because everything is one size.
Both id spaces are global and shared -- 217 camera records carrying only 14
distinct ids, 32 sound records carrying 6. Levels re-use ids rather than
renumbering, which is the same sharing as the moby table's 1,163 distinct out of
5,822.
Why this is more than parsing. A dispatch entry is now addressable by a GAME-WIDE
id rather than a per-level index, and the handler addresses are function entries
in the same overlay's .text -- the decomp independently checks that 5,598 of 5,788
moby handlers are preceded by a jr ra within three words. With the disassembler
now working on that section, a handler can be read. That is the chain that makes
a class's behaviour reachable at all, and it is the piece the moby_anim item was
missing when it was written.
Asserted in camera_and_sound_dispatch_tables_decode_at_their_documented_widths.
263 tests.
This commit is contained in:
@@ -407,6 +407,13 @@ Phase 1 hands over the extents; this phase works out what each one contains.
|
||||
the chunk class-ID artifact now retracted. Re-scored against the real set,
|
||||
no chunk slot separates (best 0.375 against 0.018 chance, a dozen slots in
|
||||
the same band). Asserted.
|
||||
- [x] **All three dispatch tables decode.** `lvl.vtbl` (3 words), `lvl.camvtbl`
|
||||
(5) and `lvl.sndvtbl` (2) each divide their sections **exactly**, with zero
|
||||
remainder on all 27 levels -- which is the check that would fail if a record
|
||||
width were wrong. 217 camera records carry 14 distinct global ids (max
|
||||
`0x1B`), 32 sound records carry 6 (max `0x07`), so both spaces are shared
|
||||
across levels rather than renumbered. Handler addresses are function
|
||||
entries in the same overlay's `.text`, which is now readable. Asserted.
|
||||
- [x] `lvl.vtbl`'s **`oClass` is a global identifier**, not an index into the level's
|
||||
class table: 1,163 distinct ids across the game, largest 5,050, against
|
||||
`moby_classes.count` of 136..259. **1,133 of 1,163 are out of range** for any
|
||||
|
||||
Reference in New Issue
Block a user