Skip to content

WORLD : func_800B338C decompiled - #265

Open
chaisito wants to merge 1 commit into
Xeeynamo:mainfrom
chaisito:decomp-world-func_800B338C
Open

chaisito wants to merge 1 commit into
Xeeynamo:mainfrom
chaisito:decomp-world-func_800B338C

Conversation

@chaisito

@chaisito chaisito commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

NOTE THAT:
This function is a matching decomp, however, the current implementation uses
register s32 var_a3 asm("$7"); and
__asm__("" : "=r"(var_a3) : "0"(var_a3));

@chaisito
chaisito force-pushed the decomp-world-func_800B338C branch from 13d4a52 to 5d763ea Compare October 5, 2026 17:13

@Xeeynamo Xeeynamo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The register keyword is strictly disallowed: https://github.com/Xeeynamo/ff7-decomp/blob/main/STYLE.md . It is unlikely the original function was written like that.

@chaisito
chaisito force-pushed the decomp-world-func_800B338C branch from 5d763ea to ac7e9dd Compare October 6, 2026 07:18
@chaisito

chaisito commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Fixed it already, feel free to comment anything before merging.
Cheers!

Comment thread src/world/world.c

INCLUDE_ASM("asm/us/world/nonmatchings/world", func_800B338C);
WorldSoundArea* func_800B338C(s16 arg0, s16 arg1) {
WorldSoundArea* var_a2;

@Zaarbs Zaarbs Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this may have been some cursed ternary use. This should match:

return (arg0 == 5 && arg1 == 18) ? D_800C68E8
     : (arg0 == 4 && arg1 == 17) ? &D_800C68FC
     : (arg0 == 4 && arg1 == 14) ? &D_800C6910
     : NULL;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’ll test this exact ternary form. This function has been extremely sensitive to codegen, and using separate D_800C68FC / D_800C6910 symbols was causing overlap issues in lint, so I may need to use &D_800C68E8[1] / [2] instead. If it still matches, this would definitely be much cleaner.

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