- Created a new log file `log-20261012.txt` to capture emulator activity. - Logged initialization steps including HTTP API startup, program executor creation, and MCP server launch. - Captured errors related to missing files during DOS operations. - Documented invalid opcode exception leading to emulation halt. - Included detailed state information at the time of errors for debugging purposes.
129 lines
No EOL
16 KiB
Markdown
129 lines
No EOL
16 KiB
Markdown
# Crusader: No Remorse Movement System Reference
|
|
|
|
## Scope and Evidence
|
|
|
|
The primary target is the Japanese Windows 9x build at `C:\RE\CRUSADER_JP_ISO\CRUSADER.EXE`, SHA-256 `037b7d2be829048a1b305eae15e7f78be72329af80425cc32e2f5fcee0ba5231`. Its address/name/comment map is `exports/CRUSADER_JP.EXE.xml`. The DOS executable is a separate NE build; `exports/src_remorse/CRUSADER.EXE.xml` and the DOS addresses below are consultation evidence, not proof that the JP build shares the same controls, selector meanings, timing, or animation behavior.
|
|
|
|
Evidence is static. REA used Ghidra 12.1.4 on the JP PE. No runtime input trace or gameplay observation was made. The exported XML is useful for symbols and prior function analysis, but an XML function record is not equivalent to a procedure body successfully resolved by REA.
|
|
|
|
Confidence labels used below:
|
|
|
|
- **JP / REA:** directly returned by REA for the JP PE.
|
|
- **JP / export:** behavior recorded in the matching JP Ghidra XML, but not independently resolved as a procedure by the current REA session.
|
|
- **DOS / comparison:** DOS behavior or address; useful for locating analogous code, not automatically portable to the JP build.
|
|
- **Unresolved:** current evidence does not justify a behavior name or rule.
|
|
|
|
## System Outline
|
|
|
|
The JP input path is process- and item-oriented rather than a single movement routine. The gameplay keyboard handler at `00416c7c` tracks input state, selects numeric action values, applies direction changes through `0040a004`, and calls `0044dc9c`. The JP export identifies `0044dc9c` as an item-action dispatcher: it switches over selectors `0x00`-`0x3f`, creates type-`0xf0` item processes, assigns selector-specific vtables, and applies item/process-state gates. Its individual selector meanings are explicitly unresolved in the export comments.
|
|
|
|
Consequently, values such as `0x17`, `0x18`, `0x1c`, `0x1d`, `0x28`, `0x29`, `0x3a`, `0x3d`, and `0x3e` must be recorded as JP action selectors until their JP process bodies establish semantics. The same values have movement-animation names in the DOS animation enum, but numeric agreement alone is not a cross-build mapping.
|
|
|
|
## JP Findings
|
|
|
|
### Input and Facing
|
|
|
|
| JP address | Finding | Evidence / limit |
|
|
|---|---|---|
|
|
| `00416c7c` `input_keyboard_handle_gameplay_event` | Central gameplay key-event path. It queries tracked key states, handles multiple event families, calls the facing helper, applies a direction code, and dispatches action selectors. | **JP / export.** REA pseudocode was inspected. The exact event/modifier semantics remain unresolved. |
|
|
| `00416a0c` `input_keyboard_adjust_facing` | When its guarded turn-key path runs, it adjusts a tracked direction, recomputes a 16-way direction from item coordinates, and stores the result. | **JP / REA and export.** The event/caller contract and direction field meaning are unresolved. Its references to item-marker helpers do not establish weapon aiming or target acquisition. |
|
|
| `0040a004` `process_apply_direction_code` | Stores a low-nibble process direction at `+0x36`. Codes `0x10`-`0x12` resolve or adjust a base direction. Codes `0x11`/`0x12` change it by two slots when process flag `+0x4b` bit `0x40` is clear, or one slot when set; the result is masked to 16 directions. | **JP / REA and export.** The code and delta are visible; the gameplay names of the modes and flag are unresolved. |
|
|
|
|
The direction updater is discrete, not evidence of a continuous angular speed. Do not substitute the DOS turn rates or infer a JP degrees-per-second value from these direction slots.
|
|
|
|
### Movement and Action Dispatch
|
|
|
|
The handler at `00416c7c` assigns selectors including `0x01`, `0x02`, `0x04`, `0x0b`, `0x17`, `0x18`, `0x1c`, `0x1d`, `0x22`, `0x24`, `0x27`-`0x29`, `0x2e`, `0x3a`, and `0x3d`/`0x3e`. Some branches choose left/right variants from relative direction or item state; others gate on key state and current per-item fields. These are observed selector values, not yet named JP movement actions.
|
|
|
|
`0044dc9c` accepts the selector and dispatches through a 64-entry switch. REA recovered cases including `0x17`, `0x18`, `0x1c`, `0x1d`, `0x22`, `0x24`, `0x28`, `0x29`, `0x3a`, `0x3d`, and `0x3e`; many paths construct a type-`0xf0` item process through `00407550` and install a selector-specific vtable. The export describes per-item process thresholds, optional replacement, tracked-item markers, and AutoFirer state as additional gates/effects. No selector should be renamed to walk, run, roll, crouch, or jump based only on the DOS enum.
|
|
|
|
REA read the first 12 32-bit entries of the vtables below from the JP image. In each sampled table, the first entry is `00408874`, entries 3-12 match, and only the second entry varies. The selected second-entry addresses decode as code, but REA did not resolve procedure boundaries or behavior there; this establishes distinct process variants, not their action names.
|
|
|
|
| JP selector | Installed vtable | Distinct second entry |
|
|
|---|---|---|
|
|
| `0x17` | `0047da60` | `0040a4e0` |
|
|
| `0x18` | `0047da30` | `0040a530` |
|
|
| `0x1c` | `0047f614` | `00451fc0` |
|
|
| `0x1d` | `0047f5e4` | `00452010` |
|
|
| `0x22` | `0047db80` | `0040a300` |
|
|
| `0x24` | `0047dc40` | `0040a1c0` |
|
|
| `0x27` | `0047f4f4` | `004521a0` |
|
|
| `0x28` | `0047f494` | `00452240` |
|
|
| `0x29` | `0047f464` | `00452290` |
|
|
| `0x2e` | `0047f3d4` | `00452380` |
|
|
| `0x3a` | `0047f2b4` | `00452560` |
|
|
| `0x3d` | `0047dac0` | `0040a440` |
|
|
| `0x3e` | `0047da90` | `0040a490` |
|
|
|
|
REA read the first 12 entries of the three additional vtables above. They have the same first entry (`00408874`) and shared entries after the distinct second slot. The second-slot addresses decode as code but remain unresolved procedures; selector-to-action semantics therefore remain unknown.
|
|
|
|
`00408874` is the shared first-slot process routine in these sampled tables. It is called from `004076b0` and `00453c64`, and its body dispatches process methods at vtable offsets `+8`, `+0xc`, and `+0x2c`. It queries shape collisions directly or through `00448bdc`'s step fallback according to process state, then invokes `00448818` when collision-result state is present. This confirms a common process/collision path, not that every keyboard-selected action uses the same movement policy; the callers do not by themselves prove that every path is the controlled avatar.
|
|
|
|
JP animation infrastructure is also visible but is not yet linked to those action variants. `00429c00` constructs a process of type `0x230`; `00429d44` lazily initializes shared process globals and creates that animation process, while `00420368` advances visible-item animations. The available bodies do not establish that these routines supply frame displacement or action names for the keyboard-created type-`0xf0` processes.
|
|
|
|
| Requested behavior | JP status | DOS comparison reference |
|
|
|---|---|---|
|
|
| Walk / run / reverse | JP selectors `0x01`, `0x02`, and several other values appear in the handler, but their movement semantics are not established by the resolved dispatcher evidence. | `Animation` enum in `exports/src_remorse/CRUSADER.EXE.xml`: walk `0x01`, small-weapon retreat `0x02`, run `0x03`; controller selection at `1130:12d6`. |
|
|
| Crouch / kneel | JP handler emits values including `0x28`, `0x29`, and `0x2e`; semantic equivalence is unresolved. | DOS enum: kneel start/stop `0x28`/`0x29`, kneel poses `0x2e`/`0x2f`; controller pose selection at `1130:10cf`. |
|
|
| Sidestep / slide | JP handler emits `0x1c`/`0x1d` in directional branches; do not yet label these as slides in the JP spec. | DOS enum names `0x1c`/`0x1d` slide left/right. |
|
|
| Jump | JP handler emits `0x3a` under a gated branch; the JP action process meaning and airborne transition are not verified. | DOS enum names forward jump `0x38`, quick jump `0x3a`, and landing `0x3b`; DOS key handling includes a jump-forward replacement at `1130:2648`. |
|
|
| Roll | JP handler emits `0x17`/`0x18` and `0x3d`/`0x3e` in separate branches; action-process names and interruption rules are unresolved. | DOS enum names combat rolls `0x17`/`0x18` and slow combat rolls `0x3d`/`0x3e`. |
|
|
| Aim / target selection | The JP turn/facing helper recomputes a direction from coordinates, but this alone does not prove aiming, weapon readiness, firing, or target selection. | DOS angle/pose update `1130:10cf`; small crosshair update `1130:0708`; weapon readiness and firing are handled separately by `1130:2211` and `10e8:0252`. |
|
|
|
|
### Collision, Position, and Gravity
|
|
|
|
| JP address | Finding | Evidence / limit |
|
|
|---|---|---|
|
|
| `00448174` `item_position_query_shape_collisions` | Initializes a shape-position query, scans nearby spatial items, and tests candidates for collision. | **JP / export** comment and REA body. The caller flags determine details; exact movement/contact policy is not fully established here. |
|
|
| `00448818` `item_process_collision_contacts_and_events` | Processes a collision-query result, including item position/event state and linked contact records. | **JP / export** comment and REA body. Do not assume this matches the DOS hit/hurl response. |
|
|
| `00448bdc` `item_query_shape_collision_with_step_fallback` | Wraps the shape collision query and conditionally retries at nearby vertical offsets for a step-compatible result. | **JP / REA** confirms the wrapper and its call to `00448174`; the XML comment describes the retries. Exact eligibility, probe geometry, and successful-position commit are not fully documented here. |
|
|
| `0042aa14` `gravity_process_construct` | Constructs a type-`0x203` process, installs its vtable, and initializes fields; caller-supplied values populate additional fields. | **JP / REA.** Field meanings and axis mapping remain unresolved. |
|
|
| `0042b7a4` `gravity_process_apply_position_delta` | Adds three 16-bit caller-supplied values to an existing type-`0x203` process, or creates one through the constructor when absent and its gate passes. | **JP / REA.** The three components' axis/order meaning is unresolved. |
|
|
| `0042b834` `gravity_process_create_for_item_if_needed` | Checks item-record and shape metadata bits/fields, then creates a type-`0x203` process only when none exists. | **JP / REA.** The checked fields' gameplay meaning is unresolved. |
|
|
| `0042ad04` `gravity_process_update` | The JP export identifies an update routine, but REA does not resolve a procedure at this address. | **JP / export.** No update formula, collision response, or grounded/airborne rule is verified. |
|
|
|
|
Other JP process comments indicate item-position probing at `004076b0`, target-direction process creation/update at `00453500`/`004536ac`/`004538c0`, and direction selection at `00453c64`. They document NPC/process behavior and are not, by themselves, proof that the controlled avatar uses the same path.
|
|
|
|
## DOS Consultation Map
|
|
|
|
These NE locations give detailed movement references for No Remorse, but remain a separate build from the primary JP PE target.
|
|
|
|
| DOS address | Reference role |
|
|
|---|---|
|
|
| `1130:2211` | `Controller_HandleKeyEvent`: key-event entry and action/animation handoff. |
|
|
| `1130:12d6` | `Controller_PickNextAnimByKeyevent`: chooses movement/pose actions from key state, current facing, weapon, and stance. |
|
|
| `1130:10cf` | `Controller_UpdateAvatarAngle`: turn/aim-facing and combat/kneel pose selection. |
|
|
| `10e8:0252` | `NPC_DoAnim`: requests an NPC/avatar animation, including weapon-size remapping. |
|
|
| `1150:016f` | `AnimPrimitive_CheckToStartNewAnimation`: starts or transitions an animation process. |
|
|
| `1150:1906` | `AnimPrimitiveProcess_Run`: advances animation metadata and applies frame displacement. |
|
|
| `10e0:162f` | Grounded shape sweep with step-up retries. The DOS analysis records probes at start-Z `+8`, then `+9`, when its grounded/endpoint gates pass. |
|
|
| `10e0:0b39` | Point-sweep path used directly for airborne frames; does not take the grounded step-up retry. |
|
|
| `10e0:032e` | Candidate collision filtering and blocking-contact determination. |
|
|
| `10e0:123a` | Commits resolved movement and queues eligible collision/contact processes. |
|
|
| `1038:12a6` | `Item_Hurl`: reuses an existing type-`0x203` gravity process or creates one for a fall request. |
|
|
| `1038:06d2` | `GravityProcess_Run`; see also downward sweep helper `1038:1131`. |
|
|
|
|
### DOS Controller and Action Detail
|
|
|
|
At `1130:12d6`, `Controller_PickNextAnimByKeyevent` uses facing-relative advance/reverse and left/right turn paths in its NumLock mode; turn selection uses stand pose `0` when unarmed and combat stand `4` when armed. Its walk/run choice defaults to walk without a weapon and run with one, with Shift reversing that choice. Armed running selects animation `0x30` rather than the unarmed run `3`. These are DOS rules, not confirmed JP input semantics.
|
|
|
|
The DOS animation enum and controller paths distinguish several movement/stance actions: reverse step `2`; slides `0x1c`/`0x1d`; kneel start/stop `0x28`/`0x29` and kneel poses including `0x2e`/`0x2f`; forward jump `0x38`, quick jump `0x3a`, and landing `0x3b`; combat rolls `0x17`/`0x18` and slow combat rolls `0x3d`/`0x3e`. `Controller_UpdateAvatarAngle` (`1130:10cf`) selects combat-stand or kneeling poses while updating facing. `Controller_HandleKeyEvent` (`1130:2211`) handles a separate Space-key weapon-ready transition; readiness persists after key release, while a later Space key-down can request firing. Pointer/crosshair target selection is a separate path. These enum/action names are evidence for DOS only and do not promote same-numbered JP selectors to those meanings.
|
|
|
|
### DOS Animation and Collision Integration
|
|
|
|
The DOS animation process is also a movement integrator. `AnimPrimitiveProcess_Run` (`1150:1906`) reads direction-specific frame metadata, applies signed stride through the native direction projection, applies signed Z displacement and frame/flip state, then chooses grounded or airborne collision handling. Grounded frames use `AreaSearch_SweepShapeBetweenPointsWithStepUp` (`10e0:162f`): after a failed sweep, eligible level-Z destinations are retried at start-Z `+8`, then `+9`. Airborne frames use the direct point-sweep path (`10e0:0b39`) without those retries. A successful clipped sweep can commit the contact-resolved position; `AreaSearch_CollideMove` (`10e0:123a`) commits it and queues eligible collision/contact processes. Candidate blocking depends on the mover/candidate solid-mask intersection (`10e0:032e`), so recording a geometric contact is not alone proof that movement blocks.
|
|
|
|
The DOS analysis identifies `GravityProcess_Run` (`1038:06d2`) and its downward-sweep helper (`1038:1131`). Vertical impacts use sweep mode 4 followed by `AreaSearch_CollideMove` (`10e0:123a`); response branches on controlled-NPC state and masks from the separate `g_itemStatus` table, with callback/termination paths and controlled-item rebound using `RandomVal`. Collision movement can also queue hit/got-hit processes. `Item_Hurl` (`1038:12a6`) reuses an existing type-`0x203` process or creates one with zero velocity, gravity 2, and a 20-tick sleep for a fall request. These response and initialization details do not establish an acceleration, terminal speed, or complete landing formula. None of the animation displacement, step-up, contact, or gravity details above has been confirmed for the JP PE.
|
|
|
|
The DOS controller evidence also distinguishes turn/aim facing from weapon readiness. The controller can select stand/combat-stand or kneel poses while updating facing; a separate Space-key path requests weapon-ready poses and later firing. Map pointer/crosshair behavior and target acquisition are further separate. Keep these distinctions when using DOS addresses to guide JP follow-up.
|
|
|
|
## Open Verification Items
|
|
|
|
1. Resolve the JP action-specific vtable entries listed above into complete process bodies, then name selectors only where behavior supports it.
|
|
2. Trace JP movement-process position updates from action creation through collision checks and final coordinate commit.
|
|
3. Resolve the JP gravity update body and determine how it interacts with grounded/airborne movement and collision.
|
|
4. Identify JP key-event codes and modifier semantics from the event producer and controller caller, rather than mapping DOS scan codes onto them.
|
|
5. Separate JP aim/facing, weapon-ready, firing, and pointer-target paths; the current turn-helper evidence does not establish those behaviors.
|
|
6. Determine whether the JP type-`0x230` animation service or visible-item animation path participates in controlled-avatar action processes; current evidence does not connect them.
|
|
7. Compare JP movement/action branches with DOS addresses one behavior at a time. Record mismatches and keep both addresses where the builds differ.
|
|
8. Add runtime observations only after a controlled JP build session is available; current statements are static-analysis findings. |