Tidy the repo root: build.sh's derived tables into analysis/, build.sh, decompile.sh and find.sh into scripts/, stale by-products removed, .gitignore regrouped, README describes the src/ layout and the test harness

This commit is contained in:
shweet committed 2026-11-23 20:24:03 -05:00
1 parent aefd3e2098
commit 7d407d5c19
17 files changed
+140 -86

No files matched your search

+2 -2
View File
@@ -45,13 +45,13 @@ How to take over a class:
- Names: keep Rebirth's names for the class and for methods the game has (ANM2::Play, StringTable::GetString, ItemConfig::Load ...). Name fields in camelCase without a leading underscore (_spriteSheetPath becomes spriteSheetPath). Use REPENTOGON's names (repentogon/libzhl/functions/*.zhl) where they exist. Everything else follows CLAUDE.md: noun_verb snake_case free functions, camelCase locals, "is" booleans.
- Method signatures may become idiomatic (std::string_view instead of std_string*, references instead of pointers, enums instead of ints) when that is clearer. Keep the meaning.
- Each method the original has gets a comment directly above it that starts with its address (or addresses, if you merged several), then one short sentence: "// 0040bd50 Loads the .anm2 at path, sharing parsed files through the cache." The generator stops emitting a function once src/ carries its address.
- Take over the WHOLE class you are assigned: every method the class has in the original that the game needs (see generated-src/classes.h for the list and generated-src/<class>.cpp, ./decompile.sh <address>, ./decompile.sh --asm <address> N for bodies).
- Take over the WHOLE class you are assigned: every method the class has in the original that the game needs (see generated-src/classes.h for the list and generated-src/<class>.cpp, scripts/decompile.sh <address>, scripts/decompile.sh --asm <address> N for bodies).
- Collapse compiler-generated ones (copy constructors, operator_assign, destructors that only free members) into the language defaults where std members make them unnecessary, and still list their addresses in a comment above the class so the generator drops them: "// Copies, assignment and destruction (0040b000, 0040b1d0, 0040ae70) are the defaults."
- Behaviour must match the original exactly: same results, same order of effects, same edge cases. Where the original crashes or has undefined behaviour, pick a safe behaviour and say so in one comment line.
- Data: XML is converted by the import tool into JSON under resources/ (lowercase paths, ".json" appended). Read it through src/engine/data.h: data_load, node_children, node_tag, node_attr, node_text. Element order is preserved and attribute values are the original strings. A file with several roots becomes {"tag":"#document","children":[...]}. Convert values exactly as the original did. resources/ holds the real converted game files: look at them.
- Other classes: call whatever classes.h declares for classes nobody has taken over (they are stubs for now). Do NOT edit src/ files other than your own: other agents are rewriting other classes at the same time. If a round 1 file outside your assignment calls something you changed, list the needed call-site change in your report.
- Every file you write must compile with no warnings: clang++ -std=c++20 -fsyntax-only -Wall -Wextra -I src -isystem ${R}/gen_\${i} -isystem external/simdjson/singleheader -isystem external/sdl/include -isystem external/lua -isystem external/stb src/<file>.cpp
- First regenerate your private header with python3 -I scripts/source_tree.py ${R}/gen_\${i} classes.tsv dump zhl_vtables.tsv. Rerun it after creating your .h, because the generator drops the classes your header defines.
- First regenerate your private header with python3 -I scripts/source_tree.py ${R}/gen_\${i} analysis/classes.tsv dump analysis/zhl_vtables.tsv. Rerun it after creating your .h, because the generator drops the classes your header defines.
- Round 1 files that depend on your old API may stop compiling. That is expected, so only check your own files.
- Style details from CLAUDE.md:
- Allman braces; a one-line body stays on one line without braces.