ApplyProtos: REPENTOGON register notation (float r<xmm3>, int x<edx>, float<xmm0> returns, static cleanup) via custom storage

Whole-program optimisation passes many floats in XMM registers and some arguments in ECX/EDX with the caller popping the
stack; those declarations were skipped. Every prototype is now applied with explicit storage (this in ECX for __thiscall).
Tested on a project copy: 1103 -> 1158 applied from the existing files (REPENTOGON's register declarations now fit),
e.g. void __thiscall Game::SetBloom(Game *this,int Time,float Strength).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-25 20:25:00 -04:00
1 parent df5db46f62
commit 36ae4cbfb8
3 files changed
+58 -28

No files matched your search

+3 -1
View File
@@ -89,7 +89,9 @@ read from the game's own trivial Lua getters, e.g. Entity 0x334 `_targetPosition
are typed too (`npc->_sprite._animState._isPlaying`).
**Prototypes** come from REPENTOGON's declarations only where this exe confirms them: a `__thiscall`/`__stdcall` callee
pops its own stack arguments (`RET n`), so the declared parameters must add up to `n` (`scripts/ApplyProtos.java`, about
600 functions, plus `db/protos.zhl`; the comment says `prototype: REPENTOGON, confirmed by RET n` or names the db file).
1,150 functions with `db/protos.zhl`; the comment says `prototype: REPENTOGON, confirmed by RET n` or names the db file).
Whole-program optimisation gives some functions other registers; REPENTOGON's notation covers them: `float r<xmm3>`,
`int x<edx>`, a `float<xmm0>` return, and `static cleanup` for a caller that pops the stack (RET n cannot check those).
Methods with a REPENTOGON `__thiscall` declaration get a typed `this`; so does any other `Class::method` whose reads
from ECX land at least 60% inside Class's confirmed fields (`scripts/this_types.py`, ~800 methods; the Lua `Sprite` and
`Color` classes are ANM2 and ColorMod). Every `NpcAI::` routine is