38 KiB
Crusader Decompilation Mid-Project Plan
Purpose
This file is the live mid-project tracker for the Crusader decompilation effort.
Keep it focused on:
- current verified state,
- active blockers,
- next resume work,
- and the remaining path to a reasonably complete decompilation.
Detailed completed analysis belongs in the files under docs/, not in this plan.
Progress Snapshot
Latest verified batch: docs/startup-map-patch-file.md now closes the long-standing startup string Using map patch file. tightly enough to stop treating it as a vague debug/status artifact. Current best read is that Init_Everything prints that line only when static\fixed.dat exists, and the later fixed-map cache path then prefers the loaded static\fixed.dat archive handle over the base fixed.dat handle for map/fixed-object reads. The remaining uncertainty in this lane is now narrow: whether any later consumer does a finer-grained fallback/merge than the first recovered chooser, not what the startup line is referring to in the first place.
Latest verified batch: docs/psx/psx.md, docs/psx/map-rendering.md, docs/psx/map-viewer-plan.md, and docs/psx/art-binding-recovery.md now tighten the PSX render-side model another step in both Ghidra and the viewer exporter. The earlier DAT_800758d4 consumer finding remains intact and is still wired into the viewer-side cache path as explicit companionExtents metadata, but the bigger practical change in this batch is the first measured art-binding recovery pass for the viewer exporter: the PSX cache builder now treats large zero-block DAT_800758d8 constructor-placement bands as inherited-art candidates, first via same-map DAT_800758cc script-signature donors and then via a constrained nearest-donor fallback inside the current 0x003e..0x0064 family. That rebuild moved the scene set from 58,262 fallback items / 1,714 bundle-mapped items to 25,038 fallback items / 34,938 bundle-mapped items, making early representative maps such as 0, 9, and 43 mostly real-art while leaving map 104 and the remaining 0x0042 / 0x0055..0x0063 constructor-placement band as the clearest unresolved outliers. The practical remaining gap is therefore narrower now: not "why are most PSX scenes placeholders" but "what executable-backed alias/resource rule explains the remaining zero-block constructor-placement families without leaning on donor heuristics."
- Overall useful decompilation progress: about 58%
- Reasonable uncertainty band: about 55% to 63%
- Top 100 far-call target coverage: about 86%
- Segment spread with meaningful analysis: about 34% to 40%
- Tooling maturity for continued work: about 83%
Why The Estimate Moved
- The NE
CRUSADER.EXEdatabase now has materially more named functions, better caller-role coverage, and broader comment-backed provenance than when this tracker was first drafted. - The startup/display lane is no longer a top active section. Its outer ownership and control flow are stable enough that it should stay closed unless new caller evidence changes the model.
- The cheat/debug lane is also much tighter: the
jassica16latch, the broader-lauriegate, the~runtime toggle, the F7-family overlays, the F10/Ctrl behavior, and the0x410CD-transfer-display branch are now separated well enough that this lane is mostly documentation and cleanup, not architecture recovery. - The USECODE/VM lane has moved from broad structure guesses to a partial runtime model: core loader/runtime helpers are named, owner-loaded slot arithmetic is verified against extracted corpora, several masked-create helpers have real contracts, and the major remaining uncertainty is now the upstream selector/caller path rather than the storage format itself.
- The map-renderer crosswalk lane also removed a lot of lingering shape ambiguity by closing more controller/helper families directly from extracted corpora plus scene evidence.
- The combat-tactic data lane is also now materially tighter:
COMBAT.DATis no longer just a named-tactic hint source, but a documented bytecode archive with stable per-record names, verified block structure, a decoded shipped opcode subset, and a practical family-level behavior map for theDumb,Pivot,Advance,Careful, marker-shuttle, and step-out-shoot tactics.
Current Verified State
Primary Tracking Assets
crusader_segment_coverage_ledger.csvremains the main executable-wide coverage tracker and should be updated after each verified batch.crusader_decompilation_notes.mdis an index, not the place for long-form analysis.CRUSADER.EXEremains the default live Ghidra target.- Verified
CRUSADER-RAW.EXEwork remains a supporting evidence base for ports, naming provenance, and caller/context cross-checks.
Strong Or Stable Areas
- seg001 gameplay/input/projectile work is stable enough to support verified raw-name ports into live NE work.
- The raw
0007rendering/camera/tile-visibility lane has a strong structural map and now acts more as supporting evidence than as a primary unknown. - The
0008dispatch-helper and000cstate/transition lanes have broad partial coverage, including enough caller-side structure to support practical NE naming work. - The VM/USECODE lane now also has one earlier compiled-side producer anchored beyond the old direct
Item_GetDamaged/StorageDataProcess_Runcallers:AreaSearch_CollideMoveis now verified as a paired0x20b/0x20ccollision-process producer, and the local seg031 queue helpers are named structurally in the live database. - That same collision-storage producer surface is now wider too: current direct callers are all movement/physics/animation-side (
Item_LegalMoveToPoint,Item_LegalMoveToPointWithCollisionInfo, gravity, animation, supersprite, and fast-area gravity cleanup), and no verified non-collision producer reaches the0x236queue yet. - The movement/collision lane is tighter at the helper level too: the step-aware seg029 sweep wrappers, the seg031 release-side queue cleanup pair, and the adjacent seg090 directional cache-offset helper are now named in the live database, so the remaining uncertainty in this lane sits earlier in caller policy rather than in the local helper layer.
- The startup/display lane is materially closed. Shared dispatch-entry ownership, seg126 file-backed control flow, seg127 fade control, and the surrounding palette/presentation helpers are now understood well enough that they should not stay in the live critical path.
- The cheat/debug lane is mostly closed at the behavior level. The secret-sequence matcher, broader cheat gates, F7 overlays, F10 modifier path,
Ctrl+Llocation popup,Ctrl+Q = 0x410CD-transfer-display toggle,-debug, and-laurieare all separated far more cleanly than before. - The hidden usecode-debugger lane is now structurally understood as a layered orphaned subsystem: seg109 UI pieces, seg1408 break-state helpers, and the seg1418 interpreter handoff are no longer conflated.
- The USECODE/VM lane now has a workable compiled-side model around
entity_vm_runtime_create,entity_vm_runtime_owner_resource_create,entity_vm_context_create_from_slot_index, the masked-create hub at000d:463a, the persistence/load helpers, and the owner-loaded slot/value arithmetic. - The owner-loaded body/range model is no longer speculative. Class-selection uses
class_id + 2, header/subentry math matches extracted corpus output, and concrete body windows forNPCTRIG,EVENT, and related families are now verified. - The map-renderer/documentation lane now has a stronger shape/controller crosswalk. Recent closures include
CRUMORPH,NPC_ONLY,WATCHNS,WATCHEW,CRYOBOX,CRAZYEW,CRAZYNS,VIDEOBOX,PANELEW,GENERATR, and cross-gameDEATHBOX, with viewer-side links kept conservative where actor-side state is still runtime-only. - The command-line/startup lane is much tighter across both games:
-warp <mission> [x y z],-mapoff,-egg, startup teleporter selection, and the-uEUSECODE root override all now have practical behavior models instead of folklore-level descriptions. - The PSX lane is no longer just side inventory. Retail/pre-alpha bundle loading, mission-briefing/passcode structure, the reduced-content pre-alpha disc, and now the retail map object's last projection stage all have dedicated notes and enough stable naming to support future targeted passes.
- The Remorse class-lift preparation lane now has a usable document cluster: overall plan, candidate inventory, endpoint spec, ABI constraints, family notes for
EntityDispatchEntryandSpriteNode, a conservativeEntityfamily split, a VM runtime/owner-resource layout note, a compatibility-header draft, and one grouped resume index. - The same class-lift prep lane is now more execution-ready: the
0x4588broker family has its own focused object note, the toolchain story has a dedicated fingerprint-evidence note, and there is now a concrete first-batch class-authoring checklist ready for the first MCP-backed namespace/struct/vtable pass. - The live Remorse VM class-lift lane also recovered from a decompiler breakage in
Remorse::EntityVmRuntime::Create: the root cause was a hidden-return-storage allocator helper signature at1000:42e2,Createnow decompiles again, and the provisional/Remorse/EntityVmSlotEntrydatatype now exists with the stable+0x1e..+0x24buffer-pair fields named. - The live Remorse VM class-lift lane is tighter again: the old
UsecodeProcess_*context lifecycle bodies at1420:0eec,1420:10b6,1420:10da,1420:1162,1420:118f, and1420:1278now live underRemorse::EntityVmContext::{CreateFromSlotIndex, FreeBuffer, SyncGlobalValueAndDispatch, Destroy, Save, Load}, with short raw000d:provenance comments preserved on each entry. - The same VM class-lift lane tightened one step further through local PyGhidra fallback once the live
run_write_script(...)route still returned404 No context found for request:/Remorse/EntityVmContextis now a real datatype,entity_vm_slot_entry_create_or_clearandInitSlotOwnerBuffersnow carryEntityVmSlotEntry *,AcquireSlotForEntitynow returnsEntityVmSlotEntry *, andInitSlots/ReleaseSlotsnow take directEntityVmRuntime * this. - That pass also made the remaining blocker more precise:
Createstill cannot hold a fully typed farthiswithout reintroducing hidden__return_storage_ptr__corruption, so it was restored to the verified split-word custom-storage signature instead of forcing a broken prettier form. - Tooling follow-up from that same batch is now clearer too: live MCP read-only Python is usable when Ghidra starts with PyGhidra enabled, but write-side repairs still had to fall back to closed-project local PyGhidra because MCP does not yet expose a constrained live write-script or equivalent custom-storage edit path.
- The live VM class-lift lane tightened slightly again in-session:
1420:19fd Remorse::EntityVmRuntime::EnsureSlotChunkLoadednow carries a realEntityVmSlotEntry *local for the acquired slot path, so the slot-entry cache tail fields decompile directly instead of through anonymousundefined4pairs. - The matching MCP gap is also clearer now: the old
apply_class_layoutdry-run null failure no longer reproduces for/Remorse/EntityVmContext, but the real write path still behaves like the older storage-preserving build. Actualapply_class_layoutand directset_function_this_typecalls on the context lifecycle methods still fail withStorage size does not match data type size: 2, and liverun_write_script(...)still returns404 No context found for requesteven with explicit target selectors. - Closing the GUI and dropping to the local PyGhidra fallback then landed the blocked context typing work cleanly:
CreateFromSlotIndex,FreeBuffer,SyncGlobalValueAndDispatch,Destroy,Save, andLoadnow all carryEntityVmContext * thisas their first parameter inCRUSADER.EXE, which confirms the newer dynamic-storage rewrite is sound even though the live MCP session still is not taking it. - The next live verification pass tightened two details. First, the new checked-in storage-aware prototype endpoint still is not the build currently serving the active GUI session: direct live POSTs to
/set_function_prototype_storagestill answered with the legacyset_function_prototypefailure body, and the alias route still returned404 No context found for request. Second, the direct callers ofCreateFromSlotIndexstill mostly consume the result as a base process object, so the current conservativeUsecodeProcess *return should stay in place until the inheritance-aware datatype story is explicit. - The refreshed live MCP build moved that forward materially:
set_function_prototype_storage(...)now reaches the real storage-aware implementation in-session and the active-programrun_write_script(...)path now executes instead of failing with404. The new blocker is narrower and more concrete: barestack:offsets at10and above currently need0xprefixes to preserve the intended stack slots,__cdecl16farstill normalizes to plain__cdecl, andCreatestill cannot collapse to a singleEntityVmRuntime * thisbecause the datatype itself still resolves to a 2-byte pointer size. - The same live batch also tightened the slot-entry class model:
/Remorse/EntityVmSlotEntrynow carriesmatch_key_farptr,owner_chunk_count, andowner_data_basein addition to the earlier owner-buffer and chunk-state tails, which makesInitSlotOwnerBuffers,AcquireSlotForEntity, andEnsureSlotChunkLoadedread more like object code and less like anonymous offset arithmetic. - The next live batch tightened the adjacent helper map too: the old unnamed
1420:1d72,1420:1d8d, and1420:1e17helpers are nowentity_vm_runtime_get_slot_chunk_ptr_at_offset,entity_vm_runtime_release_slot_chunk_ref, andentity_vm_runtime_try_unload_slot_chunk, which makes the slot-entry lifecycle around load, refcount release, and conditional unload materially easier to navigate. - The latest live batch turned that helper lane into a small shared record model:
/Remorse/EntityVmLoadedChunkRecordnow carries the stablenext_*,saved_chunk_*,slot_index, andchunk_indexanchors,entity_vm_runtime_try_unload_slot_chunknow takesEntityVmLoadedChunkRecord *and returnsbyteinAL, andentity_vm_runtime_apply_to_matching_owner_rowsnow iterates over a typed loaded-chunk record instead of anonymous stack-pair scratch state. - The adjacent interpreter-side lane is slightly tighter too: local helper
1418:003cis nowinterpreter_pop_saved_farptr, and the only verifiedInterpreter_NextUsecodeOprelease path at1418:3330is commented as a save/restore boundary aroundentity_vm_runtime_release_slot_chunk_refinstead of being left as anonymous stack traffic. - The live class-authoring state moved forward too:
Remorse::EntityVmSlotEntrynow exists as a real class owner inCRUSADER.EXE,CreateOrClearmoved under it with an explicitthisparameter andAXpointer return, and the runtime-local chunk helpers plus owner-row iterator/debug path now sit underRemorse::EntityVmRuntimeinstead of Global. - The next live pass improved the runtime class surface further:
GetSlotChunkPtrAtOffsetnow carries the recoveredruntime_farptr/slot_index/chunk_index/intra_chunk_offsetsignature and still returns its far pointer inDX:AX, whileApplyToMatchingOwnerRowsnow carries the recoveredruntime_farptr/slot_index_filter/chunk_index_filtersignature and still returns its boolean inAL. - The latest live pass removed the old runtime-wide 2-byte-
thisbottleneck for this cluster:Create,InitSlots,ReleaseSlots,DebugDumpSlotMemory,ReleaseSlotChunkRef,GetSlotChunkPtrAtOffset,TryUnloadSlotChunk,ApplyToMatchingOwnerRows, andEnsureSlotChunkLoadednow all accept an explicit 4-byteEntityVmRuntime * thisthrough/Remorse/EntityVmRuntime *32custom storage in-session. The remaining live type gap is narrower again: exact/Remorse/EntityVmSlotEntry *32return/parameter typing still fails onAcquireSlotForEntityandInitSlotOwnerBuffers, so those positions are currently held as neutraldwordplaceholders instead of prettier but broken slot-entry pointer types. - That slot-entry gap is now closed too, and the pointer cleanup widened beyond the runtime core:
AcquireSlotForEntitynow returnsEntityVmSlotEntry *32,InitSlotOwnerBuffersnow acceptsEntityVmSlotEntry *32,EntityVmOwnerResource::{Create,Destroy}now carry explicit 4-bytethis, and the simpleEntityVmContextlifecycle methods now do the same. The main remaining VM signature outlier isCreateFromSlotIndex, whose argument pack still needs caller-side recovery rather than just pointer-width cleanup. - The next family switch also landed:
Remorse::UsecodeDebuggerBreakStatenow exists as a real class owner with a0x2f2provisional datatype plus a first method batch for construction, breakpoint gating, breakpoint table helpers, callstack helpers, and step-state helpers. - That debugger batch is already tighter than the initial shell:
1408:01a5is now verified asBreakpointRemove,1408:02f5is now verified asCallstackPushFrame, breakpoint entries are recovered as0x0binline-name-plus-line records, and callstack entries are recovered as0x15inline-name-plus-three-dword records even though the trailing dword semantics remain open. - The next pass landed the debugger struct rewrite in-session too:
/Remorse/UsecodeDebuggerBreakpointEntry,/Remorse/UsecodeDebuggerCallstackEntry, and the updated/Remorse/UsecodeDebuggerBreakStatearray layout now exist live instead of only in notes, and the only verifiedCallstackPushFramecaller now narrows those three trailing dwords tosource_stream_target_farptr,current_frame_payload_farptr, and still-neutralaux_farptr. - The latest debugger class-lift pass closed two more bounded gaps without overpromoting semantics:
1408:0230now lives underRemorse::UsecodeDebuggerBreakState::BreakpointFindFirstForUnitAtOrAfterLineas the breakpoint-table lower-bound helper for(unit_name, line_number)queries, and the retail vtable root at1478:65abis now resolved enough to show thatMaybeBreakOnCurrentLinedispatches slot 0 into a shipped no-op stub while slot 1 currently returns zero through a second inert method. - The next debugger follow-up also closed the planned seg109 consumer pass:
13a0:0291plus its helper13a0:045cnow show that the current callstack entry's+0x09lane is a real source-stream cursor consumed byte-by-byte by the debugger formatter and that+0x0dis the paired current-frame payload context used for expression/watch rendering. The remaining open tail-field question is now mostlyaux_farptr, not the first two dwords. - That naming decision is now landed live rather than only in notes:
/Remorse/UsecodeDebuggerCallstackEntrynow names offset+0x09assource_stream_cursor_farptrwith an in-session field comment, andCallstackPushFramenow carries the same parameter name in its signature. The debugger-family residue is therefore narrower again: mainlyaux_farptr, plus whether the seg109 formatter helpers deserve stable names. - That last formatter-helper hesitation is now closed too. The seg109 consumer pair is no longer anonymous in-session:
13a0:0291now lives asusecode_debugger_format_expression_to_shared_buffer, and13a0:045cnow lives asusecode_debugger_format_descriptor_expression. The debugger-family residue is therefore narrower again: mainlyaux_farptr, plus any future evidence that the retail-stub callback slots ever had non-retail behavior. - The follow-up retail caller pass did not widen
aux_farptreither.get_callers(1408:02f5)still reports only1418:051d Interpreter_NextUsecodeOp, that caller still pushes literal zero for the trailing field, and the current seg109 formatter consumers still read only+0x09and+0x0d. For now the right live result is to keepaux_farptrintentionally neutral rather than invent a prettier but weak name. - The next bounded class-family step landed too.
Remorse::SpriteNodenow exists live inCRUSADER.EXE, and the first strong000b:batch is re-anchored into live1360:by preserved offset delta from000b:326e -> 1360:046e:Destroy(1360:046e),IsDirty(1360:0580),MarkDirty(1360:05a6),DispatchEvent(1360:0cb2), andUpdateAndDispatch(1360:12ee) are now class-owned with in-session provenance comments. The remainingSpriteNodework is narrower and safer than before: mainly the constructor side, the exact live anchor forGetOrTraverse, and later vtable/datatype authoring rather than basic family existence. - That same
SpriteNodepass also moved beyond method ownership into datatype work:/Remorse/SpriteNodeBasenow nameschild_or_next_farptr,local_x_offset,local_y_offset, anddirty_flags, and/Remorse/SpriteNodeVtablenow exists as a provisional slot shell exposing+0x14,+0x18,+0x20, and+0x24. - The constructor side is now started too:
1360:036alives asRemorse::SpriteNode::Createwith an in-session caveat comment that preserves the remaining wrapper uncertainty. The live search for the old000a:b988 GetOrTraverseanchor is still open, but the family no longer lacks a constructor-style entry outright. - That remaining traversal gap is now closed too.
1360:0955now lives asRemorse::SpriteNode::GetOrTraverse, and the decompiler comment records the currently safest read of the helper: recurse over child-linked nodes, adjust the incoming query coordinates by the local offsets, and return either the matched node or the default sentinel through the out pointer. The mainSpriteNoderesidue is therefore structural again: constructor-wrapper split, deeper slot naming, and subtype layout boundaries. - The next bounded-family start is now landed too.
Remorse::CacheBackendObjectexists live with1250:0000promoted asCreate; the decompiler itself carries explicit old0009:5600segment metadata on that body, and the current comment records the0x20-byte allocation plus file-handle/method-table initialization path. That family is still only at its constructor shell, but it is now a live class-lift lane instead of a pure inventory entry. - The broader Tier 1 Remorse class sweep is now closed too.
EntityVmOwnerResourcegained two real accessor wrappers in-session (QueryMaterializationSizeandMaterializeChecked) plus a corrected outer-wrapper layout (0x14bytes total, embedded file base at+0x00..+0x07, helper vtable at+0x08, owner-row table at+0x0c);CacheBackendObjectgained the first two non-constructor class methods (LoadEntryTableFromManifestandInitFixedEntryTable) plus a tighter live layout read around+0x10/+0x14/+0x16/+0x18/+0x1c; andSpriteNode::DispatchEventnow ties concrete event codes to concrete vtable slots instead of generic placeholder slot names. - The next broader Remorse batch also has its first post-Tier-1 live foothold now.
PresentationCallbackBrokeris no longer note-only:12d0:0513and12d0:0656are now live asRemorse::PresentationCallbackBroker::{InitOnce, TeardownOnce}with comments tied directly to the0x4588/0x458c/0x4590/0x4594/0x4595/0x45a6lifecycle cluster. The same pass also clarified thatWatchEntityControllerandDialogMenuObjectstill need a second re-anchor pass before any live authoring: first-pass searches on the obvious type/vtable/callback constants hit unrelated camera/process and controller-save functions rather than safe class-family matches. - That second pass is now partly closed. The old
WatchEntityControllercreate lane maps onto the liveCamera_Init/Camera_CreateProcesscluster at1180:0000/0045, so those functions now carry provenance comments instead of a weaker forced rename;DialogMenuObjectstill lacks a safe live re-anchor after a second search on the obvious0x28b5/0x27ca/0x2843leads;PresentationCallbackBrokernow has its raw0009:b1c3finalize-phase caller re-anchored live asallocator_phase_finalize_passplus two preserved live slot+0x0ccallers at1278:0616and1320:1588;CacheBackendObjectgainedSetEntryNameAndTagat1250:0910; and the widenedSpriteNode::Createcaller map now shows that the0x34allocation path is the compact shared node constructor used by manyGumpCreate_*wrappers. - The next planned pilot family also started for real:
Remorse::EntityDispatchEntrynow exists in-session with provisional/Remorse/EntityDispatchEntryBaseand/Remorse/EntityDispatchEntryVtabledatatypes, so this family is no longer just a note cluster. The remaining blocker is now concrete rather than vague: the current source note still points at older0008:/000d:anchors that are not yet ported back onto the liveCRUSADER.EXEmethod objects, so the first base-method ownership move has to wait on that mapping step instead of being guessed. - That mapping step is now partially closed too. The older
0008:ba00base cluster ports into live11e0:by offset, and the first base-method batch now lives underRemorse::EntityDispatchEntry:InitBase,SetSourceType,SetEventTypeChecked,SetGroupId,Unlink, andIncrementGroupId. The next blocker on this family is therefore narrower again: not whether the pilot can move methods at all, but which live segments carry the remaining word-list, timed/periodic, and runtime-state methods from the older0008:/000d:notes. - The runtime-state follow-up is now partially closed too.
FadeProcess_Createis explicitly tagged by the decompiler as old000d:7e00,FUN_1440_0278matches the old000d:8078release path by both offset delta and behavior, and both now live underRemorse::EntityDispatchEntryasInitRuntimeStateandReleaseRuntimeStatewith a new/Remorse/EntityDispatchEntryRuntimeStateoverlay datatype. That leaves the remainingEntityDispatchEntrypilot work in a narrower end-of-day state: mainly the word-list destroy lane and the timed/periodic constructor cluster, not the core base or runtime-state surfaces. - That pilot moved one more bounded step in-session too. The periodic/timed branch from the old
0008:note cluster is now re-anchored live onto11e0:well enough to move six more methods underRemorse::EntityDispatchEntry:ConstructVtable3AD2(11e0:14fb),ConstructVtable3AA6(11e0:1814),SetUpdatePeriodAndReschedule(11e0:187e),TickPeriodic(11e0:1913),EnableActiveCounters(11e0:19e6), andDisableActiveCounters(11e0:1a33). Each now has an in-session provenance comment tying it back to the old0008:anchor, so the remainingEntityDispatchEntryblocker is narrower again: the word-list-owned subtype still has no live function objects in the expected11e0:2000..25a1window, and a bounded boundary scan did not yet yield safe entries to promote. - That remaining
EntityDispatchEntryblocker is now closed by a re-anchor correction. The expected11e0:2000..25a1window is not code in the current live database; the old0008:da00..dfa1word-list-owned subtype actually lives in the11e8:MList_*cluster, with11e8:0000carrying explicit old0008:da00segment metadata in the decompiler. That full batch now also lives underRemorse::EntityDispatchEntry:SetWordList0408Terminated,FreeWordList,Destroy,EnsureWordListContains,AppendUniqueWord,RemoveWordValue,GetWordAt,SetWordAt, andFindUnflaggedWordById10, each with an in-session provenance comment. The remaining question on this pilot family is therefore modeling depth rather than location: whether the11e8:word-list branch deserves its own explicit derived/overlay datatype instead of remaining a method cluster under the shared class owner. CreateFromSlotIndexis no longer a raw anonymous pack either: the live signature now separatesowner_source_farptr,pitemno_farptr,mode_flags,slot_index,value_add_offset,intra_chunk_offset,ucparam_farptr, anducparamsize, with explicitAX:DXreturn storage restored even though the endpoint still textualizes the function conservatively as plaindword __cdecl.
Areas That Are No Longer Live Priorities
- Startup/display transition recovery is no longer a front-line blocker unless overlap repair becomes necessary for adjacent work.
- The general cheat/debug key matrix no longer needs broad exploratory work.
- The
-debugswitch is no longer an open mystery; remaining work there is mostly sink-side cleanup and documentation. - The earlier executable-patch experiments around the hidden debugger are documented history, not a current decompilation priority unless new evidence changes the entry model.
Live Blockers
- The main remaining VM uncertainty is the real upstream selector/caller path into
entity_vm_opcode_sequence_runand adjacent masked-create helpers. One earlier producer is now closed atAreaSearch_CollideMovefor the0x236collision-storage family, but the owner-loaded class-family chooser and any broader non-collision producers are still upstream-dark. - The dark masked-materializer wrappers still need caller-role recovery, especially the signed-additive slot-
0x0a/ slot-0x0bpair and the surrounding higher-slot wrapper ladder. - The callback object rooted at
0x4588still lacks a behaviorally safe subsystem name even though its allocation/finalize neighborhood is better constrained. - A few hot or awkward function ranges still lack clean function objects or good boundaries, especially around
000c:db68,000e:ffb0, and several caller-dense gaps in0007,000b, and000e. - Weakly covered resource/data-loader families and non-
CALLFfar-pointer relocations are still a second-pass blocker for some object/table recovery work. - The segment ledger has improved, but it still trails the actual verified state in the notes and Ghidra database. Promoting known segments from documented evidence remains real work, not bookkeeping trivia.
Current Focus
- Keep the live NE
CRUSADER.EXElane as the default working surface, using raw/full-EXE and standalone-segment work only as supporting evidence. - Keep the VM/USECODE lane focused on selector recovery, caller-role recovery, and record-shape confirmation rather than repeating storage-format validation that is already closed.
- Promote ledger coverage from existing verified notes before broadening into fresh executable-wide sweeps.
- Use overlap repair only where it unlocks an active high-payoff lane.
- Use the map-renderer/tooling lane to validate shape ids, map placements, and viewer semantics before promoting additional static-object names in Ghidra.
- Keep the PSX lane focused on the final state/variant/art bridge now that the first post-spawn interaction/reselection cluster is named; avoid broad renderer-side heuristics that bypass those runtime paths.
Next Resume Point
- Resume from
docs/ne-hole-filling-priorities.mdand pick one small NE cluster where the old disasm vocabulary, extracted corpus evidence, and live NE callers overlap cleanly. - Stay on the VM lane and move one step earlier than the now-mapped movement/collision helper set around
AreaSearch_CollideMove: the local seg029/031/090 helper layer is now named, so the next work is the policy/dispatch layer that decides when those legal-move, gravity, animation, or supersprite paths instantiate the local0x236collision-storage queue, plus verification of whether any non-collision producer feeds the sameStorageDataProcess_Create/Runfamily. - Recover caller roles for the remaining dark signed-additive masked wrappers, especially the slot-
0x0a/ slot-0x0bpair, and compare them against the now-anchored slot-0x12caller pattern. - Tighten the higher-slot wrapper ladder around
0005:3115..31daso future event-label promotion depends on compiled caller behavior instead of external tables. - Tighten the seg006 masked-helper caller chains so the local state-selector/value family can be tied to concrete gameplay subsystems.
- Classify the paired seg070 loops behind
entity_vm_runtime_owner_resource_create, especially which temporary buffers and record schemas each family populates. - Stay on the Remorse VM class-lift batch while the repaired runtime lane is warm: use the now-recovered
CreateFromSlotIndexcaller pack to decide whether any remaining scalar positions deserve stronger typedefs, but keep the return semantically conservative until the base-process inheritance model is explicit enough to justify a prettier live return type. - The current broader Remorse follow-up batch is now materially tighter:
WatchEntityControlleris effectively re-identified as the live camera-process create lane,DialogMenuObjectis the last compact family here without a safe live re-anchor,PresentationCallbackBrokernow has install/teardown plus both slot+0x08and preserved slot+0x0ccaller evidence,CacheBackendObjecthas its indexed entry writer, andSpriteNode::Createnow looks like the shared compact node constructor forGumpCreate_*wrappers. The clearest next unresolved items are therefore: a safer live reanchor forDialogMenuObject, a decision on whether the camera-process lane should stay under the stronger liveCamera_*naming or also receive a class-owner layer, deeper slot+0x0cpayload classification in the broker lane, and higher-level subtype/layout work above the compactSpriteNodebase. - In the local GhidraMCP upgrade lane, add support for dual POST body decoding (
application/jsonplus form-urlencoded) and a constrained live write-side PyGhidra endpoint family so future custom-storage/type repairs can stay inside the active MCP session when Python is enabled. - Promote additional ledger rows directly from already-verified docs and live comments, especially where segments already deserve
Foothold,Partial, orDeep; the new seg029 step-aware sweep batch, seg031 queue-release batch, and seg090 movement-helper batch should be the immediate template. - If the VM lane stalls, revisit
000e:ffb0from the now-better-constrained video/audio caller windows and try to recover an adjacent non-overlapped helper before attempting broad boundary repair. - Continue the map-renderer cross-check lane by building one conservative shape-id/map-placement crosswalk from
shapedata_more_complete.txt, extracted corpora, and authored scene evidence before promoting more trigger-heavy classes in NE. - Keep the PSX pre-alpha lane alive as a secondary target: classify the
LoadExeccallers, test whether the staleTALK1.XApath is still reachable, and compare the shippedLSET1bundles against the retail extractor outputs. - Continue the retail PSX state/art lane from the new art-binding recovery baseline: keep
DAT_800758d4on the runtime-bounds side unless new family-specific evidence contradicts it, treatmap 104plus the remaining0x0042/0x0055..0x0063zero-block constructor-placement band as the primary regression target, and trace the next family-specific callers aroundpsx_type4_reselect_motion_state,FUN_80028c94, constructor-side resource creation, and the drawable-resource/frame submission lane until the remaining donor-based fallback logic can be replaced with an executable-backed alias/resource rule.
Remaining Work To Reach A Reasonably Complete Decompilation State
1. Coverage And Tracker Completion
- Keep turning the seeded 145-row ledger into a trustworthy whole-program dashboard.
- Sweep remaining lightly covered segment clusters by adjacency and call relationships rather than one-off function hunting.
- Keep the plan, the docs, the ledger, and the live Ghidra comments synchronized after each verified batch.
2. VM / USECODE / Scripting Lane
- Close the upstream selector/caller path into the sequencer and masked-create families.
- Finish separating owner-row-backed data from runtime-decoded control streams and dispatch-entry seed records.
- Expand caller-backed event-label promotion only where binary behavior and slot reuse agree.
- Keep maturing the tooling bridge from extracted corpora into compiled-side annotation/import workflows.
3. Callback / Allocator / Object-Role Lane
- Classify the
0x4588callback object strongly enough for a real subsystem name. - Separate generic cache/allocator mechanics from game-specific client behavior where caller evidence supports it.
- Keep low-level helper names conservative until behavior, not just structure, is clear.
4. Rendering / Animation / UI Support Lanes
- Keep the rendering/palette/animation lanes focused on caller-side semantics and cleanup, not exploratory renaming in isolation.
- Revisit
000e:ffb0and adjacent overlap-heavy video helpers only when the payoff is clear. - Use map-renderer evidence and extracted corpora to validate static-object and helper/controller naming before promoting it into live NE work.
5. Data / Resource / Relocation Coverage
- Tackle deferred non-
CALLFfar-pointer relocations when they are needed for active table/object recovery. - Broaden weakly covered resource/data-loader families where they block real subsystem classification.
- Keep external references like ScummVM or older disasm corpora as evidence aids, not rename authority.
Priority Order
- VM / USECODE selector and caller recovery
- Coverage-ledger refinement from already-verified notes
- Callback-object classification around
0x4588 - High-value boundary repair when it unlocks active work
- Broader segment sweeps and second-pass data/relocation work
- Secondary map-renderer and PSX follow-up lanes
Evidence Anchors
Primary files backing this plan state:
crusader_segment_coverage_ledger.csvcrusader_decompilation_notes.mddocs/overview.mddocs/ne-hole-filling-priorities.mddocs/crusader-disasm-reference.mddocs/raw-porting-progress.mddocs/raw-0008-000c.mddocs/raw-000a-000d.mddocs/raw-000e.mddocs/far-call-targets.mddocs/usecode-roundtrip-ir.md
Update Rule
Update this file when one of the following happens:
- the headline estimate changes materially,
- a live blocker is resolved,
- a subsystem moves from structural to behavioral understanding,
- a segment cluster is promoted materially in the ledger,
- or the next resume point changes enough that the current handoff would mislead the next pass.
Keep this file short. Move detailed completed analysis into the appropriate file under docs/ and leave only the current state, blockers, and forward path here.