Jonas VolmanandClaude Opus 5 884f9db1e1 Close unit_animation_set_state with a graph-index carrier local
Route the three animation_choose_random_permutation_internal call sites
through a long animation_graph_index local, matching the byte-exact
unit_start_animation_impulse idiom at units.c:8535 and units.c:3245.
unit_animation_set_state was the file's only site that inlined the field
expression into the call.

That flips one allocator decision: January spends EDI on the unit_seat
pointer (mov edi,eax / lea eax,[edi+0x58] / mov [ebp-0x1c],edi, then
direct mov ecx,[edi+0x40] and [edi+0x44] later) and homes animation_index
at [ebp-0xc); we did the reverse and reloaded the pointer at every use.
The frame going 0x18 -> 0x1c and all three or edx,0ffffffffh sites were
consequences, not separate differences.

units.obj code census 186/3/0 -> 187/2/0; data unchanged at 129/0/0.

Also reproduce January's setcc spelling in unit_update_animation: split
the shared alert/suspicious case arm and write the in_combat arm with no
byte-typed intermediate. setcc r8 ; movzx r16,r8 occurs zero times in all
9352 January functions; the new shape emits January's
xor ebx,ebx / test cl,cl / setne bl / add ebx,2 and matches January's
relocation layout exactly (relocation_infos_equal was False, now True).
Still non-exact: 23 bytes, all register choices.

CL /Zs /W3 unchanged at 43 diagnostics with identical codes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 21:17:04 -07:00
2025-11-27 02:27:27 +00:00
2026-01-03 00:47:17 +00:00
2026-06-29 11:34:11 +01:00
2026-06-16 11:29:59 +01:00

Halo 1 decompilation Build Status Code Progress Data Progress

This is a work-in-progress decompilation of Halo: Combat Evolved build 2342 (cachebeta.exe, sha256 4cc87b45f721270392a96f1674ed2b5cd4a7bb4355faeab4531d1cf1884d9520).

Build instructions

You must source the Halo 1 PAL debug build and the August 2001 Xbox SDK yourself. You also need ninja-build on your PATH.

Extract the XDK/xbox folder from the installer into the repository root such that xbox/{bin,include} are valid paths. Place cachebeta.exe from the Halo 1 build into your repository root. Navigate to the repository and run configure.py in the terminal.

Then, use ninja build to compile the game and report progress statistics, or open the cachebeta.sln VS2022 project under projects on Windows.

Where's all the type information?

We use debug symbols from later Halo games to help map structures, enums, type definitions, function signatures and some variable names. You should obtain a copy of the Halo CEA beta and run it through pdb-decompiler to obtain debug info for yourself. Note that CEA is based off of Halo PC and has its own modifications which make it not 100% accurate to the original Xbox title.

2026-10-25 23:00:28 +01:00
Languages
C 92.1%
Python 5.4%
JavaScript 0.7%
Java 0.6%
C++ 0.2%
Other 0.6%