2259 lines
No EOL
340 KiB
Markdown
2259 lines
No EOL
340 KiB
Markdown
# Japanese No Remorse Decompilation Progress
|
||
|
||
## Objective and Method
|
||
|
||
Map the Japanese Windows executable broadly enough to support a later, evidence-based comparison with the Western edition. The active live Ghidra program for this pass was `/ja/CRUSADER.EXE`, a separate Win32 PE target from the Western DOS/NE executable. All analysis and symbol/comment changes below were made through Ghidra MCP; REA and the offline PyGhidra CLI were not used.
|
||
|
||
Ghidra symbol and comment edits are pending in the live project. This pass did not save the Ghidra project or modify executable bytes. JP and Western addresses are not directly interchangeable; compare recovered behavior and data roles, not address values.
|
||
|
||
## Coverage Report After Each Batch
|
||
|
||
After every verified JP analysis batch, run `tools/jp_executable_documentation_report.py` against the active `/ja/CRUSADER.EXE` through the live Ghidra MCP read-only script endpoint. Pass this script path to `run_readonly_script`:
|
||
|
||
```text
|
||
K:\ghidra\Crusader_Decomp\tools\jp_executable_documentation_report.py
|
||
```
|
||
|
||
Append a dated row below using the generated ledger-tracked function count and percentage, untracked count, function-body byte coverage, and defined-instruction byte coverage. Keep prior rows so progress between batches remains visible. Treat exact function-entry matches in the main progress tables as a tracking proxy, not a semantic-completeness score; the report does not count prose-only references or subsystem-specific JP documents. Run it after the Ghidra analysis and document updates, and do not save the Ghidra project or modify executable bytes.
|
||
|
||
| Date | Tracked function entries | Not in main tables | Function-body bytes | Defined instruction bytes | Batch |
|
||
|---|---:|---:|---:|---:|---|
|
||
| 2026-10-11 | 186 / 1,493 (12.5%) | 1,307 (87.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Baseline after the startup-chain documentation update. |
|
||
| 2026-10-11 | 202 / 1,493 (13.5%) | 1,291 (86.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Address-ordered pass `00414698`-`00415d68`; reused the previously documented `00415eec` entry. |
|
||
| 2026-10-11 | 222 / 1,493 (14.9%) | 1,271 (85.1%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Keyboard-control/static-overlay batch `004168cc`-`0041a274`; exact ledger report then exposed lower-address gaps beginning at `0040e764`. |
|
||
| 2026-10-11 | 242 / 1,493 (16.2%) | 1,251 (83.8%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Filled report-discovered lower-address gaps `0040e764`-`0040fb54` in the viewport/text table. |
|
||
| 2026-10-11 | 246 / 1,493 (16.5%) | 1,247 (83.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Normalized the previously documented `004123d0`-`004123e8` accessor range to four exact entry addresses so the report counts them. |
|
||
| 2026-10-11 | 266 / 1,493 (17.8%) | 1,227 (82.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0040fc74` through `0041ccc8`, including explicit rows for spatial/process helpers. |
|
||
| 2026-10-11 | 286 / 1,493 (19.2%) | 1,207 (80.8%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0041cdf4` through `0041ea3c`, documenting dispatcher and item-notification paths. |
|
||
| 2026-10-11 | 299 / 1,493 (20.0%) | 1,194 (80.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 13 report-listed entries from `0041ea78` through `0041f6ec`, documenting viewport grid, render-order, and process-queue paths. |
|
||
| 2026-10-11 | 299 / 1,493 (20.0%) | 1,194 (80.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Applied evidence-supported names and comments to 23 tracked functions and two supporting shape-record helpers; address coverage stayed unchanged. |
|
||
| 2026-10-11 | 299 / 1,493 (20.0%) | 1,194 (80.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Applied six evidence-supported names to keyed-entry cache helpers, item-shape interaction, and type-`0xf0` process construction; address coverage stayed unchanged. |
|
||
| 2026-10-11 | 319 / 1,493 (21.4%) | 1,174 (78.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `0041f954` through `00421c08`, documenting viewport spatial-node lifetime, render-order relations, visible-item animation, and invalidation. |
|
||
| 2026-10-11 | 319 / 1,493 (21.4%) | 1,174 (78.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Resolved the previously deferred `0044dc9c` as `item_action_process_dispatch`; address coverage stayed unchanged. |
|
||
| 2026-10-11 | 339 / 1,493 (22.7%) | 1,154 (77.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00421f9c` through `00423358`, covering tracked-item viewport state, intrusive-list utilities, and audio cleanup/update paths. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `0042335c` through `004237d0`, covering sound playback setup/shutdown and item-catalog lookup helpers. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Renamed and commented 11 tracked functions from `004071a0` through `0040add8`; tracked generated names fell from 85 to 74. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Renamed and commented 13 functions from `0040ce20` through `0040f920`; tracked generated names fell from 74 to 61. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Renamed and commented 13 functions from `0040fb54` through `00412c10`; tracked generated names fell from 61 to 48. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Renamed and commented 14 functions from `00412ce0` through `0041ccc8`; tracked generated names fell from 48 to 34. |
|
||
| 2026-10-11 | 359 / 1,493 (24.0%) | 1,134 (76.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Renamed and commented the final 34 documented candidates from `00422990` through `00458b8c`, and corrected `004059f0`; tracked generated names fell from 34 to 0. |
|
||
| 2026-10-11 | 379 / 1,493 (25.4%) | 1,114 (74.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00423830` through `00424d0c`, covering catalog selectors, item shape state, and type-`0xf0`/`0x20f` process paths. |
|
||
| 2026-10-11 | 399 / 1,493 (26.7%) | 1,094 (73.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00424f70` through `00425b04`, covering queue operations, fatal reporting, and DirectDraw palette fades. |
|
||
| 2026-10-11 | 419 / 1,493 (28.1%) | 1,074 (71.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00425b70` through `00426924`, covering grayscale palette transitions and file-stream operations. |
|
||
| 2026-10-11 | 439 / 1,493 (29.4%) | 1,054 (70.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00426c1c` through `004281e4`, covering memory-backed text parsing, path enumeration, usecode caches, and indexed-file helpers. |
|
||
| 2026-10-11 | 448 / 1,493 (30.0%) | 1,045 (70.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next nine entries from `00428224` through `00428918`, covering flex reads, indexed-resource cache access, and object initialization helpers. |
|
||
| 2026-10-11 | 468 / 1,493 (31.3%) | 1,025 (68.7%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00428934` through `00429fb0`, covering text layout, palette management, process construction, and resource-cache lookup. |
|
||
| 2026-10-11 | 488 / 1,493 (32.7%) | 1,005 (67.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `0042a118` through `0042bf18`, covering glob items, gravity processes, indexed resources, and static-resource pools. |
|
||
| 2026-10-11 | 508 / 1,493 (34.0%) | 985 (66.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `0042c0b0` through `00431860`, covering usecode dispatch and item containment/shape accessors. |
|
||
| 2026-10-11 | 528 / 1,493 (35.4%) | 965 (64.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `0043187c` through `00431db4`, covering item state tables and shape-class helpers. |
|
||
| 2026-10-11 | 548 / 1,493 (36.7%) | 945 (63.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00431df8` through `00432c68`, covering item lifecycle hooks, usecode item actions, direction/dimension helpers, and spatial overlap. |
|
||
| 2026-10-11 | 568 / 1,493 (38.0%) | 925 (62.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `00432ea0` through `0043399c`, covering item footprint predicates, coordinate/flag accessors, and usecode event helpers. |
|
||
| 2026-10-11 | 588 / 1,493 (39.4%) | 905 (60.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 entries from `004339cc` through `00434a94`, covering usecode event selectors, item-state bytes, shape flags, and item transitions. |
|
||
| 2026-10-11 | 598 / 1,493 (40.1%) | 895 (59.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the final 10 entries for the requested threshold, from `00434ab0` through `00435100`, covering item helper wrappers, shape action classification, and a usecode spawn path. |
|
||
| 2026-10-11 | 618 / 1,493 (41.4%) | 875 (58.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `004352b4` through `00437394`, covering item-grid updates, cell lists, and ID-pool management. |
|
||
| 2026-10-11 | 638 / 1,493 (42.7%) | 855 (57.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `004375a4` through `00439284`, covering item-pool transitions, shape-profile helpers, and spatial selectors. |
|
||
| 2026-10-11 | 658 / 1,493 (44.1%) | 835 (55.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0043935c` through `0043ca28`, covering selector iteration, shape-footprint queries, joystick polling, and process-table helpers. |
|
||
| 2026-10-11 | 678 / 1,493 (45.4%) | 815 (54.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0043ca98` through `00443f24`, covering process notifications, dispatcher records, list/resource helpers, and runtime transitions. |
|
||
| 2026-10-11 | 698 / 1,493 (46.8%) | 795 (53.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00444470` through `00446b34`, covering runtime commands, DirectDraw/UI helpers, and process-related arrays. |
|
||
| 2026-10-11 | 718 / 1,493 (48.1%) | 775 (51.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00446b78` through `00448740`, covering process-ID lists, shape state, and collision queries. |
|
||
| 2026-10-11 | 738 / 1,493 (49.4%) | 755 (50.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00448818` through `0044a798`, covering collision processing, mouse control, and audio voice updates. |
|
||
| 2026-10-11 | 747 / 1,493 (50.0%) | 746 (50.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 9 report-listed entries from `0044ab2c` through `0044b980`, completing the 50% address-tracking milestone. |
|
||
| 2026-10-11 | 767 / 1,493 (51.4%) | 726 (48.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0044ba18` through `0044c654`, covering audio lifecycle and dispatcher/resource-list helpers. |
|
||
| 2026-10-11 | 787 / 1,493 (52.7%) | 706 (47.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0044c6d4` through `0044d910`, covering gump rendering and dispatcher/process helpers. |
|
||
| 2026-10-11 | 807 / 1,493 (54.1%) | 686 (45.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0044d984` through `0044f588`, covering shape-state and per-item record helpers. |
|
||
| 2026-10-11 | 827 / 1,493 (55.4%) | 666 (44.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0044f5c0` through `00450124`, covering item allocation and shape-slot records. |
|
||
| 2026-10-11 | 847 / 1,493 (56.7%) | 646 (43.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00450148` through `00450a48`, covering item action modes and related-slot accessors. |
|
||
| 2026-10-11 | 867 / 1,493 (58.1%) | 626 (41.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00450a68` through `00450e54`, covering item option values, packed fields, and runtime action state. |
|
||
| 2026-10-11 | 887 / 1,493 (59.4%) | 606 (40.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00450e74` through `00451960`, covering item-value adjustment, linked-item state, and interaction bit flags. |
|
||
| 2026-10-11 | 907 / 1,493 (60.8%) | 586 (39.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00451980` through `00455ce8`, covering direction processes, palette transforms, and AVI playback. |
|
||
| 2026-10-11 | 927 / 1,493 (62.1%) | 566 (37.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00455fb4` through `00457930`, covering AVI playback lifecycle, shape-resource usage maps, and process filters/setters. |
|
||
| 2026-10-11 | 947 / 1,493 (63.4%) | 546 (36.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00457994` through `00458ecc`, covering keyboard categories, process timers, dependency expressions, and relation state. |
|
||
| 2026-10-11 | 967 / 1,493 (64.8%) | 526 (35.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00458f3c` through `00459940`, covering process state/timer helpers, static-overlay streams and palettes, rectangle operations, and item-process lists. |
|
||
| 2026-10-11 | 987 / 1,493 (66.1%) | 506 (33.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `004599e0` through `0045d0f4`, covering process-list cleanup, savegame state/UI, argument descriptors, and shape-resource caching. |
|
||
| 2026-10-11 | 1,007 / 1,493 (67.4%) | 486 (32.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0045d140` through `0045ed80`, covering static-resource swap files, snap-egg item bounds/overlap, and sound-FLX cache management. |
|
||
| 2026-10-11 | 1,027 / 1,493 (68.8%) | 466 (31.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0045ee9c` through `00460044`, covering sound-FLX channel management, spatial sound events, and item-event cleanup. |
|
||
| 2026-10-11 | 1,046 / 1,493 (70.1%) | 447 (29.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 19 report-listed entries from `0046009c` through `004611f4`, covering sound-event maintenance and the sprite manager/render-region paths. |
|
||
| 2026-10-11 | 1,066 / 1,493 (71.4%) | 427 (28.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00461230` through `00463350`, covering sprite-process animation, position-query movement, and cursor-state helpers. |
|
||
| 2026-10-11 | 1,086 / 1,493 (72.7%) | 407 (27.3%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00463390` through `00464390`, covering bottom-toolbar state, AVI text/file buffers, shutdown dispatch, and process timing. |
|
||
| 2026-10-11 | 1,106 / 1,493 (74.1%) | 387 (25.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Checkpoint for the already documented `00463390`-`00464390` batch; this ledger row was omitted when that batch was first recorded. |
|
||
| 2026-10-11 | 1,126 / 1,493 (75.4%) | 367 (24.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00465b88` through `004671b0`, covering mouse/disk helpers, command-line parsing, and Usecode override/resource processing. |
|
||
| 2026-10-11 | 1,146 / 1,493 (76.8%) | 347 (23.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00467304` through `0046857c`, covering Usecode process serialization, resource-cache lifetime, random helpers, and bitmap-buffer management. |
|
||
| 2026-10-11 | 1,166 / 1,493 (78.1%) | 327 (21.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00468588` through `00469a10`, covering bitmap-buffer operations, clipped drawing/blitting, palette effects, and process setup. |
|
||
| 2026-10-11 | 1,186 / 1,493 (79.4%) | 307 (20.6%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added 20 report-listed entries from `00469a2c` through `0046e2a0`, covering runtime flags, item-shape interactions, modal UI state, and viewport selection candidates. |
|
||
| 2026-10-11 | 1,226 / 1,493 (82.1%) | 267 (17.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0046fc84` through `00471c99`, covering Usecode value-list operations, item-shape selection UI, and indexed-shape blitters. |
|
||
| 2026-10-11 | 1,246 / 1,493 (83.5%) | 247 (16.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00471d49` through `004721b4`, covering pixel-effect blitters, tracked-resource management, RNG, config helpers, and x87 trig routines. |
|
||
| 2026-10-11 | 1,266 / 1,493 (84.8%) | 227 (15.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `004721be` through `0047286a`, covering string/path helpers, heap block release, process exit, file modes, and formatted stream output. |
|
||
| 2026-10-12 | 1,286 / 1,493 (86.1%) | 207 (13.9%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0047286f` through `00472d68`, covering resource release, runtime utilities, handle-table helpers, and Win32 startup. |
|
||
| 2026-10-12 | 1,306 / 1,493 (87.5%) | 187 (12.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00472dd0` through `00473d3b`, covering event interpretation, heap allocation, and formatted input/output. |
|
||
| 2026-10-12 | 1,326 / 1,493 (88.8%) | 167 (11.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00473d43` through `00475026`, covering formatted-input conversions, DBCS string helpers, runtime frames, and heap block allocation/free. |
|
||
| 2026-10-12 | 1,346 / 1,493 (90.2%) | 147 (9.8%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00475131` through `0047598a`, covering runtime error state, Win32 file operations, buffered streams, and local-time records. |
|
||
| 2026-10-12 | 1,366 / 1,493 (91.5%) | 127 (8.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `004759ef` through `00476530`, covering timestamp conversion, runtime signal/exception handling, Win32 handle tables, and mutex acquisition. |
|
||
| 2026-10-12 | 1,386 / 1,493 (92.8%) | 107 (7.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00476592` through `0047738c`, covering TLS thread contexts, runtime callback dispatch, event records, exception actions, and virtual-region tracking. |
|
||
| 2026-10-12 | 1,406 / 1,493 (94.2%) | 87 (5.8%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00477400` through `00477ba2`, covering virtual-region allocation, numeric conversion, DBCS navigation, and Win32 file/handle helpers. |
|
||
| 2026-10-12 | 1,426 / 1,493 (95.5%) | 67 (4.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00477cbf` through `00478a46`, covering buffered file output, runtime math/stack support, calendar conversion, and timezone rules. |
|
||
| 2026-10-12 | 1,446 / 1,493 (96.9%) | 47 (3.1%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00478b56` through `0047998a`, covering heap reallocation, thread-context cleanup, virtual regions, and math-error reporting. |
|
||
| 2026-10-12 | 1,466 / 1,493 (98.2%) | 27 (1.8%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `00479991` through `0047ae78`, covering exception dispatch, math diagnostics, string comparison, floating-point helper logic, and Win32 import thunks. |
|
||
| 2026-10-11 | 1,206 / 1,493 (80.8%) | 287 (19.2%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed entries from `0046e384` through `0046faf0`, covering static-overlay updates, weapon-cache records, and Usecode value heap/list operations. |
|
||
|
||
Baseline context: Ghidra reported 1,618 total functions across all address spaces, 110 tracked entries with descriptive names and 76 with generated names, 82 descriptive names outside the main progress tables, 3 functions with function comments, and 46 thunks. Five table addresses did not correspond to function entries; these are switch/option addresses, not missed function starts. These supporting values are useful for triage but are not the primary progress percentage.
|
||
|
||
## Address-Ordered Pass: Initial Span Dispatchers
|
||
|
||
The lowest mapped address, `00400000`, is the PE/DOS header, not code. The first Ghidra-defined function in the code segment is `0040102e`. This pass starts there and follows function addresses upward; earlier subsystem batches elsewhere in this document remain useful evidence, but are not the continuation cursor.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0040102e` | `dispatch_copy_u8_span_to_u16` | High confidence for the operation. Selects one of `0x140` unrolled bodies at 12-byte spacing. Raw bodies at `00401050` and `00401f44` read successive source bytes and store each as a 16-bit destination value. Called by the run decoder at `00454958`. |
|
||
| `00401f58` | `dispatch_copy_u8_span_to_two_u16_dests` | High confidence for the operation. Selects one of `0x140` unrolled bodies at 19-byte spacing. Verified bodies copy each source byte as a 16-bit value to two destinations separated by `0x280` bytes. Called by the run decoder at `00454d0c`. |
|
||
| `00403742` | `dispatch_copy_u8_span_to_two_u32_dests` | High confidence for the operation. Selects one of `0xa0` unrolled bodies at 24-byte spacing. Verified bodies expand each source byte to a 32-bit value and write two destinations separated by `0x280` bytes. Called by the run decoder at `00454a90`. |
|
||
|
||
The three callers decode run lengths from a packed nibble stream and invoke their dispatcher for selected spans. This supports the span-copy role, but the callers' full image-format and destination-layout contracts remain open. The unrolled target bodies are present as raw executable bytes but are not currently defined as instructions in Ghidra; operation details above were checked directly through MCP memory reads. Function renames and decompiler comments are pending in the live Ghidra session; no bytes were changed and the project was not saved.
|
||
|
||
## Verified Batch: NPC Process Helpers
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00404670` | `npc_process_init_base` | High confidence. Allocates a process object, installs `g_npcProcessFnPtrs`, sets base type `0x205`, associates the item, and initializes common flags. `AttackProcess` calls it at `0040af2f`, then replaces the dispatch table and process type with its own (`0x259`). The Stand, Pace, and Guard constructors at `00404904`, `00404d30`, and `00405030` contain the same base initialization sequence. |
|
||
| `00404704` | `npc_process_check_target_adjacent` | High confidence for an adjacency/eligibility check; parameter details remain open. It checks neighboring directions and a mode-dependent target/state condition. Callers include `StandProcess_Run` (`004049a8`), `PaceProcess_Run` (`00404dd8`), `GuardProcess_Run` (`004050e0`), and `FUN_00407304`. A true result triggers action `0x71` in Stand/Pace and action `5` in Guard. |
|
||
|
||
Decompiler comments were added at both entries to preserve the evidence and the unresolved parameter semantics. Read-back confirmed both renamed functions and comments in the active Ghidra session.
|
||
## Address-Ordered Pass: NPC Process Constructors and Run Paths
|
||
|
||
The existing verified entries at `00404670` and `00404704` were reused, then this pass continued through the neighboring class-specific constructors and run methods.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00404904` | `StandProcess_00404904` | High confidence for construction: reuses the common NPC base setup, records the item, installs `g_standProcessFnPtrs`, sets type `0x258`, and applies process flags `0x101`. |
|
||
| `004049a8` | `StandProcess_Run` | High confidence for the observed path. Checks item-bounds overlap and action state, then uses the shared adjacency test to dispatch action `0x71`; otherwise schedules a 100-unit delay. |
|
||
| `00404a18` | `SurrenderProcess_00404a18` | High confidence for setup: installs the surrender table and type `0x25f`, clears fields `+0x40/+0x41`, calls `item_action_process_dispatch` with selector `0x39`, threshold `0`, and replacement flag `0`, then sets bit 0 in the associated item record. The selector's specific action remains unresolved. |
|
||
| `00404b84` | `SurrenderProcess_Run` | High confidence for the visible gates, not the complete behavior. Checks global/item state and a spatial query; shape IDs `0x2f4`-`0x2f8`, `0x344`, and `0x597` select table-driven follow-up actions. Failure paths reschedule after 100 units. |
|
||
| `00404d30` | `PaceProcess_00404d30` | High confidence for construction: installs `g_paceProcessFnPtrs`, sets type `0x255`, and initializes field `+0x42` to zero after common NPC setup. |
|
||
| `00404dd8` | `PaceProcess_Run` | High confidence for the observed branches. Shares Stand's bounds/adjacency action-`0x71` path; remaining paths create/dispatch a type-specific helper and branch on process state and selected item shape IDs. |
|
||
| `00405030` | `GuardProcess_00405030` | High confidence for construction: installs `g_guardProcessFnPtrs`, sets type `0x25e`, and sets process flag bit 0 after common NPC setup. |
|
||
| `004050e0` | `GuardProcess_Run` | High confidence for the observed path. Checks termination/state, dispatches action `5` when the shared adjacency test succeeds, otherwise queries state and may schedule a 100-unit delay or call mode helpers. |
|
||
| `004051fc` | `LoiterProcess_004051fc` | High confidence for setup: installs `g_loiterProcessFnPtrs`, sets type `0x257`, initializes fields `+0x40/+0x42/+0x44/+0x46`, and applies flags in the `+0x30` word. |
|
||
| `004052f4` | `LoiterProcess_Run` | High confidence for timer behavior: decrements the timer at `+0x40` and invokes vtable slot `+0x08` at expiry; separate paths perform candidate-position and action queries. |
|
||
|
||
The process-type values and immediate actions are supported by direct decompilation. The meanings of the shared action selectors, timer units, and several state fields remain open.
|
||
|
||
## Verified Batch: Low-Level Helpers
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00405950` | `load_u16_indirect` | High confidence for the operation only: returns the 16-bit value addressed through incoming `EAX`. The owning field is unresolved. |
|
||
| `00405960` | `clear_u16_indirect` | High confidence for the operation only: writes zero to the 16-bit value addressed through incoming `EAX`. The owning field is unresolved. |
|
||
| `004059c0` | `noop_callback` | High confidence: empty body, with data references from three function-pointer tables, including `g_npcProcessFnPtrs` at `0047d7f0`. The exact callback slot role is unresolved. |
|
||
| `0040a7f0` | `packed_record_has_nonzero_fields` | High confidence for the tested bits only: returns nonzero if either of two packed fields at `+4` or the low nibble at `+7` is nonzero. The record schema is unresolved. |
|
||
|
||
These generic names are intentionally mechanical. They improve decompiler readability without asserting the meaning of the word or the table slots. Decompiler comments record the observed operations and caller evidence.
|
||
## Address-Ordered Pass: Keyed Entry Cache
|
||
|
||
The already documented helpers at `00405950`, `00405960`, and `004059c0` were reused; the next cache-related entries establish a ten-slot table with 256 four-byte pointers per key. Names describe the data structure and operations only; the key domain and entry schema remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00406540` | `keyed_entry_cache_initialize` | High confidence. Clears ten key tags, allocates the shared table, and initializes per-slot state; required allocation failure follows error path `0x2e`. |
|
||
| `004065ac` | `keyed_entry_cache_shutdown` | High confidence. Releases non-null entries across 10 x 256 cells, resets tags, then releases and clears the shared table pointer. |
|
||
| `00406714` | `keyed_entry_cache_load_key` | High confidence. Loads a missing 16-bit key into the next cyclic slot, clears the replaced slot, populates up to 256 entry pointers, and records the key tag; returns `-1` on failure. |
|
||
| `004069d8` | `keyed_entry_cache_read_entry_pair` | High confidence. Finds or loads the key slot and copies two 32-bit words from the indexed entry to caller storage. |
|
||
| `00406ab8` | `keyed_entry_cache_copy_entry_fields` | High confidence. Finds or loads the key slot and repacks fields at entry offsets `+4/+6` into a four-byte caller output, with a default-field path when no entry is present. |
|
||
| `00407000` | `keyed_entry_cache_has_entry` | High confidence. Finds or loads the key slot, then tests whether the indexed cache pointer is non-null. |
|
||
|
||
The six names and decompiler comments were read back in the active Ghidra session. Cache contents and project changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: NPC State Dispatch and Candidate Search
|
||
|
||
This span continues upward from the keyed-entry cache, reusing the previously examined entries at `004071a0`, `00407304`, `00407500`, `00407550`, and `004076b0` only after decompiling them again in address order.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004071a0` | `item_action_resolve_position_and_autofirer` | Resolves shape/item properties and an action code, handles the selector-1 AutoFirer state, then queries the position path and optionally applies an item-word-derived update. Selector semantics remain incomplete. |
|
||
| `00407304` | `item_shape_dispatch_interaction_rules` | Dispatches by associated-item shape code: codes `0x1e`/`0x1f` take an adjacency/action path, `0x385`/`0x4e6` clear item-record flags, and violent-mode codes `0x576`/`0x596` consult tables at `0047b074`/`0047b084`. Table entry meanings and resulting effects remain unresolved. |
|
||
| `00407500` | `keyed_entry_cache_key_is_available` | Resolves the incoming 16-bit key through `004262f8` and returns whether the lookup succeeded. Its sole observed caller, `keyed_entry_cache_load_key`, uses this as a gate before populating a cyclic cache slot; key semantics remain unresolved. |
|
||
| `00407550` | `process_0x0f0_construct_for_item` | Constructs process type `0xf0`, associates the supplied item ID, installs vtable `0047da00`, initializes process fields, derives additional fields from the associated item's shape record when present, and copies keyed-entry cache data. The process role remains unresolved. |
|
||
| `004076b0` | `item_process_probe_positions_and_update` | Updates process/item state, constructs type-selected temporary process objects, probes candidate coordinates, records process state at `+0x34`, then copies keyed-cache fields and updates the associated item. Candidate and field meanings remain unresolved. |
|
||
| `00408744` | `process_update_item_byte_10` | Writes `0`, `1`, or a value derived from process byte `+0x37` to byte `+0x10` of the associated item record (stride `0x79`), based on process flags and state/overlap checks. The field meaning remains unresolved. The rename and decompiler comment were read back through MCP. |
|
||
|
||
The function list confirms the next defined entry is `00409ce0`; continue there without skipping intervening function entries. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Process Buffers and Attack Process
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00409ce0` | `set_object_byte_3e_and_increment_counter` | Sets byte `+0x3e` on the incoming object and increments `DAT_0048225e`. The field and counter meanings are unresolved; the rename and comment were read back through MCP. |
|
||
| `00409ecc` | `item_process_check_spatial_conflict_and_apply_action` | Calls the spatial helper with a stack result buffer and tests output bit `0x10`. On a clear result it either sets object bit `+0x40:0x10` and calls vtable `+0x0c`, or may call `item_action_process_dispatch(10000,0x3b,1)` and update relative coordinates. Exact query semantics remain unresolved. |
|
||
| `0040a004` | `process_apply_direction_code` | Applies direction codes to object byte `+0x36`, resolving codes `0x10`-`0x12` through `00450e54` and adjusting turns by one or two 4-bit steps based on flag `+0x4b:0x40`. The rename and comment were read back through MCP. |
|
||
| `0040a7f0` | `packed_record_has_nonzero_fields` | Existing verified helper: tests packed fields at `+4` and the low nibble at `+7`; the record schema remains unresolved. |
|
||
| `0040a890` | `draw_packed_shape_geometry_variant_a` | Draws a packed coordinate/extent record through shape and edge helpers; the record schema and rendered object's role are unresolved. |
|
||
| `0040a9b8` | `draw_packed_shape_geometry_variant_b` | Related packed-geometry draw variant using the same shape/bounds helpers and two explicit edge calls; record purpose remains unresolved. |
|
||
| `0040aa90` | `object_create_from_record_with_context` | Creates a vtable-backed object from a five-byte record, copies two context words and caller state, and stores `DAT_00482670`; concrete object class remains unresolved. |
|
||
| `0040aaec` | `object_cleanup_select_mode_by_flag` | Selects object/resource cleanup paths from flag bit 2; the clear-bit path resets/releases the resource and delegates object cleanup, while the set-bit path invokes shared release helpers. |
|
||
| `0040ab54` | `object_draw_bounds_at_offset` | Builds bounds from object fields `+0x25` through `+0x2b` and draws through the packed-geometry helper or a simpler path selected by byte `+0x4a`. |
|
||
| `0040ac7c` | `object_copy_resource_subrect_to_buffer` | If object resource `+0x46` is present, computes a source subrectangle and copies it through `00428c7c` using a 256-byte stack buffer; resource format remains unknown. |
|
||
| `0040adc0` | `memory_fill_register_context_wrapper` | Thin register-context wrapper around `00471f20`; the decompiler does not recover the implicit register contract. |
|
||
| `0040add8` | `buffer_resize_from_size_record` | Releases the existing pointer, validates the low-byte size at record `+4`, allocates that many bytes, stores the pointer, and traps on zero size or allocation failure. |
|
||
| `0040ae58` | `keyed_entry_cache_entry_buffer_size` | Computes buffer bytes from the descriptor's low-byte count at `+4`: count times `0x40` when mode bit `0x40` at `+7` is clear, otherwise count times `0x80`. Called by `keyed_entry_cache_load_key`; descriptor semantics remain unresolved. |
|
||
| `0040ae88` | `keyed_entry_cache_get_entry_address` | Computes an address within a keyed-entry cache buffer from its base, descriptor stride, and packed indices. Without mode bit `0x40`, halves one index and rejects values above 7; `keyed_entry_cache_read_entry_pair` uses the result to copy two dwords. |
|
||
| `0040aec8` | `keyed_entry_cache_release_entry_buffer` | Releases the buffer pointer held in a cache-entry record and clears the pointer field. Called while replacing cache entries and during `keyed_entry_cache_shutdown`. |
|
||
| `0040af20` | `AttackProcess_0040af20` | Constructs process type `0x259` from the common NPC initializer, initializes attack state, selects timing values from shape/skill conditions, and uses the shared 32-entry table. Many fields and timing units remain unresolved. |
|
||
| `0040b524` | `attack_process_initialize_entry_table` | Initializes 32 entries in `DAT_004820c0` using per-index availability checks and allocations, sets `DAT_00482140`, and returns `00426208`'s result. The entry domain remains unresolved; the rename and comment were read back through MCP. |
|
||
| `0040b7e4` | `AttackProcess_Run` | Consumes command words from the process buffer at `+0x47`, advances cursor `+0x4b`, and dispatches many cases to action, direction, item, and spatial helpers. This establishes an interpreter-like command stream; individual command meanings remain only partly mapped. |
|
||
| `0040ce20` | `process_set_byte_7e_and_randomize_field_75` | Sets byte `+0x7e`, derives a value in roughly the 8-18 range, stores it scaled by 100 at `+0x75`, then adds a helper-produced adjustment. Field units and purpose remain unresolved. |
|
||
| `0040ce6c` | `attack_process_fallback_update` | AttackProcess fallback/update path used when process byte `+0x4f` is zero. Checks associated-item and spatial state, computes target direction/distance, updates timing/movement fields, and dispatches action helpers; field and selector meanings remain unresolved. |
|
||
|
||
The function list confirms the next defined entry is the previously examined `process_set_byte_7d_one` at `0040dfa0`. Continue there, then inspect every subsequent entry in ascending address order. This pass made no executable-byte changes and did not save the Ghidra project.
|
||
|
||
## Address-Ordered Pass: Viewport, Text, and Configuration
|
||
|
||
This continuation examined each defined function from `0040dfa0` through `004138e8` in ascending order. Ghidra renames and comments are pending in the live session; no executable bytes were changed and the project was not saved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0040dfa0` | `process_set_byte_7d_one` | Writes `1` to object byte `+0x7d`; its observed caller is `process_choose_direction_to_coords`. Field meaning remains unresolved. |
|
||
| `0040e0e8` | `rectangles_overlap_inclusive` | Tests signed-short rectangles and treats touching edges as overlap. |
|
||
| `0040e1f8` | `screen_region_queue_clipped_rect` | Clamps a four-short rectangle to 640x480, allocates a five-dword vtable-backed record, copies the clipped bounds, and appends it to the region list. The record's role remains unresolved. |
|
||
| `0040e33c` | `screen_region_rect_list_remove_overlaps` | Splits overlapping rectangles into fragments and removes empty/inverted regions; the remaining list is consumed by the rectangle drawing path. |
|
||
| `0040e728` | `camera_process_construct_common` | Initializes the common camera-process object and singleton state. `CameraProcess_00410424` installs its own vtable, stores the global process pointer, and sets type `0x219`. |
|
||
| `0040e764` | `dirty_rect_process_initialize_or_release` | Branches on an incoming flag to release the object or install its dedicated vtable and initialize state. The concrete class and flag contract remain unresolved. |
|
||
| `0040e7b8` | `screen_region_process_dirty_rects` | When dirty-region work is pending, removes overlapping rectangles, draws each remaining region, then clears and destroys the list. No direct callers were found; boundary ownership should remain under review. |
|
||
| `0040e7c4` | `screen_region_draw_dirty_rect_list` | Walks the active dirty-rectangle list, removes overlaps, draws each remaining rectangle, and finalizes list iteration. |
|
||
| `0040e87c` | `screen_region_add_intersecting_rect` | Intersects the incoming rectangle with active bounds, queues a nonempty clipped rectangle, and increments the pending count. |
|
||
| `0040e9d0` | `screen_region_next_pending_rect` | Returns or advances pending screen-region rectangle state. One path returns active bounds; the other decrements the pending count, copies current record bounds, destroys that list node, and writes a zero-sized sentinel when exhausted. |
|
||
| `0040eab4` | `screen_region_finish_rect_batch` | Finalizes screen-region rectangle-list iteration through `00422bc8` and stores the returned state word. |
|
||
| `0040ed60` | `buffer_replace_with_size_and_attribute` | Replaces the existing allocation, stores the requested size and one-byte attribute beside the pointer, and raises error `0x21` on allocation failure; record ownership remains unresolved. |
|
||
| `0040edb4` | `buffer_release_and_clear_pointer` | Releases the pointer stored at the incoming object and clears that field when non-null. |
|
||
| `0040edd0`, `0040eef0` | `directdraw_palette_export_rgb6`, `directdraw_palette_import_rgb6` | Convert between DirectDraw palette channels and RGB6 values: export shifts channels right by two; import shifts left by two before uploading entries. |
|
||
| `0040f00c` | `object_dispatch_pending_state_transition` | Evaluates shared UI/object conditions and flags, dispatches virtual method `+0x48` on one transition, and updates `DAT_00482162`; callback and event semantics remain unresolved. |
|
||
| `0040f0e8` | `object_apply_condition_state_transition` | Evaluates a shared object condition and dispatches virtual method `+0x48` or `+0x4c`, setting or clearing bit `0x20000` in `DAT_00482162`; object state meaning remains unresolved. |
|
||
| `0040f144` | `type2_object_construct_variant_a` | Constructs a type-2 object from an option record derived from the incoming byte, installs vtable variant A, sets an object flag, and clears shared state; class role remains unresolved. |
|
||
| `0040f1d4` | `type2_object_construct_variant_b` | Constructs a type-2 object from the same option-record layout as variant A but installs vtable variant B; class role and behavioral distinction remain unresolved. |
|
||
| `0040f3e4` | `resource_cache_initialize` | Initializes a circular resource-node list and resets its sentinel, slot, node-count, and byte-count state. |
|
||
| `0040f458` | `resource_cache_release_transient_nodes` | Walks the node list and destroys entries whose type is below 8; a state byte prevents repeating the sweep. Exact type ownership remains unresolved. |
|
||
| `0040f590` | `resource_cache_set_slot` | Stores an incoming pointer in the indexed cache slot and increments the slot count; traps when more than eight entries are registered. |
|
||
| `0040f5c8` | `resource_cache_clear_slot` | Clears the cache slot indexed by incoming AX; the caller's index contract remains unresolved. |
|
||
| `0040f630` | `resource_cache_node_create` | Allocates and links a cache node containing size, type/key, and associated data; updates list/count/byte totals and records it in the lookup map unless the key is sentinel `0xfffd`. |
|
||
| `0040f6d0` | `resource_cache_node_destroy` | Invokes the associated object's release method when present, clears its lookup-map slot, unlinks the node, updates counts, and frees the allocation. |
|
||
| `0040f780` | `resource_cache_remove_by_id` | Searches the node list using helper-provided key/state and destroys a matching entry; the helper's register contract and key meaning remain unresolved. |
|
||
| `0040f7f4` | `linked_record_move_to_head` | Unlinks a record from a circular doubly linked list and reinserts it after the sentinel. Values `-1` and `-2` take an error path. |
|
||
| `0040f920` | `empty_body_register_context_helper` | Ghidra reports an empty one-byte body. Callers consume register state across this entry, so its intended helper contract remains unresolved. |
|
||
| `0040fae8` | `text_get_character_width` | Reads cached metrics or calls `GetCharWidthA` for the requested character. |
|
||
| `0040fb54` | `resource_state_object_create_for_type` | Allocates a vtable-backed state object, initializes fields from type-indexed tables, validates a type value, and selects a corresponding global data pointer; object class remains unresolved. |
|
||
| `0040fc74` | `text_object_initialize_or_release` | Branches on an incoming flag to release the text object or install its vtable and initialize text-related state. The precise flag semantics remain unresolved. |
|
||
| `0040fd60` | `text_gdi_contexts_initialize` | Creates shared backing state and initializes four text memory-DC/font contexts with distinct style values. |
|
||
| `0040fe10` | `text_gdi_contexts_shutdown` | Deletes four cached GDI contexts and their selected fonts, bitmaps, and palettes, then destroys shared metrics. |
|
||
| `004100b4` | `text_create_memory_dc_with_font` | Builds a compatible memory DC with an 8-bit bitmap and grayscale palette, then adjusts font height using `GetTextMetricsA`. |
|
||
| `004103e4` | `camera_process_create` | Allocates a camera process, constructs it through `CameraProcess_00410424`, and stores the singleton pointer in `DAT_00482204`. |
|
||
| `00410400` | `camera_process_dispatch_callbacks` | If the camera singleton exists, dispatches virtual callbacks at vtable offsets `+0x2c` and `+0x30`; callback timing and semantics remain unresolved. |
|
||
| `00410424` | `CameraProcess_00410424` | Camera-process constructor variant that installs the camera vtable and sets process type `0x219`. |
|
||
| `00410454` | `viewport_invalidate_and_refresh_visible_items` | Clears two viewport state bytes and delegates refresh work to `00421fbc`; exact refresh scheduling remains unresolved. |
|
||
| `004107f8` | `project_xy_to_isometric_screen` | Projects X/Y coordinates using the current view origin and writes the two screen-space components to caller outputs. |
|
||
| `0041081c` | `project_xy_to_screen_with_item_height` | Projects coordinates, picks the viewport leaf node at that point, and adjusts outputs using the item's shape height and Z; may also return item ID and a relative-position flag. |
|
||
| `00410a0c` | `build_visible_item_render_nodes` | Traverses configured map cells and item chains, filters item/shape flags, computes isometric bounds, culls outside the view, and creates render-list nodes. Node ordering and draw-stage semantics remain open. |
|
||
| `00411078` | `update_map_viewport_tile_cache` | Maintains a 5x6 cache of 128-pixel map tiles as the viewport moves, updates tile bounds, removes or retains cached item nodes by overlap, then rebuilds the visible-node set. |
|
||
| `00411cb8` | `draw_current_map_region_outline` | Projects `DAT_004821fc` and draws four line segments through `004685d4`; the overlay's higher-level purpose remains unresolved. |
|
||
| `00411dc4` | `draw_map_region_grid_and_update_process_20f` | When renderer state is enabled, draws a 3-by-3 grid of map-region outlines; when `DAT_00482614` is set, also updates processes of type `0x20f`. Their roles remain unresolved. |
|
||
| `00412398` | `render_state_set_word_004821f2` | Stores incoming AX at the word field beginning at `DAT_004821f0+2`; field meaning is unresolved. |
|
||
| `004123d0` | `render_state_get_word_004821ec` | Returns the 16-bit value at `DAT_004821ec`; field meaning is unresolved. |
|
||
| `004123d8` | `render_state_get_word_004821ee` | Returns the 16-bit value at `DAT_004821ee`; field meaning is unresolved. |
|
||
| `004123e0` | `render_state_get_byte_004821f0` | Returns the byte at `DAT_004821f0`; field meaning is unresolved. |
|
||
| `004123e8` | `render_state_get_word_0047b168` | Returns the 16-bit value at `DAT_0047b168`; field meaning is unresolved. |
|
||
| `004123f0` | `draw_isometric_outline_from_projected_coords` | Projects a coordinate pair and draws four line segments through `004685d4` using the caller's dimensions and color; outline role remains unresolved. |
|
||
| `00412980` | `item_shape_encode_compact_flag_bits` | Maps input byte bit 1 to output bit 0 and bit 6 to bit 5, always setting output bit 15; exact field semantics remain unresolved. |
|
||
| `004129a0` | `spatial_query_rect_item_shape_flags` | Scans rectangle candidates, filters item position/Z and shape extents, ORs compact shape-derived flags, and optionally returns the first matching item ID. Flag meanings remain unresolved. |
|
||
| `00412c10` | `item_shape_derive_table_value_for_id` | Combines shape-record lookup values for the incoming ID and selector; selectors 2 and 9 take extra table/helper adjustments before a bounded update. Result domain and selector meanings remain unresolved. |
|
||
| `00412ce0` | `text_entry_prompt_run_and_wait` | Initializes the text-entry UI, obtains a string, creates a text-entry process if one is returned, runs the dispatcher until completion, then tears down the UI. |
|
||
| `00412d10` | `text_entry_process_create_for_string` | Creates a type-0 process, copies the DBCS-aware string into owned storage, initializes editing state, computes/centers bounds, and registers the process. |
|
||
| `00413188` | `text_entry_process_draw_and_advance` | Advances a DBCS-aware buffer, measures/draws characters, wraps lines at width limits and control markers, and invalidates affected regions. |
|
||
| `00413760` | `config_write_registry_string` | Writes a string value under the JP build's per-user `HKCU\\Software\\Electronic Arts\\Crusader: No Remorse\\J1.21` registry key. |
|
||
| `004138e8` | `config_load_registry_and_cfg` | Reads install/CD/Flic paths from HKLM and video, subtitles, blast limit, animation, frame-skip, music/sound volume, and mouse speed from HKCU; the routine also falls back to `crusader.cfg` parsing. |
|
||
|
||
This continuation examined defined entries from `0040dfa0` through `004138e8` in ascending order. Ghidra symbol and comment changes remain pending in the live session; no executable bytes were changed and the project was not saved.
|
||
|
||
The strict coverage report exposed these previously omitted lower-address entries, which now have evidence-backed operation-level names. Continue from the report's next untracked function rather than assuming the previously recorded `00414698` cursor.
|
||
|
||
## Address-Ordered Pass: Registry, Containers, and Controller State
|
||
|
||
This continuation reviewed defined entries from `00414698` through `00415d68` in ascending order. Existing evidence for `key_handle_option_cheats_jp` at `00415eec` is reused to keep the address sequence explicit. Names and comments for directly supported functions were applied and read back in Ghidra. Boundary review confirmed `00415670` is a callable low-16-bit entry into `runtime_mode_set`, not a stray boundary. No executable bytes were changed and the project was not saved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00414698` | `config_save_registry_options` | High confidence. Writes the current video mode, subtitles, blast limit, animation, frame skip, music volume, sound volume, and mouse speed through `config_write_registry_string`. Its only observed call is at `00443852`, currently outside a defined Ghidra function. |
|
||
| `00415400` | `item_remove_linked_contents` | Called by item removal at `00437394` when linked contents exist. Walks contents for shape classes 6/7; a flagged path uses item coordinates and triggers item-removal/usecode-event work. Whether contents are dropped, transferred, or removed in each case remains unresolved. |
|
||
| `00415498` | `item_container_destroy_contents` | High confidence. Walks linked child IDs for shape classes 6 and 7 and removes each through `004320d8` -> `00437394`; nested containers recurse through the same item-removal path. Called by `00432244` and map-unload cleanup at `00435bc0`. |
|
||
| `004154c8` | `item_recursive_sum_shape_byte_7` | High confidence for the operation only. Recursively traverses linked child IDs and sums each item's byte at shape-record offset `+7` via `004315d4`, stopping at `DAT_00482224`. The byte's meaning and units remain unresolved. |
|
||
| `00415670` | `runtime_mode_set_low16_entry` | High confidence. Two direct calls target this entry (`0041aab0`, `0042d039`). It clears `EAX` above bit 15 with `AND EAX,0xffff`, then falls through the no-op `LEA EAX,[EAX]` into `runtime_mode_set` at `00415678`; retain it as a distinct callable entry. |
|
||
| `00415678` | `runtime_mode_set` | High confidence for the state update. Stores the incoming mode in `DAT_0047b1d6` and `DAT_0047b1da`, performs mode-change cleanup/initialization, and refreshes the map viewport tile cache. Called from startup map selection and the JP cheat-key path; individual mode meanings remain unresolved. |
|
||
| `004156e0` | `runtime_mode_get` | High confidence. Returns `DAT_0047b1d6`, paired with `runtime_mode_set`; callers include gameplay, target-selection, and controller paths. |
|
||
| `004156e8` | `shape_record_code_0d_is_whitelisted` | Reads shape-record code `+0x0d` through `shape_record_get_code_0d` and accepts `0`, `1`, `0x3a`, `0x37`, `0x0b`, `0x10`, `0x20`, or `0x3b`. The code domain remains unresolved. |
|
||
| `00415730` | `shape_record_code_0d_passes_input_filter` | Reads shape-record code `+0x0d`; accepts several values directly and otherwise rejects codes `0x22`, `0x23`, or `0x26` through `shape_record_code_0d_is_excluded`. Its caller-level contract remains unresolved. |
|
||
| `00415788` | `controller_process_create` | High confidence. Allocates and stores the singleton controller process, installs `g_controllerProcessFnPtrs`, sets process type `0x247`, calls four initialization helpers, and applies flags `0x115`. Its only observed caller is startup code at `004664b6`. |
|
||
| `004158c8` | `tracked_item_marker_start_if_eligible` | Under global-state and selected-shape gates, initializes tracked-item marker state and may position it through `tracked_item_marker_reposition`; the initiating action and state ownership remain unresolved. |
|
||
| `004159b8` | `tracked_item_marker_periodic_refresh` | Applies a 100-unit clock threshold and event/state filters before delegating an accepted refresh to `tracked_item_marker_update_for_item`. |
|
||
| `00415a5c` | `tracked_item_marker_refresh_after_removal` | Conditionally refreshes the tracked-item marker after removal, gated by controller state and follow-up event/query checks. |
|
||
| `00415adc` | `tracked_item_marker_update_for_item` | Checks the target through `0041b798`, derives target-relative coordinates, and calls `0046159c` with selector `10`; selector and global meanings remain unresolved. |
|
||
| `00415ce4` | `tracked_item_marker_stop` | Clears the active marker path, resets associated globals, and invokes callback/resource cleanup when enabled. |
|
||
| `00415d68` | `tracked_item_marker_reposition` | Uses `DAT_0047b1da` as an item ID, reads item/shape properties, computes target-relative values, adjusts a cyclic value in `DAT_0047b1dc`, and updates coordinates through `00460668` or `0046093c`. The exact view/follow behavior remains unresolved. |
|
||
| `00415eec` | `key_handle_option_cheats_jp` | Previously verified in the Debug and Test Switches batch; included here to preserve the address-ordered sequence. |
|
||
|
||
`runtime_mode_set` has a discontiguous Ghidra body: `00415678`-`004156dd` and `004185a2`-`004186ff`, totaling 452 bytes. The MCP function summary presents the minimum-to-maximum address span, which is not a contiguous body. A later exact-ledger report exposed lower-address executable functions omitted from the primary tables; continue from the report's lowest untracked entry rather than assuming `004168cc` is the global cursor.
|
||
|
||
## Address-Ordered Pass: Keyboard Control and Static Overlay
|
||
|
||
This batch reviewed the next 20 untracked executable function entries in ascending address order, from `004168cc` through `0041a274`. Direct operations now have descriptive names; ambiguous event selectors and higher-level process roles remain explicitly unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004168cc` | `input_keyboard_event_dispatch_gate` | Filters keyboard event codes and applies a mode-dependent timer/rate gate using `DAT_00482258` before event dispatch. Individual code meanings and timing contract remain unresolved. |
|
||
| `00416a0c` | `input_keyboard_adjust_facing` | High confidence for the observed operation. Recognizes two turn-key byte values, adjusts `DAT_0047b1dc`, derives a 16-way direction from coordinates, and updates the caller's direction field. The key mapping and field owner remain unresolved. |
|
||
| `00416c7c` | `input_keyboard_handle_gameplay_event` | High confidence for its broad role. Queries tracked key states, dispatches several event-code families, calls `input_keyboard_adjust_facing` for turn input, and ultimately reaches `process_apply_direction_code`. Individual event and modifier meanings remain unresolved. |
|
||
| `004180b0` | `input_keyboard_process_interaction_state` | Processes keyboard interaction state, updates input globals, validates item/shape conditions, and emits action events; after a 400-unit interval it delegates candidate scanning to `0041871c`. Exact action semantics remain unresolved. |
|
||
| `0041871c` | `input_keyboard_scan_item_candidates` | Scans candidate IDs 2 through 255, excludes the current mode/item value, tests item bounds and state, then conditionally dispatches action selectors or updates selection. Selector and interaction meanings remain unresolved. |
|
||
| `004188a4` | `auto_firer_process_stop` | High confidence for the lifecycle operation. Clears AutoFirer/controller state flags and invokes virtual method `+0x08` on the active process object when present; the callback contract remains unresolved. |
|
||
| `00418910` | `auto_firer_process_create` | High confidence. Installs the AutoFirer function table, sets process type `0x260`, associates `DAT_0047b1d6`, stores the singleton pointer, and initializes its process state. |
|
||
| `00418a08` | `auto_firer_process_reset` | High confidence for the reset behavior. Clears AutoFirer globals and flags, cancels guarded timed/process state, invokes virtual cleanup callbacks, and restores default state fields. Individual globals remain unresolved. |
|
||
| `004191f8` | `item_shape_record_apply_cached_entry` | Reads a cache pair for the incoming selector, applies its flag bits through `004319f0`/`0043348c`, writes the selector at shape-record offset `+0x0d`, and clears offset `+0x10`. The cache key domain remains unresolved. |
|
||
| `00419420` | `noop_callback_00419420` | High confidence that the body is empty. Its callback-table slot and intended role are not established. |
|
||
| `00419480` | `load_u16_indirect_00419480` | High confidence for the operation: returns the 16-bit value addressed through incoming `EAX`. The owning field and caller contract remain unresolved. |
|
||
| `004194c0` | `isometric_project_world_xy_to_screen` | Computes screen X as `(X-Y)/2 - DAT_004821da` and screen Y as `(X+Y)/4 - DAT_004821dc`; the caller-specific coordinate units remain unresolved. |
|
||
| `0041966c` | `static_overlay_initialize` | High confidence for the initialization path. Resolves the resource named `"static"`, initializes related resource/display state, and stores handles used by the overlay loop. The resource format remains unresolved. |
|
||
| `00419874` | `static_overlay_shutdown` | High confidence as the paired teardown. Releases handles initialized by `static_overlay_initialize`, restores display/input state, and clears associated globals. |
|
||
| `0041999c` | `static_overlay_run_loop` | High confidence for the lifecycle role. Initializes the overlay, repeatedly services event/update and script state until completion or exit, then calls its teardown. |
|
||
| `00419a40` | `static_overlay_process_script` | High confidence for the observed behavior. Advances control bytes and text from the loaded resource, renders text, and starts palette transitions for recognized markers. The full script command vocabulary remains unresolved. |
|
||
| `0041a020` | `static_overlay_palette_fade_in_step` | High confidence for the palette operation and direction. Applies a 128-entry palette with the current fade level subtracted from each channel, clamps at zero, then decreases the level toward zero. |
|
||
| `0041a114` | `static_overlay_palette_fade_out_step` | High confidence for the palette operation and direction. Applies the same 128-entry channel adjustment while increasing the fade level toward its upper bound. |
|
||
| `0041a260` | `active_countdown_reset_to_500` | Resets `DAT_0047b1e8` to 500 only when nonzero. A separate state routine decrements the value; its higher-level timer purpose remains unresolved. |
|
||
| `0041a274` | `process_0x261_construct` | Constructs process type `0x261`, installs vtable `0047e18c`, initializes common process state, and sets flags. The process class role remains unresolved. |
|
||
|
||
Ghidra names and decompiler comments for the directly supported operations were read back in the live session. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Spatial Queries and Process Dispatch
|
||
|
||
This batch continued with the next 20 untracked entries from the exact coverage report. The first five entries (`0040fc74`-`00410454`) are recorded in the preceding viewport/text table to keep that table address-ordered; the remaining fifteen are listed here.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0041a2f8` | `item_decode_packed_position_offsets` | Decodes packed item/shape state into two coordinate outputs and a compact offset/orientation byte. Callers include position-query paths `0041b208` and `0041b798`; packed-field meanings remain unresolved. |
|
||
| `0041a410` | `empty_callback_body` | Empty function body; callback or boundary role is unresolved. |
|
||
| `0041a414` | `position_state_dispatch_from_stack_selector` | Loads a 16-bit selector from the caller's stack frame and forwards it to `position_state_dispatch_by_selector` with a zero secondary value. |
|
||
| `0041a434` | `position_state_dispatch_by_selector` | Large selector-driven dispatcher combining item/shape lookups, process queries, spatial checks, action dispatch, and process construction. Selector values and branch meanings remain unresolved. |
|
||
| `0041b1dc` | `timer_check_active_window` | Reads the current clock and checks it against the configured interval at `DAT_00482240` with length `DAT_00482244`; returns packed clock/state data with a distinct outside-window result. |
|
||
| `0041b208` | `position_query_build_candidate_and_dispatch` | Uses packed-position decoding to derive candidate coordinates, then dispatches selected cases through `position_state_dispatch_by_selector`; candidate record and return contract remain unresolved. |
|
||
| `0041b798` | `target_position_query_from_packed_records` | Scans nonempty packed cache records, derives candidate offsets, tests positions through occupancy and shape-query helpers, and returns a match result. Packed fields and success semantics remain unresolved. |
|
||
| `0041bb7c` | `target_position_query_within_axis_threshold` | Forms target-relative coordinates, issues a mode-4 spatial query, then rounds a 3D maximum-axis delta upward in 16-unit steps and accepts values below `0x31`; units and threshold meaning remain unresolved. |
|
||
| `0041bcd8` | `process_0x254_construct_variant_a` | Constructs process type `0x254`, installs vtable `PTR_LAB_0047e168`, associates `DAT_004955cc`, and initializes a type-specific field. |
|
||
| `0041be20` | `process_0x254_construct_variant_b` | Constructs a second type-`0x254` variant with vtable `PTR_LAB_0047e144`; it shares item/global setup with variant A but uses a different initializer and field value. |
|
||
| `0041bf6c` | `process_0x254_create_variant_a` | Allocates a process object and invokes `process_0x254_construct_variant_b` on success. |
|
||
| `0041bf6c` | `process_0x254_create_variant_b` | Allocates a process object and invokes `process_0x254_construct_variant_b` on success. |
|
||
| `0041bf84` | `process_0x254_create_variant_a` | Allocates a process object and invokes `process_0x254_construct_variant_a` on success. |
|
||
| `0041bf9c` | `item_state_map_context_and_selector` | Maps context/selectors through tables near `DAT_0047b20c`/`DAT_0047b260`, with item-catalog and state checks for selectors 8 and `0x2a`; returned values and selector meanings remain unresolved. |
|
||
| `0041c2d4` | `CycleProcess_0041c2d4` | Constructs CycleProcess type `0x248`, installs its function table, initializes common process state, stores the singleton in `DAT_004822c4`, and clears two process fields. |
|
||
| `0041cbcc` | `shared_storage_and_singleton_initialize` | Allocates shared storage, initializes dispatcher record/playback state, allocates an object, and constructs a singleton; subsystem purpose remains unresolved. |
|
||
| `0041cbf8` | `shared_storage_and_singleton_shutdown` | Shuts down dispatcher record/playback state and releases the shared allocation at `DAT_00482308`; startup is the only observed caller. |
|
||
| `0041cc24` | `shared_state_object_construct` | Constructs a vtable-backed shared object, runs three initialization helpers, stores it at `DAT_0048230c`, and sets flag bit `0x10`; object class remains unresolved. |
|
||
| `0041ccc8` | `dispatcher_two_phase_record_dispatch` | Copies six-dword records through 25-slot rings in phase 1, then processes phase-2 records, optional recording, and virtual callbacks; event schema and phase meanings remain unresolved. |
|
||
|
||
Renames and decompiler comments for the directly supported operations were applied and read back through Ghidra MCP. Operation-level names are in place where supported; ambiguous contracts remain unresolved. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Dispatcher and Item Notifications
|
||
|
||
This batch reviewed the next 20 report-listed executable entries, from `0041cdf4` through `0041ea3c`. The dispatcher cluster manages bounded event queues and optional record/playback state; the later entries maintain and render timed item-notification overlays. Several record fields and display-state meanings remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0041cdf4` | `dispatcher_record_playback_initialize` | One-time setup for two 25-slot rings of `0x18`-byte records and a five-entry context table; an optional capture/playback allocation path reports `No room for Dispatcher Record/Playback.` |
|
||
| `0041d028` | `dispatcher_record_playback_shutdown` | Closes registered contexts, releases the ring/context storage and optional capture/playback data, then clears the initialized flag. |
|
||
| `0041d148` | `dispatcher_process_phase3_records` | Processes the `PHASE3` stream, converts sampled event state through `dispatcher_encode_event_record_type`, and queues internal records. Event-field meanings remain unresolved. |
|
||
| `0041d4b0` | `dispatcher_encode_event_record_type` | Maps external event-record values into compact internal type codes, including `1`, `2`, `4`, and `0x100`, while preserving payload fields. |
|
||
| `0041d8b4` | `dispatcher_unknown_event_type_error` | Thin wrapper calling the shared dispatcher error helper with code `0x33d`; the precise triggering condition remains unestablished. |
|
||
| `0041d8c4` | `dispatcher_notify_active_contexts` | Copies a four-word event record and forwards it through `0044c798` for each active dispatcher context. The listener contract remains unresolved. |
|
||
| `0041d954` | `dispatcher_register_context` | Adds a context pointer to the bounded dispatcher table while fewer than five slots are occupied; overflow takes the error path. |
|
||
| `0041d9f4` | `dispatcher_append_recorded_event` | Appends eligible `0x14`-byte event snapshots to the capture/playback buffer, stores the current dispatcher sequence value, and advances the record count. |
|
||
| `0041dac4` | `dispatcher_event_context_create` | Creates a context object with a dedicated vtable, associates it with current dispatcher state, registers it in the bounded table, and notifies the context subsystem. |
|
||
| `0041dcb0` | `dispatcher_run_event_loop` | Invokes the active process callback, drains records through `0041ccc8`, waits on the dispatcher completion condition, and releases temporary context state. |
|
||
| `0041ddc0` | `dispatcher_clear_queued_context` | Scans pending `0x18`-byte records and clears the context field for entries matching the supplied value. |
|
||
| `0041e0ac` | `item_notification_process_initialize` | Initializes the item-notification process object with its dedicated vtable and time-derived field, then calls a shared process helper. The exact meaning of the time field remains unresolved. |
|
||
| `0041e0fc` | `item_notification_layout_and_draw` | Checks overlap among eight notification slots, lays out active rows and labels, and requests screen-region refresh for affected bounds. |
|
||
| `0041e170` | `memory_zero_fill` | Calls `00471f20` to zero-fill the caller-requested byte span; the call path does not establish a fixed length. |
|
||
| `0041e188` | `item_notification_draw_active` | Draws active entries from the eight-slot notification table, including repeated-item counts and optional secondary text, then marks rendered bounds for refresh. |
|
||
| `0041e3cc` | `item_notification_clear_dirty_regions` | Passes the saved bounds of active changed notifications to `00468c7c`, then clears each per-slot changed byte. The drawing helper's exact contract remains open. |
|
||
| `0041e448` | `item_notification_tick_expiry` | Decrements each active notification's lifetime; on expiry, refreshes its screen region and releases its item/display data. |
|
||
| `0041e4d4` | `item_notification_add_or_update` | Updates a matching notification's count/state or allocates a free slot, records display metadata and bounds, starts its timer, and requests redraw. |
|
||
| `0041e738` | `item_notification_resolve_label` | Resolves notification type and caption; explicit labels include `KEYCARD` and `CREDITS`, with helper-derived text for other supported item classes. |
|
||
| `0041ea3c` | `rect_intersect_bounds` | Intersects two four-short rectangles by raising the first two bounds to their maxima and lowering the final two bounds to their minima. |
|
||
|
||
Supported names and decompiler comments were applied and read back through Ghidra MCP. The error code, generic resource semantics, and process-like class remain unresolved despite their operation-level names. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Viewport Spatial Grid and Process Queues
|
||
|
||
This batch reviewed the next 13 report-listed executable entries, from `0041ea78` through `0041f6ec`, bringing the exact-address ledger to its 20% target. The functions cover rectangle bounds, a fixed viewport-node pool, queued process state, and render-order relationships across the viewport grid.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0041ea78` | `rect_union_bounds` | Expands the incoming four-short rectangle to include a second rectangle, using minima for the first two bounds and maxima for the final two. |
|
||
| `0041eab4` | `viewport_spatial_node_allocate` | Pops a `0x36`-byte node from the shared free list and decrements the available count; returns null when exhausted. |
|
||
| `0041ead8` | `viewport_spatial_node_release` | Pushes a node back onto the shared viewport spatial-node free list and increments the available count. |
|
||
| `0041eaf8` | `viewport_spatial_node_pool_init` | Allocates and chains `0x5dc` fixed-size `0x36`-byte nodes into the shared free list. |
|
||
| `0041ec30` | `viewport_process_queue_update` | Reconciles ready and waiting process queues using viewport bounds and dependency flags; invokes a process callback on the queue-drain path. |
|
||
| `0041efa0` | `viewport_render_node_add_order_link` | Allocates a relation record from a secondary pool and links the supplied render-node pair into each other's relation lists. |
|
||
| `0041eff8` | `viewport_process_enqueue` | Marks the incoming process runnable and inserts it into the active process queue. |
|
||
| `0041f044` | `viewport_process_unlink` | Removes process relations and child links, then detaches a queued process from the active list and clears its runnable flag. |
|
||
| `0041f160` | `visible_item_render_node_update_links` | Called by `build_visible_item_render_nodes`; visits the five-column by six-row viewport cells overlapped by the incoming node and builds links for intersecting render bounds. |
|
||
| `0041f37c` | `visible_item_render_node_order_link` | Chooses an ordering-link direction using the nodes' depth field and a fallback comparator, then allocates the relation. |
|
||
| `0041f3ec` | `map_viewport_tile_cache_update_links` | Called by `update_map_viewport_tile_cache`; revisits covered grid cells and refreshes relationships for overlapping nodes. |
|
||
| `0041f67c` | `map_viewport_tile_cache_node_order_link` | Applies the depth/fallback ordering comparison and allocates a relation for map-viewport cache nodes. |
|
||
| `0041f6ec` | `viewport_spatial_grid_initialize` | Initializes a five-column by six-row grid of `0x80`-square cells, allocating one node per cell and inserting them into the process queue. |
|
||
|
||
Renames and decompiler/disassembly comments were applied and read back through Ghidra MCP. The fallback ordering comparator's exact semantics remain unresolved. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Viewport Spatial Nodes and Animation
|
||
|
||
This pass reviewed the next 20 entries reported as untracked, from `0041f954` through `00421c08`. Together they manage viewport spatial-node lifetime and selection, render-order relation records, visible-item collection, animation-frame advancement, and redraw invalidation. The exact phase/timing domain and several shape-bound fields remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0041f954` | `viewport_spatial_grid_release_buffers` | Frees the viewport spatial-node pool, render-order relation pool, and two item-ID bitmaps. Its observed caller is the startup/shutdown cleanup sequence at `00466591`. |
|
||
| `0041f9c4` | `viewport_spatial_node_unlink_and_release` | Unlinks one spatial node from the viewport process queue, then returns it to the spatial-node pool. |
|
||
| `0041f9d8` | `viewport_render_order_relation_unlink_and_release` | Removes one render-order relation from both endpoint lists and returns the relation record to its pool. |
|
||
| `0041f9ec` | `viewport_spatial_pick_leaf_node_at_point` | Maps a point to a grid cell, marks nodes whose virtual hit test accepts it, then returns a marked node with no marked child and clears the temporary mark. The virtual hit-test contract remains unresolved. |
|
||
| `0041fb5c` | `viewport_spatial_queue_nodes_intersecting_rect` | Visits cells intersecting an input rectangle, queues overlapping nodes once, and records their item IDs in the pending bitmap. |
|
||
| `0041fd34` | `viewport_spatial_filter_pending_items_to_viewport` | Filters pending IDs by item activity and shape bounds against the viewport, sets accepted IDs in the visible bitmap, and clears the pending bitmap. |
|
||
| `00420028` | `viewport_collect_visible_items_for_phase` | Compacts visible-bitmap IDs into a caller buffer, rejecting inactive/offscreen items and applying a per-shape comparison with the incoming phase value. The phase domain remains unresolved. |
|
||
| `00420368` | `viewport_advance_visible_item_animations` | Builds the visible-item list and updates selected shape/frame state across shape-class branches. The animation selector and timing units remain unresolved. |
|
||
| `004206a8` | `viewport_spatial_grid_clear` | Walks the 5-by-6 grid, invokes each node's cleanup callback, unlinks/releases nodes, then frees the grid storage. |
|
||
| `0042073c` | `intrusive_list_insert_between` | Inserts a list node between the supplied neighbors by updating its `+4/+8` links and the adjacent nodes. |
|
||
| `004207e0` | `viewport_relation_pool_release` | Returns one `0x18`-byte render-order relation record to the pool free list and increments the available count. |
|
||
| `00420800` | `viewport_relation_pool_initialize` | Allocates and chains 4,000 render-order relation records of `0x18` bytes each, then initializes the free-list head and count. |
|
||
| `0042088c` | `viewport_render_order_relation_attach` | Attaches one relation record to both endpoint nodes' relation lists; called by visible-item render-order linking. |
|
||
| `004208bc` | `viewport_render_order_relation_unlink` | Unlinks a relation record from both endpoint lists. The record's additional relation links are not fully understood. |
|
||
| `004209d0` | `viewport_render_nodes_compare_overlap_order` | Tests item/shape bounds for overlap and returns ordering code 1 or 2 when one render node precedes the other; returns 0 when no ordering is established. |
|
||
| `004214a4` | `viewport_render_node_update_bounds` | Recomputes and stores a render node's screen-space bounds from its item and shape dimensions, including an additional shape-specific adjustment when available. |
|
||
| `004218c8` | `viewport_item_clear_spatial_tracking` | Clears an item's bits in the visible and pending bitmaps and calls `004334bc(item, 0xfffe)`; the helper's separate state effect remains unresolved. |
|
||
| `00421954` | `viewport_spatial_find_item_node_in_region` | Searches a bounded grid-cell range for a type-2 node associated with an item ID and returns the matching node, if present. |
|
||
| `004219f0` | `viewport_spatial_find_item_render_node` | Computes an item's shape footprint in grid coordinates and searches those cells for its type-2 node, falling back to the full 5-by-6 grid. |
|
||
| `00421c08` | `viewport_item_invalidate_render_bounds` | Finds the item's render node, updates its bounds, removes its old spatial registration, and marks or redraws the affected viewport rectangle. Dirty-region globals remain unresolved. |
|
||
|
||
All 20 names and decompiler comments were read back through Ghidra MCP. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Tracked Item, List, and Audio Helpers
|
||
|
||
This pass reviewed the next 20 entries reported as untracked, from `00421f9c` through `00423358`. It resolved the tracked-item viewport refresh path, a doubly linked-list utility family, and guarded audio cleanup/update paths. The three class lifecycle helpers now have operation-level names; their derived-object role remains unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00421f9c` | `viewport_set_tracked_item_id` | Replaces `DAT_004825b0`, refreshing the previous item's viewport spatial/render state first when nonzero. |
|
||
| `00421fbc` | `viewport_refresh_tracked_item_spatial_state` | Builds or updates spatial/render state for the tracked item; called by visible-item node building and viewport invalidation paths. |
|
||
| `004225d4` | `viewport_publish_pending_dirty_rect` | Publishes accumulated bounds to the renderer, marks viewport update state, and runs `viewport_process_queue_update`. |
|
||
| `00422690` | `dispatcher_flush_pending_rect_notification` | Sends the pending four-short rectangle through `dispatcher_notify_active_contexts` and clears the pending flag. |
|
||
| `00422990` | `resource_object_release_callback` | Object callback changes its vtable and conditionally releases associated resources/object storage based on flag bits. Flag meanings and class ownership remain unresolved. |
|
||
| `004229c0` | `intrusive_list_insert_head` | Inserts a node at the head of a container using next/previous links at node offsets 0/+4. |
|
||
| `004229e0` | `intrusive_list_insert_tail` | Inserts a node at the tail of a container using its head/tail pointers. |
|
||
| `00422aac` | `intrusive_list_move_before` | Unlinks a node and inserts it before another node, or at the head when the position is null. |
|
||
| `00422b08` | `intrusive_list_move_to_head` | Unlinks a node and reinserts it at the container head. |
|
||
| `00422b3c` | `intrusive_list_move_to_tail` | Unlinks a node and reinserts it at the container tail. |
|
||
| `00422b74` | `intrusive_list_unlink` | Repairs neighboring links and container head/tail pointers to detach one node. |
|
||
| `00422bac` | `intrusive_list_unlink_and_destroy` | Unlinks a node, then invokes its vtable callback at node offset +8. |
|
||
| `00422bc8` | `intrusive_list_clear_and_destroy` | Calls the vtable callback for each node, then clears the container head and tail. |
|
||
| `00422c00` | `intrusive_list_advance_forward` | Advances a cursor through next links, starting at the container head when null. |
|
||
| `00422c18` | `intrusive_list_advance_backward` | Advances a cursor through previous links, starting at the container tail when null. |
|
||
| `00422c40` | `record_backed_object_create_from_fields` | Allocates and initializes a base object from a five-byte record; a caller installs derived vtable `0047dce4`. The object role is unresolved. |
|
||
| `00422c84` | `record_backed_object_resource_cleanup` | Cleanup callback conditionally releases fields `+0x38/+0x3c` and delegates common cleanup. The derived object's role remains unresolved. |
|
||
| `004232c8` | `audio_cleanup_pending_resources` | Under `DAT_004825d4`, releases resources through audio-channel cleanup helpers and clears callback state. The guard's broader owner/meaning remains unresolved. |
|
||
| `00423310` | `audio_update_pending_channels` | Under `DAT_004825d4`, calls the audio-channel update routine with `0x40`; that value's meaning remains unresolved. |
|
||
| `00423358` | `noop_00423358` | Immediate return with no side effects. |
|
||
|
||
The ten list-helper names and all seven additional names/comments were read back through Ghidra MCP. The three class lifecycle helpers now have operation-level names; their derived-object roles remain unresolved. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Audio and Item Catalog
|
||
|
||
This pass reviewed the next 20 entries reported as untracked, from `0042335c` through `004237d0`. It mapped sound playback shutdown/initialization and the static item-catalog lookup helpers. Catalog fields without caller-confirmed meaning retain offset-based names.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0042335c` | `audio_stop_playback_for_sound_id` | When audio is enabled, finds the playback slot matching the incoming sound ID and stops it if present. |
|
||
| `00423378` | `audio_stop_all_playback_channels` | Scans the 12 playback slots, marks occupied slots for stop, invokes the channel object's release method, and clears slot state. |
|
||
| `004233b0` | `audio_initialize_sound_flx` | Under the audio-init gate, loads the `sound` FLX resource when needed, initializes playback helpers, and updates the audio-active flag. |
|
||
| `004233e0` | `item_catalog_initialize` | Allocates and initializes the catalog backing resource, sets catalog-active state, and opens the `static` resource. |
|
||
| `00423424` | `item_catalog_release_if_inactive` | Releases and clears the backing resource only when the catalog-active flag is clear and the pointer is non-null. |
|
||
| `0042344c` | `item_catalog_open_static_resource` | Resolves the `static` resource and invokes its object methods; item-name and secondary-item string tables are nearby. |
|
||
| `004234c8` | `item_catalog_find_record_index_by_id` | Searches 64 catalog records at stride `0x8e` for the ID at record offset `+0x3e`; returns the index or `-1`. |
|
||
| `00423530` | `item_catalog_get_secondary_word_02_by_item_id` | Looks up an item in the 21-record table, follows its related-record index at `+6`, and returns word `+2` from that 8-byte secondary record. |
|
||
| `00423574` | `item_catalog_get_item_byte_0a` | Returns byte `+0x0a` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
| `004235b0` | `item_catalog_get_item_word_02` | Returns word `+2` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
| `004235ec` | `item_catalog_get_item_word_04` | Returns word `+4` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
| `00423628` | `item_catalog_lookup_secondary_index_by_id` | Searches the 16-entry, 8-byte secondary table by ID and returns its row index; no match returns zero. |
|
||
| `0042364c` | `item_catalog_get_related_record_index_by_item_id` | Searches the 21-record item table by ID and returns the related-record index at `+6`. |
|
||
| `00423678` | `item_catalog_get_related_item_id` | Uses the item's related-record index at `+6` to return the related ID from the secondary table. |
|
||
| `004236bc` | `item_catalog_get_secondary_item_name` | Searches the secondary table by ID and returns its display-string pointer; a miss falls back to row zero (`INVALID`). |
|
||
| `004236e8` | `item_catalog_get_item_word_08` | Returns word `+8` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
| `00423724` | `item_catalog_get_item_byte_0c` | Returns byte `+0x0c` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
| `00423760` | `item_catalog_get_item_word_0d` | Returns word `+0x0d` from the matching item row; the field's semantic meaning is unresolved. |
|
||
| `0042379c` | `item_catalog_get_item_name_by_id` | Searches the 21-record item table by ID and returns the corresponding display-name pointer; a miss falls back to `INVALID`. |
|
||
| `004237d0` | `item_catalog_get_item_byte_0f` | Returns byte `+0x0f` from the matching 21-record item row; zero or missing IDs fall back to row zero. |
|
||
|
||
All 20 names and decompiler comments were read back through Ghidra MCP. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Catalog Selectors and Item Shape State
|
||
|
||
This pass reviewed the next 20 exact entries from `00423830` through `00424d0c`. The catalog accessors are named by table size and field where domain semantics remain unknown. Process constructors are named by their verified vtables or type `0xf0`; item-record ownership and the meaning of several state fields remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00423830` | `catalog_9entry_get_word_06_by_id` | Looks up an ID in a nine-entry table at `0047b50c` and returns row word `+0x06`; a miss falls back to row 0. |
|
||
| `0042385c` | `catalog_9entry_get_name_by_id` | Uses the same nine-entry lookup and returns its parallel name pointer; row 0 is `INVALID`. |
|
||
| `004238ac` | `catalog_12entry_get_word_02_by_id` | Looks up an ID in a twelve-entry table at `0047b4dc` and returns row word `+0x02`; a miss falls back to row 0. |
|
||
| `004238d8` | `catalog_12entry_get_name_by_id` | Uses the same twelve-entry lookup and returns its parallel name pointer; row 0 is `INVALID`. |
|
||
| `00423904` | `item_catalog_get_item_word_10` | Searches the 21-row item table and returns word `+0x10`; row 0 handles zero/missing IDs. A nonzero upper half at `+0x0e` triggers assertion `0x31e`. |
|
||
| `00423964` | `catalog_lookup_name_by_id` | Searches the item table and parallel 12-, 9-, and 16-entry tables by ID, returning a name pointer or `INVALID`. The specific label domains are unresolved. |
|
||
| `00423abc` | `catalog_lookup_first_nonzero_word_by_id` | Tests item-row `+0x0d`, then word `+0x02` in the 12- and 9-entry tables, then word `+0x06` in the 16-entry table; returns the first nonzero value. |
|
||
| `00423bc0` | `process_create_with_vtable_0047e49c` | Allocates a base process, installs vtable `0047e49c`, sets the common process flag, and clears field `+0x3e`. Derived process role unresolved. |
|
||
| `00423d24` | `item_record_create_or_update` | Clears record field `+0x0e`; one path cleans up/projects coordinates and creates from shape ID `+0x02`, while the alternate path updates projected coordinates. Record mode meaning unresolved. |
|
||
| `00423e60` | `item_shape_state_initialize` | Resets fields `+0x18/+0x1a` to `-1` and `+0x02` to zero, then stores a nonzero shape ID in a shape-associated record. Called after selecting a spatial leaf of type 2; owning state unresolved. |
|
||
| `00423eb0` | `item_shape_state_update` | Processes shape ID `+0x02`; for shape classes `0x20` or `0x90`, validates and updates associated state, then clears `+0x02`. Higher-level purpose unresolved. |
|
||
| `004240d8` | `item_record_project_to_screen` | Projects record coordinates, updates projected position, and applies shape-table height/extent offsets. Owning record type unresolved. |
|
||
| `004242c0` | `process_create_with_vtable_0047e54c` | Initializes a base process, saves `DAT_004955ce` at `+0x30`, installs vtable `0047e54c`, and sets the global to 1. |
|
||
| `00424764` | `process_f0_construct_variant_a` | Creates a type-`0xf0` process with vtable `0047e528`; may create a companion via `004242c0` and stops playback when `DAT_004825d4` is set. Class semantics unresolved. |
|
||
| `004247f8` | `process_f0_construct_variant_b` | Creates a type-`0xf0` process with vtable `0047e528`, stores `DAT_0047b984` and an input word in fields `+0x30/+0x32`, and may create the companion process. |
|
||
| `00424874` | `item_status_get_high_nibble` | Returns the high nibble of the status byte at `DAT_00482b34 + item ID`. |
|
||
| `004248a8` | `item_status_set_high_nibble` | Replaces that status byte's high nibble while preserving its low nibble. |
|
||
| `004248d0` | `item_state_get_byte` | Returns the byte at `DAT_00482b38 + item ID`; the field meaning is unresolved. |
|
||
| `004249fc` | `EggHatcher_004249fc` | Existing symbol retained. Initializes the base, installs `g_eggHaterProcessFnPtrs`, associates the item, sets process type `0x20f`, and clears `+0x30`. |
|
||
| `00424d0c` | `process_20f_draw_item_outline` | Called by `draw_map_region_grid_and_update_process_20f`; draws an item outline from the status nibbles and, in one branch, the per-item Y table. |
|
||
|
||
All 19 renamed symbols were read back through Ghidra MCP. The 20-comment batch was accepted, and representative comments were confirmed in decompiler output. `EggHatcher_004249fc` was kept unchanged. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Queue and Palette Fade
|
||
|
||
This pass reviewed the next 20 entries from `00424f70` through `00425b04`. It covers a ten-slot queue of 16-byte records, one-shot halted-file reporting, and the RGB6 DirectDraw palette/fade path. The fade-process class purpose beyond its observed process type and vtables remains unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00424f70` | `ring_buffer_enqueue_16byte_record` | Copies a 16-byte record into the ten-entry ring buffer and advances its write index/count; a full queue is unchanged. |
|
||
| `00424fd0` | `ring_buffer_dequeue_16byte_record` | Copies the next 16-byte record to the caller and advances the read index/count; an empty queue leaves the destination unchanged. Used by `0044a1dc` to drain queued records. |
|
||
| `00425050` | `fatal_report_halted_file_line` | One-shot fatal report formats `Halted file %s` and line number, then enters `win32_shutdown_message_loop`; not a USECODE debugger stop. |
|
||
| `00425084` | `fatal_report_halted_file_line_detail` | Adds a detail string to the halted-file report, copying it when it is not the shared buffer, then enters the shutdown message loop. |
|
||
| `00425104` | `fatal_report_halted_resource_string_2` | Loads string resource ID 2 and enters the one-shot fatal shutdown/report path. |
|
||
| `00425160` | `fatal_report_halted_resource_string_3` | Loads string resource ID 3 and enters the one-shot fatal shutdown/report path. |
|
||
| `004251bc` | `release_text_buffer_unless_global` | Releases the supplied text buffer unless it is the shared pointer at `DAT_00495818`. |
|
||
| `004251f0` | `release_text_buffer_unless_global_alt` | Duplicate release helper with the same shared-buffer guard as `004251bc`. |
|
||
| `00425270` | `palette_fade_process_initialize` | Initializes process type `0x206`, allocates two 256-entry palette buffers, snapshots the current RGB6 palette, and records fade state. Mode zero imports a palette directly. |
|
||
| `00425560` | `palette_fade_create_black_process_a` | Creates a process with vtable `0047e5bc`, prepares a black 256-entry palette, and initializes the fade process. |
|
||
| `00425600` | `palette_fade_create_black_process_b` | Near-duplicate of `00425560` with different return-value handling; both call paths are in `FUN_0042c6ac`. |
|
||
| `004256a0` | `palette_fade_create_process_pair_a` | Creates a vtable-`0047e5bc` fade process from `DAT_00482680`, then creates and registers a vtable-`0047e598` companion. |
|
||
| `00425710` | `palette_fade_create_process_pair_b` | Near-duplicate of `004256a0`; initializes the same vtable pair and registers the companion. |
|
||
| `0042577c` | `palette_set_black_rgb6` | Fills all 256 RGB6 entries with black, imports them into DirectDraw, and releases the temporary palette buffer. |
|
||
| `004257e8` | `palette_set_white_rgb6` | Fills all 256 RGB6 entries with white (`0x3f` per channel), imports them into DirectDraw, and releases the temporary palette buffer. |
|
||
| `00425858` | `palette_import_and_clear_fade_flag` | Imports all entries from the supplied RGB6 palette and clears the current palette process's active marker at `+0x3e` when set. |
|
||
| `00425884` | `palette_fade_create_for_rgb6_color` | Validates three RGB6 components in `0..0x3f`, creates a vtable-`0047e5bc` process, and initializes its fade toward that color. |
|
||
| `0042596c` | `palette_fade_create_registered_process` | Creates and registers a vtable-`0047e5bc` process initialized in mode 1 from `DAT_00482680`. |
|
||
| `004259b8` | `palette_fade_create_to_black` | Creates a vtable-`0047e5bc` fade process initialized in mode 1 with a black palette. |
|
||
| `00425b04` | `palette_fade_pump_until_complete` | Creates a vtable-`0047e5bc` fade process and pumps window/palette updates until its process flag bit 1 clears. |
|
||
|
||
All 20 renamed symbols were read back through Ghidra MCP. The comment batch was accepted, and representative comments were confirmed in decompiler output. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Palette Transition and File Streams
|
||
|
||
This pass reviewed the next 20 entries from `00425b70` through `00426924`. The palette routines build grayscale/solid-color RGB6 transitions; the remainder implements a Windows file-stream object with indexed backing records, random-access I/O, range copying, and bounded text-line reads. The indexed-record payload's higher-level format remains unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00425b70` | `palette_fade_to_grayscale` | Exports all 256 RGB6 entries, copies each red component into green/blue to form grayscale, then initializes a vtable-`0047e5bc` fade process. |
|
||
| `00425c48` | `palette_fade_to_grayscale_wait` | Starts the grayscale transition and pumps window/palette updates until process flag bit 1 clears. |
|
||
| `00425e70` | `file_stream_release_resources` | Closes/frees file-stream backing state through separate cleanup paths selected by flag `4`; exact object-class role remains open. |
|
||
| `00425ed0` | `file_stream_load_backing_data` | Closes prior backing state, resolves a file/resource source, then loads and stores backing data at `+0x12`; the source-container contract is unresolved. |
|
||
| `00425fb4` | `file_stream_get_indexed_record8` | Copies an eight-byte record from the backing table at `+0x12`, indexed by the supplied short. |
|
||
| `00425fc8` | `file_stream_set_indexed_record8` | Updates an eight-byte indexed backing record and persists it through the file writer at offset `0x80 + index*8`. |
|
||
| `00426070` | `file_stream_initialize` | Clears object field `+0`, sets handle field `+4` to `-1`, and stores the dispatch/data pointer at `+0x0c`. |
|
||
| `00426088` | `file_stream_initialize_and_open` | Initializes the object and immediately opens the supplied path using the supplied access/open flags. |
|
||
| `00426114` | `file_stream_open` | Calls `CreateFileA`, stores the handle/access flags, replaces any prior copied path, and keeps a heap copy of the new path. |
|
||
| `00426208` | `file_stream_close` | Closes a valid Windows handle, releases the copied path, and resets the handle field to `-1`. |
|
||
| `004262b8` | `file_stream_seek` | Moves the file cursor to the supplied offset using the requested `SetFilePointer` origin. |
|
||
| `004262f8` | `file_stream_read` | Optionally seeks to an explicit offset, then reads the requested byte count; errors route through the file/line fatal reporter. |
|
||
| `0042637c` | `file_stream_write` | Optionally seeks to an explicit offset, then writes the requested byte count; errors route through the file/line fatal reporter. |
|
||
| `00426400` | `file_stream_get_size` | Returns `GetFileSize` for the stored handle. |
|
||
| `00426440` | `file_stream_flush` | Calls `FlushFileBuffers` on the stored handle. |
|
||
| `0042647c` | `file_stream_get_position` | Returns the current cursor position using a zero offset relative to the current position. |
|
||
| `004264c4` | `file_stream_copy_range` | Copies a byte range between file streams in chunks and adjusts direction for overlapping ranges in the same file. |
|
||
| `0042675c` | `file_stream_set_length` | Seeks to the requested end and calls `SetEndOfFile`; restores the original cursor when extending, while truncation leaves it at the new end. |
|
||
| `0042682c` | `file_stream_position_is_within_size` | Returns whether the current cursor is not beyond the file size, restoring the original cursor afterward. |
|
||
| `00426924` | `file_stream_read_text_line` | Reads a bounded text line, stops at carriage return or DOS EOF `0x1a`, null-terminates the result, and positions the cursor past the consumed terminator. |
|
||
|
||
All 20 renamed symbols were read back through Ghidra MCP. The comment batch was accepted, and representative comments were confirmed in decompiler output. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Memory Readers and Indexed Files
|
||
|
||
This pass reviewed the next 20 entries from `00426c1c` through `004281e4`. The functions implement a memory-backed text reader, a shared resource-path builder and wildcard/list-file enumerator, usecode-related caches, and fixed-record indexed-file operations. The selector-table record schema and indexed-file record contract remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00426c1c` | `memory_reader_release` | Releases the memory-reader allocation according to ownership flags, restores its dispatch pointer, and optionally completes object cleanup. |
|
||
| `00426c4c` | `memory_reader_skip_whitespace` | Advances the cursor past spaces, tabs, carriage returns, and line feeds, stopping at the buffer end. |
|
||
| `00426c94` | `memory_reader_read_token` | Skips leading whitespace, copies the next non-whitespace token, and null-terminates the caller's output. |
|
||
| `00426d34` | `memory_reader_read_until` | Copies bytes up to a delimiter or buffer end and null-terminates the output. |
|
||
| `00426dbc` | `memory_reader_skip_line` | Advances through the next line feed and consumes it when present. |
|
||
| `00426e00` | `memory_reader_read_byte` | Returns the current byte and advances the cursor; returns zero without advancing at end of buffer. |
|
||
| `00426e28` | `memory_reader_open_file` | Opens a file through the file-stream layer, allocates a buffer sized to the file, reads the full contents, and initializes memory-reader state. |
|
||
| `00426f80` | `resource_path_build` | Joins up to four path/name components in one of five rotating scratch buffers, handling backslash boundaries and a dot before the final component when needed. Callers include audio, catalog, and cache paths. |
|
||
| `004272e8` | `file_enumerator_start` | Starts `FindFirstFileA` enumeration; an input prefixed with `@` is opened as a text file containing search patterns, retained for later results. |
|
||
| `0042761c` | `file_enumerator_close` | Closes the optional memory-backed pattern-list reader and active `FindFirstFileA` handle. |
|
||
| `0042765c` | `resource_path_exists` | Builds a path with the shared helper and returns the result of the path-existence check. |
|
||
| `00427684` | `file_enumerator_next` | Advances with `FindNextFileA`, reads another pattern from an `@` list when needed, and copies the selected `WIN32_FIND_DATAA` result into enumerator state. |
|
||
| `00427a70` | `selector_table_find_by_id` | Searches 16 records at `0047b600`, each `0x11` bytes, using the supplied short identifier; reports a fatal error if no record matches. |
|
||
| `00427aac` | `selector_table_release_resource` | Finds the record matching the supplied short identifier and releases the resource referenced by its field at `+2`; the record schema remains unresolved. |
|
||
| `00427b10` | `usecode_cache_release` | Frees two global usecode-related cache buffers when present and resets cached size fields. |
|
||
| `00427b54` | `usecode_cache_reload` | Clears/reloads usecode-related buffers, updates cached sizes, enumerates a derived path, and optionally loads an associated data file. |
|
||
| `00427e30` | `indexed_file_create` | Creates a fixed-record file with a `0x54`-byte header containing the supplied count and format value, followed by zeroed four-byte entries. |
|
||
| `00427ef4` | `indexed_file_open_or_create` | Initializes an indexed-file object, creates and zero-initializes the fixed-record file in create-on-missing mode, or opens an existing file and reads its `0x54`-byte header. |
|
||
| `00428054` | `indexed_file_initialize_from_path` | Initializes an indexed-file object from a path, creating the header and zeroed entries in create-on-missing mode or reading the existing `0x54`-byte header. |
|
||
| `004281e4` | `indexed_file_select_record` | Checks the requested short index against the count at object `+0x10`, reports out-of-range access, then dispatches through the object's vtable at `+4`; exact record-selection semantics remain open. |
|
||
|
||
All 20 renamed symbols were read back through Ghidra MCP. The comment batch was accepted, and representative comments were confirmed in decompiler output. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Flex and Resource Cache Helpers
|
||
|
||
This pass reviewed the final nine entries needed to reach the 30% address-tracking target. It covers exact reads from flex/indexed files, a file-stream rewind helper, resource-cache object creation and lookup, and two object initializers. The indexed resource payload format and some cache-context fields remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00428224` | `flex_read_exact` | Resolves the selected record through a virtual method, reads the requested range at the supplied offset, and reports a flex-file error if the read is short. |
|
||
| `004283a0` | `file_stream_rewind` | Invokes the object's virtual preparation method, then seeks its file stream to offset zero. |
|
||
| `0042865c` | `resource_cache_context_initialize` | Runs two shared initialization helpers and sets field `+0x58` to 1; its cache-context role is inferred from callers. |
|
||
| `00428700` | `clear_two_dwords` | Clears two consecutive 32-bit fields; used while initializing a fixed-record file. |
|
||
| `00428710` | `resource_cache_object_create` | Initializes and registers a resource-cache object, computes a size/selector field, creates an embedded file-stream object, and invokes its setup method. |
|
||
| `004287f4` | `resource_cache_get_by_id` | Resolves a cache slot by ID; on a miss it releases/recreates and reloads the resource, while a hit promotes the entry to the list head. |
|
||
| `004288a4` | `resource_cache_get_indexed_data` | Gets the cached resource, reads the indexed relative offset from its table at `+6 + index*8`, and returns the corresponding data pointer. |
|
||
| `00428910` | `text_object_initialize` | Installs the text-object dispatch table at object offset `+8`; additional setup is performed by the caller. |
|
||
| `00428918` | `resource_state_object_initialize` | Clears three 16-bit state fields and installs the resource-state dispatch table at offset `+8`. |
|
||
|
||
All nine renamed symbols were read back through Ghidra MCP. The comment batch was accepted, and representative comments were confirmed in decompiler output. No executable bytes were changed and the Ghidra project was not saved. The exact-entry coverage report confirms 448/1,493 (30.0%) tracked entries.
|
||
|
||
## Address-Ordered Pass: Text Layout, Palette, and Runtime Helpers
|
||
|
||
This pass reviewed the next 20 entries from `00428934` through `00429fb0`. It covers DBCS-aware text layout and measurement, shared object/rectangle helpers, a game-runtime transition path, palette-manager operations, scheduler/animation process construction, and resource-cache lookup. The two text-context vtable accessors and several process-state fields remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00428934` | `text_layout_advance_character` | Advances one character in the text layout: line feed updates Y and resets X, carriage return resets X, and other characters advance X using renderer metrics. |
|
||
| `00428ac8` | `text_measure_multiline_width` | Measures DBCS-aware text through a renderer callback, resets the line width on line feed, and returns the maximum width. |
|
||
| `00428ba8` | `text_context_get_vfunc_10` | Calls renderer vtable slot `+0x10` and returns its result; the specific metric and caller contract are unresolved. |
|
||
| `00428bc8` | `text_context_get_vfunc_10_alt` | Separate entry calling renderer vtable slot `+0x10`; its caller contract is unresolved. |
|
||
| `00428be4` | `text_layout_initialize_and_advance_string` | Initializes text-layout coordinates, then advances the layout for each DBCS-aware character in the shared string. |
|
||
| `00428c7c` | `text_layout_advance_to_width_limit` | Advances layout until the next character would exceed the requested width and returns the accepted character count. |
|
||
| `00428d40` | `text_layout_advance_string` | Walks the shared string as DBCS-aware characters and advances the current text-layout state. |
|
||
| `00428dc8` | `set_shared_object_context` | Stores the incoming object pointer in both shared globals `DAT_0048266c` and `DAT_00482670`. |
|
||
| `00428de0` | `rect_set_bounds` | Copies four incoming 16-bit coordinate values into the bounds record. |
|
||
| `00428e00` | `game_runtime_transition_dispatch` | Updates runtime mode and palette state, dispatches the event loop, and handles its result through process, resource-cache, map, and item-state paths. |
|
||
| `0042923c` | `noop_callback_0042923c` | Empty function body; data references establish callback use, but the callback slot role is unresolved. |
|
||
| `00429648` | `process_opcode_d9_construct` | Allocates and initializes a process object; the opcode dispatcher invokes this constructor for command `0xd9`. |
|
||
| `004296e0` | `palette_manager_initialize` | Initializes palette-manager buffers and indexed-file state, installs its dispatch table, and initializes the active palette-entry buffer. |
|
||
| `004297dc` | `palette_manager_shutdown` | Releases palette-manager buffers and indexed-file state, then clears associated global pointers. |
|
||
| `004299f4` | `palette_manager_reset_entry_buffer` | Resets indexed-file entry state and replaces its allocated entry buffer. |
|
||
| `00429a78` | `palette_set_grayscale_rgb6` | Copies the current RGB6 palette, replaces green and blue with each entry's red channel, and imports the grayscale palette. |
|
||
| `00429ba0` | `scheduler_process_construct` | Constructs and initializes the scheduler process, sets type `0x245`, and calls the scheduler setup helper. |
|
||
| `00429c00` | `animation_process_construct` | Constructs and initializes the animation process, sets type `0x230`, and invokes its setup helpers. |
|
||
| `00429d34` | `animation_process_reset_timing` | Clears process byte `+0x52` and copies field `+0x3e` to `+0x42`; higher-level timing semantics remain unresolved. |
|
||
| `00429fb0` | `resource_cache_get_or_create_by_id` | Looks up an entry by 16-bit ID in a 512-slot tag table; on a miss it reserves or evicts a slot and creates a cache node, while a hit promotes the node to the list head. |
|
||
|
||
All 20 names were read back at their exact Ghidra entry addresses, and the decompiler-comment batch was accepted. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Gravity, Glob Items, and Static Resources
|
||
|
||
This pass reviewed the next 20 entries from `0042a118` through `0042bf18`. It covers glob-item resource expansion, item-edge overlap queries, gravity-process setup/update, indexed-resource drawing and bounds, and static-resource pool operations. Several resource-record fields and callback roles remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0042a118` | `glob_item_create_for_source` | Resolves a coordinate and forwards it with the source item's Y/Z values to the glob-item loader. |
|
||
| `0042a180` | `glob_items_load_from_resource` | Expands compact six-byte resource records into runtime records and creates shape-`0x82` glob items when the target region is eligible; the record schema remains unresolved. |
|
||
| `0042a4a8` | `resource_cache_apply_record_entries` | Walks the cached record count and passes each record's byte at offset `+7` to a helper whose semantics remain unresolved. |
|
||
| `0042a514` | `static_resource_context_load` | Loads and initializes a static resource, stores it in `DAT_00482aa8`, and halts with a resource error if loading fails. |
|
||
| `0042a544` | `static_resource_context_invoke` | Invokes the first method in the initialized resource object's dispatch table with the supplied argument. |
|
||
| `0042a65c` | `spatial_query_item_edge_overlap_flags` | Queries nearby item shapes against supplied bounds and builds directional overlap flags; bit `0x10` marks overlap on opposing sides. Shape-flag semantics remain unresolved. |
|
||
| `0042aa14` | `gravity_process_construct` | Constructs a process using `g_gravityProcessFnPtrs`, associates the supplied item, sets type `0x203`, and initializes movement/state fields. |
|
||
| `0042ad04` | `gravity_process_update` | Reads and updates associated-item coordinates and flags, checks candidates through spatial/edge-overlap queries, and conditionally performs item/process actions; state fields and movement rules remain partly unresolved. |
|
||
| `0042b720` | `object_dispatch_cleanup_sequence` | Runs a fixed helper sequence, conditionally invokes vtable slot `+0x08` based on an object flag, and performs cleanup; the caller-specific lifecycle role is unresolved. |
|
||
| `0042b7a4` | `gravity_process_apply_position_delta` | Finds the first type-`0x203` process and adds supplied deltas to three stored fields; if absent, conditionally constructs and schedules one. |
|
||
| `0042b834` | `gravity_process_create_for_item_if_needed` | Checks the item's shape record and creates/schedules a type-`0x203` process only when record gates pass and none already exists. |
|
||
| `0042ba10` | `static_resource_pair_initialize` | Loads two static resources into globals and creates a cache object with selector `0x100`; required load failures take fatal error paths. |
|
||
| `0042ba84` | `static_resource_pair_shutdown` | Releases the paired static-resource cache object and resource, then clears their global pointers. |
|
||
| `0042bb40` | `draw_indexed_resource_at_position` | Loads indexed resource data and draws it at supplied screen coordinates; index `0x15` also draws associated notification text and updates its state. |
|
||
| `0042bcc8` | `indexed_resource_copy_record_to_state` | Loads indexed resource data and passes it with a two-word caller buffer to `004696bc`; the copied record fields remain unresolved. |
|
||
| `0042bd14` | `indexed_resource_get_bounds` | Reads width and height from an indexed resource record and writes bounds from `(0,0)` through `(width-1,height-1)`. |
|
||
| `0042bdf0` | `resource_cache_object_reset_or_release` | Releases or resets a resource-cache object based on flag bits, updating its dispatch pointer and cache slot on the reset path. |
|
||
| `0042be90` | `static_resource_pool_reserve` | Reserves bytes from the static-resource pool, advances pool accounting, and returns the pool address; requests beyond 5000 take a fatal error path. |
|
||
| `0042bed4` | `static_resource_pool_initialize` | Loads the static-resource pool backing block, stores its pointer in `DAT_00482ac4`, initializes the allocator helper, and resets the pool offset. |
|
||
| `0042bf18` | `static_resource_pool_shutdown` | Releases the static-resource pool backing block and clears `DAT_00482ac4`. |
|
||
|
||
All 20 names were read back from the active Ghidra program, and the decompiler-comment batch was accepted. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Usecode and Item Accessors
|
||
|
||
This pass reviewed the next 20 entries from `0042c0b0` through `00431860`. Caller checks tie the process initializer and opcode dispatcher to `UsecodeProcess_Create` and `UsecodeProcess_NextOpcode`; the remaining functions provide runtime-mode and item-record accessors for containment, coordinates, shape bounds, and footprint queries.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0042c0b0` | `usecode_process_initialize_program_data` | Initializes a usecode-process execution object, copies optional program bytes, stores runtime arguments, creates backing resource state, and enqueues an initial selector/value pair. |
|
||
| `0042c6ac` | `usecode_opcode_dispatch` | Dispatches the current usecode opcode to operation-specific handlers, including process/resource, item, rendering, and audio paths; individual opcode contracts remain partly unresolved. |
|
||
| `0042ddc8` | `UsecodeProcess_NextOpcode` | Reads and advances the next opcode from the usecode instruction stream; `UsecodeProcess_Run` calls it before opcode dispatch. |
|
||
| `0043120c` | `runtime_mode_matches_value` | Compares the incoming 16-bit value with `DAT_0047b1d6` and returns the equality result; callers use it as a runtime-mode predicate. |
|
||
| `00431220` | `item_has_flag_20` | Tests bit `0x20` in the item flags word. |
|
||
| `00431240` | `item_get_outermost_x` | Follows item-parent links through the X field while flag bit 3 is set, then returns the outermost item's X coordinate. |
|
||
| `00431280` | `item_get_outermost_y` | Follows item-parent links through the X field while flag bit 3 is set, then returns the outermost item's Y coordinate. |
|
||
| `004312c4` | `item_get_contained_x_offset` | Returns the low byte of the packed Y field when item flag bit 3 is set, otherwise zero; the contained-position interpretation is supported by paired accessors. |
|
||
| `004312f4` | `item_get_contained_y_offset` | Returns the high byte of the packed Y field when item flag bit 3 is set, otherwise zero; the contained-position interpretation is supported by paired accessors. |
|
||
| `0043132c` | `item_set_contained_position` | For items with flag bit 3 set, packs two clamped coordinate components into the item's Y field. |
|
||
| `0043137c` | `item_get_outermost_z` | Follows item-parent links while flag bit 3 is set, then returns the outermost item's Z value. |
|
||
| `004313c4` | `item_get_shape_adjusted_x` | Returns item X adjusted by the X footprint extent decoded from its shape record; the world-bound convention remains unresolved. |
|
||
| `00431410` | `item_get_shape_adjusted_y` | Returns item Y adjusted by the Y footprint extent decoded from its shape record; the world-bound convention remains unresolved. |
|
||
| `0043145c` | `item_get_shape_adjusted_z` | Returns root-item Z plus the current item's shape-height contribution scaled by four. |
|
||
| `004314e4` | `item_set_auxiliary_state_byte` | Stores a byte in `DAT_00482b44` indexed by item ID; the table's state meaning remains unresolved. |
|
||
| `004314f8` | `item_set_z` | Stores a new item Z byte when below `0xfa`; larger values take a fatal validation path. |
|
||
| `0043152c` | `item_get_outermost_position` | Follows item-parent links and writes the outermost item's X, Y, and Z values to caller storage. |
|
||
| `004315d4` | `item_get_shape_byte_7` | Returns byte `+7` from the item's shape record; recursive item aggregation uses it, but its meaning and units remain unresolved. |
|
||
| `00431794` | `item_shape_begin_footprint_query` | Starts a shape-footprint selector query for the supplied item ID using mode arguments 1 and 1. |
|
||
| `00431860` | `item_get_shape_id` | Returns the shape ID stored for the incoming item ID. |
|
||
|
||
All 19 renamed functions were read back at their exact entry addresses. The existing `UsecodeProcess_NextOpcode` symbol was retained, and its comment update was accepted. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item State and Shape-Class Accessors
|
||
|
||
This pass reviewed the next 20 entries from `0043187c` through `00431db4`. It covers item shape changes and render invalidation, per-item state-byte tables, shape-class-gated state access, and shape-record bit extraction. The semantic roles of several global byte/word tables remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043187c` | `item_set_shape_id_and_refresh` | Changes the item's shape ID and invokes a shape-change helper when tested rendering flags differ; item flag bit `0x8000` suppresses one transition path. |
|
||
| `00431980` | `item_get_render_state_bytes` | Combines the byte at `DAT_00482b28` indexed by item ID with item-record byte `+0x0f`; exact field semantics remain unresolved. |
|
||
| `004319f0` | `item_set_render_state_bytes` | Stores both bytes of an item state value and may invalidate its render bounds and refresh the tracked-item selection. |
|
||
| `00431ad4` | `item_set_auxiliary_byte_00482b34` | Stores a byte in `DAT_00482b34` indexed by item ID; the table's semantic role remains unresolved. |
|
||
| `00431ae8` | `item_get_auxiliary_byte_00482b34` | Returns the byte in `DAT_00482b34` indexed by item ID. |
|
||
| `00431afc` | `item_set_auxiliary_byte_00482b38` | Stores a byte in `DAT_00482b38` indexed by item ID; the table's semantic role remains unresolved. |
|
||
| `00431b10` | `item_get_auxiliary_byte_00482b38` | Returns the byte in `DAT_00482b38` indexed by item ID. |
|
||
| `00431b24` | `noop_callback_00431b24` | Empty function body; no stronger callback role is established. |
|
||
| `00431b44` | `item_get_shape_class_10_state` | Returns the per-item word in `DAT_00482b30` only when masked shape-class bits equal `0x10`. |
|
||
| `00431b88` | `item_set_shape_class_10_state` | Stores the per-item word in `DAT_00482b30` only when masked shape-class bits equal `0x10`. |
|
||
| `00431bc8` | `item_get_shape_class_40_state` | For masked shape-class bits `0x40`, returns the low byte of the per-item word in `DAT_00482b30`. |
|
||
| `00431c0c` | `item_get_state_table_value` | Returns the per-item word stored in `DAT_00482b30` without checking the item's shape class. |
|
||
| `00431c28` | `item_set_state_and_start_event` | Stores a per-item word in `DAT_00482b30` and starts the associated usecode event process with selector `0x1000`. |
|
||
| `00431c58` | `item_get_state_for_shape_class_6_7` | Returns the per-item word in `DAT_00482b30` only when the decoded shape class is 6 or 7. |
|
||
| `00431cb0` | `item_get_container_id_if_nested` | Returns the item's X-field parent/container ID only when item flag bit 3 is set; otherwise returns zero. |
|
||
| `00431cd8` | `item_get_shape_class_30_state` | For masked shape-class bits `0x30`, returns the per-item word in `DAT_00482b30`. |
|
||
| `00431d1c` | `item_set_state_table_value` | Stores a per-item word in `DAT_00482b30` without checking the item's shape class. |
|
||
| `00431d34` | `item_set_state_for_shape_class_6_7` | Stores a per-item word in `DAT_00482b30` only when masked shape-class bits equal `0x60` or `0x70`. |
|
||
| `00431d80` | `item_get_shape_flags_low_9` | Returns the low nine shape-record flag bits shifted down by four. |
|
||
| `00431db4` | `shape_record_test_bit` | Tests one selected bit from a shape-record byte using the low three bits of the supplied selector as the bit index. |
|
||
|
||
All 20 names were read back from the active Ghidra program, and a representative decompiler comment was confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Lifecycle and Spatial Helpers
|
||
|
||
This pass reviewed the next 20 entries from `00431df8` through `00432c68`. It covers item flag/shape access, item creation and removal hooks, usecode-driven item state updates, direction and dimension helpers, and 3D overlap testing. Several register-context wrappers and action helpers retain explicitly generic names where their contracts remain unclear.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00431df8` | `item_get_flags` | Returns the 16-bit flags word for the incoming item ID. |
|
||
| `00431e14` | `item_create_from_shape_and_initialize` | Validates a shape ID, creates an item under the item lock, initializes it with a value from the context object, and returns success. |
|
||
| `00431e98` | `item_create_from_shape_with_value` | Validates a shape ID, creates an item under the item lock, initializes it with the supplied value, and returns success. |
|
||
| `00432090` | `item_call_helper_00437768` | Register-context wrapper around `00437768`; its implicit register contract is unresolved. |
|
||
| `004320a8` | `item_call_helper_00437e40` | Register-context wrapper around `00437e40`; its implicit register contract is unresolved. |
|
||
| `004320b4` | `item_update_active_item_position` | Updates the active item's position through two helpers and preserves the stored Y value when the active item is nested. |
|
||
| `004320bc` | `item_call_helper_00438000` | Thin wrapper around `00438000`; caller/register semantics remain unresolved. |
|
||
| `004320c8` | `item_release_related_state` | Thin wrapper around `0043760c`; its caller-specific lifecycle role remains unresolved. |
|
||
| `004320d8` | `item_remove_with_side_effects` | Runs selected-shape, usecode/resource, and optional footprint-query side effects, then delegates to `00437394` for item removal. |
|
||
| `00432244` | `item_container_destroy_contents_if_class_6_7` | Decodes the item's shape class and destroys linked contents only for classes 6 or 7. |
|
||
| `0043229c` | `usecode_item_update_position_and_event` | Updates item state, starts usecode event selector `0x40000`, and may refresh the tracked-item marker based on mode and shape data. |
|
||
| `004324c4` | `item_remove_linked_child_and_start_event` | Runs item helpers and starts usecode event selector `0x40000`; called while processing linked contents during removal. |
|
||
| `004324fc` | `usecode_item_apply_guarded_action` | Runs a guarded operation using current-item and shape-derived state, optionally invokes a follow-up helper, and returns the guard result; action semantics remain unresolved. |
|
||
| `0043257c` | `item_test_spatial_and_shape_condition` | Tests a spatial/shape condition using the current item and supplied coordinates, reports optional outputs, and initializes a footprint query on selected paths. |
|
||
| `004327e0` | `item_restore_position_from_record` | Reads an item-related value from `0043760c` and passes it to `00437768`; record and register contracts remain unresolved. |
|
||
| `0043280c` | `item_direction_from_delta` | Calls the eight-way direction helper using the incoming register delta and current item's Y coordinate. |
|
||
| `00432898` | `item_direction_to_item` | Computes an eight-way direction from the current and target items' Y coordinates, then normalizes the result into a direction code. |
|
||
| `00432904` | `item_direction_from_target_y` | Calls the eight-way direction helper using current and supplied item Y coordinates; this entry discards the helper result. |
|
||
| `0043295c` | `item_shape_get_oriented_dimensions` | Decodes shape width, depth, and height into caller outputs, swapping horizontal dimensions when item flag `0x20` is set. |
|
||
| `00432c68` | `item_shapes_overlap_spatially` | Tests whether two non-contained items overlap in X, Y, and Z using oriented shape extents. |
|
||
|
||
All 20 names were read back at their exact Ghidra entry addresses, and the decompiler-comment batch was accepted. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Footprints and Usecode Events
|
||
|
||
This pass reviewed the next 20 entries from `00432ea0` through `0043399c`. Callers place the footprint predicates and event helpers in usecode dispatch, position-state dispatch, item-state updates, and gravity processing; names preserve selector values where the event semantics are not established.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00432ea0` | `item_footprints_overlap_xy` | Tests whether two non-nested items' shape-derived horizontal extents overlap on X and Y; it does not test Z. |
|
||
| `00433074` | `item_xy_overlap_at_shape_top_z` | First calls `00432ea0`, then tests whether the current item's Z equals the other item's Z plus that shape's height; called by usecode dispatch. |
|
||
| `00433150` | `item_test_contained_footprint_at_top_z` | Compares oriented shape extents and coordinates for a directional footprint-containment condition, then checks top-Z alignment; called by usecode dispatch. |
|
||
| `00433364` | `item_get_position_xyz` | Copies the current item's X, Y, and Z coordinates to caller storage. |
|
||
| `004333a4` | `item_id_is_nonzero_byte_range` | Returns whether the current item ID is in the range 1 through `0xff`. |
|
||
| `004333d8` | `item_check_nested_parent_chain` | Follows nested-parent links and tests whether the encountered parent ID is in the nonzero byte-sized range; the higher-level purpose remains unresolved. |
|
||
| `00433460` | `item_invalidate_render_state_if_allowed` | Unless item flag `0x800` is set, invalidates viewport render bounds and updates the tracked-item ID; called by usecode dispatch. |
|
||
| `0043348c` | `item_set_flags` | Replaces the current item's 16-bit flags word. |
|
||
| `004334a4` | `item_add_flags` | ORs supplied bits into the current item's flags word. |
|
||
| `004334bc` | `item_mask_flags` | ANDs the current item's flags word with a supplied mask, preserving only selected bits. |
|
||
| `004334d4` | `usecode_start_event_selector_1` | Starts a usecode event process with selector 1 and mode 0. |
|
||
| `00433500` | `item_set_flag_8000_and_notify` | If the current item lacks flag `0x8000`, calls `0046540c` and sets the flag on the helper-selected item; called by item-state and usecode paths. |
|
||
| `00433558` | `item_clear_flag_8000_and_cleanup` | If the current item has flag `0x8000`, calls `004653ac` and clears the flag on the helper-selected item. |
|
||
| `004335b0` | `item_has_flag_8000` | Returns whether the current item's flags word contains bit `0x8000`. |
|
||
| `004335d4` | `usecode_start_event_selector_2_if_eligible` | Checks item ID/state helpers and conditionally starts usecode event selector 2; called by usecode dispatch. |
|
||
| `00433688` | `usecode_start_event_selector_20` | Starts a usecode event process with selector `0x20`, forwarding the incoming low-byte mode. |
|
||
| `004336c4` | `item_try_start_event_selector_40` | Validates item/shape state, may start selector `0x40`, and walks nested parents; called by position-state selector dispatch. |
|
||
| `0043388c` | `usecode_start_event_selector_4` | Starts a usecode event process with selector 4 and mode 0. |
|
||
| `004338bc` | `item_start_footprint_query` | Initializes a shape-footprint query for the current item with mode 3; callers include gravity processing. |
|
||
| `0043399c` | `usecode_start_event_selector_400` | Starts a usecode event process with selector `0x400`, forwarding the incoming low-byte mode. |
|
||
|
||
All 20 names were read back at their exact Ghidra entry addresses, and representative decompiler comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item State and Event Transitions
|
||
|
||
This pass reviewed the next 20 entries from `004339cc` through `00434a94`. It covers event-selector wrappers, item transition flags, viewport/spatial helpers, shape-record bits, and a per-item state word; names retain generic helper addresses where only the forwarding behavior is known.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004339cc` | `usecode_start_event_selector_800` | Starts usecode selector `0x800`, forwarding the incoming low-byte mode. |
|
||
| `004339fc` | `usecode_start_event_selector_10_if_enabled` | Starts selector `0x10` only when the high word of `DAT_0047b982` is nonzero. |
|
||
| `00433a70` | `usecode_start_event_selector_4000` | Starts usecode selector `0x4000` with mode 0. |
|
||
| `00433aa0` | `item_set_flag_2000_and_process_shape` | Sets item flag `0x2000`, runs shape-class-dependent processing, and may start selector `0x8000`; callers include item helper `00437768`, map cleanup, and usecode dispatch. |
|
||
| `00433e38` | `item_clear_flag_2000_and_finalize` | Clears flag `0x2000`, performs item/resource cleanup, and may start selector `0x10000`; callers include item helper `00437768` and map-unload paths. |
|
||
| `00434018` | `usecode_start_event_selector_20000` | Starts usecode selector `0x20000`, forwarding the incoming low-byte mode. |
|
||
| `00434078` | `usecode_start_event_selector_80000_if_eligible` | Checks byte-sized item eligibility and item state before possibly starting selector `0x80000`. |
|
||
| `004340f4` | `viewport_pick_spatial_leaf_class_2` | Picks the spatial leaf at a point and returns its word at offset `0x24` only when its encoded class is 2; otherwise writes zero. |
|
||
| `0043412c` | `shape_record_test_flag_10` | Returns bit `0x10` from the first shape-record byte; callers use it in tracked-item-marker eligibility/refresh paths. |
|
||
| `00434164` | `shape_record_test_field_bit_12_at_5` | Tests bit `0x1000` of the shape-record word at offset 5. |
|
||
| `00434198` | `shape_record_get_flag_01` | Returns bit 0 of the first shape-record byte. |
|
||
| `004348e4` | `item_state_get_high_byte` | Returns the high byte of the per-item word in `DAT_00482b30`. |
|
||
| `00434904` | `item_state_set_high_byte` | Replaces that per-item word's high byte while preserving its low byte. |
|
||
| `00434928` | `item_state_get_low_byte` | Returns the low byte of the per-item word in `DAT_00482b30`. |
|
||
| `00434948` | `item_state_set_low_byte` | Replaces that per-item word's low byte while preserving its high byte. |
|
||
| `0043496c` | `usecode_query_from_root_item_position` | Follows nested-parent links to root-item coordinates, then passes them and an incoming selector to two query helpers; called by usecode dispatch. |
|
||
| `00434a40` | `item_call_helper_0045fa74_if_enabled` | Forwards the current item ID to `0045fa74` when `DAT_004825d4` is nonzero; used by surrender, interaction, and process-state paths. |
|
||
| `00434a5c` | `item_call_helper_0045fc28_if_enabled` | Forwards the current item ID to `0045fc28` when `DAT_004825d4` is nonzero; callers include usecode dispatch and process constructors. |
|
||
| `00434a78` | `item_call_helper_0045ffb4_if_enabled` | Conditionally forwards the current item ID to `0045ffb4`; the higher-level operation remains unresolved. |
|
||
| `00434a94` | `item_call_helper_0045fee0_if_enabled` | Conditionally forwards the current item ID to `0045fee0`; the higher-level operation remains unresolved. |
|
||
|
||
All 20 names were read back at their exact Ghidra entry addresses, and representative decompiler comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Helpers and Spawn Path
|
||
|
||
This final threshold batch reviewed the next 10 entries from `00434ab0` through `00435100`. The helper wrappers retain address-based names where the target behavior is not established; the larger shape-classifier and usecode spawn path are described by their observed data flow.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00434ab0` | `item_call_helper_0045ffb4_if_enabled` | Forwards the current item ID to `0045ffb4` when `DAT_004825d4` is nonzero; duplicates the conditional path at `00434a78`. |
|
||
| `00434acc` | `item_mode_call_helper_0046009c_if_enabled` | Calls `0046009c` only when `DAT_004825d4` is nonzero. |
|
||
| `00434ae4` | `item_mode_call_helper_00460164_if_enabled` | Calls `00460164` with the current item ID only when `DAT_004825d4` is nonzero; otherwise returns zero. |
|
||
| `00434b04` | `usecode_call_helper_00456c20` | Usecode-dispatch wrapper around `00456c20` with fixed arguments and incoming BX. |
|
||
| `00434b24` | `usecode_call_helper_00456d90` | Usecode-dispatch wrapper around `00456d90` with fixed arguments and incoming BX. |
|
||
| `00434b44` | `item_call_helper_00456f0c` | Forwards incoming context and BX to `00456f0c`, then returns zero. |
|
||
| `00434b58` | `item_has_flag_2000` | Returns whether the current item's flags contain `0x2000`; callers include usecode dispatch and gravity processing. |
|
||
| `00434cd0` | `shape_id_get_action_class` | Maps selected shape IDs to action-class values, using `00468354` as a discriminator for several ranges. |
|
||
| `00434d84` | `usecode_spawn_item_from_shape_profile` | Usecode-dispatched path that reads per-item state/profile data, creates an item at the current item's coordinates, applies state, and may create a second shape-selected item. |
|
||
| `00435100` | `item_shape_id_check_under_lock` | For shape IDs below `0x800`, enters the item lock and performs helper `004477d8` lookup; returns the lookup success byte. |
|
||
|
||
All 10 names were read back at their exact Ghidra entry addresses, and representative decompiler comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Grid and Pool Management
|
||
|
||
This batch continues at the next report-listed entries after `00435100`. The names describe observed item-grid, cell-list, and ID-pool operations; unresolved flag and shape-record semantics are kept explicit.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004352b4` | `item_test_projected_shape_bounds` | High confidence for the geometry path. Projects the current item's world coordinates to screen space, derives its rendered shape bounds, and passes those bounds to a rectangle test. Callers include NPC adjacency, surrender, and attack update paths. |
|
||
| `00435448` | `item_global_state_00482b74_is_set` | High confidence for the operation only: returns whether global word `DAT_00482b74` is nonzero. |
|
||
| `00435458` | `shape_id_test_feature_or_sentinel_7fe` | Returns true for shape ID `0x7fe`; otherwise queries a shape-record value and tests a packed bit. The bit's meaning remains unresolved. |
|
||
| `0043548c` | `item_test_shape_footprint_at_top_z` | Tests the current item's oriented horizontal footprint against the supplied item's bounds and requires the current item's Z to equal the supplied shape's top Z. Called by usecode dispatch. |
|
||
| `004356a0` | `clear_u16_result` | Writes zero to the 16-bit output addressed by incoming `EAX`; the decompilation shows two consecutive zero stores. |
|
||
| `004356d4` | `isometric_bounds_contains_tile` | Tests whether a transformed coordinate pair lies within four isometric bounds and rejects coordinates outside the `0..63` tile domain. Used by visible-item rendering. |
|
||
| `0043577c` | `item_grid_reserve_ids_for_cell` | Reserves the requested number of item IDs from the free list, initializes their property records, links them into the selected 64x64 cell, and updates cell/free counts. Called while loading glob items. |
|
||
| `004358ec` | `item_grid_spawn_globs_for_cell` | Walks items in one grid cell and creates glob objects for entries with shape-class bits `0x30` and nonzero associated state; called by the viewport-region updater. |
|
||
| `004359dc` | `item_grid_mark_transition_items` | Walks one grid cell and marks eligible items with flag `0x2000` after outermost-Z, shape, existing-flag, and item-flag checks. The transition's higher-level meaning remains unresolved. |
|
||
| `00435a94` | `item_grid_cleanup_transition_items` | Processes items in one grid cell during a transition: cleans matching type-`0x203` processes, then finalizes or removes items based on flag `0x80` and shape checks. |
|
||
| `00435bc0` | `item_grid_prune_or_recycle_items` | When enabled, scans all 64x64 cells, finalizes or removes their items, and repairs the small-item free list. Called when the viewport-region updater changes mode. |
|
||
| `00435d20` | `item_grid_set_mode_and_rebuild` | Changes the active grid mode, optionally resets item state, rebuilds free-ID and cell lists, restores or removes items, and refreshes the viewport; called by `00436900`. |
|
||
| `00436650` | `item_grid_initialize_default_state_tables` | Initializes a sequence of object-vtable state values and clears flag bit 0 across the item flag table. The state-table entry roles remain unresolved. |
|
||
| `00436900` | `item_grid_update_viewport_region` | Called by `update_map_viewport_tile_cache`. Handles grid-mode changes and scans transformed tile bounds to run per-cell transition, cleanup, and glob-creation work. |
|
||
| `00436dd0` | `item_grid_initialize_storage` | Allocates item property arrays and 64x64 grid tables, opens the static item resource, and initializes free-ID chains and sentinel state. Used during runtime/map initialization. |
|
||
| `00436f80` | `item_grid_release_storage` | Releases the static item resource and grid allocations, then frees the item property arrays. |
|
||
| `00436fe4` | `item_grid_find_previous_id_in_owner_list` | Finds the previous ID in the current item's owning chain, selecting among free-ID lists, nested-item links, or the item's spatial cell chain. |
|
||
| `00437138` | `item_grid_unlink_item_from_cell` | Unlinks the current item from its 64x64 cell chain and decrements that cell's item count. |
|
||
| `004371fc` | `item_pool_return_id_to_free_list` | Removes the current item ID from the appropriate small- or large-ID free list and decrements the matching free count. |
|
||
| `00437394` | `item_remove_from_world_and_recycle_id` | Runs shape/tracked-marker hooks, removes linked contents, unlinks the item from its owner or cell, returns its ID to a free list, marks Z as `0xfe`, and clears associated map bits. |
|
||
|
||
All 20 names were read back at their exact Ghidra entry addresses; decompiler comments were applied to all entries, and representative comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Pool and Spatial Selectors
|
||
|
||
This batch follows the item-grid routines with pending/free-ID management, shape-profile helpers, and the next four spatial-selector scans. Names and descriptions stay at the observed operation level where the profile fields or resource format remain unknown.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004375a4` | `item_grid_coords_within_viewport_bounds` | Shifts the supplied coordinates right by 9, writes the resulting grid-cell coordinates to caller outputs, and tests them against the current isometric bounds. |
|
||
| `0043760c` | `item_pool_queue_id_for_release` | Detaches the current item from its owner, spatial cell, or free list as applicable, then links its ID onto pending-list head `DAT_00482b08` and sets flag bit `0x08`. Called by removal and grid-rebuild paths. |
|
||
| `00437768` | `item_grid_insert_item_at_position` | Adds an item at a world position, updates the destination cell count, obtains an ID from the pending/free pool, and initializes or links item state. Callers include item creation, saved-position restoration, usecode position updates, and grid rebuild. |
|
||
| `00437e40` | `item_move_to_outermost_position` | Moves or restores an item at its outermost world position. Shape class `0x60` uses a special pending-ID path; other shapes resolve the outermost position and delegate insertion to `00437768`. |
|
||
| `00437f7c` | `item_pool_restore_pending_head` | Processes the pending-list head, routing nested items through `00437e40` or inserting other items through `00437768`, then restores a saved coordinate field. |
|
||
| `00438000` | `item_pool_reinsert_pending_id_at_position` | For shape classes `0x60`/`0x70`, removes an ID from the pending list and links it into the item's state chain; other shapes resolve the outermost world position and delegate insertion. |
|
||
| `00438154` | `item_pool_discard_pending_head` | Pops one pending ID, clears item flag bit `0x08`, and optionally clears its auxiliary byte for IDs above `0xff`; the observed caller is `0044fed4`. |
|
||
| `00438228` | `item_pool_get_pending_head_id` | Returns the low word of `DAT_00482b08`, the current pending-list head ID. |
|
||
| `00438230` | `item_pool_discard_large_free_head` | Clears state associated with the large-ID free-list head, then routes that ID through `item_pool_queue_id_for_release`; traps when the large free count is empty. |
|
||
| `00438294` | `item_pool_discard_small_free_head` | If the small-ID free-list head exists, clears its associated state and routes the ID through `item_pool_queue_id_for_release`. |
|
||
| `004384c0` | `item_resource_streams_initialize` | Initializes the global item-resource stream object, allocates a companion object/buffer, opens the stream through a virtual method, and stores the context at `DAT_00482b10`; resource format remains unknown. |
|
||
| `00438594` | `item_resource_streams_release` | Clears `DAT_00482b10`, releases the global stream object when present, and frees its companion allocation. |
|
||
| `00438630` | `shape_record_get_flag_0x10_or_default_one` | Reads the shape's six-byte profile record: when byte 0 bit 0 is set, returns its bit 4; otherwise returns 1. The profile field's meaning is unresolved. |
|
||
| `0043867c` | `shape_record_first_byte_has_flag_1` | Tests bit 0 of byte 0 in the shape's six-byte profile record. |
|
||
| `00438698` | `item_shape_event_selector_40_check_state` | Checks shape-profile and global gates, then evaluates item flag `0x100` and a per-item auxiliary byte; called by `item_try_start_event_selector_40`. |
|
||
| `00438734` | `item_apply_shape_event_selector_40` | Applies selector-`0x40` shape-profile behavior: updates item flags and profile-driven state/render bytes, and may replace or remove the item. Profile byte semantics remain unresolved. |
|
||
| `00438fc0` | `search_selector_scan_exact_shape` | Advances the spatial selector until an item with the exact requested shape has X/Y inside the stored inclusive rectangle, or the grid scan is exhausted. Called by both spatial-query and shape-footprint selector paths. |
|
||
| `004390a0` | `search_selector_scan_family` | Advances the selector until an item's shape-record family field matches the requested value and its X/Y lies inside the inclusive rectangle. |
|
||
| `00439188` | `search_selector_scan_shape_set` | Advances the selector until an item's shape ID matches one of the supplied IDs and its X/Y lies inside the inclusive rectangle. |
|
||
| `00439284` | `search_selector_scan_two_shapes` | Advances the selector until an item's shape ID matches either requested shape and its X/Y lies inside the inclusive rectangle. |
|
||
|
||
All 20 entries are listed in the main address table, with 16 new Ghidra names; four selector names were already descriptive. Names were read back after the two misleading labels were corrected, and representative comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Selector Iteration and Process Helpers
|
||
|
||
This batch completes the next 20 report-listed entries after the shape-specific selector scans. It covers selector initialization/iteration and footprint contact, then reaches joystick process methods and paired auxiliary tables used by the process kernel. The auxiliary-table payload semantics remain unresolved.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043935c` | `search_selector_scan_bounds_only` | Advances the spatial selector across grid cells and linked items until an item's X/Y is inside the stored inclusive rectangle, or the scan ends. |
|
||
| `00439520` | `search_selector_next_linked_item_match` | Advances through a linked-item chain until the expression matcher accepts a candidate or the chain ends. |
|
||
| `00439560` | `search_selector_expression_matches_candidate` | Evaluates the selector expression against the current candidate; shared by spatial, footprint, linked-item, and usecode selector paths. |
|
||
| `00439b6c` | `search_selector_init_bounds_and_mode` | Clamps and stores bounds, initializes grid cursors, recognizes query-mode tokens, and finds an initial expression-matching candidate. Called by attack and usecode paths. |
|
||
| `00439f4c` | `search_selector_next_spatial_match` | Advances through cell chains and dispatches scanning by query mode: exact shape, family, set, two shapes, or bounds-only. |
|
||
| `0043a288` | `search_selector_next_map_cell_match_variant` | Traverses linked/nested item relations while advancing map cells, then checks the selector callback and expression predicate. |
|
||
| `0043a454` | `search_selector_set_candidate_from_reference` | Resolves a candidate from the supplied reference/state, stores it in the selector cursor, evaluates the expression, and calls the selector callback on rejection. Used by item snapshots and usecode. |
|
||
| `0043a4bc` | `search_selector_set_candidate_with_bound` | Stores the supplied selector bound/state word, resolves a candidate from the reference, and checks its expression before invoking the callback. Called by usecode. |
|
||
| `0043a528` | `search_selector_next_coordinate_keyed_match` | Traverses linked or nested item relations, advances candidate state, and returns when the expression matcher accepts an item. |
|
||
| `0043a5c0` | `search_selector_init_shape_footprint_query` | Initializes a footprint query from an item, recording position, top-Z, query flags, and dimensions derived from its shape record before setting bounds. |
|
||
| `0043a6ec` | `search_selector_init_shape_footprint_bounds` | Initializes clamped grid bounds and query mode for a footprint search, then looks for an initial expression-matching candidate. |
|
||
| `0043ac78` | `search_selector_match_shape_footprint_contact` | Tests candidate footprint position and Z constraints, storing contact state 0, 1, or 2 in the selector record. |
|
||
| `0043ae30` | `search_selector_next_shape_footprint_match` | Dispatches footprint scanning by query mode and repeats shape/cell scans until a candidate passes the contact test. |
|
||
| `0043becc` | `joystick_process_clear_active_state` | Called from `JoystickProcess_Run`; invokes virtual method `+0x28` for active state, then clears process byte `+0x34` and word `+0x3b`. |
|
||
| `0043bf58` | `joystick_process_create_singleton` | Initializes a process with the joystick vtable and type `0x262`, sets its fields, and stores the singleton at `DAT_00482b68`. |
|
||
| `0043bf6c` | `joystick_poll_button_state` | Calls `joyGetPosEx` for joystick 0 and returns the button-state word; disables the joystick-enabled global on failure. |
|
||
| `0043c770` | `kernel_process_aux_table_maintenance_tick` | On timer expiry, scans for the last populated entry and may shrink the paired auxiliary tables; otherwise resets the timer. Called by the process-manager update. |
|
||
| `0043c844` | `kernel_process_aux_tables_resize` | Resizes both auxiliary tables, copies the retained dword/word entries, updates global pointers, and resets the maintenance timer. |
|
||
| `0043c8fc` | `kernel_process_aux_tables_grow` | Grows both auxiliary tables by 30 entries, zeroes the new slots, updates global count/pointers, and frees the old allocations. Called during process-table insertion. |
|
||
| `0043ca28` | `Kernel_GetNumProcesses` | Counts process-table entries matching the requested item ID and process type, excluding entries with process flag bit 3 set. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses; eight generated names were replaced with operation-level names. Names were read back, and representative selector/timer comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Process Notifications and Runtime Transitions
|
||
|
||
This batch continues through process-table access and notification, then covers a phase-3 record ring, intrusive-list/resource helpers, and mode-driven runtime transition routines. The purpose of the final rectangle lookup remains uncertain, so it is described only as a preset-coordinate table.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043ca98` | `kernel_process_count_for_item_and_type` | Counts populated process-table entries matching the current item ID and requested process type; type `0x0c` is a wildcard and entries with flag bit 3 are excluded. Called by `item_action_process_dispatch`. |
|
||
| `0043cc44` | `kernel_process_get_by_id` | Returns a populated process pointer for a nonzero in-range ID, otherwise null. Used by process and item operations. |
|
||
| `0043cc6c` | `kernel_process_notify_item_processes` | Thin forwarding wrapper around `kernel_process_notify_matching`; callers include item removal, usecode dispatch, and process construction. |
|
||
| `0043cd20` | `kernel_process_notify_matching` | Guards against recursion, scans eligible processes matching an item ID and optional process type, and invokes virtual method `+0x0c`; then clears queued notification flags. |
|
||
| `0043ced4` | `kernel_process_notify_selected_types` | Filters eligible processes by item ID and a zero-terminated list of up to ten process types, invokes virtual method `+0x0c`, and clears queued notification flags. |
|
||
| `0043d39c` | `Kernel_Implies` | Usecode-facing helper with this existing symbol. On nonzero inputs it calls `00446bc8`, checks the selected process slot, and conditionally calls `004586a0` and `00458608`; higher-level script meaning remains unresolved. |
|
||
| `0043efdc` | `process_timer_setup_noop_callback` | Empty callback invoked by the timer/process setup routine after timing fields are initialized. |
|
||
| `00440340` | `memory_zero_fill` | Calls the byte-fill utility with a zero value; destination and size arrive through the caller's register convention. Used while resetting input/event state. |
|
||
| `00440510` | `empty_callback_stub` | Empty function body with no observed callers. |
|
||
| `004412c0` | `dispatcher_phase3_enqueue_record` | Appends a 12-byte record to a ten-entry phase-3 ring buffer, advances/wraps the write index, and refuses enqueue when full. |
|
||
| `00441314` | `dispatcher_phase3_dequeue_record` | Reads the next 12-byte phase-3 record, advances/wraps the read index, and decrements the queued count. |
|
||
| `004413b0` | `resource_container_cleanup` | Releases container/resource allocations according to flag bits or installs the default vtable on the reset path. Exact container type is unresolved. |
|
||
| `004413e0` | `intrusive_list_append` | Appends a non-null node to the tail, initializes the head when empty, and clears the node's next link. |
|
||
| `00441400` | `intrusive_list_move_node_to_tail` | Removes a non-null node from its current list, then appends it to the destination list. |
|
||
| `00441430` | `intrusive_list_remove_node` | Unlinks the supplied node, searching for its predecessor when needed and updating the head/tail endpoints. |
|
||
| `00441484` | `intrusive_list_destroy_nodes` | Calls each node's cleanup function while walking the list, then clears both endpoints. |
|
||
| `004414c0` | `game_runtime_transition_apply_mode` | Applies mode 0-6 branches coordinating event-loop waits, palette changes, static-overlay work, input reset, and process notifications. Called by `game_runtime_transition_dispatch`. |
|
||
| `00441e84` | `game_runtime_transition_process_state` | Dispatches transition behavior by mode and routes mode 3 through the dedicated setup helper. |
|
||
| `004423e4` | `game_runtime_transition_mode3_setup` | Mode-3 helper called by `game_runtime_transition_process_state`; it performs transition-related resource/process work whose individual state fields remain unidentified. |
|
||
| `00443f24` | `ui_get_preset_rect_by_id` | Returns four 16-bit preset coordinates for selectors 0-7 and a zero rectangle otherwise; the owning UI component is not established. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses; 19 generated names were replaced with operation-level names, and the existing `Kernel_Implies` name was retained. Names were read back, and representative process-notification, ring-buffer, and rectangle comments were confirmed in pseudocode. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Runtime UI, Palette, and Array Helpers
|
||
|
||
This batch follows the mode-3 transition helper and preset rectangle lookup with runtime command handling, DirectDraw/UI support, and process-related array utilities. Names stay at the operation level where resource or state ownership is not established.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00444470` | `input_handle_runtime_key_command` | Switches on runtime command codes and updates associated audio or game state; exact command meanings remain unresolved. |
|
||
| `00444650` | `game_runtime_transition_create_overlay` | Called by the runtime transition state handler to create the overlay/state object used by that path. |
|
||
| `00444db4` | `ui_create_indexed_resource_control` | Constructs a type-2 control, stores its indexed-resource reference, initializes bounds, and conditionally invokes its update method. |
|
||
| `00445150` | `store_u16_output` | Writes the supplied 16-bit value through the implicit output pointer in `EAX`. |
|
||
| `00445418` | `directdraw_surface_lock` | Locks the configured DirectDraw surface and records its returned surface data and pitch for drawing. |
|
||
| `00445498` | `directdraw_surface_unlock` | Unlocks the configured DirectDraw surface after drawing. |
|
||
| `00445520` | `named_resource_release_if_present` | Looks up a named resource and, when present, invokes its release path; shared by process teardown and text-GDI cleanup. |
|
||
| `00445648` | `fatal_report_show_message_box` | Displays a fatal-error message box; callers include file/line and resource-error reporting paths. |
|
||
| `00445778` | `fatal_report_show_modal_error_and_pump` | Displays a modal error and pumps messages until the interaction completes. |
|
||
| `004458c4` | `directdraw_wait_for_vertical_blank` | Calls the DirectDraw surface vtable's `WaitForVerticalBlank` method with the wait flag and a null event. |
|
||
| `004458d8` | `directdraw_palette_set_entries` | Imports palette entries into DirectDraw using the game's RGB6 conversion path. |
|
||
| `00445948` | `directdraw_palette_get_entries` | Reads DirectDraw palette entries and converts them to the game's RGB6 representation. |
|
||
| `004459ac` | `video_transition_noop` | Empty callback with no body operations. |
|
||
| `00446030` | `win32_pump_messages_and_callbacks` | Services queued window messages and registered callbacks; routes fatal UI errors through the modal handler. |
|
||
| `00446400` | `ui_create_centered_text_panel` | Creates a centered text panel used by Japanese keyboard and option/cheat handling paths. |
|
||
| `004467e0` | `usecode_calculate_root_item_motion_steps` | Computes motion step counts and per-axis deltas for the Usecode root-item position query. |
|
||
| `00446a04` | `gravity_process_apply_root_item_delta` | Forwards the computed root-item position delta to the gravity-process helper. |
|
||
| `00446a40` | `kernel_process_id_filter_initialize` | Copies process IDs through the `0x408` terminator into owned storage and optionally resolves the associated process. |
|
||
| `00446b04` | `dynamic_array_release_required` | Requires an allocated array, frees it, then clears its count and pointer fields. |
|
||
| `00446b34` | `dynamic_array_release_if_present` | Conditionally frees an allocated array and clears its count and pointer fields. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses. Generated names were replaced with operation-level names, while existing descriptive names were retained. Live decompiler readback confirmed the renamed array helpers and representative DirectDraw and process-filter comments. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Process Lists and Shape Collision Queries
|
||
|
||
This batch documents the process-ID list helpers and stream support, then follows item shape-state handling into the spatial collision-query routines. Collision result fields and several mode flags remain only partly understood.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00446b78` | `process_id_list_contains_or_append` | Searches the sentinel-terminated process-ID list and appends an ID only when absent; called by process activation/linking paths. |
|
||
| `00446bc8` | `process_id_list_append` | Grows the owned list and appends an ID before sentinel `0x408`; used by process-state and Usecode helpers. |
|
||
| `00446c88` | `process_state_list_remove_id` | Rebuilds the list without the requested ID and releases storage when no IDs remain. |
|
||
| `00446e0c` | `u16_array_get_at` | Bounds-checks an index against the array count and returns that 16-bit element; callers include process callback/listener dispatch. |
|
||
| `00446e38` | `u16_array_set_at` | Bounds-checks an index and stores a 16-bit element. |
|
||
| `00446e64` | `process_id_list_find_unflagged_match` | Finds the first word whose low 10 bits match the requested ID and whose `0x400` flag is clear; returns the index and full word. |
|
||
| `00446f4c` | `u16_array_read_from_stream` | When an array allocation is present, allocates storage from its recorded count and reads the serialized contents from the file stream. |
|
||
| `00446fd0` | `buffer_write_to_stream` | Writes the non-null buffer associated with the incoming object to the file stream. |
|
||
| `00447070` | `usecode_shape_query_set_mode_and_init` | Sets `DAT_00484bf0` and initializes a full-range spatial selector; the exact mode semantics remain unresolved. |
|
||
| `00447170` | `usecode_shape_query_clear_mode_and_init` | Clears `DAT_00484bf0` and initializes the alternate full-range spatial selector mode. |
|
||
| `00447270` | `usecode_shape_query_get_mode` | Returns the current `DAT_00484bf0` selector-mode flag. |
|
||
| `00447278` | `item_process_shape_and_spawn_associated` | Guards repeated item work, reads render/shape-profile state, and may initialize selectors or create shape-derived items. |
|
||
| `00447740` | `collision_query_state_initialize` | Initializes the query's result pointer and state/status fields. |
|
||
| `0044775c` | `collision_query_release_linked_results` | Walks and frees the linked collision-result records. |
|
||
| `00447784` | `collision_query_release_results_and_reset` | Frees linked collision-result records and clears two associated status bytes. |
|
||
| `004477d8` | `item_shape_query_region_flags` | Decodes oriented shape extents and compact flags, queries a region, and reports whether matching flags are absent. |
|
||
| `004478ec` | `item_collision_record_append` | Adds a candidate collision record and may update the query's stored candidate point/state. |
|
||
| `004479b0` | `item_position_test_candidate_collision` | Tests a neighboring item's shape extents, compact flags, and Z range against the moving item, then records qualifying collision candidates. |
|
||
| `00448174` | `item_position_query_shape_collisions` | Initializes a shape-position query, scans nearby spatial items, and tests candidates for collision; callers determine how result flags are interpreted. |
|
||
| `00448740` | `item_position_query_collisions_for_item` | Obtains a reference item's outermost position and queries the selected shape at the supplied target coordinates. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with operation-level names and decompiler comments applied. Live readback confirmed the process-list removal, stream-read, item shape-state, and candidate-collision paths. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Collision Resolution, Mouse Control, and Audio
|
||
|
||
The collision-query helpers lead into result processing, followed by the `mousectl.c` controller and a per-voice audio control update. Some cursor-slot fields and the audio control modes remain only partly interpreted.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00448818` | `item_process_collision_contacts_and_events` | Updates item position/event state, evaluates linked contact records and related shapes, then clears and releases query state; used by movement, spatial-condition, and guarded-action paths. |
|
||
| `00448b78` | `item_query_shape_collision_from_position` | Obtains an item's outermost position and queries collisions for the requested shape and query flags. |
|
||
| `00448bdc` | `item_query_shape_collision_with_step_fallback` | Runs the shape collision query and, for selected flags, retries at nearby vertical offsets to find a step-compatible position. |
|
||
| `00448f24` | `item_shape_region_has_collision_flags` | Initializes collision-query state, checks a shape region for matching flags, optionally returns a result word, then releases linked results; called by existing position-query dispatchers. |
|
||
| `00448fd0` | `mouse_controller_create` | Constructs the mouse controller, loads pointer-resource data, initializes cursor bounds and buffers, and installs the global controller pointer; source path `mousectl.c` appears in its corruption check. |
|
||
| `00449418` | `mouse_controller_destroy` | Releases controller resources; one flag path decrements/frees the shared object, while the other releases owned arrays and optional backing state. |
|
||
| `0044946c` | `mouse_controller_set_global_instance` | Forwards the object through its setup helper and stores it as the global mouse-controller instance. |
|
||
| `00449a6c` | `mouse_controller_restore_pointer_background` | If the pointer is drawn, clears that state and restores the saved screen rectangle beneath it. |
|
||
| `00449ac0` | `mouse_controller_draw_pointer` | Selects the current pointer image from the loaded resource, updates its bounds, redraws the saved screen area, and marks the pointer as drawn. |
|
||
| `00449bf8` | `mouse_controller_set_cursor_slot_value` | Stores the supplied value in the current cursor slot, refreshes pointer bounds, and redraws the pointer when it was already visible. |
|
||
| `00449d78` | `mouse_controller_advance_cursor_slot` | Advances a cursor-cycle counter, stores the supplied value in the current slot, and refreshes the selected pointer state. |
|
||
| `00449eb0` | `mouse_controller_reset_cursor_cycle` | Resets the cursor-cycle counter, stores the supplied value in the current slot, and refreshes pointer bounds and visibility. |
|
||
| `00449fd4` | `mouse_controller_retreat_cursor_cycle` | Retreats the cursor-cycle counter, updates the selected slot and pointer state, and returns the value previously stored in the slot. |
|
||
| `0044a1dc` | `mouse_controller_dequeue_event_record` | Retrieves the next 16-byte event record, using a pending single record when present or dequeuing from the ring buffer otherwise. |
|
||
| `0044a24c` | `mouse_controller_redraw_pointer_at_position` | When the pointer is drawn, refreshes its selected resource image and redraws it at the current controller position. |
|
||
| `0044a34c` | `mouse_controller_redraw_pointer_and_restore_background` | Restores the old pointer rectangle, redraws the pointer at its current position, and clears the refresh-pending flag. |
|
||
| `0044a3f4` | `mouse_resource_get_header_word_at_offset_4` | Returns the 16-bit header value stored at offset 4 in the loaded mouse resource. |
|
||
| `0044a400` | `mouse_controller_set_cursor_position` | Calls `SetCursorPos`, updates controller position and bounds, queues a position-change record when needed, and redraws the pointer if visible. |
|
||
| `0044a53c` | `mouse_controller_clear_active_input_flag` | Clears bit `0x40` in the active mouse-controller flags when a global controller is installed. |
|
||
| `0044a798` | `audio_voice_process_control_step` | Called for active voices from the audio update loop; processes a packed control mode that adjusts timing/rate or position fields, after which the caller clamps a secondary counter. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with operation-level names and decompiler comments applied. Readback confirmed collision-result processing, mouse-controller initialization and drawing, event dequeue, and the audio control-step behavior. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: AMF Audio Engine
|
||
|
||
This nine-entry pass documents the audio command, mixing, device-output, and music-resource paths. The observed resource signature is `ASYLUM`; detailed meanings of individual packed control modes remain incomplete.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0044ab2c` | `audio_voice_apply_amf_command` | Decodes an AMF control word, initializes or updates the selected voice from its instrument record, and applies mode-specific sample, rate, timing, and volume parameters. |
|
||
| `0044af58` | `audio_mix_active_voices` | Mixes active voices into stereo accumulation buffers using sample and lookup tables, advances sample positions, and disables voices that reach their end. |
|
||
| `0044b0a0` | `audio_submit_mixed_buffer` | Clamps accumulated samples to signed 16-bit values, submits the output buffer through the device interface, and advances the ring offset when the device is ready. |
|
||
| `0044b168` | `audio_engine_update_tick` | Consumes queued AMF control words, updates active voices, clears the accumulation buffer, mixes voices, and submits the result to the audio device. |
|
||
| `0044b348` | `audio_load_amf_music_resource` | Loads and validates an `ASYLUM`/AMF resource, reads instrument records and sample data, converts sample bytes to signed values, and fixes sample lengths. |
|
||
| `0044b574` | `audio_push_track_and_play` | Pushes the current track onto a bounded stack and loads the requested AMF track when audio is active; runtime-transition and overlay-startup paths call it. |
|
||
| `0044b6ec` | `audio_pop_track_and_play_previous` | Pops and reloads the prior AMF track when audio is active; called by overlay shutdown. |
|
||
| `0044b854` | `audio_reset_track_stack_and_load_zero` | Clears the track stack and reloads track zero as the default AMF resource when audio is active. |
|
||
| `0044b980` | `audio_request_driver_sync` | Sets the pending synchronization flag while audio is active and invokes the device callback when its driver-ready bit is set. |
|
||
|
||
All nine entries are listed at exact function-entry addresses, with operation-level names and decompiler comments applied. Live readback confirmed the AMF command decoder, voice mixer, engine tick, resource loader, track push, and driver-sync paths. This reaches the 747-entry milestone; no executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Audio Lifecycle and Resource Lists
|
||
|
||
This batch closes out the audio-engine setup, track switching, and teardown paths, then documents dispatcher record predicates and resource-backed intrusive-list objects. Several record fields are still described only by their observed values and operations.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0044ba18` | `audio_resume_engine_with_timing` | Clears the pending audio-control flag and, when active, signals the device or applies a scaled timing value before resuming playback; called from window-message paths. |
|
||
| `0044bab0` | `audio_stop_engine_and_wait` | Stops the active device callback, waits for the audio worker thread, releases temporary buffers, and clears current-track state; used by runtime transitions and overlay lifecycle. |
|
||
| `0044bb5c` | `audio_start_engine` | Initializes voice levels and device buffers, configures audio output, starts the worker thread, and enables playback. |
|
||
| `0044bd2c` | `audio_select_and_play_track` | Loads the requested AMF track and records it as current when audio is active; called by Usecode dispatch. |
|
||
| `0044be78` | `audio_reload_current_track` | Invokes the owning object's callback twice, then reloads the current AMF track when the audio engine is active; used by savegame-load reconstruction. |
|
||
| `0044c034` | `audio_set_engine_timing_value` | Stores the engine timing value and updates the active device; zero or a pending-control flag takes the device notification path. |
|
||
| `0044c0b8` | `audio_get_engine_timing_value` | Returns the current audio-engine timing value. |
|
||
| `0044c0c0` | `audio_engine_initialize` | Builds audio lookup tables, initializes the device interface and format, then sets the engine-active flag on success. |
|
||
| `0044c28c` | `audio_engine_shutdown` | Stops and joins the audio worker, releases the device interface, and clears engine-active and current-track state. |
|
||
| `0044c448` | `dispatcher_record_initialize_fields` | Copies supplied words and register values into fixed fields of a dispatcher record; called by pending-transition and playback-record initialization paths. |
|
||
| `0044c474` | `dispatcher_record_is_type_1` | Tests whether the record's 16-bit type field equals 1. |
|
||
| `0044c484` | `dispatcher_record_is_type_2` | Tests whether the record's 16-bit type field equals 2. |
|
||
| `0044c494` | `dispatcher_record_is_type_3` | Tests whether the record's 16-bit type field equals 3. |
|
||
| `0044c4a4` | `resource_object_initialize` | Initializes a resource object's base fields and installs its vtable; used by linked-record construction. |
|
||
| `0044c4c0` | `resource_object_destroy` | Clears and destroys both owned intrusive lists, restores the base vtable, and releases the object when requested. |
|
||
| `0044c50c` | `resource_list_append` | Forwards the supplied node to the intrusive-list tail-insertion helper. |
|
||
| `0044c51c` | `intrusive_list_find_and_move_to_tail` | Traverses the supplied intrusive list until the cursor wraps, then moves the selected node to the list tail. |
|
||
| `0044c588` | `intrusive_list_find_by_tag_byte` | Walks an intrusive list and returns the first node whose tag byte matches the requested value. |
|
||
| `0044c5bc` | `resource_linked_record_create` | Initializes a resource-linked record and flags, constructs its nested resource object, and appends it to the owner list when present. |
|
||
| `0044c654` | `resource_object_release` | Clears the global current pointer if needed, frees auxiliary storage and owned lists, releases the object, and updates the shared count. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with operation-level names and decompiler comments applied. Live readback confirmed audio startup, lookup-table/device initialization, list traversal, linked-record construction, and resource-object release. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Gump Rendering and Dispatcher State
|
||
|
||
This pass covers counted resource allocation, nested gump rendering and hit-testing, coordinate conversion, dispatcher context and event-ring helpers, and process cleanup. Packed object-state fields and several process flag meanings remain provisional.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0044c6d4` | `tracked_resource_allocate` | Allocates a tracked resource block, reports allocation failure, and increments current and high-water allocation counters; called by runtime transitions and event-context creation. |
|
||
| `0044c730` | `tracked_resource_release` | Releases a tracked resource block and decrements the shared allocation count; used by object/resource cleanup paths. |
|
||
| `0044c75c` | `tracked_object_extend_state_flags` | Updates the packed word at offset `0x2d`: preserves low-bit states 1 or 3, initializes zero to 3, otherwise shifts left two and sets the low bits. |
|
||
| `0044c798` | `gump_render_tree_recursive` | Invokes the gump draw callback when enabled, registers its intersecting screen rectangle, and recursively processes linked children with adjusted coordinates. |
|
||
| `0044c978` | `gump_render_tree` | Accumulates parent offsets, invokes recursive rendering, and optionally calls the active display callback; used by pending-state transitions and the dispatcher loop. |
|
||
| `0044cb44` | `gump_hit_test_tree` | Tests a gump and linked ancestors/children against event data and flags, returning a matching gump through an output pointer; source diagnostics identify `newgump.c`. |
|
||
| `0044cd3c` | `object_update_display_state_from_word` | Passes the high 16 bits of the supplied word to the object's display-state update helper. |
|
||
| `0044cd54` | `object_merge_state_bits` | Initializes the packed state word at offset `0x2d` or shifts its existing value and merges supplied state bits. |
|
||
| `0044cd80` | `gump_get_absolute_x` | Recursively sums the gump's X offset with each parent offset. |
|
||
| `0044cda0` | `gump_get_absolute_y` | Recursively sums the gump's Y offset with each parent offset. |
|
||
| `0044cdc0` | `gump_coordinate_to_local_x` | Converts a supplied X coordinate to the object's local coordinate by subtracting its stored X offset. |
|
||
| `0044cdd0` | `gump_coordinate_to_local_y` | Converts a supplied Y coordinate to the object's local coordinate by subtracting its stored Y offset. |
|
||
| `0044cff8` | `gump_set_allowed_shape_ids` | Replaces a zero-terminated 16-bit shape-ID filter and toggles the corresponding filter-present flag; called by runtime, text-entry, and modal-dialog setup. |
|
||
| `0044d130` | `gump_draw_content_and_invalidate` | Builds a display rectangle from position and parent offsets, invokes the display callback, and adds the intersecting screen region. |
|
||
| `0044d3c8` | `dispatcher_set_active_context_pointer` | Stores a supplied context pointer, defaulting to the current object when the argument is zero, and returns the shared context value. |
|
||
| `0044d3d8` | `dispatcher_clear_active_context_pointer` | Clears the shared context pointer and returns the shared context value. |
|
||
| `0044d3e4` | `dispatcher_event_queue_enqueue_record` | Validates required record fields and copies six words into the next slot of a 25-entry dispatcher ring. |
|
||
| `0044d614` | `new_gump_validate_id_complement` | Checks the NewGump ID complement invariant and reports a `Bad NewGumpId` error on mismatch. |
|
||
| `0044d720` | `process_terminate_related_children` | Walks a process ID list, applies flag-selected operations to related processes, and updates owner/state fields; called by `Process_Terminate`. |
|
||
| `0044d910` | `runtime_initialize_default_item_shape_entries` | Allocates a shared initialization block and sets default entries in item-shape, flag, Z, and related lookup tables. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with operation-level names and decompiler comments applied. Live readback confirmed recursive gump rendering, hit-testing, shape-ID filtering, dispatcher event-ring insertion, and process termination handling. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Shape-State and Per-Item Records
|
||
|
||
This pass documents the runtime shape-state buffer and per-item record accessors used by input, item-state, process, and Usecode paths. Predicate names retain the exact tested record fields and values where their higher-level semantics are not established.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0044d984` | `runtime_shape_table_buffer_release` | Frees the allocated runtime shape-table buffer and clears its global pointer; called during runtime transitions. |
|
||
| `0044d9c0` | `object_invoke_vtable_method_0c_with_zero` | Invokes the object's virtual method at vtable offset `0x0c` with argument zero; used during savegame-load reconstruction. |
|
||
| `0044d9e0` | `process_has_item_type_minus_16` | Forwards the process context to the item-type-presence query with selector `-0x10`; called by Surrender, Pace, Guard, and Loiter process handlers. |
|
||
| `0044d9f8` | `item_marker_is_left_parenthesis` | Looks up the byte associated with the supplied item ID and tests whether it equals `'('`; used by item-state and input paths. |
|
||
| `0044da18` | `shape_state_load_record_and_spawn_item` | Copies a `0x8e`-byte shape-state record, optionally creates an item from its shape metadata, updates a selected per-item slot, and stores three record words. |
|
||
| `0044f264` | `item_update_state_cache_on_mode_change` | When the item's state mode differs from the requested mode, conditionally dispatches matching process exclusions and stores the resulting state in its per-item record. |
|
||
| `0044f33c` | `item_record_get_field_59_flag_1` | Returns bit 1 of the per-item byte at offset `0x59`; called from Usecode dispatch. |
|
||
| `0044f364` | `item_record_get_field_59_flag_3` | Returns bit 3 of the per-item byte at offset `0x59`; used by runtime-mode and viewport/item paths. |
|
||
| `0044f38c` | `item_shape_code_0d_is_not_probe_excluded` | Returns true when the per-item word at offset `0x0d` is not 0, 1, `0x0b`, `0x10`, or `0x3a`; called during item probe-position processing. |
|
||
| `0044f3cc` | `item_shape_code_0d_is_1c_or_1d` | Returns true when the per-item word at offset `0x0d` equals `0x1c` or `0x1d`; called from gameplay input handling. |
|
||
| `0044f3fc` | `item_record_value_within_200_of_field_69` | Obtains a per-item value and tests it against the record's offset-`0x69` value plus 200; used by an attack-process fallback. |
|
||
| `0044f440` | `item_record_flag_1_or_invalid_id` | For a valid item ID, returns bit 0 of the per-item word at offset `0x13`; returns true for an invalid ID. |
|
||
| `0044f474` | `item_set_flag_8000_and_mark_record` | Sets the item's `0x8000` flag through its helper and sets bit 0 of the per-item byte at offset `0x13`; used by state and Usecode dispatch. |
|
||
| `0044f49c` | `item_clear_flag_8000_and_clear_record_mark` | Clears the item's `0x8000` flag through its helper and clears bit 0 of the per-item byte at offset `0x13`; used by the Japanese option-cheat handler. |
|
||
| `0044f4c4` | `item_record_clear_field_59_flag_0` | Clears bit 0 of the per-item byte at offset `0x59`; called during item removal. |
|
||
| `0044f4e4` | `item_record_get_field_13_high_bit` | Returns bit 15 of the per-item word at offset `0x13`; used by item-state and cheat paths. |
|
||
| `0044f50c` | `item_record_set_field_13_flag_1` | Sets bit 1 of the per-item byte at offset `0x13`; called by input-cheat and Usecode paths. |
|
||
| `0044f52c` | `item_record_clear_field_13_flag_1` | Clears bit 1 of the per-item byte at offset `0x13`; called by input-cheat and Usecode paths. |
|
||
| `0044f54c` | `item_shape_code_0d_is_03_30_31_or_38` | Returns true when the per-item word at offset `0x0d` equals 3, `0x30`, `0x31`, or `0x38`; called during gameplay input handling. |
|
||
| `0044f588` | `shape_record_code_0d_is_excluded` | Returns true when the per-item word at offset `0x0d` equals `0x22`, `0x23`, or `0x26`; called from gameplay input handling. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed shape-state record loading, state-cache updates, the `0x8000` item flag path, and the shape-code exclusion predicate. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Pool, Shape Slots, and Record Fields
|
||
|
||
This pass documents item-slot allocation and recycling, shape spawning, the 30-entry per-item shape-state list, and record-field accessors. The meaning of several packed marker bits remains expressed by their exact field offsets.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0044f5c0` | `item_record_get_field_13_flag_2` | Returns bit 2 of the per-item word at offset `0x13`; used by position, cache, probe, and input paths. |
|
||
| `0044f6a0` | `item_record_get_field_59_flag_5` | Returns bit 5 of the per-item byte at offset `0x59`. |
|
||
| `0044f6c8` | `item_record_set_field_59_flag_5` | Sets bit 5 of the per-item byte at offset `0x59`. |
|
||
| `0044f6e8` | `item_record_clear_field_59_flag_5` | Clears bit 5 of the per-item byte at offset `0x59`; called during pre-termination updates. |
|
||
| `0044f72c` | `item_allocate_slot_with_eviction` | Allocates from the small free pool or scans for an eligible item to remove and recycle, then initializes the requested shape and per-item state. |
|
||
| `0044fa54` | `item_spawn_shape_with_metadata` | Creates or recycles an item, restores its render state and catalog metadata, and sets an additional record flag for shapes `0x597` and `0x3ac`; called by item and Usecode spawn paths. |
|
||
| `0044fb38` | `item_spawn_shape_with_saved_state` | Creates or recycles an item, restores render state and catalog metadata, then loads its saved shape-state record; called by Usecode dispatch. |
|
||
| `0044fc98` | `item_record_get_shape_slot` | Returns the 16-bit value at per-item record offset `0x1b` plus twice the slot index. |
|
||
| `0044fcc0` | `item_shape_state_assign_linked_item` | Assigns an item ID to a shape-state slot, applies shape-flag-dependent cleanup or related-item updates, then sets the slot, Z value, and item flag. |
|
||
| `0044fe24` | `item_record_clear_shape_slot` | Clears the selected 16-bit slot at offset `0x1b` plus twice the supplied index. |
|
||
| `0044fe50` | `item_record_remove_shape_slot_references` | Scans the first 30 slots and clears every entry equal to the supplied item ID; called when an item ID is queued for release. |
|
||
| `0044fe94` | `item_record_clear_all_shape_slots` | Clears all 30 16-bit shape slots beginning at offset `0x1b`; called during item-grid mode rebuild. |
|
||
| `0044fed4` | `item_update_position_and_marker` | Updates item X/Y/Z and marker state, performs item/map cache updates, and handles pool transitions when the marker matches a global value. |
|
||
| `0044ffe4` | `item_record_find_empty_slot_01_05` | Returns the first empty slot index from 1 through 5, or zero if all five are occupied. |
|
||
| `00450030` | `item_record_find_empty_slot_06_10` | Returns the first empty slot index from 6 through 10, or zero if all five are occupied. |
|
||
| `0045007c` | `item_record_find_empty_slot_11_25` | Returns the first empty slot index from 11 through 25, or zero if all 15 are occupied. |
|
||
| `004500c8` | `item_get_marker_byte` | Returns the marker byte stored in the global per-item byte array. |
|
||
| `004500dc` | `item_record_set_field_06` | Stores a 16-bit value at offset `0x06` in the item's `0x79`-byte record. |
|
||
| `00450100` | `item_record_set_field_08` | Stores a 16-bit value at offset `0x08` in the item's `0x79`-byte record. |
|
||
| `00450124` | `item_record_set_field_0a` | Stores a 16-bit value at offset `0x0a` in the item's `0x79`-byte record. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed item-slot recycling, metadata-bearing shape spawning, linked-item assignment, marker/position updates, and slot lookup. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Action Modes and Related Slots
|
||
|
||
This pass covers per-item record fields, action-mode dispatch, process updates, and selected linked-item slots used by the action and position-query paths.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00450148` | `item_record_set_field_12` | Stores the supplied byte at offset `0x12` in the item's `0x79`-byte record; called during shape-profile spawning. |
|
||
| `00450168` | `item_record_get_field_06` | Returns the 16-bit value at offset `0x06` in the item record. |
|
||
| `00450188` | `item_record_get_field_08` | Returns the 16-bit value at offset `0x08` in the item record. |
|
||
| `004501a8` | `item_record_get_field_0a` | Returns the 16-bit value at offset `0x0a` in the item record. |
|
||
| `004501c8` | `item_record_replace_field_02_save_previous` | Copies the current field at offset `0x02` to offset `0x04`, then stores the supplied value at offset `0x02`; called by an attack-process fallback. |
|
||
| `0045023c` | `item_set_action_mode_and_dispatch_process` | Updates item action-mode fields, dispatches process notifications, and ensures the selected Stand, Loiter, Pace, Guard, Surrender, or Attack process when the mode changes. |
|
||
| `00450684` | `item_action_mode_matches_current` | Resolves selectors `0x70`–`0x72` through record fields `0x06`, `0x08`, and `0x0a`, then compares with field `0x02`. |
|
||
| `00450714` | `item_release_shape_slot_selector_resource` | Selects one of two item-record slot indices, resolves a linked item, reads its catalog field, and releases the associated selector resource when present. |
|
||
| `004507bc` | `item_record_set_field_59_flag_3` | Sets bit 3 of the per-item byte at offset `0x59`; called by probe-position processing. |
|
||
| `004507f0` | `item_clear_state_flag_and_update_process` | Clears bit 3 of the state byte, then conditionally updates or dispatches the associated item process based on runtime mode and item flags. |
|
||
| `004508a4` | `item_repeat_action_for_direction_delta` | Forwards a direction delta to the item-action repeat helper; called by Surrender and Usecode paths. |
|
||
| `004508d8` | `item_record_get_field_00` | Returns the 16-bit value at offset `0x00` in the item record. |
|
||
| `004508f8` | `item_record_get_field_02` | Returns the 16-bit value at offset `0x02` in the item record. |
|
||
| `00450918` | `item_record_get_field_15` | Returns the 16-bit selector at offset `0x15` in the item record. |
|
||
| `00450938` | `item_record_get_field_19` | Returns the 16-bit selector at offset `0x19` in the item record. |
|
||
| `00450958` | `item_get_shape_catalog_field_02` | Returns `0x96` for item ID 1; otherwise resolves the shape's catalog record and returns its field at offset `0x02`. |
|
||
| `004509a0` | `item_get_related_item_from_slot_15` | Uses the selector at offset `0x15` to return the corresponding linked item ID from the 30-entry slot array, or zero when unset. |
|
||
| `004509d8` | `item_get_related_item_from_slot_17` | Uses the selector at offset `0x17` to return the corresponding linked item ID from the 30-entry slot array, or zero when unset. |
|
||
| `00450a10` | `item_get_related_item_from_slot_19` | Uses the selector at offset `0x19` to return the corresponding linked item ID from the 30-entry slot array, or zero when unset. |
|
||
| `00450a48` | `item_record_get_field_57` | Returns the 16-bit value at offset `0x57` in the item record. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed action-mode process dispatch, mode matching, selector-resource release, state-flag updates, and linked-item lookup. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Option Values and Runtime Item State
|
||
|
||
This pass covers an item-1 option-value mapping, additional per-item record fields and packed data, selector-triggered refreshes, and a global runtime action-state value.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00450a68` | `item_record_set_field_57` | Stores a 16-bit value at per-item offset `0x57`; used by the option-cheat value helper. |
|
||
| `00450a9c` | `item1_value_from_option_selector` | For item ID 1, maps global selector values 1, 2, and 3 to 2500, 5000, and 10000; process `0x254` setup and Usecode are callers. |
|
||
| `00450ae8` | `item_set_option_cheat_value_or_create_process` | The Japanese option-cheat input path updates field `0x57` for item 1 when the selector argument is zero; otherwise it creates process `0x254` variant B. |
|
||
| `00450b54` | `item_record_get_field_66` | Returns the 16-bit value at per-item offset `0x66`; used by position-state dispatch. |
|
||
| `00450b74` | `item_record_set_field_66_and_refresh` | Stores a 16-bit value at offset `0x66` and invokes the shared refresh routine. |
|
||
| `00450ba0` | `item_get_option_selector` | Returns the global selector used by the item-1 special-value mapping. |
|
||
| `00450bb8` | `item_set_option_selector_and_item1_value` | Stores the global selector and updates item 1's field `0x57` using the corresponding mapped value. |
|
||
| `00450c14` | `item_record_set_field_00` | Stores a 16-bit value at per-item offset `0x00`. |
|
||
| `00450c34` | `item_record_get_field_5c` | Returns the 16-bit value at per-item offset `0x5c`. |
|
||
| `00450c54` | `item_record_set_field_5c` | Stores a 16-bit value at per-item offset `0x5c`. |
|
||
| `00450c78` | `item_record_set_packed_field_5e` | Copies five bytes from the input buffer to per-item offset `0x5e`; called during shape-profile spawning. |
|
||
| `00450ca8` | `item_record_copy_packed_field_5e` | Copies five bytes from per-item offset `0x5e` into the caller's output buffer. |
|
||
| `00450cec` | `item_record_set_field_15_and_refresh` | Stores a selector at per-item offset `0x15` and invokes the shared refresh routine; called by shape spawning and option handling. |
|
||
| `00450d14` | `item_record_set_field_19` | Stores a 16-bit selector at per-item offset `0x19`. |
|
||
| `00450d38` | `item_get_runtime_action_state` | Returns the global runtime action-state value. |
|
||
| `00450d40` | `item_set_runtime_action_state_and_refresh` | Stores the supplied global state; if the selected item's state and eligibility checks pass, temporarily enables an update guard and refreshes process state. |
|
||
| `00450db4` | `item_set_runtime_action_state_one_and_refresh` | Sets the global state to 1 and conditionally refreshes the selected item's process state under the same eligibility checks. |
|
||
| `00450e28` | `item_clear_runtime_action_state` | Clears the global runtime action-state value. |
|
||
| `00450e34` | `item_record_set_field_0c` | Stores a byte at per-item offset `0x0c`; callers include shape spawning, probe-position processing, and direction-code handling. |
|
||
| `00450e54` | `item_record_get_field_0c` | Returns the byte at per-item offset `0x0c`; called by viewport and item-shape position updates. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed the option-cheat selector mapping, packed-field copy, runtime-state refresh guard, and field `0x0c` accessor. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Item Values and Linked-Item Interaction
|
||
|
||
This pass follows the option-value helpers into shape-linked item lookup, keyboard interaction state, and a global per-slot bitset. Two routines search for the special shape ID `0x4ed`; the longer interaction transition remains only partly interpreted.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00450e74` | `shape_record_get_code_0d` | Returns the 16-bit per-item record field at offset `0x0d`. |
|
||
| `00450e94` | `item_adjust_count_toward_shape_limit` | Adjusts field `0x00` by a signed delta, clamping to the shape catalog's field `0x02` or to `0x96` for item ID 1; called from Usecode. |
|
||
| `00450f48` | `item_adjust_field_57_toward_option_limit` | Adjusts field `0x57` by a signed delta, clamped between zero and the selector-derived item-1 limit; refreshes shared state when changed. |
|
||
| `00451010` | `item_get_shape_04ed_class_10_state` | Searches the 30-entry item-slot array for shape `0x4ed` and returns that item's shape-class-10 state, or zero if absent. |
|
||
| `0045107c` | `item_reset_runtime_and_option_fields` | Resets several selected-item fields, sets field `0x00` to `0x96`, clears the global bitset and item flags, and resets render state; called by runtime-transition dispatch. |
|
||
| `0045111c` | `startup_get_u_override_constant_6a` | Returns constant `0x6a`; called by startup handling for a U-key override. |
|
||
| `00451124` | `item_get_global_option_value_d7` | Returns the global 16-bit value at `DAT_004955d7`; exact meaning is unresolved. |
|
||
| `0045112c` | `object_call_virtual_0c_then_refresh` | Invokes the object's virtual function at vtable offset `0x0c` with argument zero, then calls the shared refresh helper. |
|
||
| `00451180` | `item_find_slot_by_shape_id` | Searches the 30-entry item-slot array for a matching shape ID and returns its item ID, or zero. |
|
||
| `004511d0` | `item_find_related_catalog_shape_slot` | Resolves the selected item's slot-`0x15` linked item, obtains its catalog related-item shape, and searches the slot array for a matching item. |
|
||
| `00451288` | `item_get_related_state_or_option_ratio` | Returns linked-item state metadata when present; otherwise computes item-1 field `0x57` divided by the linked shape's catalog byte at offset `0x0a`, using one when that divisor is zero. |
|
||
| `0045135c` | `item_apply_related_state_or_decrease_option_value` | Applies linked-item state/event metadata or decreases item-1 field `0x57` by the linked shape's catalog byte `0x0a`, clamped at zero; refreshes shared state. |
|
||
| `004514b4` | `item_related_shape_position_flag_test` | Checks for a slot-`0x15` linked item and its shape catalog byte at offset `0x0c`; returns true when no linked item is set. Used by target-position and attack paths. |
|
||
| `00451510` | `item_process_interaction_with_linked_item` | Keyboard-interaction path that applies linked-item catalog state/event changes or item-1 option-value adjustments, and may clean up related items. Detailed transition semantics remain partly unresolved. |
|
||
| `00451800` | `item_test_global_slot_bit` | Tests the bit indexed by `AL` in the global bitset at `DAT_004955d9`; called from Usecode. |
|
||
| `0045181c` | `item_set_global_slot_bit` | Sets the bit indexed by `AL` in the global bitset at `DAT_004955d9`. |
|
||
| `00451860` | `item_clear_global_slot_bits` | Clears the global bitset at `DAT_004955d9`. |
|
||
| `00451888` | `item_get_shape_04ed_class_10_state_variant` | Second scan for shape `0x4ed` that returns its shape-class-10 state, or zero if absent. |
|
||
| `004518f4` | `item_update_shape_04ed_class_10_state` | Finds shape `0x4ed` in the 30-entry item-slot array and updates its shape-class-10 state. |
|
||
| `00451960` | `item_record_get_field_63_byte` | Returns the byte at per-item offset `0x63`; callers include attack and Usecode paths. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed item-value clamping, shape-`0x4ed` slot searches, the global bitset operations, and the linked-item interaction path. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Palette and AVI Playback
|
||
|
||
This sparse report slice finishes a few item-record helpers, then documents direction-process construction, palette transforms, run-length frame rendering, and AVI container/audio/video playback.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00451980` | `item_record_set_field_63_byte` | Stores a byte at offset `0x63` in the per-item record; called by shape spawning and Usecode. |
|
||
| `004519a0` | `item_record_get_field_04` | Returns the 16-bit value at offset `0x04` in the per-item record. |
|
||
| `00453500` | `process_direction_toward_target_create_at_position` | Creates process type `0x204` with the direction-toward-target update vtable and supplied target position; called by Loiter and Attack process paths. |
|
||
| `004536ac` | `process_direction_toward_target_create_at_item_position` | Creates process type `0x204` using the selected item's outermost position; called by Attack process paths. |
|
||
| `004542d0` | `palette_color_array_initialize_from_rgb` | Replaces the color buffer with 256 three-byte entries initialized from one RGB triple; used by palette fade/grayscale operations. |
|
||
| `00454340` | `palette_color_array_resize_and_copy` | Resizes a color buffer and copies three-byte entries; used by palette-manager initialization and fades. |
|
||
| `00454440` | `palette_load_resource_by_id` | Loads and copies a Windows executable resource of type `PALETTE` by numeric ID. |
|
||
| `004544f0` | `palette_rgb_to_yiq_transform` | Transforms each RGB palette entry to YIQ using integer coefficient matrices; called by grayscale-palette routines. |
|
||
| `004546a4` | `avi_player_context_construct` | Initializes the AVI player context, including stream, frame, audio, timing, and input state. |
|
||
| `00454958` | `avi_rle_blit_u8_to_u16` | Decodes run-length spans and dispatches nontransparent source spans to a 16-bit destination. |
|
||
| `00454a90` | `avi_rle_blit_u8_to_dual_u32` | Decodes run-length spans and dispatches nontransparent source spans to paired 32-bit destinations. |
|
||
| `00454bc8` | `avi_rle_copy_spans_to_byte_buffer` | Decodes run-length spans and copies nontransparent source bytes to a byte-oriented destination buffer. |
|
||
| `00454d0c` | `avi_rle_blit_u8_to_dual_u16` | Decodes run-length spans and dispatches nontransparent source spans to paired 16-bit destinations. |
|
||
| `00454e34` | `avi_player_advance_chunk_with_wrap` | Advances by the current chunk size and header, handles ring-buffer wrap, and tests whether a target stream position was crossed. |
|
||
| `00454f08` | `avi_player_consume_video_chunk` | Accepts video chunks `00db`/`00dc`, validates and copies frame payloads, and reports an error for other chunk types. |
|
||
| `00455034` | `avi_player_render_video_frame` | Computes frame row spans and dispatches to the appropriate run-length decoder for the output format. |
|
||
| `00455190` | `avi_player_update_status_text_overlay` | Updates timed player text and its screen rectangle. |
|
||
| `00455280` | `avi_player_process_audio_chunk` | Processes `01wb` audio chunks, submits prepared data through the audio-device virtual interface, and advances the audio-frame counter. |
|
||
| `0045542c` | `avi_player_parse_riff_header_and_index_chunks` | Reads the RIFF/AVI container, locates nested stream lists, and initializes chunk-position/index state. |
|
||
| `00455ce8` | `avi_player_read_stream_and_pump_input` | Reads 4 KiB stream blocks while pumping Windows messages, stops on selected mouse/keyboard input, and advances stream/timing state. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Live readback confirmed process type `0x204`, RGB-to-YIQ conversion, `00db`/`00dc` video chunks, `01wb` audio chunks, and RIFF/AVI indexing. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: AVI Lifecycle and Process Filters
|
||
|
||
This slice completes the AVI player lifecycle and follows the report into shape-resource usage tracking and process-table type filters.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00455fb4` | `avi_player_find_video_or_resource_file` | Builds a media path and tries `.AVI`, with `.DAT` and optional `.TXT` fallbacks. The DAT path uses the static display overlay instead of AVI playback. |
|
||
| `004562f8` | `avi_player_prepare_stream_buffers_and_audio` | Initializes AVI ring-buffer pointers and optional audio/resource state; reports a `player.h` halt on invalid setup. |
|
||
| `004563d8` | `avi_player_apply_palette_fade_overlay` | Builds and installs a temporary RGB palette used by the AVI player's fade/display overlay. |
|
||
| `0045661c` | `avi_player_draw_screen_overlay_indicator` | Draws indexed overlay resources based on player position/state, or updates the overlay rectangle when active. |
|
||
| `00456774` | `avi_player_find_movi_list_and_start_stream` | Walks the RIFF index to find `movi`, initializes the first stream chunk, and primes video/audio playback. |
|
||
| `0045690c` | `avi_player_begin_display_overlay` | Saves palette state, applies fade/indicator setup, and prepares the player display. |
|
||
| `00456a20` | `avi_player_restore_game_display_state` | Restores display, palette, mouse, and runtime-action state changed during AVI playback. |
|
||
| `00456b18` | `avi_player_release_stream_resources` | Closes the AVI stream, releases audio/buffer/resource state, resets stream pointers, and clears input-event state. |
|
||
| `00456c20` | `avi_player_run_standard_profile` | Standard AVI playback entrypoint; initializes the context, opens/indexes the stream, runs playback, and restores resources. |
|
||
| `00456d90` | `avi_player_run_large_buffer_profile` | AVI playback entrypoint that sets a `0x300000` stream-buffer limit before using the shared playback and cleanup path. |
|
||
| `00456f0c` | `avi_player_run_item_cutscene_profile` | Item-triggered AVI playback entrypoint with its own context flags and the shared stream/playback/cleanup path. |
|
||
| `0045737c` | `shape_resource_mark_character_usage` | Sets a usage bit for a character/resource index in the bitmap selected by shape index. |
|
||
| `0045740c` | `shape_resource_build_live_item_usage_map` | Allocates two shape-character maps, scans items across both map planes, and marks character/resource-cache usage. |
|
||
| `004575a0` | `shape_resource_process_live_item_usage` | Builds live item usage; unless disabled, applies each marked shape-character pair, then frees the temporary maps. Called during item-grid initialization/rebuild. |
|
||
| `004576e0` | `process_type_filter_is_active` | Tests whether a process-type filter byte encodes an active all-types or bounded/exact match mode. |
|
||
| `00457704` | `process_type_filter_matches_type` | Matches a process type against less-than, equal, or greater-than mode and the filter's low-five-bit threshold. |
|
||
| `00457870` | `process_allocate_id_and_stage_pending_insert` | Allocates a process ID, halts on allocation failure, and stages the ID for pending process-table insertion. |
|
||
| `004578a0` | `process_require_state_flag_4000` | Halts unless the process state word contains flag `0x4000`; called from process update/control paths. |
|
||
| `004578c8` | `Process_SetItemNo` | Sets the process item ID and updates kernel item-ID and, for types `0xf0`-`0xf7`, process-type presence tracking. |
|
||
| `00457930` | `Process_SetProcType` | Sets the process type and refreshes process-type presence tracking for types `0xf0`-`0xf7`. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Caller/readback checks confirmed the AVI playback variants converge on the same setup and teardown, shape usage maps are built from live map items, and the process filter helpers are used by kernel matching/dispatch. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Process Timers and Related State
|
||
|
||
This slice documents process-local timer scheduling, dependency-expression handling during termination, and the related-process state lists used by process construction and teardown.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00457994` | `keyboard_process_set_category_and_update_counts` | Validates a category from 1 through 31, updates the keyboard-process field, and maintains global per-category counts. |
|
||
| `00457a04` | `process_schedule_timer_deadline` | Marks the process timer active and stores its current accumulated 10 ms tick count plus the requested interval. |
|
||
| `00457a40` | `process_update_timer_and_check_deadline` | Advances the accumulated timer, clears an expired deadline, and dispatches the timer callback when enabled. Called by the process manager update. |
|
||
| `00457d74` | `process_evaluate_termination_dependency_expression` | Evaluates `true`, `AND`, `OR`, and terminator opcodes, then updates related-process state lists when true. Called during related-child termination. |
|
||
| `00458198` | `process_remove_related_state_flag_0800` | Clears relation flag `0x0800` and removes the state-list entry when no other relation flags remain. |
|
||
| `00458268` | `process_remove_related_state_flag_1000` | Clears relation flag `0x1000` and removes the state-list entry when no other relation flags remain. |
|
||
| `00458408` | `process_remove_related_state_flag_4000` | Clears relation flag `0x4000` and removes the state-list entry when no other relation flags remain. |
|
||
| `00458608` | `process_set_related_state_flag_2000` | Adds or updates a related-process list entry with flag `0x2000`; used by process activation/linking and `Kernel_Implies`. |
|
||
| `004586a0` | `process_set_related_state_flag_4000` | Adds or updates a related-process list entry with flag `0x4000`. |
|
||
| `00458738` | `process_initialize_related_state_lists` | Initializes reciprocal relation entries, updates item/type-presence bookkeeping, and appends related IDs plus an optional `AND` opcode. |
|
||
| `00458bfc` | `process_assert_flag_0800_clear_and_set_option_02` | Requires process flag `0x0800` to be clear, then sets state-byte bit `0x02`; used by process constructors. |
|
||
| `00458c2c` | `process_assert_flag_0002_clear_and_set_option_10` | Requires process flag `0x0002` to be clear, then sets state-byte bit `0x10`. |
|
||
| `00458c64` | `process_set_state_flag_08_and_increment_count` | Sets state-byte bit `0x08` and increments the global process-removal count; called by process-table removal. |
|
||
| `00458c70` | `process_release_state_arrays` | Releases the two dynamic arrays holding process state/relation entries. |
|
||
| `00458ca4` | `process_read_state_arrays` | Reads the process's two 16-bit state/relation arrays from a stream. |
|
||
| `00458cc0` | `process_write_state_arrays` | Writes the process's two state/relation buffers to a stream. |
|
||
| `00458cdc` | `process_construct_noop_base` | Calls the base initializer, installs the no-op callback vtable, clears callback data, and sets a base state bit. |
|
||
| `00458cfc` | `process_link_related_process_by_id` | Adds reciprocal relation entries between this process and the requested process using flags `0x1000` and `0x0800`. |
|
||
| `00458e5c` | `process_register_flag_40_state_guarded` | Checks shared-state guards, then registers the process for flag-`0x40` changes. Called during mouse-controller creation. |
|
||
| `00458ecc` | `process_register_flag_80_state_guarded` | Checks shared-state guards, then registers the process for flag-`0x80` changes. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Caller and decompiler readbacks confirmed the timer-manager path, the termination expression opcodes, reciprocal process-relation lists, and state-list flag operations. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Timer Setup, Overlay Streams, and Item Process Lists
|
||
|
||
This mixed slice follows the process-state helpers into timer callbacks, the static-overlay stream and palette path, rectangle clipping, and the process-pointer list used by item collision handling. Names stay at the observed operation level where field semantics are not established.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00458f3c` | `process_set_state_flag_01_guarded` | Checks shared-state guards before setting process state-byte bit `0x01`; called by shared-state and keyboard-process construction. |
|
||
| `00458f74` | `process_construct_timed_noop_variant` | Constructs a no-op process variant, sets its mode flag, and initializes timer state; reused by controller, cycle, animation, and other process constructors. |
|
||
| `00458fb0` | `process_read_state_arrays_and_reset_tick` | Restores the process state arrays and resets its millisecond tick baseline. |
|
||
| `00458fc8` | `process_timer_initialize_clock` | Converts the configured rate to a timer interval, stores the `timeGetTime` baseline, and installs the timer callback. |
|
||
| `00459038` | `process_timer_dispatch_interval_callback` | When the interval elapses, advances the baseline, sets the callback-in-progress bit, invokes the process callback, and clears the bit. |
|
||
| `00459094` | `process_register_state_flag_04_and_track_active` | Marks state-byte bit `0x04`, updates shared process-state bookkeeping, and records the process ID in a state list. |
|
||
| `004590b8` | `process_set_state_flag_2000_and_adjust_counts` | Sets state flag `0x2000` and conditionally transfers a count between global process-state counters. |
|
||
| `00459360` | `process_has_state_flag_0002` | Returns whether process state flag `0x0002` is set; called by `Process_Terminate`. |
|
||
| `00459410` | `static_overlay_clear_stream_handle` | Clears the static-overlay file-stream handle. |
|
||
| `00459418` | `static_overlay_close_stream` | Closes and releases the static-overlay stream object, then clears its handle. |
|
||
| `00459448` | `static_overlay_open_stream_and_read_header` | Opens the requested stream and reads its header and fixed-size metadata blocks; called by the AVI `.DAT` fallback and static-overlay initialization. |
|
||
| `004594c0` | `static_overlay_release_stream` | Closes and releases the static-overlay stream object through a second cleanup entrypoint. |
|
||
| `004594ec` | `static_overlay_consume_frame_payloads` | Seeks to the stored stream offset and consumes the configured number of frame payload blocks. |
|
||
| `00459568` | `static_overlay_palette_to_rgb24` | Converts 256 RGB6 palette entries into packed three-byte RGB values for the overlay. |
|
||
| `004595f0` | `rect_contains_point` | Tests a point against the rectangle's inclusive left, right, top, and bottom bounds. |
|
||
| `00459610` | `rect_intersect_in_place` | Tightens the rectangle bounds to their intersection with a second rectangle and clears the result if empty. |
|
||
| `004597a0` | `storage_data_process_construct` | Constructs process type `0x236`, associates its item ID, and initializes storage-data fields. |
|
||
| `004598cc` | `process_pointer_list_initialize` | Initializes an empty process-pointer list and allocates its backing array when capacity is nonzero. |
|
||
| `00459920` | `process_pointer_list_append` | Appends a process pointer, increments the list count, and stores the assigned index in the process. |
|
||
| `00459940` | `process_pointer_list_terminate_matching_items` | Scans process fields at offsets `+0x02` and `+0x34` for the requested item ID, unlinks matches, marks them for deletion, and invokes teardown callbacks. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Caller/readback checks confirmed the timer callback path, AVI/static-overlay stream use, RGB6 conversion, rectangle intersection, and item-process teardown. No executable bytes were changed and the Ghidra project was not saved.
|
||
## Address-Ordered Pass: Savegame UI and Shape Resource Cache
|
||
|
||
This slice finishes the item-process pointer-list helpers, follows the runtime savegame restore and slot-selector UI, then documents shape metadata and the static-resource cache paths used by viewport and item geometry routines.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004599e0` | `process_pointer_list_update_and_cleanup` | Dispatches each live list entry and unlinks/marks entries that become eligible for teardown; called by item collision processing. |
|
||
| `00459a48` | `process_pointer_list_release_storage` | Releases the pointer-list backing allocation when present; called at the end of item collision processing. |
|
||
| `00459a80` | `savegame_scan_slot_metadata_files` | Iterates 13 savegame slots, prepares each slot path, and reads fixed metadata for existing files. |
|
||
| `00459d28` | `game_runtime_restore_savegame_state` | On the savegame transition path, reads saved records and reinitializes input, audio, item-grid, Usecode, process, and viewport state. |
|
||
| `00459f3c` | `savegame_slot_get_metadata_buffer` | Returns the metadata buffer selected by the current slot index. |
|
||
| `00459f48` | `savegame_slot_set_metadata_text` | Copies supplied text into the metadata buffer selected by the current slot index. |
|
||
| `00459fa4` | `savegame_slot_selector_gump_construct` | Creates the slot-selector gump and 11 positioned row objects, loads its palette resource, and renders the UI. |
|
||
| `0045a570` | `savegame_slot_row_construct` | Constructs a row object with indexed-resource bounds and row-specific state; called by the slot-selector constructor. |
|
||
| `0045a8bc` | `savegame_slot_row_handle_event` | Handles row events, refreshes the slot text, and queues a selection event for a nonempty label. |
|
||
| `0045ab80` | `indexed_resource_child_construct` | Constructs an indexed-resource child object and initializes its bounds from the selected resource. |
|
||
| `0045acd0` | `build_length_prefixed_argument_descriptor` | Encodes variadic fields into a length-prefixed descriptor with a `$` terminator and a 31-byte limit; used by search-selector and snapshot paths. |
|
||
| `0045c3f8` | `shape_get_bounds_metadata` | Retrieves four shape bound/origin words from the cache or default record; called by item and projected-shape geometry checks. |
|
||
| `0045c450` | `shape_get_frame_resource_metadata` | Looks up shape/frame metadata and loads the entry when absent; called during visible-item animation updates. |
|
||
| `0045c4c4` | `shape_get_bounds_at_position` | Translates cached shape bounds to a rectangle at the supplied X/Y position; used by viewport render-node bounds updates. |
|
||
| `0045c55c` | `shape_resource_cache_insert_frame` | Creates a cache node, copies resource data through the cache interface, and links it into the shape entry. |
|
||
| `0045c660` | `shape_resource_cache_get_frame` | Retrieves the requested shape/frame entry and initializes its cached resource group on first access. |
|
||
| `0045c8b0` | `static_resource_cache_construct` | Constructs the static-resource cache manager, enumerates the static resource path, and initializes its streams and cache state. |
|
||
| `0045cc80` | `shape_resource_cache_get_frame_with_disk_fallback` | Retrieves a shape/frame entry, loading missing group data through resource streams before creating cache nodes. |
|
||
| `0045cff8` | `static_resource_cache_build_index` | Initializes the active cache context and walks 0x800 entries to build its resource index. |
|
||
| `0045d0f4` | `resource_cache_variant_construct_type_04` | Constructs resource-cache variant type `4`, installs its dispatch table, and registers cache slot 4. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses, with descriptive names and decompiler comments applied. Caller and decompiler readbacks confirmed the savegame restore/UI path, selector descriptor use, shape-bound consumers, and static-resource cache construction. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Static Swap Files, Snap-Egg Bounds, and Sound-FLX Cache
|
||
|
||
This continuation follows static-resource-cache construction into swap-file management, then documents the snap-egg process's tracked-item bounds and overlap selection, and the sound-FLX entry cache's LRU lifecycle.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0045d140` | `resource_cache_managers_initialize` | Allocates and constructs the global static-resource manager and type-4 cache variant; reports a fatal resource error if either allocation fails. |
|
||
| `0045d190` | `static_resource_cache_release` | Invokes the static-resource manager's virtual cleanup and clears its global pointer. |
|
||
| `0045d1b8` | `static_resource_cache_build_swap_file` | Opens or creates the static swap/index file, scans 0x800 resource records, writes selected indexed records, and updates progress output. Called by `static_resource_cache_construct`. |
|
||
| `0045d64c` | `static_resource_cache_finalize_or_rebuild` | Releases the active static-resource object and either rebuilds the index or removes/recreates the temporary file, according to cache-mode globals. |
|
||
| `0045da10` | `snap_egg_process_construct` | Constructs a process with its specialized vtable, stores it globally, and initializes its tracked-item list and active-bound fields. |
|
||
| `0045da80` | `snap_egg_process_reset` | Clears the process's tracked IDs, current bounds, and active-selection fields; called during runtime transition dispatch. |
|
||
| `0045db24` | `snap_egg_get_item_world_bounds` | Computes an item's four world-space rectangle coordinates from its X/Y position and auxiliary footprint fields; used by snap-egg overlap checks. |
|
||
| `0045dc10` | `snap_egg_process_add_item` | Adds an item ID once to the process list; a full 0x40-entry list reports `Too many snap eggs!`. Called when item flag `0x2000` is set. |
|
||
| `0045dcf8` | `snap_egg_process_remove_item` | Removes an item ID, clears associated active-selection state, and trims empty trailing list slots; called from item creation/finalization paths. |
|
||
| `0045ddb0` | `snap_egg_item_overlaps_active_bounds` | Tests the current item's rectangle against the active item's bounds and accepts a vertical difference within `0x30`. |
|
||
| `0045df10` | `snap_egg_process_update_active_bounds` | Searches tracked IDs for an item overlapping the current item, records the match and its bounds, then updates the projected viewport tile cache. |
|
||
| `0045e28c` | `snap_egg_process_draw_item_outlines` | Iterates nonzero tracked IDs and draws isometric outlines using the current item's auxiliary footprint and each tracked item's position. |
|
||
| `0045e488` | `audio_sound_flx_cache_initialize` | Allocates the sound-FLX data, index, and entry-list storage for the requested count; called by `audio_initialize_sound_flx`. |
|
||
| `0045e560` | `audio_sound_flx_cache_destroy` | Resets sound-FLX entries and frees the three backing allocations; called during audio resource cleanup. |
|
||
| `0045e584` | `audio_sound_flx_cache_set_stream_object` | Stores the stream/resource object used by sound-FLX cache reads; called during sound-FLX initialization. |
|
||
| `0045e58c` | `audio_sound_flx_cache_reset_entries` | Recreates per-entry cache nodes, frees old buffers, and resets entry indices. |
|
||
| `0045e6c0` | `audio_sound_flx_cache_get_entry` | Returns a cached sound-FLX entry or loads it on demand, evicting an LRU slot when needed and transforming bytes after its 20-byte header. |
|
||
| `0045ecf0` | `audio_sound_flx_cache_initialize_once` | When the audio cache feature is enabled, allocates its singleton object and initializes the 12 entry slots once. |
|
||
| `0045ed5c` | `audio_sound_flx_cache_shutdown` | Clears the initialization flag, releases cache entries, and frees the backing singleton; called during audio cleanup. |
|
||
| `0045ed80` | `audio_sound_flx_cache_clear_entries` | Invokes per-entry cleanup for the 12 cache slots and resets their object, index, and state fields. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses with descriptive names and decompiler comments. Caller checks confirmed the static-cache constructor path, item flag/list lifecycle, snap-egg runtime reset, and sound-FLX initialization/cleanup. Representative readbacks confirmed the names and comments. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Sound Channels and Spatial Event Records
|
||
|
||
This continuation maps the sound-FLX channel lifecycle and the 11-byte event records used by spatial item sounds. Names describe observed channel, cache-entry, and item-reference operations; the full record schema remains open.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0045ee9c` | `audio_sound_flx_start_or_update_channel` | Walks the 12 sound-FLX channels, obtains the requested cached entry, and configures the selected channel's buffer, volume, and playback state. Called by audio channel updates and item sound requests. |
|
||
| `0045f140` | `audio_sound_flx_start_playback` | Reuses a channel for the requested entry or delegates to channel setup; refreshes the audio object when the requested parameters differ. |
|
||
| `0045f204` | `audio_sound_flx_stop_playback` | Marks a matching channel for cleanup, stops its audio object, and resets its entry/playback fields; used by sound-ID stop handling. |
|
||
| `0045f310` | `audio_sound_flx_allocate_channel_slot` | Selects a free channel from the 8 normal or 4 reserved slots, advancing a replacement cursor and releasing a slot when its range is full. |
|
||
| `0045f418` | `audio_sound_flx_update_channels` | Updates all 12 channels from the sound cache and clears channels marked for release; called by event maintenance and item sound helpers. |
|
||
| `0045f468` | `audio_sound_flx_invalidate_entry_users` | Marks channels using an evicted cache entry for cleanup, stops their audio objects, and clears their entry IDs; called by cache eviction. |
|
||
| `0045f514` | `audio_sound_flx_set_channel_volume` | Multiplies a channel's stored volume by the global scale and applies it through the audio object. |
|
||
| `0045f5cc` | `audio_sound_flx_get_channel_state` | Returns a stored channel value only while its audio object is valid and not marked for cleanup; otherwise returns `-1`. |
|
||
| `0045f654` | `audio_sound_flx_find_channel_for_entry` | Finds an active channel by cache-entry index and returns its associated sound ID; used by initialization and stop paths. |
|
||
| `0045f698` | `audio_sound_flx_set_global_volume_scale` | Stores a global sound-volume scale and reapplies scaled volumes to active channels; called during runtime restore and key-command handling. |
|
||
| `0045f730` | `audio_sound_flx_get_global_volume_scale` | Returns the global sound-volume scale used by the channel volume updates. |
|
||
| `0045f80c` | `audio_sound_event_table_initialize` | Allocates the requested number of 11-byte sound-event records and initializes each sound ID to the unused sentinel; called by sound-FLX initialization. |
|
||
| `0045f8d0` | `audio_sound_event_table_release` | Releases the sound-event record array and clears its initialized flag; called by audio cleanup. |
|
||
| `0045f900` | `audio_sound_event_table_reset` | Resets each initialized event record's sound ID to the unused sentinel; called during process/runtime setup. |
|
||
| `0045fa18` | `audio_sound_find_available_event_slot` | Updates channels, reclaims event records whose playback is no longer active, and returns an available record offset. |
|
||
| `0045fa74` | `audio_sound_play_spatial_effect` | Creates an item-associated sound event and chooses attenuation from shape overlap or distance to the current view item; called through an item sound helper. |
|
||
| `0045fc28` | `audio_sound_play_or_refresh_spatial_loop` | Creates or refreshes a persistent spatial event, reusing an event for the same sound when possible and applying distance-based attenuation. |
|
||
| `0045fee0` | `audio_sound_play_item_effect_if_new` | Avoids duplicating an active event for the same item and sound, otherwise routes the request through spatial sound setup. |
|
||
| `0045ffb4` | `audio_sound_stop_item_effect` | Finds matching item/sound event records, stops their playback channels, and clears their record fields. |
|
||
| `00460044` | `audio_sound_clear_item_event_references` | Clears the item reference in matching sound-event records without stopping playback; called from item removal side effects. |
|
||
|
||
All 20 entries are listed at exact function-entry addresses with descriptive names and decompiler comments. Caller checks tied channel eviction to the sound cache, global volume updates to runtime restore/input, and event-table initialization/cleanup to the audio lifecycle; spatial event helpers are reached from item sound calls. Representative readbacks confirmed the channel and spatial-event behavior. No executable bytes were changed and the Ghidra project was not saved.
|
||
|
||
## Address-Ordered Pass: Sound Events and Sprite Manager
|
||
|
||
This pass completes the remaining sound-event maintenance helpers, then follows the 64-entry sprite table through lifecycle, frame/position updates, projected bounds, and dirty-region rendering.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0046009c` | `audio_sound_stop_all_events_for_item` | Scans event records for the supplied item ID, stops each associated playback, and marks the record unused; called from item finalization and the item-mode helper. |
|
||
| `004600f8` | `audio_sound_stop_persistent_events_for_item` | Stops matching item-associated events only when the record's persistent/loop flag is set; called from item removal side effects. |
|
||
| `00460164` | `audio_sound_is_item_effect_active` | Updates sound channels and checks for an active event matching both the supplied sound and item IDs; called through the item-mode helper. |
|
||
| `00460314` | `audio_sound_clear_event_by_channel_id` | Finds a sound-event record by its ID and clears its sound and item fields; called while allocating channel slots and invalidating users of an evicted cache entry. |
|
||
| `00460380` | `audio_sound_refresh_spatial_event_volumes` | Refreshes the final four spatial records, selecting volume from item-shape overlap or distance to the current view item; called during viewport tile-cache updates. |
|
||
| `00460520` | `sprite_manager_initialize` | Initializes a table of 64 19-byte sprite records and screen-region state; invoked from runtime setup. |
|
||
| `00460600` | `sprite_manager_shutdown` | Releases the sprite table, screen-region state, and optional dynamic list; invoked from runtime teardown. |
|
||
| `00460668` | `sprite_manager_add_shape_entry` | Adds a shape-backed record in the first free slot, initializes its frame and position, and marks it for redraw; callers include tracked-item marker repositioning and sprite-process paths. |
|
||
| `00460758` | `sprite_manager_remove_shape_entry` | Removes a record, invalidates its prior clipped bounds, clears its fields, and trims trailing unused slots; called by runtime mode changes and tracked-item marker updates/stops. |
|
||
| `00460878` | `sprite_manager_get_frame` | Returns the frame index stored in the selected sprite record; called by sprite-process helpers. |
|
||
| `00460898` | `sprite_manager_set_frame` | Stores a new frame, refreshes cached shape dimensions, and marks the affected screen region for redraw; called from sprite creation and processing paths. |
|
||
| `0046093c` | `sprite_manager_set_world_position` | Updates a record's world-position fields and marks its previous screen bounds dirty when they change; called by item-position and marker-update paths. |
|
||
| `004609e0` | `sprite_manager_get_world_position` | Copies a record's stored world-position components into caller outputs; called by sprite-process handling. |
|
||
| `00460a14` | `sprite_manager_get_screen_bounds` | Projects a record into screen space and returns its un-clipped rectangle; used by the render/update pass. |
|
||
| `00460ae8` | `sprite_manager_project_world_position` | Projects a record's world position to a screen point with its vertical offset applied; used by sprite-process rendering. |
|
||
| `00460b58` | `sprite_manager_get_clipped_screen_bounds` | Projects a record's bounds and clamps the rectangle to the 640-by-480 screen region; used when invalidating or changing a sprite. |
|
||
| `00460c7c` | `sprite_manager_render_and_update` | Rebuilds dirty screen regions, draws affected cached shape frames, and clears per-entry dirty flags; called by the viewport update path. |
|
||
| `00461180` | `screen_region_process_intersecting_rects` | Removes overlaps from a screen-region rectangle list and processes the remaining rectangles; called by screen-region update code. |
|
||
| `004611f4` | `sprite_manager_reset_entries` | Resets the live sprite count and clears active/position fields in all 64 records; called during runtime initialization. |
|
||
|
||
Caller checks and representative decompiler readbacks confirmed the sound-event/item relationships, sprite-table lifecycle, cached-frame updates, and dirty-region renderer. All 19 entries are documented at exact function-entry addresses with descriptive names and comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Sprite Processes and Position Queries
|
||
|
||
This continuation completes sprite-manager accessors and restore controls, documents sprite-process creation/animation, then follows the position-query process through motion setup, collision-checked steps, and related cursor-state helpers.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00461230` | `sprite_manager_get_position_component_a` | Returns the 16-bit sprite-record field at offset `+0x0a`; callers include keyboard-facing adjustment and a sprite-state helper. The component's exact axis remains unresolved. |
|
||
| `00461250` | `sprite_manager_get_packed_world_xy` | Returns the packed position word at `+0x0c`, which the sprite manager passes to isometric projection; callers include keyboard-facing adjustment and motion setup. |
|
||
| `00461270` | `sprite_manager_suppress_updates` | Sets the global flag that makes the sprite render/update pass skip its work; called by a runtime state helper. |
|
||
| `00461278` | `sprite_manager_resume_and_mark_all_dirty` | Clears the suppression flag and marks every live sprite record dirty; called during runtime transitions. |
|
||
| `004612d8` | `sprite_manager_restore_state_from_stream` | Clears temporary lists, reads a 16-bit array from the supplied stream, and marks live sprite records dirty; called from savegame restoration. |
|
||
| `0046159c` | `sprite_process_find_or_create_for_state` | Allocates a sprite process for the requested state; for selected states it checks existing sprite positions and reuses a nearby process before creating another. Callers include item-state, marker, audio-selector, position-state, and Usecode paths. |
|
||
| `00461880` | `sprite_process_construct` | Constructs process type `0x249`, installs its dispatch table, creates a sprite-manager entry, and initializes animation fields; called by the state-based creator. |
|
||
| `00461b50` | `sprite_process_run` | Advances animation counters at a tick-dependent rate, updates the displayed frame, schedules the next timer, and removes its sprite entry on completion. This is a virtual run method. |
|
||
| `00461c9c` | `sprite_manager_offset_world_position` | Reads the selected sprite's position fields, applies two supplied offsets, and writes the updated position; called by item-grid insertion. |
|
||
| `00461cfc` | `position_query_process_construct` | Constructs process type `0x250`, initializes collision-query state and position-search fields, and stores its query-state object; called by candidate construction. |
|
||
| `00461e30` | `position_query_process_set_position_snapshot` | Copies a five-byte position value into two process snapshots and stores the accompanying field; also initializes an additional snapshot word. |
|
||
| `00461e50` | `position_query_process_set_position_snapshot_variant` | Copies the same five-byte position value into both snapshots and stores the accompanying field, without the additional word initialized by the other variant. |
|
||
| `00461e68` | `position_query_process_configure_motion` | Derives target deltas and step rates from the requested mode/state, with bounded randomized offsets; called by the position-query candidate builder and thin wrappers. |
|
||
| `0046227c` | `position_query_process_configure_motion_from_args` | Adapts its arguments and forwards them to the shared motion configurator; called by the candidate builder. |
|
||
| `00462300` | `position_query_process_configure_motion_from_sprite` | Reads stored sprite-manager position fields and forwards them with supplied parameters to the motion configurator; called by the candidate builder. |
|
||
| `00462414` | `position_query_process_update` | Updates process state, handles item contacts, synchronizes its sprite entry, advances a mode-specific frame, and may request another sprite process. |
|
||
| `004624f0` | `position_query_process_step_toward_target` | Advances toward a target in collision-checked increments, dispatches resulting position state and sound, then terminates or removes the associated item; called by its process update path. |
|
||
| `004628c0` | `position_query_update_world_bounds_from_shape` | Decodes shape-related packed fields and tightens supplied world-bound components using the item's outermost X/Y coordinates; called by the collision-checked step. |
|
||
| `0046332c` | `cursor_state_disable_and_center` | Sets the cursor-mode state to zero and centers the cursor at horizontal coordinate `0x140`; reached from Usecode dispatch. |
|
||
| `00463350` | `cursor_state_enable_and_center` | Sets the cursor-mode state and six related flags, then centers the cursor at horizontal coordinate `0x140`; reached from Usecode dispatch. |
|
||
|
||
Caller checks and decompiler readbacks confirmed the sprite-process lifecycle, savegame restore path, position-query call chain, and cursor helpers. All 20 entries are listed at exact function-entry addresses with descriptive names and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Bottom Toolbar, AVI Text, and Process Timing
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00463390` | `bottom_toolbar_initialize` | Initializes five sprite-backed slots from a resource-ID table, spaces their bounds across the lower screen, and stores draw state. The direct caller lookup timed out; the matching five-slot state is consumed by the neighboring event and redraw helpers. |
|
||
| `00463520` | `bottom_toolbar_process_events` | Large event dispatcher; tests pointer input against the five stored rectangles, handles active-slot state, and dispatches selected UI/item actions. The exact user-facing meaning of each slot remains unresolved. |
|
||
| `00463c40` | `bottom_toolbar_redraw_dirty_slots` | Processes the stored rectangle for each dirty slot and clears its dirty flag when toolbar mode is active. |
|
||
| `00463cb0` | `bottom_toolbar_set_enabled` | Sets the toolbar state from the incoming boolean, marks all five slots dirty when enabled, and centers the cursor; called from two runtime helpers and a third unresolved entry. |
|
||
| `00463d0c` | `bottom_toolbar_enable_all_slots` | Enables toolbar mode, marks all five slots dirty, and centers the cursor; called by `game_runtime_transition_dispatch`. |
|
||
| `00463d4c` | `bottom_toolbar_disable` | Clears toolbar mode and centers the cursor; called by `game_runtime_transition_dispatch`. |
|
||
| `00463d70` | `bottom_toolbar_mark_slot_dirty` | Bounds-checks a slot index in the range 0-4 and marks that slot dirty; called by `item_shape_state_assign_linked_item`. |
|
||
| `00463dc0` | `avi_stream_file_buffer_init` | Clears stream fields, runs base initialization, then loads a requested file; called by `avi_player_find_video_or_resource_file`. |
|
||
| `00463e00` | `avi_stream_file_buffer_release` | Frees and clears the allocated stream-data pointer; called by AVI stream preparation and release paths. |
|
||
| `00463e1c` | `avi_stream_file_buffer_load` | Determines file size, allocates a buffer, reads the file through the stream helpers, and stores size and pointer; called by the initializer above. |
|
||
| `00463ed4` | `avi_player_get_next_status_record` | Returns the next 12-byte record and advances its index while records remain; called by `avi_player_update_status_text_overlay`. |
|
||
| `00463f08` | `avi_player_parse_text_records` | Walks buffered text records, locates `@` markers with DBCS-aware scanning, and fills per-record fields; called during AVI stream preparation. The text format's full semantics are unresolved. |
|
||
| `00463ff4` | `avi_player_find_next_text_record` | Finds a record boundary in the buffered text, advances across CR/LF and separators, and terminates parsed text in place; called by the parser above. |
|
||
| `004640b8` | `avi_player_find_record_marker` | Scans for `@` while skipping DBCS multibyte characters and returns the marker address; called by the AVI text parser. |
|
||
| `004641a0` | `file_stream_insert_at_offset` | Uses stream virtual methods to inspect/copy existing content, extend the stream, write bytes at the requested offset, and flush; called by an AVI-related helper. |
|
||
| `00464298` | `callback_noop_00464298` | Empty callback that immediately returns; referenced by an unresolved call site. |
|
||
| `0046429c` | `win32_shutdown_once` | Global guard ensures a registered shutdown callback runs once, then conditionally exits the Win32 message loop; called by fatal-report helpers and the main window procedure. |
|
||
| `004642f0` | `timer_process_construct` | Constructs a specialized process with type 4 and initializes its timer fields; called by `kernel_process_manager_initialize`. |
|
||
| `00464360` | `win32_delay_with_message_pump` | Pumps messages and callbacks until the multimedia timer advances by the requested number of 10 ms units; used by static-overlay loops and scripts. |
|
||
| `00464390` | `timer_process_accumulate_elapsed_ticks` | Accumulates elapsed 10 ms units and advances the process's previous timestamp; called by the process-manager loop and timer update helper. |
|
||
|
||
Caller checks and decompiler readbacks confirmed the AVI preparation/status-text paths, shutdown callback, process constructor, and timing helpers. Direct caller retrieval for the two larger toolbar routines timed out; their names are supported by the five-slot initialization, hit-testing, dirty-state, and cursor behavior in their decompilation/disassembly. All 20 entries are listed at exact function-entry addresses with descriptive names and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Mouse, Command Line, and Usecode Resources
|
||
|
||
This slice resumes at the next report-listed entry after the timer helpers. It covers small mouse/configuration utilities, Japanese command-line parsing, and resource-cache/process setup for Usecode event dispatch and the optional `-u` override.
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00465b88` | `usecode_opcode_table_get_9bit_field` | Extracts a 9-bit value from an indexed 9-byte table record; called by `usecode_opcode_dispatch`. The table field's higher-level meaning remains unresolved. |
|
||
| `00465bc0` | `filesystem_get_available_disk_space_bytes` | Multiplies the free-cluster count, sectors per cluster, and bytes per sector returned by `GetDiskFreeSpaceA`. |
|
||
| `00465c00` | `mouse_controller_initialize_global` | Creates the global mouse-controller object from its resource path, installs its dispatch table, and initializes dimensions to 320 by 200. |
|
||
| `00465c64` | `mouse_controller_update_pointer_region_state` | Translates cached pointer-region rectangles with controller dimensions and stores whether the supplied point lies in either region. |
|
||
| `00466068` | `process_construct_timed_state_flag_variant` | Builds on the timed no-op process constructor, initializes the process clock, registers state flag `0x04`, and sets another process flag. |
|
||
| `004660ac` | `Game_ViolenceEnabled` | Tests whether the configured `VIOLENCE` value contains `'1'` at offset 9; used by item-interaction and Usecode paths. |
|
||
| `004660bc` | `Game_CompileIs1` | Tests whether the configured `GAME_COMPILE` value contains `'1'` at offset `0x0d`; queried by Usecode opcode dispatch. |
|
||
| `004666d0` | `command_line_next_token` | Advances through the command-line buffer, skips classified separators, and returns the next token after terminating it in place; called by the Japanese argument parser. |
|
||
| `00466a1c` | `win32_game_initialize_command_line` | Initializes the Windows game object, sets the Japanese game-title prefix, dispatches Japanese command-line arguments, and invokes virtual cleanup; called from `win32_game_main`. |
|
||
| `00466c10` | `usecode_override_stream_open` | Constructs and opens the resource stream used by the optional Japanese Usecode override path; reports a fatal resource error if backing allocation fails. |
|
||
| `00466cf8` | `usecode_resource_stream_seek` | Seeks the Usecode resource stream to the requested offset and reports a fatal file error when the stream position is invalid. |
|
||
| `00466d30` | `usecode_resource_stream_read` | Forwards a requested byte count to the Usecode resource stream's read operation. |
|
||
| `00466d60` | `usecode_resource_cache_entry_initialize` | Initializes a resource-cache entry, allocates its backing data, stores size/resource metadata, and installs its release callback. |
|
||
| `00466de0` | `usecode_resource_cache_entry_release` | Releases a cache entry and its resource object, with additional cleanup selected by callback flags. |
|
||
| `00466e68` | `usecode_runtime_reset_state` | Resets the active Usecode runtime object and associated state; called during savegame restoration and startup initialization. |
|
||
| `00466ebc` | `startup_apply_u_override_if_present` | Applies the Japanese `-u` Usecode override when configured, loads its resource data, and rebuilds associated resource-index state. |
|
||
| `00467004` | `usecode_override_shutdown` | Releases the active Japanese Usecode override object, clears its global state, and performs shared runtime cleanup. |
|
||
| `00467060` | `usecode_get_item_event_selector` | Derives an item's Usecode event selector from its item flags, shape flags, shape-class state, or shape ID; called by event-selection helpers. |
|
||
| `004670b0` | `usecode_start_event_process_if_enabled` | Checks the item's derived selector against the enabled-event mask and creates a Usecode process when that event is enabled; called from item lifecycle paths. |
|
||
| `004671b0` | `UsecodeProcess_Create` | Constructs a Usecode process, initializes its program context/function data, and copies supplied argument bytes onto its stack. |
|
||
| `00467304` | `UsecodeProcess_Run` | Runs the next Usecode opcode, updates saved execution state on completion, and dispatches the process completion callback. |
|
||
| `00467360` | `UsecodeProcess_Callback_67360` | Releases the process state arrays and conditionally performs final cleanup when the process is not in its completed state. |
|
||
| `00467380` | `UsecodeProcess_Callback_67380` | Serializes process state arrays, execution offsets, function metadata, and associated data buffers to the save stream. |
|
||
| `00467448` | `UsecodeProcess_Callback_67448` | Restores serialized process state and data buffers, then reconnects the process to its active function/resource context. |
|
||
| `004676a0` | `usecode_resource_table_release_entries` | Releases both allocated arrays for each of the 128 Usecode resource-table entries, then clears the associated intrusive list. |
|
||
| `00467738` | `usecode_resource_table_find_or_select_slot` | Finds a resource-table entry by ID or selects and cleans a reusable slot, returning the selected slot through an output pointer. |
|
||
| `004678d4` | `usecode_resource_table_load_metadata` | Reads a resource-table entry header, allocates its metadata arrays, and initializes per-resource reference states. |
|
||
| `004679f0` | `usecode_resource_cache_acquire_resource` | Acquires a resource by table and index, loading and caching missing data, updating reference counts, and promoting cache nodes. |
|
||
| `00467d50` | `usecode_resource_cache_get_data_pointer` | Returns the data pointer from the cache entry acquired for the supplied resource table and index. |
|
||
| `00467d64` | `usecode_reference_table_decrement_refcount` | Decrements the selected resource reference count and reports an underflow. |
|
||
| `00467de8` | `usecode_resource_cache_release_if_unused` | Releases a cache node when its resource reference count reaches zero, updates cache accounting, and unlinks the node. |
|
||
| `00467ebc` | `usecode_resource_cache_release_matching` | Releases cache entries matching the requested table/resource selector, or drains entries when passed the all-entry sentinel. |
|
||
| `004680f0` | `UsecodeProcess_Callback_680F0` | Releases process-owned resource and dynamic-array state, with a separate teardown path selected by callback flags. |
|
||
| `004681f0` | `file_path_exists` | Returns whether `GetFileAttributesA` succeeds for the supplied path. |
|
||
| `00468208` | `random_range_inclusive` | Advances the shared linear-congruential random state and reduces its 16-bit value modulo the inclusive endpoint span. |
|
||
| `00468344` | `random_seed_initialize` | Initializes the shared random state from the supplied seed while forcing the low bit to one. |
|
||
| `00468354` | `random_next_modulo` | Advances the shared linear-congruential random state and returns its 16-bit value modulo the supplied nonzero bound. |
|
||
| `004683e4` | `surface_bitmap_buffer_initialize` | Initializes bitmap-buffer dimensions and row offsets, allocating backing storage or obtaining the DirectDraw surface pointer according to flags. |
|
||
| `00468510` | `surface_bitmap_buffer_release_resources` | Releases owned backing storage and row-offset data; flags select pointer-only clearing or preservation of externally managed storage. |
|
||
| `0046857c` | `surface_bitmap_buffer_release` | Thin cleanup wrapper that delegates bitmap-buffer release to the shared resource-release routine. |
|
||
| `00468588` | `surface_bitmap_buffer_copy_descriptor` | Releases the destination buffer's current resources, copies the supplied bitmap-buffer descriptor, and marks the copied buffer as externally managed. |
|
||
| `004685b8` | `surface_bitmap_buffer_get_pixel_address` | Computes a pixel address as the buffer base plus row times stride plus column. |
|
||
| `004685d4` | `surface_draw_line_bresenham` | Draws a clipped line between two coordinates using an integer Bresenham-style raster walk. |
|
||
| `00468964` | `surface_draw_horizontal_line` | Draws a horizontal span clipped to the bitmap-buffer bounds; an unsupported buffer mode takes the not-implemented error path. |
|
||
| `00468a78` | `surface_draw_rectangle_outline` | Draws a rectangle outline by composing clipped horizontal and vertical spans, defaulting zero bounds to the full buffer. |
|
||
| `00468c7c` | `surface_bitmap_buffer_copy_rect` | Copies a clipped rectangular pixel region between bitmap buffers, temporarily locking and unlocking a DirectDraw surface when its backing pointer is unavailable. Confirmed from disassembly after decompilation failed. |
|
||
| `004692e0` | `surface_draw_vertical_line` | Draws a clipped vertical span by writing the requested pixel value at each row using the buffer stride. |
|
||
| `00469338` | `surface_set_pixel` | Writes one pixel when its coordinates fall within the bitmap-buffer bounds. |
|
||
| `00469390` | `surface_blit_indexed_shape` | Blits a clipped indexed shape into the destination buffer, selecting the pixel-copy routine from the source encoding flag. |
|
||
| `00469488` | `surface_blit_indexed_shape_flipped` | Blits a clipped indexed shape with its source rows reversed horizontally, selecting the copy routine from the source encoding flag. |
|
||
| `00469598` | `render_flip_skip_translucent_not_implemented` | Reports the unsupported flipped skip-translucent draw mode through the fatal message-box path. |
|
||
| `004695a8` | `surface_blit_indexed_shape_with_pixel_effect` | Blits a clipped indexed shape through one of two pixel-effect routines selected by the source encoding flag. |
|
||
| `004696ac` | `render_flip_skip_transform_not_implemented` | Reports the unsupported flipped skip-transform draw mode through the fatal message-box path. |
|
||
| `004696bc` | `packed_shape_find_pixel_data_at_position` | Walks packed shape row data to locate source pixel data at a translated coordinate. |
|
||
| `0046974c` | `surface_blit_indexed_shape_with_mapping` | Blits a clipped indexed shape through one of two mapping/effect routines selected by the source encoding flag. |
|
||
| `00469850` | `surface_blit_shape_effect_mode_dispatch` | Dispatches the indexed-shape effect blit; the skip-translucent mode reports an unsupported-operation error. |
|
||
| `0046988c` | `surface_apply_yiq_palette_effect` | Transforms each buffer pixel using palette RGB-to-YIQ values, then releases the temporary palette buffer. |
|
||
| `004699fc` | `usecode_runtime_mode_flag_set` | Sets a shared runtime mode byte to one; its higher-level meaning is not yet established. |
|
||
| `00469a04` | `usecode_runtime_mode_flag_clear` | Clears the shared runtime mode byte; its higher-level meaning is not yet established. |
|
||
| `00469a10` | `usecode_process_create_special_type` | Allocates and initializes a process base object, then installs the derived process vtable at `004804e4`. |
|
||
|
||
## Address-Ordered Pass: Item Interactions and Selection
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00469a2c` | `usecode_runtime_flag_set_00495834` | Sets runtime byte `00495834`; called from Usecode opcode dispatch. |
|
||
| `00469a34` | `usecode_runtime_flag_clear_00495834` | Clears runtime byte `00495834`; called from Usecode opcode dispatch. |
|
||
| `00469a40` | `item_action_advance_shape_entry` | Resets the current item-action shape entry, updates its sprite state, and advances the active entry list. |
|
||
| `00469af8` | `input_state_clear_and_reset` | Clears pending input-state fields and invokes the shared input-event reset routine. |
|
||
| `00469b18` | `runtime_flag_00482698_is_clear` | Returns whether runtime byte `00482698` is zero; exposed through Usecode opcode dispatch. |
|
||
| `00469b28` | `gump_item_shape_is_eligible` | Checks shape/category-specific slot and state constraints before the caller adds an item through its gump flow. |
|
||
| `00469d50` | `item_shape_interaction_apply_state` | Dispatches shape-specific interaction logic, updating category-dependent item slots and counters; selected paths also remove an item or refresh its selection state. |
|
||
| `0046a5a8` | `item_record_cycle_field_15_slot` | Cycles item-record field 15 through slots 1-5, skipping empty slots, then refreshes the toolbar and related shape state. |
|
||
| `0046a714` | `item_record_cycle_field_19_slot` | Cycles item-record field 19 through slots `0x0b`-`0x18`, skipping empty slots, and marks the toolbar slot dirty. |
|
||
| `0046a780` | `usecode_runtime_flag_clear_00495837` | Clears runtime byte `00495837`; called from Usecode opcode dispatch. |
|
||
| `0046a78c` | `usecode_runtime_flag_get_00495837` | Returns runtime byte `00495837` to Usecode opcode dispatch. |
|
||
| `0046a794` | `usecode_runtime_flag_set_00495837` | Sets runtime byte `00495837`; called from Usecode opcode dispatch. |
|
||
| `0046a7f4` | `modal_ui_suspend_world_rendering` | Stops audio, disables toolbar updates, suppresses sprite updates, and redraws the pointer for modal UI. |
|
||
| `0046a864` | `modal_ui_resume_world_rendering` | Restores sprite and toolbar updates, redraws the pointer, and resets input state after modal UI. |
|
||
| `0046a8e4` | `runtime_transition_noop_stub` | Decompiles to an immediate return and is called during runtime transition dispatch; unreachable-block warnings leave its original intent unclear. |
|
||
| `0046a940` | `item_shape_filter_gump_create` | Creates linked resource record type `0x11e`, initializes its UI fields and surface-derived bounds, and configures its shape filter. |
|
||
| `0046dc44` | `viewport_select_spatial_item_node` | Picks a viewport spatial node at the supplied point; for node type 2, updates item-shape state and clicked coordinates. |
|
||
| `0046ddec` | `item_shape_selection_candidates_rebuild` | Scans item IDs below `0x2800`, filters candidates by flags, shape/category, height, and distance, sorts by distance, and updates the active sprite entry. |
|
||
| `0046e154` | `item_shape_selection_advance_candidate` | Advances through the current item-shape candidate list while updating the associated sprite-manager entry. |
|
||
| `0046e2a0` | `item_shape_selection_clear_candidate` | Clears the current candidate and advances the list, removing the sprite entry when the active list ends. |
|
||
|
||
## Address-Ordered Pass: Static Overlay and Usecode Values
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0046e384` | `sprite_manager_remove_shape_entry_if_active` | Calls sprite-manager shape-entry removal only when the global shape-entry index is active. |
|
||
| `0046e870` | `static_overlay_process_update` | Advances a static-overlay frame, updates and imports its palette, notifies matching processes, releases the stream, and renders the gump tree; selected modes delegate to a virtual handler. |
|
||
| `0046ed00` | `item_shape_selection_get_current_head` | Returns the first pointer-sized field from the supplied selection-list object; used as the initial candidate by the item-action path. |
|
||
| `0046ed3c` | `weapon_cache_load_records_for_type` | Loads the selected weapon-cache type from the static indexed resource, allocating cache buffers and reading records marked for caching. |
|
||
| `0046efb4` | `weapon_cache_get_shape_render_metadata` | Looks up cached shape render metadata and fills the caller's dimensions/offset outputs; reloads the cache when the active type changes and returns zeroed outputs for unsupported or absent entries. |
|
||
| `0046f0b0` | `weapon_cache_has_shape_records` | Ensures the selected weapon-cache type is loaded, then reports whether the requested shape slot has cached records. |
|
||
| `0046f0d4` | `weapon_cache_get_type_shape_value` | Finds the selected type in the weapon-cache table and returns its associated 16-bit shape value. |
|
||
| `0046f160` | `usecode_value_heap_initialize` | Allocates the Usecode value heap backing storage and installs its initial free-block metadata. |
|
||
| `0046f200` | `usecode_value_heap_shutdown` | Releases the backing storage for the Usecode value heap and clears its global base pointer. |
|
||
| `0046f220` | `usecode_value_heap_copy_string` | Allocates space in the Usecode value heap for a NUL-terminated string, copies it, and returns its heap offset. |
|
||
| `0046f274` | `usecode_value_heap_allocate` | Allocates a block from the Usecode value heap, splitting a larger free block when enough space remains. |
|
||
| `0046f394` | `usecode_value_heap_free_owner_values` | Releases Usecode heap values associated with the supplied owner ID by passing each matching allocation to `Usecode_FreeVal`. |
|
||
| `0046f3e8` | `Usecode_FreeVal` | Releases an allocated Usecode heap value and coalesces adjacent free blocks. |
|
||
| `0046f4d4` | `usecode_value_heap_reset` | Resets the Usecode value heap by replacing its backing allocation and restoring the empty-list sentinel. |
|
||
| `0046f588` | `Usecode_FreeList` | Traverses a Usecode value list and frees each value, including nested payload values when the list flag is set. |
|
||
| `0046f608` | `usecode_value_list_copy` | Copies a Usecode value list and duplicates each element's inline or string payload into the destination list. |
|
||
| `0046f79c` | `usecode_value_list_get_element` | Returns a pointer to the requested element's payload in a Usecode value list, or zero when the index is out of range. |
|
||
| `0046f850` | `usecode_value_list_append` | Appends a value offset to the end of a Usecode value list. |
|
||
| `0046f8c4` | `usecode_value_list_insert_sorted` | Inserts a value into a Usecode list in sorted order, comparing strings or value data according to the list type. |
|
||
| `0046faf0` | `usecode_value_list_remove_value` | Removes matching values from a Usecode list and releases their payload and heap allocations. |
|
||
|
||
Caller and decompiler readbacks confirmed the static indexed weapon-cache path, its viewport-bound metadata lookups, and Usecode heap/list operations used by opcode processing and runtime reset. All 20 entries have exact-address table rows and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
Caller and decompiler readbacks confirmed Usecode list membership/replacement helpers, the modal item-shape selection gump and event handler, selection limits and costs, and the indexed-shape row decoder variants used by the surface blitters. All 20 entries have exact-address table rows and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Usecode Lists and Item-Shape Selection
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0046fc84` | `usecode_value_list_contains_value` | Searches a Usecode value list for a matching value; string lists compare referenced strings, while other entries compare the stored value bytes. |
|
||
| `0046fd58` | `usecode_value_list_replace_element` | Replaces the zero-based list element with the supplied value, freeing the old string payload when applicable; returns zero if the index is out of range. |
|
||
| `0046fe18` | `usecode_value_list_set_heap_metadata` | Writes the supplied 16-bit value to the allocator header immediately before each list element and, for string lists, each referenced string block; header semantics are unresolved. |
|
||
| `0046fed0` | `item_shape_selection_show_modal` | Creates the item-shape selection gump when resource allocation succeeds, runs the event loop until it exits, invokes a virtual completion callback, and toggles the transition flag. |
|
||
| `0046ff30` | `item_shape_selection_gump_create` | Builds the item-shape selection gump and indexed-resource child controls, positions them relative to the screen, loads the requested record, queues setup, sets allowed shape IDs, and suspends modal world rendering. |
|
||
| `00470400` | `item_shape_gump_initialize_tag_groups_a` | Finds child controls with tags 2 through 8 and extends their state flags, adjusts the scale fields for tags 1 and 0, then renders the gump tree. |
|
||
| `004704b0` | `item_shape_gump_initialize_tag_groups_b` | Finds child controls with tags 1 and 0 and extends their state flags, adjusts scale fields for tags 2 through 7, renders the gump tree, and clears a state byte. |
|
||
| `00470994` | `item_shape_selection_load_record_by_index` | Loads the indexed fixed-size 0x142-byte selection record, clears type-specific fields for lower record classes, and advances the current cursor past entries with zero shape IDs. |
|
||
| `00470b50` | `flic_play_random_transition` | When the transition guard is clear, chooses a random FLIC path, runs it with the selected AVI profile, restores the palette and display region, and redraws the pointer. |
|
||
| `00470ee4` | `item_shape_selection_handle_input_action` | Dispatches item-shape selection UI actions 0 through 8, updating the current record and selection, handling navigation, and queuing follow-up events. |
|
||
| `0047155c` | `item_shape_selection_check_add_limit` | Counts existing selections of the requested shape, includes its item-slot/state cost when present, and checks the resulting count against a shape-class-specific limit. |
|
||
| `00471640` | `item_shape_selection_try_add_current` | Attempts to add the current shape to the selection: checks the remaining budget and gump eligibility, applies the per-shape limit, updates selection state, and removes the temporary item. |
|
||
| `00471748` | `item_shape_selection_clear_selected` | Clears selected shape state by restoring each selected item, refreshes the special shape 0x4ed state when present, then resets the selected count. |
|
||
| `00471914` | `item_shape_get_selection_cost` | Maps a shape record's class to a small selection-cost/category value; observed results include 3, 4, and 5, with 0 for unhandled classes. |
|
||
| `00471a44` | `surface_blit_indexed_shape_decode_rows` | Decodes one indexed-shape row stream into the destination surface using the supplied source and destination strides. |
|
||
| `00471aa2` | `surface_blit_indexed_shape_decode_rle_rows` | Decodes an indexed-shape row stream with literal and repeated-run forms into the destination surface. |
|
||
| `00471b27` | `surface_blit_indexed_shape_decode_rows_flipped` | Decodes an indexed-shape row stream into a horizontally reversed destination, as used by the flipped indexed-shape blitter. |
|
||
| `00471b8d` | `surface_blit_indexed_shape_decode_rle_rows_flipped` | Decodes an indexed-shape row stream with literal and repeated-run forms into a horizontally reversed destination. |
|
||
| `00471c20` | `surface_blit_indexed_shape_decode_rows_mapped` | Decodes indexed-shape rows into the destination while applying the supplied two-stage palette mapping to each output pixel. |
|
||
| `00471c99` | `surface_blit_indexed_shape_decode_rle_rows_mapped` | Decodes indexed-shape rows with literal and repeated-run forms while applying the supplied two-stage palette mapping to each output pixel. |
|
||
|
||
Caller and helper decompilations confirmed pixel-effect row decoding, resource-object cleanup, deferred tracked-resource callbacks, allocation retries, configuration parsing, and x87 range-reduction loops. All 20 entries have exact-address table rows and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Pixel Effects, Resource Memory, and Config Helpers
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00471d49` | `surface_blit_indexed_shape_decode_rows_pixel_effect` | Decodes indexed-shape rows and applies the supplied pixel-effect lookup to each destination pixel. |
|
||
| `00471db9` | `surface_blit_indexed_shape_decode_rle_rows_pixel_effect` | Decodes indexed-shape rows with literal and repeated-run forms, applying the supplied pixel-effect lookup to each destination pixel. |
|
||
| `00471ea4` | `resource_object_release_owned_allocation` | Releases the allocation associated with a non-null resource-object data pointer through the shared resource cleanup path. |
|
||
| `00471ec4` | `tracked_resource_release_thunk` | Thunk entry used by resource-object cleanup paths to reach `tracked_resource_release`. |
|
||
| `00471ec9` | `random_seed_get_pointer` | Returns the random-generator state pointer from a virtual method's state field. |
|
||
| `00471ed3` | `random_next_15bit` | Advances the generator state with the observed 0x41c64e6d/0x3039 recurrence and returns bits 16 through 30. |
|
||
| `00471f20` | `memory_fill_byte_value` | Fills the destination with the supplied byte value by replicating it across a word-sized fill operation. |
|
||
| `00471f38` | `tracked_resource_process_deferred_queue` | Drains the global deferred resource-callback queue, invokes each saved callback record, and unlinks the processed entry. |
|
||
| `00471fc0` | `tracked_resource_release` | Releases a tracked-resource allocation, updates the owning range metadata, and invokes the resource object's cleanup callbacks. |
|
||
| `00471fcc` | `tracked_resource_allocate_wait_thunk` | Thunk entry to the tracked-resource allocation retry routine. |
|
||
| `00471fd4` | `tracked_resource_allocate_with_retries` | Retries tracked-resource allocation, servicing configured frame-skip and callback hooks between attempts; a zero requested size is promoted to one. |
|
||
| `00472000` | `tracked_resource_allocate_retry_worker` | Allocation retry continuation that pumps the configured callbacks and frame-skip hook until allocation succeeds or no callback remains. |
|
||
| `00472033` | `string_format_into_buffer` | Formats the supplied text into the destination buffer through the shared output callback, then writes a terminating NUL. |
|
||
| `00472050` | `string_compare_lexicographic` | Compares two NUL-terminated strings lexicographically and returns zero on equality, otherwise a signed ordering result. |
|
||
| `0047211e` | `config_parse_value_using_pattern` | Parses the supplied configuration text with a fixed format pattern through the shared formatted-input parser. |
|
||
| `00472145` | `config_parse_value_string_method` | Configuration-value method wrapper that forwards its input string to `config_parse_value_using_pattern`. |
|
||
| `00472166` | `string_lowercase_ascii` | Converts ASCII uppercase letters in the NUL-terminated input string to lowercase in place. |
|
||
| `0047218c` | `float80_return_passthrough` | Returns the supplied extended-precision floating-point value unchanged through the hidden return-storage pointer. |
|
||
| `004721aa` | `x87_cosine_reduce_argument` | Executes x87 FCOS and repeats while the FPU range-reduction status bit remains set. |
|
||
| `004721b4` | `x87_sine_reduce_argument` | Executes x87 FSIN and repeats while the FPU range-reduction status bit remains set. |
|
||
|
||
Caller and decompiler/disassembly readbacks confirmed Usecode flag dispatch, input reset, modal UI suspend/resume, gump item eligibility, shape-specific item updates, viewport node selection, and distance-ordered item-shape candidates. All 20 entries have descriptive names and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
Caller and decompiler readbacks confirmed opcode dispatch, Japanese command-line parsing, override-stream operations, savegame/runtime reset, item-event process creation, resource-cache lifecycle, bitmap-buffer cleanup, clipped drawing, and indexed-shape rendering. The latest 60 entries are documented at exact function-entry addresses with descriptive names and comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Address-Ordered Pass: Timed Processes, String Tables, and Item Selection
|
||
## Address-Ordered Pass: Path, Heap, and File Runtime Helpers
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004721be` | `x87_wait_until_not_busy` | Polls x87 status bit 10 until clear, then returns the status word with AX. |
|
||
| `00472224` | `ascii_uppercase_char` | Converts one ASCII lowercase letter to uppercase; leaves other byte values unchanged. |
|
||
| `00472234` | `array_construct_elements_with_callback` | Initializes array-allocation metadata and invokes the element constructor callback once per requested element. |
|
||
| `0047227c` | `string_copy_dbcs_bounded` | Copies a bounded string/path component with DBCS-aware length handling and a terminating NUL. |
|
||
| `004722b2` | `path_split_drive_and_components` | Extracts an optional drive prefix and scans path separators and extension dots while respecting DBCS pairs. |
|
||
| `0047238b` | `string_find_last_character` | Scans through the string terminator and returns the last matching byte, or null when absent. |
|
||
| `004723a5` | `string_copy_with_zero_padding` | Copies up to the destination capacity and zero-fills the unused remainder. |
|
||
| `004723ef` | `uint_to_string_radix` | Converts an unsigned value to digits in a radix through 36 and writes them in forward order. |
|
||
| `00472439` | `int_to_string_radix` | Formats a signed value in the requested radix, adding a minus sign for negative base-10 values. |
|
||
| `00472454` | `memory_move_bytes` | Moves a byte range and copies backward when the higher-address destination overlaps the source. |
|
||
| `004724a1` | `heap_free_block_and_coalesce` | Selects the containing heap under lock, frees/coalesces the block, and refreshes cached free-block sizes. |
|
||
| `00472542` | `string_vformat_into_buffer` | Runs the custom varargs formatter through a buffer-writing callback and null-terminates the produced text. |
|
||
| `00472572` | `runtime_noop_callback` | Empty callback reached by the process-exit dispatch sequence. |
|
||
| `00472573` | `win32_process_exit_with_cleanup` | Runs configured shutdown callbacks and transfers control to the termination routine. |
|
||
| `0047258b` | `win32_process_exit_terminate` | Runs termination hooks and runtime cleanup, then exits through `ExitProcess`. |
|
||
| `004725b0` | `file_parse_open_mode_flags` | Parses `r`, `w`, or `a` mode strings and optional `+`, `b`, or `t` modifiers into access flags. |
|
||
| `00472681` | `file_object_open_with_mode_flags` | Opens the backing file using parsed flags and initializes or cleans up file-object state. |
|
||
| `00472745` | `file_object_open_with_mode_string` | Parses the mode string, obtains or reuses a file object, and opens the requested path. |
|
||
| `0047277e` | `file_object_open_mode_thunk` | Forwarding wrapper to the file-object mode-string opener. |
|
||
| `0047286a` | `file_stream_vformat_thunk` | Thunk to the formatted file-stream writer at `004755d9`. |
|
||
| `0047286f` | `resource_list_find_and_release_by_key` | Searches the global resource list by key, releases a matching entry, and returns -1 when no key matches. |
|
||
| `004728ae` | `resource_list_release_and_relink_entry` | Releases the matched resource object's state, then unlinks and relinks its list entry through the shared list helper. |
|
||
| `004728c3` | `hex_digit_to_lowercase_ascii` | Maps a hexadecimal nibble to its lowercase ASCII digit. |
|
||
| `004728cf` | `temporary_filename_build` | Builds a process-specific temporary filename in the observed `t..._....tmp` form. |
|
||
| `00472934` | `resource_object_release_owned_state` | Releases resource-object buffers and handles according to state flags, clears freed storage, and unregisters its runtime handle. |
|
||
| `00472a60` | `x87_log2_positive_input` | Computes x87 log2 for positive input; nonpositive or NaN input goes through the runtime domain-error helper. |
|
||
| `00472aa1` | `x87_log2_positive_input_thunk` | Forwarding thunk to the checked x87 log2 routine. |
|
||
| `00472ac1` | `audio_timing_log2_wrapper` | Audio timing callers forward an extended-precision value through the checked log2 routine. |
|
||
| `00472acd` | `string_uppercase_ascii` | Converts ASCII lowercase letters to uppercase in the input string in place. |
|
||
| `00472af2` | `string_to_signed_decimal` | Skips classified whitespace, accepts an optional sign, and accumulates decimal digits into a signed integer. |
|
||
| `00472b5f` | `local_time_to_timestamp` | Reads local calendar time, converts the populated time record to a timestamp, and stores an auxiliary result when requested. |
|
||
| `00472b8e` | `string_compare_case_insensitive_ascii` | Compares two NUL-terminated strings lexicographically after folding ASCII uppercase letters to lowercase. |
|
||
| `00472bd8` | `win32_runtime_fatal_error` | Triggers a debugger break when configured; otherwise writes the message, runs cleanup hooks, and exits with the supplied code. |
|
||
| `00472bf8` | `runtime_event_execute_nested_frame` | Pushes a temporary event/runtime frame, invokes the event interpreter, then restores the prior frame. |
|
||
| `00472c31` | `win32_runtime_get_current_thread_context` | Returns the current thread's runtime-context pointer captured during Win32 process initialization. |
|
||
| `00472c36` | `win32_process_exit_noop_callback` | Empty callback used by the process-exit dispatch path. |
|
||
| `00472c37` | `win32_handle_table_register_thunk` | Registers a Win32 handle in the runtime handle table and returns its slot index. |
|
||
| `00472c3c` | `win32_handle_table_unregister_thunk` | Clears a runtime handle-table slot by index. |
|
||
| `00472c41` | `win32_runtime_capture_process_context` | Captures environment strings, module path, command line, and GetVersion fields, then initializes per-thread runtime context. |
|
||
| `00472d68` | `win32_runtime_startup_initialize` | Captures process context, establishes exception-chain metadata, runs a startup callback, and invokes final runtime initialization. |
|
||
| `00472dd0` | `memory_fill_bytes` | Fills a byte range with a repeated byte value, handling destination alignment, dword stores, and trailing bytes. |
|
||
| `00472e07` | `memory_fill_dwords` | Writes a repeated 32-bit value using alignment handling and unrolled dword stores. |
|
||
| `00472e74` | `runtime_event_resolve_next_record` | Resolves the next runtime event record, follows conditional records, and routes invalid record types through the error path. |
|
||
| `00472ebe` | `runtime_event_call_if_flag_clear` | Tests event-state flags against a mask and invokes the record callback only when those bits are clear. |
|
||
| `00472f08` | `runtime_event_interpreter_execute` | Interprets runtime event records, dispatching callbacks and control records, including conditional flow and nested frames. |
|
||
| `00473038` | `runtime_event_interpreter_thunk` | Thunk forwarding to the event interpreter with the current register-provided context. |
|
||
| `00473042` | `runtime_event_run_global_sequence` | Runs the event interpreter against the global runtime sequence at `00495c80`. |
|
||
| `00473067` | `runtime_heap_allocate_with_retry` | Scans runtime heap regions and retries allocation after requesting additional storage; returns null when no region can satisfy the request. |
|
||
| `00473156` | `string_vformat_emit` | Custom variadic formatter that emits literal characters and converted arguments through an output callback. |
|
||
| `004734f5` | `format_spec_parse_width_precision` | Parses field width, optional precision, and length modifiers; width and precision may be supplied as arguments. |
|
||
| `00473633` | `format_spec_parse_flags` | Parses the `-`, `#`, `+`, space, and `0` conversion flags. |
|
||
| `00473692` | `format_count_narrow_string_limited` | Counts narrow-string characters up to NUL or the active field-width limit. |
|
||
| `004736b6` | `format_count_wide_string_limited` | Counts 16-bit string characters up to NUL or the active field-width limit. |
|
||
| `004736d9` | `format_integer_zero_padded_width` | Formats an integer in decimal and fills leading positions with zeroes to meet the requested width. |
|
||
| `00473737` | `format_fixed_point_decimal` | Formats a signed fixed-point value with the requested decimal precision and rounds the final fractional digit. |
|
||
| `0047382c` | `format_emit_character_callback` | Emits one character through the configured formatter output callback. |
|
||
| `00473833` | `format_emit_argument_conversion` | Fetches conversion arguments, applies parsed width/precision and flags, and dispatches supported conversions. |
|
||
| `00473d1c` | `string_copy_uppercase_ascii` | Copies a NUL-terminated string while converting each ASCII character to uppercase. |
|
||
| `00473d34` | `input_callback_read_character` | Invokes the input-stream callback at offset zero to fetch the next character. |
|
||
| `00473d3b` | `input_callback_unread_character` | Invokes the input-stream callback at offset four to return or unread the current character. |
|
||
| `00473d43` | `input_vformat_scan` | Shared callback-backed scanf-style parser; matches literals and whitespace, parses conversion specifications, and dispatches input conversions. |
|
||
| `00473f8a` | `input_scan_spec_parse` | Parses assignment suppression, field width, allocation and length flags, and the conversion length modifier. |
|
||
| `0047407f` | `input_scan_skip_whitespace` | Consumes classified whitespace through the input callback, leaving the first non-whitespace character unread. |
|
||
| `004740be` | `input_scan_read_character_field` | Reads a bounded character field and stores byte or wide-character values when assignment is enabled. |
|
||
| `00474153` | `input_scan_read_string_field` | Reads a width-limited string field until whitespace or input exhaustion and terminates an assigned result. |
|
||
| `00474276` | `input_scan_store_consumed_count` | Stores the number of input characters consumed through the next variadic destination. |
|
||
| `004742d4` | `input_scan_build_character_class_bitmap` | Builds a character-membership bitmap from the conversion class up to its closing bracket. |
|
||
| `00474317` | `input_scan_read_character_class` | Reads a bounded character-class field, supports initial negation, and NUL-terminates an assigned result. |
|
||
| `00474411` | `input_scan_read_float_field` | Collects a bounded signed decimal/fraction/exponent token, converts it, and stores the result using the requested width. |
|
||
| `00474728` | `input_scan_read_integer_field` | Parses a signed integer field, recognizes radix prefixes where applicable, and stores the result at the requested width. |
|
||
| `00474918` | `ascii_digit_to_hex_value` | Converts an ASCII decimal or hexadecimal digit to its value; returns 16 for bytes outside those ranges. |
|
||
| `0047493f` | `input_callback_read_with_width` | Reads one callback character while decrementing field width; returns -1 when width is exhausted or input ends. |
|
||
| `00474af1` | `runtime_context_frame_push` | Initializes a temporary runtime frame from the current context and invokes the frame setup helper. |
|
||
| `00474b21` | `dbcs_adjust_offset_to_character_boundary` | Adjusts a byte offset to a DBCS character boundary by walking character starts up to the requested address. |
|
||
| `00474b5f` | `dbcs_byte_length_for_character_count` | Measures the byte span of up to the requested number of DBCS characters. |
|
||
| `00474dee` | `string_copy_dbcs_bounded_dispatch` | Adjusts a bounded source span to a DBCS character boundary, then copies it with zero padding. |
|
||
| `00474e0d` | `string_copy_dbcs_with_zero_padding` | Copies with zero padding; in DBCS mode it preserves character pairs and avoids ending on a lead byte. |
|
||
| `00474ec1` | `dbcs_read_character` | Reads one string character as a byte or a two-byte DBCS value when the first byte is a lead byte. |
|
||
| `00474f7e` | `heap_region_allocate_block` | Finds a suitably aligned free block, splits it when possible, and updates runtime heap metadata. |
|
||
| `00475026` | `heap_region_free_block_and_coalesce` | Returns a block to the runtime heap, coalesces adjacent free blocks, and updates free-list counters. |
|
||
| `00475131` | `ascii_lowercase_char` | Converts one ASCII uppercase letter to lowercase; disassembly confirms the operation where decompiler output is empty. |
|
||
| `0047513f` | `runtime_context_set_error_code_0d` | Stores fixed runtime error code `0x0d` in the current thread context; higher-level meaning is unresolved. |
|
||
| `00475144` | `runtime_context_set_error_code` | Stores the supplied runtime error code at offset `+4` in the current thread context. |
|
||
| `00475152` | `runtime_context_set_error_code_0e` | Stores fixed runtime error code `0x0e` through the shared context setter. |
|
||
| `00475169` | `runtime_context_set_aux_error_value` | Stores the supplied auxiliary error value at offset `+8` in the current thread context. |
|
||
| `0047519b` | `win32_file_open_with_mode_flags` | Opens through `CreateFileA`, registers the resulting handle, and returns its runtime handle-table index. |
|
||
| `00475352` | `file_object_allocate_and_link` | Allocates and initializes a runtime file/object record, then links it into the active list. |
|
||
| `0047540a` | `runtime_object_release_to_free_pool` | Removes a matching runtime object from the active list, marks it released, and links it into the free pool. |
|
||
| `00475461` | `file_stream_update_buffer_cursor` | Repositions the buffered cursor when the offset is in range; otherwise resets it and signals an OS seek. |
|
||
| `004754a3` | `file_stream_seek` | Reconciles buffered state or flushes output before `SetFilePointer`; returns a failure sentinel on error. |
|
||
| `00475597` | `file_stream_initialize_mode_state` | Initializes file-stream state from its runtime descriptor and applies the observed mode-flag updates. |
|
||
| `004755d9` | `file_stream_vformat_write` | Formats variadic output through the stream callback, flushes when required, and restores status bits. |
|
||
| `0047566a` | `win32_get_current_process_id` | Wrapper for `GetCurrentProcessId`. |
|
||
| `00475674` | `file_stream_flush_buffer` | Writes pending stream data to the backing file, updates buffer state, and marks errors. |
|
||
| `0047575e` | `file_stream_get_position` | Gets the backing file position and adjusts it for buffered read/write offsets. |
|
||
| `004757af` | `win32_file_set_pointer` | Calls `SetFilePointer` for a registered handle and records the runtime error on failure. |
|
||
| `004757e9` | `win32_file_close_handle` | Closes a registered Win32 handle through the configured path and clears its runtime handle entry. |
|
||
| `00475858` | `win32_delete_file_a_thunk` | Calls `DeleteFileA` and records the Win32 error when deletion fails. |
|
||
| `0047594e` | `runtime_math_domain_error_dispatch` | Argument-forwarding wrapper to the math-error path, called by the checked x87 log2 routine. |
|
||
| `0047598a` | `local_time_record_read_system_time` | Reads `GetLocalTime` into the runtime calendar record and returns milliseconds. |
|
||
| `004759ef` | `local_time_record_to_timestamp` | Normalizes calendar fields, accounts for leap days and runtime timezone adjustments, and returns a timestamp or -1. |
|
||
| `00475b43` | `runtime_debug_break_if_enabled` | Executes an INT 3 breakpoint when the runtime debug-break flag is enabled; otherwise returns zero. |
|
||
| `00475b69` | `runtime_fatal_write_message_and_exit` | Writes the fatal message to the error-output handle, performs exception cleanup, and terminates the process. |
|
||
| `00475ba0` | `runtime_fatal_error_dispatch` | Attempts the configured debug break and otherwise routes to fatal output and process termination. |
|
||
| `00475be1` | `runtime_exception_dispatch_result_check` | Returns false for signal-dispatch status values 2 or 3 and true for other results. |
|
||
| `00475c16` | `runtime_exception_slots_are_idle` | Tests two thread-context exception status fields for values other than 2 and 3. |
|
||
| `00475c81` | `runtime_console_ctrl_handler_unregister` | Unregisters the installed console control handler and reports whether it is inactive. |
|
||
| `00475cbd` | `runtime_control_signal_dispatch` | Dispatches a control signal through the current thread's handler table and updates runtime state. |
|
||
| `00475cf6` | `runtime_thread_signal_handler_invoke` | Invokes the current thread's signal handler unless its slot contains a default/special sentinel. |
|
||
| `00475e22` | `runtime_thread_signal_table_initialize` | Copies global default signal-handler entries into the current thread's runtime context table. |
|
||
| `00475e4f` | `runtime_default_signal_handler_noop` | Empty default callback used as a runtime signal-handler target. |
|
||
| `00476220` | `win32_exception_handler_install` | Links a stack-based structured-exception frame into FS:[0] and assigns the runtime handler. |
|
||
| `0047625e` | `win32_exception_handler_remove` | Restores the prior FS:[0] frame, clears the context pointer, and resets idle signal/control state. |
|
||
| `004762ad` | `win32_handle_table_is_full` | Checks the registered-handle table capacity and searches for an empty slot. |
|
||
| `004762f2` | `win32_handle_table_register` | Registers a Win32 handle, expands the table when needed, and returns its slot index. |
|
||
| `00476407` | `win32_handle_table_unregister` | Clears an in-range handle-table slot. |
|
||
| `00476433` | `win32_standard_handle_table_initialize` | Initializes the handle table and registers standard input, output, and error handles. |
|
||
| `0047646a` | `win32_custom_handle_next_id` | Increments and returns the identifier used by the custom Win32 handle path. |
|
||
| `0047647d` | `win32_file_state_close_handles` | Closes the stored Win32 handle when present and clears associated object fields. |
|
||
| `00476530` | `runtime_recursive_mutex_acquire` | Lazily creates and acquires the mutex, records its owner thread, and increments the recursive lock count. |
|
||
| `00476592` | `runtime_recursive_mutex_release` | Decrements the recursive mutex count and releases the Win32 mutex when it reaches zero. |
|
||
| `004765d7` | `win32_runtime_thread_context_create` | Creates or initializes the current thread runtime context and records the current thread ID. |
|
||
| `00476616` | `win32_tls_alloc_with_win9x_guard` | Allocates a TLS index and, on Win9x, retries indices below 3 to avoid reserved slots. |
|
||
| `00476662` | `win32_runtime_thread_context_create_and_set_tls` | Creates and validates the current thread context, then stores it in the allocated TLS slot. |
|
||
| `004766af` | `win32_runtime_thread_context_destroy_current` | Releases the current thread's TLS context and optionally closes its associated Win32 handle. |
|
||
| `00476726` | `win32_runtime_support_initialize` | Initializes runtime callback pointers, the mutex, initial thread context, and context accessor. |
|
||
| `004768aa` | `runtime_strdup_with_retry` | Allocates space through the runtime heap retry helper and copies a string including its terminator. |
|
||
| `004768f0` | `runtime_startup_callback_dispatch` | Invokes pending startup callbacks by priority and marks each table entry complete. |
|
||
| `0047693b` | `runtime_process_exit_callback_dispatch` | Invokes eligible process-exit callbacks in priority order and marks each entry complete. |
|
||
| `0047698c` | `runtime_event_record_resolve` | Resolves runtime event-record size/position through a dispatch entry selected by record type. |
|
||
| `004769ba` | `runtime_event_cursor_initialize` | Initializes an event cursor from the supplied record/source and calls its type-specific setup routine. |
|
||
| `004769db` | `runtime_event_cursor_retreat` | Moves the runtime event cursor backward by one record-unit step. |
|
||
| `004769e0` | `runtime_event_cursor_find_predecessor` | Walks backward through event records, follows conditional branches, and returns a matching predecessor. |
|
||
| `00476a65` | `runtime_event_cursor_find_next_record` | Advances through event records, follows conditional branches, and routes unsupported types to the fatal path. |
|
||
| `00476af8` | `runtime_event_mark_frame_complete` | Marks the current event frame complete, sets its flag, and invokes its cleanup callback. |
|
||
| `00476b0f` | `runtime_event_stack_corruption_fatal` | Sets the stack-corruption diagnostic and enters the runtime event fatal-error path. |
|
||
| `00476be3` | `runtime_function_exception_specification_violation` | Sets the exception-specification violation diagnostic, dispatches a handler if present, then enters the fatal path. |
|
||
| `00476c1f` | `runtime_event_record_get_payload` | Returns the current event payload, skipping its leading tag byte for the tagged form. |
|
||
| `00476cd0` | `runtime_exception_event_action_interpret` | Interprets encoded exception/event actions, updates the active frame, and uses `RtlUnwind` as needed. |
|
||
| `0047738c` | `runtime_virtual_region_register` | Inserts a virtual region into an address-sorted doubly linked list and initializes its metadata. |
|
||
| `00477400` | `runtime_virtual_region_allocate` | Allocates and registers a page-backed virtual region, then initializes its metadata. |
|
||
| `00477490` | `runtime_heap_virtual_region_fallback` | Computes a rounded region size and attempts VirtualAlloc as a fallback for runtime heap allocation. |
|
||
| `004774a1` | `runtime_virtual_region_round_size` | Rounds a requested region size for metadata overhead, configured minimums, and page allocation. |
|
||
| `004774eb` | `runtime_allocation_failure_return_zero` | Returns zero as the allocation-failure fallback callback. |
|
||
| `004774ee` | `runtime_fatal_error_callback` | Forwards the runtime error state to the fatal-error dispatcher. |
|
||
| `00477525` | `runtime_uint_to_base_string` | Formats an unsigned integer as a NUL-terminated string in the selected radix. |
|
||
| `0047756f` | `runtime_signed_int_to_base_string` | Adds a minus sign for negative decimal values, then formats the integer in the selected radix. |
|
||
| `0047758a` | `runtime_decimal_to_float32_bits` | Converts the parsed decimal mantissa/exponent representation to IEEE-754 single-precision bits. |
|
||
| `004777d0` | `runtime_event_record_get_length` | Returns the payload length for an encoded event-record tag, routing invalid tags to the fatal path. |
|
||
| `00477814` | `runtime_context_exception_frame_link` | Links a runtime exception/context frame into the global frame chain and returns runtime state. |
|
||
| `0047783a` | `dbcs_decode_next_character` | Decodes the next character through the active multibyte lead-byte table and advances one or two bytes. |
|
||
| `0047793f` | `dbcs_previous_character_boundary` | Finds the previous character boundary, accounting for multibyte lead/trail-byte pairs. |
|
||
| `00477a31` | `win32_open_mode_to_access_flags` | Maps runtime open modes to Win32 generic read/write access and the associated share-mode value. |
|
||
| `00477a5d` | `win32_open_mode_to_creation_disposition` | Maps runtime open/create mode bits to the CreateFile creation-disposition value. |
|
||
| `00477a97` | `win32_last_error_set_runtime_status` | Stores a Win32 error in runtime context and maps it to a runtime error code. |
|
||
| `00477ae8` | `win32_last_error_to_runtime_status` | Reads GetLastError and forwards it to the runtime error-code mapping helper. |
|
||
| `00477af7` | `win32_handle_is_character_device` | Tests whether a registered Win32 handle is FILE_TYPE_CHAR and releases temporary handle access. |
|
||
| `00477b38` | `win32_handle_table_get` | Retrieves a registered handle and lazily records character-device state for standard handles. |
|
||
| `00477b8d` | `win32_handle_table_set_flags` | Updates the registered handle entry's runtime mode/status flags. |
|
||
| `00477ba2` | `win32_file_get_current_position` | Queries the file position with SetFilePointer(FILE_CURRENT) and records errors on failure. |
|
||
| `00477cbf` | `file_stream_write_character` | Writes one character to a buffered stream, handles newline translation, and flushes when stream flags or buffer capacity require it. |
|
||
| `00477d82` | `file_stream_initialize_buffer` | Selects a buffer size from stream mode flags and allocates or configures the stream buffer. |
|
||
| `00477df9` | `win32_file_write_buffer` | Writes pending bytes to a Win32 file handle, handles append mode, and maps short writes or API failures to runtime status. |
|
||
| `00477e9f` | `file_stream_flush_buffered_data` | Flushes buffered output or synchronizes the file position, then resets stream pointers and records errors. |
|
||
| `00477eaf` | `win32_delete_file_a` | Calls DeleteFileA and translates a Win32 failure into runtime error status. |
|
||
| `00477edd` | `runtime_thread_stack_update_and_measure` | Reads current-thread stack bounds, updates the tracked boundary when needed, and returns a stack-distance value. |
|
||
| `00477f0c` | `runtime_heap_initialize_region_size` | Sets the runtime region-size global to `0x8000` during startup. |
|
||
| `00477f18` | `runtime_math_fpu_control_dispatch` | Forwards a math/FPU control request to the floating-point status dispatcher. |
|
||
| `00477f22` | `runtime_fpu_apply_control_flags` | Maps floating-point exception/control bits to runtime categories and dispatches the resulting math status. |
|
||
| `00477ffd` | `runtime_is_leap_year` | Applies the Gregorian 4/100/400-year rule and returns whether the supplied year is a leap year. |
|
||
| `00478038` | `runtime_timezone_rule_day_of_year` | Converts a timezone transition-rule record to a zero-based day-of-year position, accounting for leap years and rule format. |
|
||
| `0047811d` | `runtime_timezone_transition_rule_compare` | Orders transition rules by year and then by their computed day-of-year positions. |
|
||
| `00478151` | `runtime_timezone_daylight_rule_active` | Tests a calendar record against the configured daylight-transition interval and stores the active-state result. |
|
||
| `00478414` | `runtime_calendar_fields_compare` | Compares calendar fields lexicographically in year, month, then day order. |
|
||
| `00478444` | `timestamp_to_calendar_record` | Applies a seconds offset to a timestamp and fills the calendar record's time, date, weekday, and year fields. |
|
||
| `004786d8` | `runtime_timezone_initialize` | Initializes timezone names, offsets, and transition rules from the runtime setting or Windows timezone data. |
|
||
| `00478721` | `runtime_parse_decimal_component` | Consumes consecutive decimal digits from the input and stores the resulting integer. |
|
||
| `00478745` | `runtime_timezone_parse_name_and_offset` | Parses a timezone name and signed hour/minute/second offset, returning the first unconsumed character. |
|
||
| `0047886e` | `runtime_timezone_parse_transition_rule` | Parses a POSIX transition rule in Julian-day or month/week/weekday form, including an optional transition time. |
|
||
| `00478a46` | `runtime_control_signal_fatal_callback` | Routes the fatal control-signal callback to the runtime fatal-error dispatcher with status `0xff`. |
|
||
| `00478b56` | `runtime_heap_reallocate` | Handles null/free cases, attempts an in-place resize, and falls back to allocate-copy-free when the block must move. |
|
||
| `00478bd0` | `win32_runtime_thread_context_get_or_create` | Ensures the current thread has a runtime context in TLS, routing initialization failure to the fatal path. |
|
||
| `00478c07` | `win32_runtime_thread_context_register_cleanup` | Allocates and links cleanup metadata for a newly created thread context, retaining its pointer and cleanup flag. |
|
||
| `00478c68` | `win32_runtime_thread_context_unregister_cleanup` | Removes the current thread context's cleanup record and releases its optional owned allocation. |
|
||
| `00478cdb` | `runtime_heap_allocate_zeroed` | Allocates the requested runtime heap size and zero-fills it when allocation succeeds. |
|
||
| `00478cf8` | `runtime_event_cursor_test_record_flag` | Tests an indexed event-record flag using the runtime bit-mask table. |
|
||
| `00478d18` | `runtime_unhandled_exception_handler_thunk` | Thunk to the unhandled-exception path, which invokes a configured handler or performs fatal cleanup and exits. |
|
||
| `00478ff0` | `runtime_noop_callback` | Empty callback that returns without changing state. |
|
||
| `00479012` | `runtime_heap_reclaim_matching_virtual_regions` | Scans virtual-region metadata and releases matching region records before another virtual allocation. |
|
||
| `00479026` | `runtime_virtual_region_release_memory` | Calls VirtualFree and updates allocator globals and stale path metadata after successful release. |
|
||
| `00479084` | `runtime_virtual_region_release_record` | Releases a region's memory, then unlinks its record from the allocator's doubly linked list. |
|
||
| `00479681` | `file_stream_flush_matching` | Flushes pending output buffers for registered streams whose mode/status flags match the supplied mask. |
|
||
| `004796c7` | `runtime_math_error_format_output` | Formats and emits the runtime math-error diagnostic through configured output callbacks. |
|
||
| `0047970f` | `runtime_math_error_dispatch` | Invokes the configured math-error handler or emits the diagnostic and stores the corresponding runtime error code. |
|
||
| `0047973e` | `runtime_environment_find_value` | Searches the runtime environment-string table for a named variable and returns the value after `=`. |
|
||
| `0047979f` | `runtime_heap_block_get_usable_size` | Returns the usable allocation size recorded in the heap block header, excluding allocator metadata. |
|
||
| `004797a8` | `runtime_heap_resize_block_locked` | Acquires the runtime heap lock, resizes a block in place, and releases the lock. |
|
||
| `004797e2` | `runtime_heap_resize_block_in_place` | Coalesces following free blocks when growing or splits excess space when shrinking a heap block. |
|
||
| `00479980` | `runtime_zero_result_callback` | Returns zero as a no-op/default result callback. |
|
||
| `0047998a` | `runtime_configured_callback_dispatch` | Invokes the callback currently stored in the runtime callback slot. |
|
||
| `00479991` | `runtime_callback_dispatch_return_value` | Invokes the callback stored in `PTR_runtime_zero_result_callback_0047c648`, returning its value through the call result registers. |
|
||
| `004799d8` | `runtime_unhandled_exception_dispatch` | Invokes a configured unhandled-exception handler when present; otherwise removes exception state, runs fatal cleanup, and exits the process. |
|
||
| `00479a0d` | `runtime_unhandled_exception_fatal_fallback` | Forwards the no-handler unhandled-exception path to the runtime fatal-error handler. |
|
||
| `00479a41` | `runtime_exception_specification_fatal_handler` | Routes an exception-specification violation to the runtime fatal-error handler with status 1. |
|
||
| `00479f8e` | `runtime_math_error_default_handler_thunk` | Thunk to the default runtime math-error handler at `0047abab`. |
|
||
| `00479f93` | `runtime_math_error_message_by_index` | Returns a 26-byte runtime math-error message record for indices 0-3; larger indices produce null/zero. |
|
||
| `00479fb2` | `file_stream_write_c_string` | Writes a NUL-terminated string to a runtime stream, initializing its buffer as needed and flushing when requested. |
|
||
| `0047a040` | `string_compare_case_insensitive_ascii` | Compares two strings with ASCII case folding, stopping at a mismatch, NUL, or the supplied length. |
|
||
| `0047a213` | `runtime_thread_exit_dispatch` | Dispatches configured thread-exit cleanup, removes exception-handler state, conditionally destroys the runtime thread context, then calls `ExitThread(0)`. |
|
||
| `0047a420` | `runtime_extended_float_classify_helper` | Processes extended-precision floating-point fields with exponent/significand checks and runtime tables; exact status-bit meanings remain unresolved. |
|
||
| `0047abab` | `runtime_math_error_default_handler` | Default runtime math-error callback; returns zero without side effects. |
|
||
| `0047ae48` | `ExitThread` | Win32 import thunk for `ExitThread`. |
|
||
| `0047ae4e` | `CreateThread` | Win32 import thunk for `CreateThread`. |
|
||
| `0047ae54` | `CreateEventA` | Win32 import thunk for `CreateEventA`. |
|
||
| `0047ae5a` | `GetCurrentThread` | Win32 import thunk for `GetCurrentThread`. |
|
||
| `0047ae60` | `SetEvent` | Win32 import thunk for `SetEvent`. |
|
||
| `0047ae66` | `VirtualFree` | Win32 import thunk for `VirtualFree`. |
|
||
| `0047ae6c` | `RtlUnwind` | Win32 import thunk for `RtlUnwind`. |
|
||
| `0047ae72` | `GetTimeZoneInformation` | Win32 import thunk for `GetTimeZoneInformation`. |
|
||
| `0047ae78` | `DeleteFileA` | Win32 import thunk for `DeleteFileA`. |
|
||
| `0047ae7e` | `GetFileType` | Win32 import thunk for `GetFileType`. |
|
||
| `0047ae84` | `GetLastError` | Win32 import thunk for `GetLastError`. |
|
||
| `0047ae8a` | `VirtualAlloc` | Win32 import thunk for `VirtualAlloc`. |
|
||
| `0047ae90` | `TlsFree` | Win32 import thunk for `TlsFree`. |
|
||
| `0047ae96` | `TlsSetValue` | Win32 import thunk for `TlsSetValue`. |
|
||
| `0047ae9c` | `TlsAlloc` | Win32 import thunk for `TlsAlloc`. |
|
||
| `0047aea2` | `TlsGetValue` | Win32 import thunk for `TlsGetValue`. |
|
||
| `0047aea8` | `ReleaseMutex` | Win32 import thunk for `ReleaseMutex`. |
|
||
| `0047aeae` | `WaitForSingleObject` | Win32 import thunk for `WaitForSingleObject`. |
|
||
| `0047aeb4` | `CreateMutexA` | Win32 import thunk for `CreateMutexA`. |
|
||
| `0047aeba` | `GetCurrentThreadId` | Win32 import thunk for `GetCurrentThreadId`. |
|
||
| `0047aec0` | `GetStdHandle` | Win32 import thunk for `GetStdHandle`. |
|
||
| `0047aee4` | `SetConsoleCtrlHandler` | Win32 import thunk for `SetConsoleCtrlHandler`. |
|
||
| `0047aeea` | `WriteFile` | Win32 import thunk for `WriteFile`. |
|
||
| `0047aef0` | `GetLocalTime` | Win32 import thunk for `GetLocalTime`. |
|
||
| `0047aef6` | `CloseHandle` | Win32 import thunk for `CloseHandle`. |
|
||
| `0047aefc` | `SetFilePointer` | Win32 import thunk for `SetFilePointer`. |
|
||
| `0047af02` | `GetCurrentProcessId` | Win32 import thunk for `GetCurrentProcessId`. |
|
||
| `0047af08` | `CreateFileA` | Win32 import thunk for `CreateFileA`. |
|
||
| `0047af14` | `GetModuleHandleA` | Win32 import thunk for `GetModuleHandleA`. |
|
||
| `0047af1a` | `GetVersion` | Win32 import thunk for `GetVersion`. |
|
||
| `0047af20` | `GetCommandLineA` | Win32 import thunk for `GetCommandLineA`. |
|
||
| `0047af26` | `GetModuleFileNameA` | Win32 import thunk for `GetModuleFileNameA`. |
|
||
| `0047af2c` | `GetEnvironmentStrings` | Win32 import thunk for `GetEnvironmentStrings`. |
|
||
| `0047af32` | `ExitProcess` | Win32 import thunk for `ExitProcess`. |
|
||
| `0047af56` | `WINNLSEnableIME` | Win32 import thunk for `WINNLSEnableIME`. |
|
||
| `0047af5c` | `DirectSoundCreate` | DirectSound import thunk for `DirectSoundCreate`. |
|
||
| 2026-10-12 | 1,486 / 1,493 (99.5%) | 7 (0.5%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the next 20 report-listed Win32 import thunks from `0047ae7e` through `0047af14`. |
|
||
|
||
Readbacks confirmed DBCS-aware path/file helpers and heap/exit paths in the first slice, resource and Win32 runtime helpers in the second, event interpretation, heap allocation, and custom formatting/input callbacks in the third, scanf-style conversions, DBCS string handling, runtime frames, and heap block management in the fourth, runtime error state, file streams, Win32 file operations, and local-time records in the fifth, timestamp conversion, runtime signal/exception handling, handle-table operations, and mutex acquisition in the sixth, TLS contexts, callback dispatch, event records, exception actions, and virtual-region tracking in the seventh, virtual-region allocation, numeric conversions, DBCS navigation, file-mode mapping, and Win32 handle operations in the eighth, buffered stream output, stack/FPU support, calendar conversion, and POSIX timezone parsing in the ninth, heap reallocation, thread-context cleanup, virtual-region management, environment parsing, and math-error reporting in the tenth, exception dispatch, case-insensitive comparison, floating-point helper logic, and Win32 import thunks in the eleventh, additional Win32 runtime API imports in the twelfth, and final Win32/DirectSound import thunks in the thirteenth. The float helper's exact status-bit meanings remain unresolved. All 247 entries in this section have descriptive names and decompiler comments. Ghidra edits remain pending; executable bytes were not changed and the project was not saved.
|
||
| 2026-10-12 | 1,493 / 1,493 (100.0%) | 0 (0.0%) | 336,693 / 499,712 (67.4%) | 399,698 / 499,712 (80.0%) | Added the final 7 report-listed imports from `0047af1a` through `0047af5c`; the exact-entry ledger now covers every executable function. |
|
||
|
||
## Address-Ordered Pass: Timed Processes, String Tables, and Item Selection
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004643cc` | `timer_process_accumulate_global_elapsed_ticks` | Updates the global timer object's accumulated elapsed value in 10 ms units and advances its last-sample timestamp. |
|
||
| `0046440c` | `timed_item_process_construct` | Constructs process type 10, associates the supplied item number, seeds its elapsed-time fields from the global timer, and initializes process flags. |
|
||
| `004644a0` | `timed_item_process_update` | Updates the global timer state, stores the elapsed value on this process, then invokes a timer-state helper. |
|
||
| `004646b0` | `string_table_construct` | Initializes the string-table object's vtables, counters, capacity, and entry-index array. |
|
||
| `00464840` | `string_table_load_from_stream` | Reads and terminates stream contents, allocates per-entry storage and an index array, then parses string records. Identifiers and record semantics are not fully recovered. |
|
||
| `00464b9c` | `string_table_clear_entries` | Frees each allocated entry, then releases the entry array and auxiliary buffer. |
|
||
| `00464c14` | `string_table_initialize_entries` | Reinitializes entry and index arrays for the supplied mode/count, initializes index order, and seeds records with the string `INVALID`. |
|
||
| `00464d48` | `string_table_write_selected_entries` | Builds an output buffer from selected entries and writes it at offset zero through `file_stream_insert_at_offset`. |
|
||
| `00464e60` | `string_table_sort_entries_by_key` | Compares entry strings and sorts by swapping entry pointers and their associated index values. |
|
||
| `00465120` | `text_overlay_construct` | Constructs a text-overlay object and uses the DBCS-aware multiline text-width helper to store measured dimensions and flags. |
|
||
| `00465300` | `tracked_item_id_set_initialize` | Allocates and zeroes a 100-element 16-bit item-ID array, resetting the tracked count. |
|
||
| `0046537c` | `tracked_item_id_set_release` | Frees the tracked-ID array and resets its capacity and count globals. |
|
||
| `004653ac` | `tracked_item_id_set_add` | Inserts the incoming ID in the first empty slot when capacity is available and increments the active count. |
|
||
| `0046540c` | `tracked_item_id_set_remove` | Finds the incoming ID, clears its slot, and decrements the active count. |
|
||
| `00465468` | `tracked_item_find_nearest_in_direction` | Searches tracked items in 8-way or 16-way direction, applies item/shape and overlap filters, and returns the nearest qualifying ID within the observed bound. |
|
||
| `004656dc` | `position_state_dispatch_for_nearby_items` | Begins a rectangular item query around the supplied position, filters results, and dispatches the requested position state for qualifying items. |
|
||
| `004658b8` | `tracked_item_id_set_save` | Writes tracked-ID capacity, active count, and the 16-bit ID array through the supplied stream object's write method. |
|
||
| `004659a0` | `resource_buffer_load` | Allocates a 0x4800-byte working area and initializes/loads resource-backed data through file/resource helpers. The resource's higher-level role remains unresolved. |
|
||
| `00465a68` | `resource_buffer_release` | Releases the object's working buffer and resource handle, clearing both fields. |
|
||
| `00465b54` | `fixed_record_copy_by_index` | Copies one fixed 9-byte record selected by index from the object's record array to the output buffer. |
|
||
|
||
Decompiler and disassembly readbacks confirmed the timer, string-table, tracked-ID, spatial-selection, and fixed-record operations. All 20 entries are listed at exact function-entry addresses with descriptive names and decompiler comments. Ghidra changes remain pending; no executable bytes were changed and the project was not saved.
|
||
|
||
## Verified Batch: Process Startup
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00429d44` | `init_scheduler_and_animation_processes` | High confidence. Called at `0046647c` in the startup initialization sequence. Lazily allocates the global scheduler and animation process objects using constructors that set process types `0x245` and `0x230`, respectively. |
|
||
|
||
## Verified Batch: Process Kernel
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00457740` | `Process_InitBase` | High confidence. Initializes common fields on a preallocated process object, installs the base vtable, assigns initial fields, inserts it into the kernel table, and runs a post-insert hook. Many specialized process constructors call it before replacing the vtable/type. |
|
||
| `0043cb64` | `kernel_process_table_insert` | High confidence. Finds an unused global process-table slot, expands/retries when needed, stores the process pointer and ID, and increments the live count. |
|
||
| `0043d450` | `kernel_process_find_first` | High confidence. Starts a stateful table iterator at slot 3 with process-type and item/selector filters, skips entries with flag bit 3 set, and returns the first match. |
|
||
| `0043d4e0` | `kernel_process_find_next` | High confidence. Continues the iterator with the stored filters and cursor, returning the next eligible process or null. |
|
||
| `0043c0a0` | `kernel_process_manager_initialize` | High confidence. One-time initialization allocates process-table arrays and creates core process instances, then clears the initialization guard. |
|
||
| `0043db84` | `kernel_process_table_allocate` | High confidence. Allocates the process-pointer table, per-slot state arrays, and process-filter bitmaps; asserts on required allocation failure. |
|
||
| `0043c110` | `kernel_process_manager_shutdown` | High confidence. Tears down eligible entries, performs a flagged-entry sweep, frees the table arrays and related buffers, and clears manager globals. |
|
||
| `0043d834` | `kernel_process_table_remove` | High confidence. Called by `Process_Terminate`; removes the specified slot, updates live/type counts, releases the object, and refreshes filter bits based on remaining processes. |
|
||
| `0043dd2c` | `kernel_process_shutdown_flagged_sweep` | High confidence for the observed filter only: during shutdown, processes with flag bit 1 set and bit 3 clear receive a virtual cleanup call and are released. The flag meanings are unknown. |
|
||
| `0043ddc0` | `kernel_process_prune_flagged_entries` | High confidence for the observed operation. Called during savegame-load reconstruction; if the pending-prune count is nonzero, frees entries from slot 3 onward with flag bit 3 set and decrements that count. |
|
||
| `0043e11c` | `kernel_process_manager_rebuild` | High confidence for the lifecycle role. Its only known caller is the savegame-load reconstruction path. It tears down eligible processes and manager buffers, allocates new tables, reconstructs process entries through virtual callbacks, then resets related event/input state. The saved-state format and individual callback contracts remain unresolved. |
|
||
| `0043c340` | `kernel_process_manager_update` | High confidence. Per-cycle process dispatch: visits eligible entries and calls their primary virtual callback, handles queued events, releases marked entries, updates the selected process-type state, and services timed records by enqueueing events and invoking callbacks. Individual flag semantics remain partly unresolved. |
|
||
| `0043efe0` | `kernel_process_manager_run_loop` | High confidence. The Win32 startup path calls this timed, non-returning loop. It samples the multimedia clock, invokes the process-manager update, optionally invokes a supplied callback, and updates elapsed-time state before repeating. |
|
||
| `0043fbb4` | `kernel_process_mark_item_id_presence` | High confidence. Sets the bit for a process-associated item ID in `DAT_0048432c`; called by `Process_SetItemNo`. |
|
||
| `0043fc10` | `kernel_process_refresh_item_id_presence` | High confidence. Scans for another live process using the item ID, excluding entries with flag bit 3 set, then sets or clears that item's presence bit. |
|
||
| `0043fd18` | `kernel_process_mark_item_type_presence` | High confidence. Sets the process-type bit in the per-item bitmap `DAT_00484330`; called for item-associated processes in the observed type range `0xf0`-`0xf7`. |
|
||
| `0043fd6c` | `kernel_process_refresh_item_type_presence` | High confidence. Scans for a live process matching both item ID and process type, excluding entries with flag bit 3 set, then updates the corresponding per-item type bit. |
|
||
| `0043fe50` | `kernel_process_item_type_present` | High confidence. Tests the per-item process-type bitmap `DAT_00484330` for a given item ID and process type; used by object-placement/selection checks. |
|
||
|
||
The function-boundary analyzer had split the timed loop: `0043efe0` held only its prologue while `0043f007` was incorrectly marked as a function entry at an internal loop target. The false entry was removed and the contiguous body was recreated as `kernel_process_manager_run_loop` (`0043efe0`-`0043f035`); instruction bytes were not changed.
|
||
|
||
These helpers establish a JP process table, first/next query API, per-cycle dispatcher, timed run loop, item-association presence indexes, and explicit manager initialization, shutdown, removal, pruning, and savegame-load rebuild paths. The process record layout and flag semantics are only partially recovered; names describe the observed operations, not higher-level process behavior.
|
||
|
||
## Verified Batch: Process Direction and Termination
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004538c0` | `process_update_direction_toward_target` | High confidence for the observed movement role. Reads the associated item's current X/Y through global item tables, delegates direction selection to `process_choose_direction_to_coords`, updates direction state, and dispatches vtable slot `+0x08` on arrival or terminal movement conditions. |
|
||
| `00453c64` | `process_choose_direction_to_coords` | High confidence for direction selection and the visible special paths. Tests candidate 8-way directions and updates direction/turn state; returns `0x10` under a packed-state condition. Its `0xff` path checks a process of type `0x259`, a nonzero record word at `+0x64`, item-bounds overlap, and a location test before calling `item_action_process_dispatch` with selector `0` and threshold `10000`, setting process byte `+0x7d` to 1, and updating bytes `+0x4a`/`+0x49`. Its `DebugBreak` sites are gated by `DAT_004955e8`. |
|
||
| `00453b10` | `process_pre_termination_update` | High confidence for observed operations, not the flag meanings. Clears bit `0x20` in a record byte at `+0x59`, then gates follow-up on fields `+0x47`, `+0x12`, `+0x49`, `+0x4a`, global `DAT_00482b78`, and associated-item/status checks. May call `item_action_process_dispatch` with selectors `0` or `4`. Called by both wrappers below. |
|
||
| `00453c3c` | `process_check_state_then_terminate` | High confidence for call order: runs `process_pre_termination_update`, then calls the existing `Process_Terminate` entry. |
|
||
| `00453c50` | `process_check_state_then_terminate_and_remove` | High confidence for call order: runs `process_pre_termination_update`, then calls `process_terminate_set_flag_20`, whose body reaches cleanup callbacks and `kernel_process_table_remove`. |
|
||
| `00458980` | `Process_Terminate` | Existing symbol. The entry clears bit `0x20` in byte `+0x14` before entering the shared cleanup path. Boundary ownership needs review: Ghidra reports a body spanning `00457ce5`-`00458b8b`, overlapping the preceding function range. |
|
||
| `00458990` | `process_terminate_set_flag_20` | Medium confidence as a separate entry. Sets bit `0x20` in byte `+0x14`, initializes `+0x10` from the second argument when unset, then reaches shared termination processing. Ghidra records a separate 16-byte body here while `Process_Terminate`'s reported body overlaps it; confirm the function boundary before treating these as independent complete routines. |
|
||
| `0040dfa0` | `process_set_byte_7d_one` | High confidence for the exact write. The sole observed caller is `process_choose_direction_to_coords`, which passes its process-object register; the helper writes `1` to byte `+0x7d`. The field's meaning is unresolved. |
|
||
| `00435148` | `item_shape_bounds_overlap_rect` | High confidence. Builds an item's shape bounds from position/shape data and tests them against the rectangle at `DAT_00495820`. Corrected the prototype from `void` to `bool` after confirming callers consume the low byte as a boolean. |
|
||
| `00459690` | `rectangles_overlap` | High confidence. Tests two axis-aligned four-short rectangles for inclusive overlap. Its three direct callers test the low byte as a boolean; the prototype is now `bool`. |
|
||
|
||
The `0xff` branch also compares the process field at `+0x02` with `DAT_0047b1d6`, calls `kernel_process_find_first` for type `0x259`, reads that record's `+0x64` word, and requires both `item_shape_bounds_overlap_rect` and `target_position_query_from_packed_records` to pass. Once these checks succeed it calls `item_action_process_dispatch` with selector `0` and threshold `10000`, sets byte `+0x7d` through `process_set_byte_7d_one`, then updates bytes `+0x4a` and `+0x49`. The exact role of `DAT_0047b1d6`, the type-`0x259` record, state bytes, and individual action selectors remains open. Function and prototype edits are pending in the live JP Ghidra project; executable bytes were not changed.
|
||
|
||
## Verified Batch: Position Queries and Distance Helpers
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00468288` | `max_axis_delta_3d` | High confidence. Returns the maximum absolute difference across three coordinate components. `0041bb7c` rounds this result upward in 16-unit steps and accepts values through `0x30`; other callers include attack and position-checking paths. |
|
||
| `004682ec` | `max_axis_delta_2d` | High confidence. Returns the maximum absolute difference across two coordinate components. Used by target-position logic including `0041b798`; it is an axis-max measure, not Euclidean distance. |
|
||
|
||
The two position-query routines now have operation-level Ghidra names and comments recording their caller sets and observed checks. `target_position_query_from_packed_records` walks nonempty packed records and tests candidate offsets; `target_position_query_within_axis_threshold` applies a mode-4 spatial query and 3D axis-distance threshold. Their packed-record fields, exact success criteria, and coordinate units remain unresolved.
|
||
|
||
## Verified Batch: Windows Keyboard/Event Input
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043f060` | `input_event_state_reset` | High confidence. Drains the pending 32-entry event ring, clears two 256-entry event tables and the ring records, resets input counters, then synchronizes the Caps Lock toggle through `GetKeyState(VK_CAPITAL)`. |
|
||
| `0043f334` | `input_keyboard_event_update` | High confidence. Called from Windows message-dispatch paths. Updates per-key press/timing state and modifiers, maps selected keypad/navigation keys, translates characters with `GetKeyboardState`/`ToAscii`, queues an event record, and dispatches eligible listeners. |
|
||
| `0043f7fc` | `input_keyboard_key_state_get` | High confidence for the read operation: returns a tracked 16-bit field from a two-dimensional key table. Gameplay and cancellation paths use it as a nonzero key-state check; the full index protocol remains unresolved. |
|
||
| `0043f9f4` | `kernel_process_dispatch_queued_events` | High confidence. Drains queued event records and sends them to registered process listeners matching the type filter, listener flag bit `0x10`, and process flag bit `0x100` clear. The meaning of the flags remains unknown. |
|
||
| `004403e4` | `keyboard_process_create` | High confidence. Creates the singleton keyboard process, installs `g_keyboardProcessFnPtrs`, sets process type `7`, and runs initialization helpers. Its sole known caller is `kernel_process_manager_initialize`. |
|
||
|
||
The paired sweep at `0043f190` also calls listener vtable method `+0x28`, but selects processes with flag bit `0x100` set. Its distinct listener group is not yet understood.
|
||
|
||
## Verified Batch: Windows Startup and Window Lifecycle
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `004729e0` | `entry` | PE entry point, confirmed by Ghidra's external-entry-point metadata. Its first instructions store `win32_game_main` (`00446250`) at `DAT_00495ccc` and jump to `0047585d`, where the runtime startup path eventually invokes the stored callback indirectly at `0047593c`. Ghidra currently includes that runtime path in an oversized `entry` body (`004729e0`-`0047594d`); `0047585d` is an internal label, not a separate defined function. |
|
||
| `00446250` | `win32_game_main` | High confidence. Installed as the startup callback by the PE entry routine. Checks joystick status, may show dialog resource `0x71`, stores the module instance, creates the main window, initializes DirectDraw/DirectSound, and enters the process-manager run loop. Startup parameter meanings remain partly unresolved. |
|
||
| `00445f40` | `win32_create_main_window` | High confidence. Registers `win32_main_window_proc`, creates a fullscreen popup titled `Crusader: No Remorse`, disables IME, and registers `MSWHEEL_ROLLMSG`. |
|
||
| `004459b0` | `video_init_directdraw_and_directsound` | High confidence. Creates DirectDraw, sets cooperative level and 640x480 display mode, creates the palette and primary surface, then initializes DirectSound. |
|
||
| `00445ba8` | `win32_main_window_proc` | High confidence for callback registration and message families. Handles `WM_DESTROY` resource release and quit posting, activation/device-state handling, keyboard input, mouse-event dispatch, and the registered mouse-wheel message. Ghidra currently models two register placeholders before the four stack callback arguments; the WNDPROC registration and `RET 0x10` establish the actual four-argument callback shape. |
|
||
| `004453d0` | `win32_shutdown_message_loop` | High confidence. Destroys the main window, then runs `GetMessageA`/`TranslateMessage`/`DispatchMessageA` until `WM_QUIT`, where it invokes the runtime shutdown path. This is a shutdown/close-path loop, not the steady-state game loop. |
|
||
|
||
The `WM_CLOSE` path reaches `0046429c`, whose callback/reentrancy contract is not yet clear. DirectX error helpers at `00445648` and `00445778` show recoverable versus fatal window/error handling, but remain unnamed until the error-string and restoration contracts are separated. These findings confirm native Windows lifecycle behavior; they do not establish a JP-versus-Western behavioral difference.
|
||
|
||
The verified startup call chain is `entry` (`004729e0`) -> runtime startup at internal label `0047585d` -> indirect callback through slot `00495ccc` to `win32_game_main` (`00446250`) -> `kernel_process_manager_run_loop` (`0043efe0`). Direct xrefs confirm the callback call at `0047593c` and the loop call at `004462f4`. During startup, `win32_game_main` calls `win32_create_main_window` (`00445f40`) at `004462a1` and `video_init_directdraw_and_directsound` (`004459b0`) at `004462b6`. The non-returning process loop repeatedly invokes `kernel_process_manager_update` (`0043c340`) at `0043effb`. All six defined functions in this chain already have descriptive Ghidra names; no rename was needed. Ghidra currently includes the runtime path in an oversized `entry` body (`004729e0`-`0047594d`); `0047585d` is an internal label, not a separate defined function.
|
||
|
||
## Verified Batch: Item State Lifecycle
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00438a30` | `item_property_arrays_allocate` | High confidence. Allocates the per-item arrays for x/y/z, shape, flags, linked-item ID, and other fields. Called by `FUN_00436dd0`, which initializes the item free list and ID ranges. |
|
||
| `00438c24` | `item_property_arrays_free` | High confidence. Releases and clears those arrays; called by `FUN_00436f80` during teardown. |
|
||
| `00438d58` | `item_record_from_property_arrays` | High confidence for direction and copied fields. Copies one item ID's x/y/z, shape, flags, linked-item ID, and related bytes/words into a 16-byte record. Some field meanings are still unknown. |
|
||
| `00438dec` | `item_property_arrays_from_record` | High confidence for direction and copied fields. Copies the record fields into the selected item's global property arrays and derives one extra byte from shape data when available. |
|
||
| `00431f2c` | `item_create_from_shape_id` | High confidence. For shape IDs below `0x800`, allocates a free item ID, writes the shape and shape-derived defaults, and reports success; invalid shape IDs clear the output ID and fail. Used by item wrappers, restore code, and the JP cheat handler. |
|
||
| `00438ec4` | `item_restore_core_record` | High confidence for observed behavior. Restores the reserved item ID `1` from the snapshot's core record while clearing flags and two extra fields. |
|
||
| `00438f44` | `item_restore_shape_record` | High confidence for observed behavior. Creates an item from the saved shape ID, then copies shape-derived fields into the item arrays. |
|
||
| `00429240` | `snapshot_item_state` | High confidence. Stores selected item records and linked-item search results in `DAT_00482678` before the item subsystem is torn down. |
|
||
| `00429428` | `restore_item_state` | High confidence. Rebuilds the selected items and global arrays from that buffer, then frees the snapshot. |
|
||
|
||
The transaction call sequence at `00429617` is `snapshot_item_state`, item-array teardown, subsystem reinitialization, then `restore_item_state` at `00429630`. The surrounding operation is not yet identified, so this is documented as item-state preservation across reinitialization rather than assumed to be a level transition. The 16-byte record's full schema and the linked-item selection criteria remain open.
|
||
|
||
## Verified Batch: Spatial Search
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00439420` | `search_selector_collect_rect_candidates` | High confidence. Traverses grid buckets and each bucket's linked item chain, appending IDs whose x/y coordinates are inside the inclusive rectangle to `DAT_00482b40`, then writes a zero terminator. |
|
||
| `0043b150` | `search_selector_begin_rect_query` | High confidence. Clamps/stores rectangle bounds, derives grid-cell bounds by shifting coordinates right 9 bits, invokes the collector, and initializes the selector cursor to the first candidate. Callers include `FUN_004129a0`, `FUN_0042a65c`, `FUN_00448174`, and `FUN_004656dc`. |
|
||
|
||
The adjacent selector scan routines apply exact-shape, shape-family, shape-set, two-shape, or bounds-only filtering while walking the same grid buckets and item linked lists. `search_selector_next_spatial_match` dispatches to those filters based on selector mode. This establishes a JP spatial-search implementation path, but not a difference from Western retail; the selector record layout and coordinate units still need cross-build comparison.
|
||
|
||
## Verified Batch: Direction Quantization
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043b328` | `direction_8way_from_delta` | High confidence. Classifies signed X/Y deltas into eight direction sectors encoded as even values `0..14`; returns `16` for a zero vector. Called by NPC adjacency logic and other movement/process paths. |
|
||
| `0043b414` | `direction_16way_from_delta` | High confidence. Classifies signed X/Y deltas into sixteen sectors encoded as `0..15`; returns `16` for a zero vector. Used by the wrapped-direction selector and other process/input paths. |
|
||
| `0043b270` | `choose_nearest_wrapped_direction` | High confidence. Uses the eight-way quantizer for period `8`, otherwise the sixteen-way quantizer, then chooses the closer of two candidate directions under modular wraparound. Callers include `AttackProcess_Run` and `FUN_0040ce6c`. |
|
||
|
||
`npc_process_check_target_adjacent` uses the eight-way result to compare the target's relative direction with adjacent direction values. The encoding and behavior are verified for JP; no Western direction mapping has yet been performed.
|
||
|
||
## Verified Batch: Joystick Input
|
||
|
||
| JP address | Ghidra name | Evidence and confidence |
|
||
|---|---|---|
|
||
| `0043b5f4` | `joystick_process_ensure_or_reset` | High confidence. When the joystick-enabled global is set, creates the process if absent or resets its timing/button state fields if present. Called during saved-state subsystem reconstruction. |
|
||
| `0043b644` | `JoystickProcess_0043b644` | Existing constructor symbol confirmed by decompilation. Installs `g_joystickProcessFnPtrs`, sets process type `0x262`, initializes its state, and stores the global process pointer. |
|
||
| `0043b6d8` | `joystick_get_direction_flags` | High confidence. Polls joystick 0, reads calibrated axis ranges, and returns four directional bits for positions in the outer thirds; returns `-1` on polling failure. Used by `JoystickProcess_Run` and startup input code. |
|
||
| `0043b7dc` | `JoystickProcess_Run` | High confidence for the input paths. Polls joystick 0 with `joyGetPosEx` and disables the joystick global on polling or direction-sampling failure. In the default mode, configured button masks in `0047b9b2` and `0047b9c0`-`0047b9cc` select action IDs; IDs 4-8 build callback records carrying `u/g/s/m/e`, while action 9 maps direction flags to `q/w/i/o`. Other gameplay paths dispatch direction/control records through vtable `+0x28`. When process byte `+0x62` bit 0 is set, directions map to `<`/`>` and buttons to Enter/Escape with timed repeat handling. The action names, config-table schema, and meaning of the mode bit remain unresolved. |
|
||
|
||
The adjacent startup routine `win32_game_main` at `00446250` also polls joystick direction, may set the enabled global or show a dialog, then creates the window and initializes DirectDraw/DirectSound. Its exact role within the wider startup call chain remains open.
|
||
|
||
## Verified Batch: Debug and Test Switches
|
||
|
||
| JP address | Switch/helper | Evidence and confidence |
|
||
|---|---|---|
|
||
| `00466774` | `handle_commandline_args_jp` | High confidence. The parser has a table-driven option list. `-debug` at `004811d2` selects the handler at `004668b4`, which prints `Debugging mode ON.`, writes `0x000a` to `DAT_00482620`, and sets bytes `DAT_004957d9` and `DAT_004957eb` to 1. |
|
||
| `00455eac` | `debug_mode_update_timeline_buffer` | High confidence for the buffer operation. Its caller checks `DAT_004957eb` before calling it. The helper builds and copies two 500-byte rows into a buffer reached through the object at `+0xfc` (base offset `+0x4ab78`), with marker values derived from object fields at `+0xeb`, `+0xef`, `+0xf3`, and `+0xf7`, scaled in 6000-unit steps. This confirms debug-gated timeline instrumentation; the meaning of each timestamp and how the buffer is presented remain unresolved. |
|
||
| `00466774` | `-laurie` special case | High confidence. Outside the option table, this token sets `g_wasLaurieSet` and `g_cheatsActive`, then prints `Cheats are active.` This is a separate cheat-enabling path, not evidence that the cheat strings belong to debug mode. |
|
||
| `00418454` | `key_check_jassica16_toggle_jp` | High confidence. The byte-by-byte key matcher uses the literal sequence `JASSICA16` at `0047b1cc`. On a full match it toggles `g_wasLaurieSet`, copies that state to `g_cheatsActive`, marks `DAT_00495838`, and displays the active/inactive cheat message. This and `-laurie` are two separate ways to set the cheat state. |
|
||
| `00415eec` | `key_handle_option_cheats_jp` | High confidence that it contains cheat-gated keyboard actions: it tests `g_cheatsActive`, has a `0x79` (`y`) path additionally gated by `DAT_0047bed4`, and emits `Immortality enabled.` / `Immortality disabled.` on separate branches. The full action mapping and exact trigger for the immortality toggle remain unresolved. |
|
||
| `004811f3` | `-warp N` | High confidence. Prints `Warping to mission %d.` and stores the selected mission index. `FUN_00428e00` resolves it through the base-map table at `0047b72c`, adds the `-mapoff` value, and follows the alternate map-start path. |
|
||
| `00481200` | `-mapoff N` | High confidence. Stores the parsed offset in `DAT_004957e8`; `FUN_00428e00` adds it to the selected mission's base-map value before starting that map. |
|
||
| `004811f9` | `-skill N` | High confidence for the data flow. Stores the parsed value in `DAT_0047bed0`; `FUN_00428e00` copies a positive value to `DAT_004955d7`. The game's skill encoding/range is not yet established. |
|
||
| `00481208` | `-egg N` | High confidence for the data flow. Stores and prints the destination value in `DAT_0047bed2`; the map-start path passes it to `FUN_00424764`, which creates a process of type `0xf0`. If no value is supplied, that path uses `0x1e`. The process's exact destination semantics remain unresolved. |
|
||
| `0048120d` | `-demo` | High confidence that this selects a distinct startup path: prints `Demo mode.` and sets `DAT_004957ea`. With no explicit `-warp`, `FUN_00428e00` clears `DAT_004823c0`/`DAT_004823c2` and repeatedly calls `FUN_00456d90` until the high word of `DAT_004823c2` becomes nonzero, instead of calling it once. The higher-level demo behavior is unresolved. |
|
||
| `004811cc`-`004811eb` | `-?`, `-u`, `-setver`, `-vesatest`, `-asylum` | The `-?` and `-u` handlers have not been traced. The observed switch targets for `-setver`, `-vesatest`, and `-asylum` return to the parser loop without a distinct handler in this build. |
|
||
|
||
The timeline caller at `00455bb6` lies in an unrecognized function region around `00455ae4`-`00455ce4`; boundary analysis did not establish a reliable function entry, so it remains unnamed. The `DebugBreak` string at `00496734` is in `.idata` and has no reported data uses; it does not establish an active breakpoint feature. No executable bytes were changed, and Ghidra changes remain unsaved.
|
||
|
||
## Examined Functions With Unresolved Semantics
|
||
|
||
The functions previously listed as unnamed now have operation-level Ghidra names and evidence-backed comments. The addresses remain here as tracking anchors; unresolved rows identify the higher-level contracts that still need investigation.
|
||
|
||
| JP address | Current Ghidra name | Observed behavior | Remaining uncertainty |
|
||
|---|---|---|---|
|
||
| `004059f0` | `memory_fill_buffer_with_zero` | Calls the repeated-byte memory-fill path with fill value zero; the keyed-cache loader is its only observed caller. | The exact buffer role and size contract remain unresolved. |
|
||
| `00405a10` | `item_action_repeat_for_direction_delta` | Computes the shortest wrapped difference over low-nibble direction values and repeats `item_action_process_dispatch(10000, mode, 0)` according to the difference. | Mode selection and incoming direction-field meanings remain unresolved. |
|
||
| `00405c4c` | `audio_play_sound_for_selector` | Maps an incoming mode through fixed/table-driven values, calls `0046159c(3, ...)`, and conditionally updates audio state. | Selector, table, and shared-helper semantics remain unresolved. |
|
||
| `00405ea8` | `controller_send_event_20_if_query_false` | When the query returns zero, sets `DAT_004822bd` and calls controller vtable slot `+0x28` with event `0x20`. | Controller event and global-state meanings remain unresolved. |
|
||
| `004060e8` | `item_state_dispatch_mode_one` | Wrapper around `item_state_update_and_dispatch` with a fixed mode. | Owning object fields and resulting gameplay action remain unresolved. |
|
||
| `00406100` | `item_state_update_and_dispatch` | Changes state bits, selects table-derived values, and calls shared action/spatial-query helpers. | The owning object fields and action semantics remain unresolved. |
|
||
| `00406378` | `packed_state_update_from_query_results` | Updates packed fields at `DAT_004957ac+0x1beb` from helper values around a spatial query. | Packed-record schema and query purpose remain unresolved. |
|
||
| `004071a0` | `item_action_resolve_position_and_autofirer` | Checks object/type state, handles an AutoFirer-specific branch, then queries position through `0041b208`. | Selector and event meanings remain unresolved. |
|
||
| `004076b0` | `item_process_probe_positions_and_update` | Constructs type-selected temporary processes, probes directional candidates, records process state at `+0x34`, then updates keyed-cache/item state. | Candidate geometry, record contract, and higher-level action remain unresolved. |
|
||
| `00407500` | `keyed_entry_cache_key_is_available` | Checks whether a 16-bit key can be resolved through `004262f8`. | The resource represented by the key remains unresolved. |
|
||
| `00405f18` | `keyed_cache_find_record_with_packed_fields` | Searches ten-slot table entries for a packed record with nonzero fields and returns matching offsets. | Record schema and exact spatial/shape operation remain unresolved. |
|
||
| `00406018` | `keyed_cache_get_record_with_packed_fields` | Returns scratch/record data associated with the packed-field lookup. | Record schema and caller-facing contract remain unresolved. |
|
||
| `0041bf9c` | `item_state_map_context_and_selector` | Maps context/selectors through tables near `0047b20c`/`0047b260`, with item/state checks for selectors `8` and `0x2a`. | Returned values and selector meanings remain unresolved. |
|
||
| `00429d2c` | `animation_process_set_flag_52` | Sets byte `+0x52` on the incoming animation-process object. | The flag meaning and owning call-path contract remain unresolved. |
|
||
| `00429e70` | `static_resource_create_registered_object` | Resolves resource `"static"`, creates/registers an associated object, and installs a function table. | The concrete object role remains unresolved. |
|
||
| `00429ea8` | `static_resource_load_and_initialize` | Initializes static-resource object state, obtains/caches a handle, and conditionally creates the registered object. | Resource/object ownership remains unresolved. |
|
||
| `0043d2c4` | `process_table_dispatch_flagged_callbacks` | Sweeps the process table and conditionally invokes virtual methods `+0x0c` and `+0x28` based on flags. | Callback contracts and lifecycle purpose remain unresolved. |
|
||
| `0043d574` | `process_table_find_by_id_and_type` | Finds a process entry matching object ID/type under flag checks and updates the search cursor. | Selected process role remains unresolved. |
|
||
| `0043d640` | `process_table_find_related_by_id_and_type` | Searches for a same-ID/type process whose relation list contains the current slot. | Relation-list semantics remain unresolved. |
|
||
| `0043d754` | `process_manager_get_cursor_slot_if_eligible` | Returns the current cursor slot only when in range, non-null, and eligible. | Cursor ownership and caller intent remain unresolved. |
|
||
| `0043d7a4` | `process_activate_and_link_related_processes` | Registers a process relationship, searches related entries, and updates relation-list state. | Link and activation semantics remain unresolved. |
|
||
| `00458b8c` | `process_activation_register_and_link` | Marks the process active, copies its type, and links related processes unless flag `0x1000` is set. | Activation/link contract remains unresolved. |
|
||
| `0043db10` | `process_initialization_mark_flag_40` | During manager initialization, sets process flag bit 6 when its slot exceeds `DAT_0048433a`. | Initialization flag meaning remains unresolved. |
|
||
| `0043db58` | `process_table_stage_pending_insert_id` | Asserts `DAT_00484306` is clear and stores the incoming 16-bit value for later process-table insertion. | Staged value meaning remains unresolved. |
|
||
| `0043ed80` | `process_dispatch_registered_window_callbacks` | Traverses registered startup/window entries and invokes `00459038` after process/type checks. | Callback and event-entry semantics remain unresolved. |
|
||
| `0043eed0` | `process_terminate_update_tracking_state` | During termination, updates shared counters/state and removes the process slot ID from a short-ID list. | Counter and list meanings remain unresolved. |
|
||
| `0044dc9c` | `item_action_process_dispatch` | Dispatches item actions to action-specific process constructors and updates tracked-item/AutoFirer state. | Individual selector meanings remain unresolved. |
|
||
| `0041b798` | `target_position_query_from_packed_records` | Scans nonempty packed records, derives candidate offsets, then checks occupancy and shape queries; several callers consume its low return word as boolean. | Packed fields, exact success criteria, and the `+0x64` input record meaning remain unresolved. |
|
||
| `0041bb7c` | `target_position_query_within_axis_threshold` | Forms target-relative coordinates, issues a mode-4 spatial query, then tests rounded-up 3D axis distance against `0x31` steps. | Coordinate units and threshold semantics remain unresolved. |
|
||
| `0043f038` | `process_manager_restore_saved_global_84314` | Restores `DAT_00484314` from saved byte `DAT_00484337` when nonzero. | Higher-level state meaning remains unresolved. |
|
||
| `0043f04c` | `process_manager_save_and_clear_global_84314` | Copies `DAT_00484314` to `DAT_00484337` and clears the original global. | Higher-level state meaning remains unresolved. |
|
||
| `0043f190` | `process_dispatch_flag_10_listeners` | Invokes vtable method `+0x28` when listener bit `0x10` and process bit `0x100` are both set. | Listener-group distinction remains unresolved. |
|
||
| `00440354` | `input_record_test_low_bits_at_offset_2` | Tests whether either low-order bit is set in the byte at input-record offset `+2`. | Record ownership and mode meanings remain unresolved. |
|
||
| `0044035c` | `input_record_test_flag_bit_3` | Tests bit 3 of the high word in the incoming dword. | Field ownership and flag meaning remain unresolved. |
|
||
| `00440368` | `input_record_test_flag_bit_2` | Tests bit 2 of the high word in the incoming dword. | Field ownership and flag meaning remain unresolved. |
|
||
| `00440374` | `stack_list_contains_byte_value_until_fe` | Searches a stack-provided list for a byte value until sentinel `0xfe`. | List schema remains unresolved. |
|
||
| `004405c8` | `modal_dialog_run` | Sets up a modal context, constructs the dialog, runs the dispatcher until completion, and tears down the context. | Dialog purpose remains unresolved. |
|
||
| `00440600` | `modal_dialog_construct_controls` | Constructs a vtable-backed dialog/process, derives bounds from `DAT_00495824`, and creates positioned child controls. | Dialog purpose and control labels remain unresolved. |
|
||
| `0043fe80` | `process_broadcast_to_flag_40_listeners` | Under a reentrancy guard, broadcasts event/payload values to processes with listener bit `0x40`. | Observed event IDs `1`, `4`, `8`, and `0x10` remain uninterpreted. |
|
||
| `0043f8f4` | `process_register_flag_80_state` | Sets process bit `0x80`, increments `DAT_0048433c`, and adds its ID to a unique short-ID list. | Higher-level process state remains unresolved. |
|
||
| `0043f97c` | `process_unregister_flag_80_state` | Clears process bit `0x80`, decrements `DAT_0048433c`, and removes its ID during termination. | Higher-level process state remains unresolved. |
|
||
| `0043ff9c` | `process_register_flag_40_state` | Sets process bit `0x40`, increments `DAT_0048437a`, and adds its ID to a unique short-ID list. | Higher-level process state remains unresolved. |
|
||
| `00440024` | `process_unregister_flag_40_state` | Clears process bit `0x40`, decrements `DAT_0048437a`, and removes its ID during termination. | Higher-level process state remains unresolved. |
|
||
| `00431148` | `process_state_list_add_unique_id` | Returns an existing ID or appends it and increments the list object's associated count. | List purpose remains unresolved. |
|
||
| `004310e0` | `process_state_list_remove_id` | Removes a 16-bit process ID and updates associated list state/counts. | List purpose remains unresolved. |
|
||
| `00407550` | `process_0x0f0_construct_for_item` | Constructs a type-`0xf0` process and optionally derives fields from an associated item. | Process class purpose remains unresolved. |
|
||
| `0043d0c8` | `process_table_dispatch_matching_type_exclusions` | Finds eligible matching process entries while excluding up to ten stack-supplied IDs, then invokes vtable method `+0x0c`. | Event/type and callback contracts remain unresolved. |
|
||
| `0043b5c4` | `process_word_shift9_forwarder` | Passes the incoming object's 16-bit word shifted right by 9 to `004356d4`. | Source-field and helper semantics remain unresolved. |
|
||
| `00446250` | `win32_game_main` | Checks joystick state, may show dialog resource `0x71`, then creates the main window and initializes graphics/audio. | Exact startup/UI role remains unresolved. |
|
||
| `00407304` | `item_shape_dispatch_interaction_rules` | Filters object/type values, queries adjacency, and consults violence-gated tables at `0047b074`/`0047b084`. | Event/effect behavior and table contents remain unresolved. |
|
||
| `00455ae4`-`00455ce4` | `unresolved; no verified function entry` | The range polls tracked keys, advances a counter, and updates the debug timeline when `DAT_004957eb` is nonzero. | Function entry and timeline timestamp/display path remain unresolved. |
|
||
|
||
The reviewed process helpers now have operation-level names; selector, table, and flag semantics remain open. The timeline range above remains unassigned because boundary analysis did not establish a reliable function entry.
|
||
|
||
## Western Comparison Status
|
||
|
||
Current coverage establishes JP-specific item-state, spatial-search, process-manager lifecycle, Windows keyboard/event behavior, and native Windows startup/window lifecycle, but not a Japanese-versus-Western behavior difference. The process IDs, item record layout, dispatch tables, and function addresses documented here are JP-specific until matched against a verified Western implementation. Existing Japanese executable and platform findings are summarized in [JP Windows 9x investigation](jp-remorse-windows9x-investigation.md); broader JP/Western format and modding boundaries are in [JP Windows modding feasibility](jp-remorse-windows-modding-feasibility.md).
|
||
|
||
## Semantic-Gap Analysis Checkpoint (2026-10-12)
|
||
|
||
This is a read-only static pass over the five requested areas. No Ghidra database changes or executable-byte writes were made; the live Ghidra project remains under the user's control.
|
||
|
||
| Area | Verified findings | Remaining analysis |
|
||
|---|---|---|
|
||
| Action and process behavior | `item_action_process_dispatch` cases `0`, `4`, `0x21`, `0x39`, and `0x3b` all construct type `0xf0` through `process_0x0f0_construct_for_item`, then install distinct callback tables. Type `0x259` is constructed by `AttackProcess_0040af20`. The direction helper's `0xff` path requires the current item to differ from `DAT_0047b1d6`, a type-`0x259` process with nonzero `+0x64`, shape-bounds overlap, and a successful packed-position query before dispatching selector `0`; it then sets process byte `+0x7d` and updates `+0x4a/+0x49`. | Identify the callback-table methods behind each selector; establish the meanings of `DAT_0047b1d6`, AttackProcess `+0x64`, and process `+0x7d`; confirm the caller-level result contract. |
|
||
| Data schemas | The keyed cache has ten rotating key slots and 256 entry pointers per slot. Its 16-bit key is looked up at file offset `key * 4`; descriptor low byte `+4` sets entry count and bit `0x40` at `+7` selects `0x40` versus `0x80` bytes per entry. The pair reader copies two dwords. The main item record stride is `0x79`; its separate 16-byte snapshot record maps X/Y words at `+0/+2`, Z at `+4`, shape at `+5`, packed byte at `+7`, flags at `+8`, an auxiliary word at `+0x0a`, auxiliary bytes at `+0x0c/+0x0d`, and next-item ID at `+0x0e`. | Resolve the cache key/resource and two-dword entry contract, auxiliary item-field and shape-profile flag meanings, and Western-build field correspondences. |
|
||
| Animation and spatial queries | AnimationProcess construction sets type `0x230`, vtable `0047e7a8`, and byte `+0x52` to zero; `animation_process_set_flag_52` writes one, and its only xref is the direct call at `00411fcd`, which has no owning function in Ghidra. Sixteen vtable slots were inspected; seven currently target defined functions and nine remain non-function/LAB targets. The spatial grid is indexed as 64 two-byte cells per `0x80`-byte row; selector coordinates advance by `0x200` and are converted with `>> 9`. | Establish the `+0x52` contract and unowned caller boundary; map remaining vtable slots, selector-mode tokens, and 8-way direction-sector encodings. |
|
||
| Input and presentation | Joystick polling uses `joyGetPosEx`; configured action IDs `4`-`8` emit `u/g/s/m/e`, action `9` maps directions to `q/w/i/o`, and process byte `+0x62` selects distinct handling paths. Startup opens dialog resource `0x71` only when joystick polling returns a nonzero direction; a zero dialog result aborts startup. The DirectDraw surface helper calls vtable offset `+0x60`, then locks at `+0x64` only on a zero result; that helper has no restore branch. The debug timeline helper has one caller at unowned address `00455bb6`. | Trace joystick configuration and mode semantics, decode resource `0x71` text/button intent, find any surface-restore path, and identify the timeline consumer/fields `+0xeb/+0xef/+0xf3/+0xf7` plus the writer for `DAT_004955e8`. |
|
||
| Unclassified bytes and boundaries | The latest report tracks all `1,493 / 1,493` function entries with zero untracked or generated names; function bodies cover `67.4%` and defined instructions cover `80.0%` of the `499,712` executable bytes. The remaining `100,014` bytes outside defined instructions may be data, padding, or unanalyzed code. Both `00411fcd` and `00455bb6` are confirmed code call sites without an owning function; five unmatched table addresses are not function entries. | Classify executable gaps by references and control flow before creating functions; prioritize the two confirmed unowned call sites and keep data/padding distinct from missed code. |
|
||
|
||
## Next Work
|
||
|
||
1. Classify the report's remaining executable-byte gaps as code, data, or padding using references and control flow; do not infer functions from coverage percentages alone.
|
||
2. Resolve the action callback tables and the `process_choose_direction_to_coords` `0xff` contract, including `DAT_0047b1d6`, AttackProcess `+0x64`, and process byte `+0x7d`.
|
||
3. Finish the keyed-cache resource/entry schema and label unresolved item snapshot, auxiliary-field, and shape-profile semantics; compare the verified `0x79` and 16-byte layouts against the Western build.
|
||
4. Map AnimationProcess vtable slots and the caller/boundary around `00411fcd`; resolve `+0x52`, selector-mode tokens, and 8-way direction-sector encodings.
|
||
5. Trace joystick configuration and `+0x62` mode behavior; identify the text/response meaning of startup dialog resource `0x71`, any DirectDraw surface-restore path, the debug timeline consumer/fields, and the writer of `DAT_004955e8`.
|
||
6. Recover process flag meanings and the related-process list used by `0043d574`, `0043d640`, and `0043d7a4`; distinguish bit `0x20` at record bytes `+0x59` and `+0x14`, and verify the overlapping `Process_Terminate`/`process_terminate_set_flag_20` boundaries.
|
||
7. Continue `item_shape_dispatch_interaction_rules` through its callers and resolve the violence-gated tables at `0047b074` and `0047b084`, including their selected effects and relationship to target adjacency.
|
||
8. Compare JP and Western process, animation, joystick, item-record, spatial-query, `-debug`, `JASSICA16`, and developer-switch behavior only after opening the correct Western Ghidra target; document semantic differences, not address differences.
|
||
9. Map the remaining actions in `key_handle_option_cheats_jp`, identify the immortality-toggle trigger, and determine the destination semantics of the type-`0xf0` process created for `-egg`.
|
||
10. Establish what state completes the `-demo` polling loop, then trace `-?`, `-u`, `DAT_00482620`, and `DAT_004957d9`.
|
||
11. Keep future batches evidence-backed, add Ghidra comments for mapped names, preserve uncertain functions as `FUN_...`, and leave project saving to the user. |