Skip to content

o_container_wood: match init and dest, disp at 99.78% - #8

Open
thescorcher wants to merge 2 commits into
roeming:mainfrom
thescoocher:wood-container
Open

thescorcher wants to merge 2 commits into
roeming:mainfrom
thescoocher:wood-container

Conversation

@thescorcher

@thescorcher thescorcher commented Oct 11, 2026 •

Copy link
Copy Markdown

Start of the wood container with three of the five functions. Claude wrote the C, verified the matches in objdiff and I'm still learning to read the C. Validation is 100, 100, 99, with the last one needing ContainerWood_exec to be complete. I’m holding off on that one for now because it overlaps with the iron container. I wasn’t sure if the wood container was already taken, so I’m happy to close this if it is. Any naming that should change?

Claude Desc:
ContainerWood and ContainerWood_dest match.

ContainerWood_disp matches except for the position of one float constant, which depends on ContainerWood_exec being written.

Rename ContainerWood_0..3 to dest/exec/disp/dispSort after o_container_chao. Object stays NonMatching.

ContainerWood and ContainerWood_dest match. ContainerWood_disp matches
except for the position of one float constant, which depends on
ContainerWood_exec being written. Rename ContainerWood_0..3 to
_dest/_exec/_disp/_dispSort after o_container_chao. Object stays NonMatching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@decomp-dev

decomp-dev Bot commented Oct 15, 2026

Copy link
Copy Markdown

Report for GSNE8P (874a480 - db0a526)

📈 Matched code: 4.80% (+0.00%, +556 bytes)

✅ 3 new matches
Unit Item Bytes Before After
stg13D/OBJECT/o_container_wood ContainerWood_disp +268 0.00% 100.00%
stg13D/OBJECT/o_container_wood ContainerWood +232 0.00% 100.00%
stg13D/OBJECT/o_container_wood ContainerWood_dest +56 0.00% 100.00%
📈 1 improvement in an unmatched item
Unit Item Bytes Before After
stg13D/OBJECT/o_container_wood .rodata +21 0.00% 24.00%

@roeming

roeming commented Oct 15, 2026

Copy link
Copy Markdown
Owner

For floats not matching, sometimes we add a fake function like static float rodata_fix() { return FLOAT; } and put that between functions. In reality what probably happened is there was a function that existed but was stripped out by the compiler, but that still effected when the first occurrence of that float was.

Comment thread src/OBJECT/o_container_wood.c Outdated
extern int lbl_803ADAD0;
extern NJS_VECTOR *lbl_80175378[];

extern NJS_TEXLIST lbl_13_data_215698;

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.

These are most definitely part of this file, look at o_container_chao.c and config\GSNE8P\config.yml to see examples on how to extract models and textures. You may have to mark some display list variables as align:32 in symbols.txt and ATTRIBUTE_ALIGN(32) in the .c. Ideally, any variables/functions in this rel (labeled fn_13_* or lbl_13_*) are named to something sensible before linking, even if it's something like o_cont_wood_material_0. When we pull those changes across other rels, it helps to have everything named because those rels will have different prefixes like lbl_14_* and the addresses will basically never line up.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

all the data is now defined in the file and extracted through config.yml like the Chao Container; .data is at 100%; the module’s data symbols are renamed to o_cont_wood_*

is that right, or do you want those handled differently?

Comment thread src/OBJECT/o_container_wood.c Outdated
tp->exec = ContainerWood_exec;
tp->dest = ContainerWood_dest;
switch (_rename_GetStageNum()) {
case 60:

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.

This will be STAGE_B_BIGFOOT, you can find it in samt\sonic\game.h

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in commit 2

Comment thread src/OBJECT/o_container_wood.c Outdated
case 61:
case 62:
_rename_njSubVector(&twp->pos, lbl_80175378[lbl_803ADAD0], &v);
if (njScalor2(&v) < 900.0f) {

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.

this is distance squared, could you replace 900.0f with SQ(30.0f)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in commit 2

Define the texture lists, GJ and chunk models, break-piece table, draw
table and collision in o_container_wood.c, with assets extracted via
config.yml like o_container_chao. Name the module's data symbols
o_cont_wood_* and mark the display lists align:32. Use STAGE_B_* names
for the boss stages and SQ(30.0f) for the distance check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thescorcher
thescorcher requested a review from roeming October 18, 2026 00:14
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.

2 participants