dat: implement C deserialization codegen, improve coverage - #3632
Merged
Merged
Conversation
…on queued objects A C library, tools/dat-cli/native, that reads the archives into the game's own types on any platform, from tables `melee-dat native codegen` writes from the DWARF. It's a port of the walk that converts as it goes, so `melee-dat native expect` and the library's trace must agree: they do for all 7048 archives on 64-bit and 32-bit little-endian and 32-bit big-endian (under qemu), and every converted object reads back against its data. The dat preset builds it with the host's compiler and runs its tests in ctest. - the walk lays queued objects out as they were reached, so typedef tags apply (the CPU attack lists' DAT_TERMINATED was ignored) - CPU attack tables typed (ftCo_AttackList); stage param types moved into their headers; stage param fields typed as their data - 47 dat_symbols.txt aliases that read stage data as material animations removed - generated C casts only between different types; untyped data typed from the fields that point to it - `samples report --incomplete`, why units aren't complete - a `native` dev shell with the DWARF/dat tools, qemu and a ppc32 cross compiler; the default shell is what CI needs - clang-tidy's checks stay on src/: tools/ and the generated tables opt out Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ype indices `melee-dat native codegen` writes a directory instead of one tables.c: each type is a named `dat_type_*` descriptor with its members, in types/<header>.c for the header that declares it, along with what refers to it (pointers, arrays); roots are in roots/<module>.c; DAT_TYPE_* and DAT_NAME_* are enums. Descriptors use designated initializers, refer to types by name and keep expressions next to their members, with the annotation as written in a comment where it isn't plain. - dat/schema.h: the schema's types and the macros descriptors are written in; DAT_NONE is 0, so every field defaults to zero - members, expressions, scripts, binds and roots are pointers, not ranges of shared tables; macros expand to a depth when evaluated - the schema is generated when configuring, again when its inputs change - codegen split into generator.rs (the rows) and emit.rs (the C) Co-Authored-By: Claude Opus 5.5 <[email protected]>
ribbanya
marked this pull request as ready for review
October 5, 2026 17:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code