1719 lines
No EOL
257 KiB
Markdown
1719 lines
No EOL
257 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. |
|
||
|
||
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.
|
||
|
||
## 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).
|
||
|
||
## Next Work
|
||
|
||
1. Continue at the lowest untracked executable function reported by `tools/jp_executable_documentation_report.py` (`00425b70` at the latest checkpoint), inspecting entries in ascending address order.
|
||
2. Determine the keyed-entry cache's 16-bit key domain, descriptor mode/count fields, and two-dword entry schema from the loader and pair-reader without assuming a specific resource class.
|
||
3. Map the remaining JP process dispatch behavior around type `0x259`, and reconcile it with the now-verified common and Stand, Surrender, Pace, Guard, and Loiter process types.
|
||
4. 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.
|
||
5. Recover the AnimationProcess function-pointer table and trace the flag at `+0x52` from its call site near `00411fcd`.
|
||
6. Continue `item_shape_dispatch_interaction_rules` through its callers and tables to identify the violence-gated behavior and its relationship to target adjacency.
|
||
7. Resolve the violence-gated tables at `0047b074` and `0047b084` used by `00407304`, including their callers and selected effects.
|
||
8. After sequential coverage reaches `00440bf4`, resume the deferred subsystem-specific questions below; treat the existing later-address notes as prior evidence, not as a reason to skip the lower-address pass.
|
||
9. Compare the 16-byte JP item-state record and item allocation/free lifecycle against the Western build by semantic field mapping.
|
||
10. Compare the JP spatial selector record, grid scale, scan modes, and direction-sector encodings against the Western build by behavior and data role.
|
||
11. Resolve the configured joystick action IDs and mode bit; identify the startup dialog's prompt/response and the DirectDraw recovery transitions.
|
||
12. Once the JP NPC, animation, and joystick paths are mapped, inspect corresponding Western process behavior in its own active Ghidra target and document only verified semantic differences.
|
||
13. Keep future batches evidence-backed: add Ghidra comments for mapped names, preserve uncertain functions as `FUN_...`, and leave project saving to the user.
|
||
14. Identify the owner and presentation path for the debug timeline buffer around `00455ae4`-`00455ce4`; resolve the meanings and units of object fields `+0xeb`, `+0xef`, `+0xf3`, and `+0xf7`.
|
||
15. Map the remaining actions in `key_handle_option_cheats_jp`, identify the exact trigger for its immortality toggle, and determine the destination semantics of the type-`0xf0` process created for `-egg`.
|
||
16. Establish what state completes the `-demo` polling loop, then trace `-?`, `-u`, `DAT_00482620`, and `DAT_004957d9`.
|
||
17. Compare the confirmed JP `-debug` gate, `JASSICA16` cheat sequence, and developer switches with the Western executable by behavior, after opening the correct Western Ghidra target; do not infer a difference from addresses or strings alone.
|
||
18. Trace the `process_choose_direction_to_coords` `0xff` branch through `DAT_0047b1d6`, the type-`0x259` record at `+0x64`, `0041b798`, and `0041bb7c`; resolve the query contract and the meaning of byte `+0x7d` set by `process_set_byte_7d_one`.
|
||
19. Map the individual selectors of `item_action_process_dispatch`, prioritizing `0`, `4`, `0x21`, `0x39`, and `0x3b`; the shared dispatcher role is verified, but case-specific behavior remains unresolved.
|
||
20. Find the writer and usage context of `DAT_004955e8` to establish what state gates the `DebugBreak` sites in `process_choose_direction_to_coords`. |