Skip to content

Conversation

@malvarezcastillo
Copy link
Contributor

More vacuuming work

malvarezcastillo and others added 19 commits January 29, 2026 12:01
All three functions matched at 100%.
Integrated 5 functions that achieved high sandbox matches but failed
automatic integration:

- un_80309338 (99.88%) - Vec3 distance calculation
- un_803062EC (99.91%) - Debug text display
- un_80307018 (99.91%) - Background/fog setup
- un_8030813C (99.86%) - Trophy model lookup
- un_803078E4 (96.76%) - Light/sprite setup

Fixed multiline string issues and prototype mismatches during
integration.
- un_803053C4: 97.5%
- Trophy_SetUnlockState: 94.9%
- un_80305918: 98.7%
- un_80306C5C: 91.1%
- un_803075E8: 96.3%
- un_803078E4: 96.8%
- un_80307F64: 98.4%
- un_80308354: 68.1%
- un_803082F8: 91.2%
- un_803102D0: 72.4%
- un_803109A0: 87.7%
- un_80311788: 81.3%
- un_80312050: 91.8%

Also add missing header includes for gobjgxlink.h, gobjobject.h, gobjplink.h
- un_80305FB8 (70.8% match) - C-stick Y input
- un_80306D70 (82.6% match) - Sound play helper

These are best-effort decompilations. The code is functionally
equivalent but doesn't match byte-for-byte due to compiler
code generation differences.
- un_80306EEC (96.3%) - Light object loading
- un_8030715C (92.2%) - Camera/light position update
- un_80307BA0 (99.4%) - Trophy JObj setup
- un_80310324 (89.2%) - Trophy display initialization

Also fix related header prototypes for un_8030FE48, un_803087F4,
un_8030FA50.
@encounter
Copy link
Contributor

encounter commented Jan 29, 2026

Report for GALE01 (762fb72 - 2553449)

📈 Matched code: 51.38% (+0.08%, +2940 bytes)

✅ 11 new matches
Unit Item Bytes Before After
main/melee/ty/toy un_803064B8 +388 0.00% 100.00%
main/melee/ty/toy un_8030663C +384 0.00% 100.00%
main/melee/ty/toy un_80307018 +324 0.00% 100.00%
main/melee/ty/toy un_80308DC8 +316 0.00% 100.00%
main/melee/ty/toy un_80311680 +264 0.00% 100.00%
main/melee/ty/toy un_80305EB4 +260 0.00% 100.00%
main/melee/ty/toy fn_80307E84 +224 0.00% 100.00%
main/melee/ty/toy un_80306A48 +208 0.00% 100.00%
main/melee/ty/toy un_803083D8 +200 0.00% 100.00%
main/melee/ty/toy un_80311F5C +188 0.00% 100.00%
main/melee/ty/toy un_80306954 +184 0.00% 100.00%
📈 19 improvements in unmatched functions
Unit Item Bytes Before After
main/melee/ty/toy un_80308F04 +1074 0.00% 99.88%
main/melee/ty/toy un_803084A0 +850 0.00% 99.85%
main/melee/ty/toy un_80310324 +796 0.00% 96.25%
main/melee/ty/toy un_80310660 +792 0.00% 95.20%
main/melee/ty/toy un_80307BA0 +739 0.00% 99.95%
main/melee/ty/toy un_8030715C +726 0.00% 92.21%
main/melee/ty/toy un_803078E4 +677 0.00% 96.76%
main/melee/ty/toy un_80305918 +616 0.00% 98.72%
main/melee/ty/toy un_803075E8 +554 0.00% 96.32%
main/melee/ty/toy un_80306D70 +313 0.00% 82.60%
main/melee/ty/toy un_80306EEC +288 0.00% 96.32%
main/melee/ty/toy un_8030813C +264 0.00% 95.72%
main/melee/ty/toy un_803062EC +231 0.00% 99.91%
main/melee/ty/toy .sdata2 +209 8.70% 68.01%
main/melee/ty/toy un_803063D4 +205 0.00% 90.32%
main/melee/ty/toy un_80305FB8 +204 0.00% 78.74%
main/melee/ty/toy un_80309338 +203 0.00% 99.92%
main/melee/ty/toy .sdata +48 0.00% 86.54%
main/melee/if/textlib un_80304D30 +5 93.81% 94.35%

The asm function definition was causing syntax errors. Call un_803063D4
directly instead of going through the call_text_func wrapper.
- un_8030813C: Change first param back to s16 (restores gm_1601 matches)
- un_803063D4: Change to s32 return with s16 first param (restores un_803082F8/un_80308328)

These prototype fixes restore cross-file compatibility at the cost of
reducing un_803063D4 match from 100% to 90.32%.
@malvarezcastillo
Copy link
Contributor Author

Running permuter on 99% matches, then doing my own review, then flagging for review, please be patient 😆

- un_8030663C: Add temp variable in else branch for register alloc
- un_80307018: Stack padding + variable reorder (applied by agent)
- un_80306A48: Temp variables + declaration order changes
- un_80311680: Split increment into separate load and add

All 4 functions now 100% matched.
- Fix stale match percentages (un_80305FB8, un_80306EEC, un_8030715C, un_80310324)
- Remove 100% match comment from un_803082F8 (now matches)
- Add missing match comments for un_803063D4, un_80306D70, un_8030813C, un_80310660
- Add FAKE MATCH comment for dead code in un_80306EEC
- Remove duplicate forward declaration of un_80306BB8
@malvarezcastillo malvarezcastillo marked this pull request as ready for review January 29, 2026 18:59
Comment on lines +647 to +648
// Decompilation of un_803062EC
// Unit: main/melee/ty/toy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you get it to stop doing this?

Comment on lines +369 to +372
skip = 1;

check_skip:
if (skip == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you can teach it to create an inline function every time it wants to create a label. In this case, this is clearly an inline bool whose result is being checked.

Comment on lines +407 to +409
next_iter:
var_r25++;
var_r27 += 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing is a for loop and any goto next_iter should be continue.

Comment on lines +742 to +749
typedef struct {
s16 x0;
s16 x2;
s16 x4;
s16 x6;
s16 x8;
s16 xA;
} ToyNameData;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put type definitions at the top of the file. Maybe use your static checker to flag them and then just move them up manually.

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