Skip to content

Decompile 33 functions across 4 source files#35

Open
McMarius11 wants to merge 1 commit intomkst:masterfrom
McMarius11:decomp-33-functions
Open

Decompile 33 functions across 4 source files#35
McMarius11 wants to merge 1 commit intomkst:masterfrom
McMarius11:decomp-33-functions

Conversation

@McMarius11
Copy link
Copy Markdown

Summary

  • blood.c (game_161520.c): 20 new functions decompiled (58 → 38 GLOBAL_ASM remaining)
  • game_16EE20.c: 9 new functions decompiled (71 → 62 remaining)
  • game_1944C0.c: 2 new functions decompiled (37 → 35 remaining)
  • game_981E0.c: 2 new functions decompiled (59 → 57 remaining)

Notable matching techniques used

  • switch statements to produce beqz/beql sequential forward branches instead of bnel from if-else chains
  • Same-line trick for instruction scheduling (memcpy(); *(s16*)... = -*(s16*)...;)
  • Raw pointer casts (*(s32*)((u8*)arg0 + 0x1C)) when struct field type doesn't match ASM load width
  • Float 0.0f placed last in source to let IDO schedule mtc1 zero earlier (pipeline optimization)

Infrastructure additions

  • include/auto_funcs.h / include/auto_vars.h — auto-generated declarations for undefined symbols
  • struct102 field extensions (unk40–unk1D4)
  • tools/score_functions.py — scores remaining GLOBAL_ASM functions by difficulty
  • tools/gen_expected.sh — generates expected .o files for asm-differ
  • tools/gen_progress.py — tracks decompilation progress
  • Build fixes for mips64-linux-gnu- cross toolchain (Fedora)

Test plan

  • Verify build completes with make (may need CROSS=mips64-linux-gnu- on Fedora)
  • Verify matched functions produce identical .o output via asm-differ

🤖 Generated with Claude Code

blood.c (game_161520.c): 58 → 38 GLOBAL_ASM (-20 functions)
- func_1513416C, func_151346D0, func_151346EC, func_1513470C,
  func_1513472C, func_1513477C, func_151348F0, func_15134CD4,
  func_151352EC, func_1513530C, func_15135658, func_15135670,
  func_15136A1C, func_15135424, func_15137E10, func_151368A8,
  func_151380B4, func_1513532C, func_151353A8, func_1513B0B8,
  func_15136A50, func_15134CEC, func_15134DAC, func_1513555C,
  func_151355B8, func_15135480, func_15134908

game_16EE20.c: 71 → 62 GLOBAL_ASM (-9 functions)
- func_15142A5C, func_15143044, func_15143E64, func_15144A74
  and 5 others from previous sessions

game_1944C0.c: 37 → 35 GLOBAL_ASM (-2 functions)
game_981E0.c: 59 → 57 GLOBAL_ASM (-2 functions)

Also adds:
- auto_funcs.h / auto_vars.h for undefined symbol declarations
- struct102 field extensions (unk40-unk1D4)
- Build fixes for mips64-linux-gnu cross toolchain
- Helper tools: score_functions.py, gen_expected.sh, gen_progress.py

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mkst
Copy link
Copy Markdown
Owner

mkst commented Mar 30, 2026

I don't think I want this...

@McMarius11
Copy link
Copy Markdown
Author

McMarius11 commented Mar 30, 2026

I don't think I want this...

i thought this could help by decompiling the functions.
i can change the PR to only include the functions if you like.

@ShizCalev
Copy link
Copy Markdown

ShizCalev commented Mar 30, 2026

🤖 Generated with Claude Code

I think a larger concern is that this is an AI Slop generated PR & that your py scripts still have AI generated comments in them that say things like "Almost Done."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants