Skip to content

it: declare Article attribute unions and typed callers - #3600

Merged
itsgrimetime merged 12 commits into
doldecomp:masterfrom
itsgrimetime:codex/dat-root-bindings-samus
Oct 4, 2026
Merged

itsgrimetime merged 12 commits into
doldecomp:masterfrom
itsgrimetime:codex/dat-root-bindings-samus

Conversation

@itsgrimetime

@itsgrimetime itsgrimetime commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Article.x4_specialAttributes hides different item layouts behind void*. Declare it as union ItemSpecialAttributes*, describe the concrete layouts in C, and access named members at item and fighter callers. Remove the DAT_TYPE override and attribute-pointer casts while preserving the original binary.

Reuse members for genuinely shared layouts, including Game & Watch/Kirby's Chef Pan and itSanseijuuAttributes for Entei/Raikou/Suicune. Give Freeze, Bunny Hood, Metal Box, and Kirby's dropped-copy ability their actual records; describe complete Pokémon layouts and food/animation/trailing arrays. Preserve established identifiers and unknown offset field names. The TODO update documents remaining discriminator and inline-array count support.

This general cleanup is independent of #3619 and uses the existing DAT CLI. Loader bindings, the fighter-slot union and required callers, and Samus's grapple sampling/count fix are in #3619. Neither PR requires the other to merge first. Remaining item-kind conditions and matrix typing/sampling are follow-ups.

Validation:

  • The MWCC game build retains 100% matching code/data and passes the original DOL checksum.
  • Clang syntax/AST checks pass for all 147 Article callers, with no attribute-pointer casts. Local commit checks pass.
  • With the unchanged CLI, the Clang DAT pipeline matches 12,087/12,089 samples across 838 archives. The two existing mismatches are Samus's x8_hurtbones_x352D8 and Game & Watch's dyn_descs_0_x78F0.
  • Rebased onto current master. Old Goomba uses master’s canonical itOldkuriAttributes declaration and typed nested fields through the oldkuri union member; there is no duplicate declaration. Its 16-byte layout is verified in DWARF. Original archives and generated output are excluded.

Comment thread config/GALE01/dat_symbols.txt Outdated
Comment thread src/melee/ft/types.h Outdated
@itsgrimetime itsgrimetime changed the title dat: bind fighter roots and type Samus grapple data dat: type fighter item roots and Article attributes Oct 1, 2026

@ribbanya ribbanya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are any of the dat-cli changes necessary still?

@itsgrimetime

itsgrimetime commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Are any of the dat-cli changes necessary still?

@ribbanya

yeah i'm pretty sure they're still needed for the samus fix (but not for the article cleanup). the rust changes are what brings the fighter kind from the loader's name table into the walk & letting DAT_IF select it in the right slot

without those changes it reports an ambiguous union at samus's slot 4

@ribbanya ribbanya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If it is necessary, please split the PRs. A src-only changeset would be much easier to review.

@itsgrimetime itsgrimetime changed the title dat: type fighter item roots and Article attributes ft, it: type fighter item and Article attribute unions Oct 2, 2026
Comment thread src/melee/ft/kinds/ftCommon/ftCo_0D8E.c Outdated
Comment thread src/melee/it/kinds/itcerebi.c Outdated
Comment thread src/melee/it/kinds/itfflowerflame.c Outdated
Comment thread src/melee/it/kinds/itfoods.c Outdated
@itsgrimetime
itsgrimetime requested a review from ribbanya October 3, 2026 06:02
Comment thread src/melee/it/kinds/itkamex.c Outdated
Comment thread src/melee/it/itemattrs.h Outdated
Comment thread src/melee/it/kinds/itkirbygamewatchchefpan.c Outdated
Comment thread src/melee/it/itemattrs.h Outdated
Comment thread src/melee/it/itCommonItems.h Outdated
@ribbanya ribbanya added ai-assisted Utilizes a LLM to do the heavy lifting portability Improves non-matching builds labels Oct 3, 2026
ribbanya
ribbanya previously approved these changes Oct 3, 2026
@itsgrimetime
itsgrimetime force-pushed the codex/dat-root-bindings-samus branch from ed1a2c9 to f44f876 Compare October 3, 2026 20:50
@itsgrimetime itsgrimetime changed the title ft, it: type fighter item and Article attribute unions it: declare Article attribute unions and typed callers Oct 3, 2026
ribbanya
ribbanya previously approved these changes Oct 3, 2026
@itsgrimetime
itsgrimetime enabled auto-merge (squash) October 3, 2026 23:30
@itsgrimetime
itsgrimetime force-pushed the codex/dat-root-bindings-samus branch from 2ed0828 to fb35f2a Compare October 4, 2026 06:12
@itsgrimetime
itsgrimetime merged commit c057575 into doldecomp:master Oct 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Utilizes a LLM to do the heavy lifting portability Improves non-matching builds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants