Repository navigation
docs(src): readable names, simple comments and moby labels for USA v1.01 - #464
Merged
Merged
Conversation
Every USA v1.01 C unit (src/core, src/game, src/levels): - a short plain-English comment above each function saying what it does; - decompiler-style locals and parameters (s0, arg0, temp_v0, var_a1, ...) and unkXX fields of file-local structs renamed to meaningful names; - moby class ids in code labelled from docs/game/moby-dispatch.tsv, e.g. `0x1366 /* Miniturret */`, or `/* moby class N */` when unlabelled. include/names.h gains 7,463 descriptive aliases (8,508 in all) for USA v1.01 functions and data, following its rule: definitions and extern declarations keep the catalogue names, bodies use the readable ones. Duplicate names carry a level or address suffix; a name that already exists as an identifier anywhere in src/, include/ or nonmatching/ was suffixed so no macro changes another unit. 156k call sites now use the aliases; files that used an alias before reaching common.h include names.h. src/game/0029B658-rc2.c keeps its call by address: test_rectangle_forwarding compiles it with a mock common.h. config/fakematch.tsv: one row reordered by tools/fakematch.py --write. Only identifiers and comments changed; no types, expressions or statement order. Checked: - tools/check.py on every function in every changed file: all places match - tools/build.py all --strict: 28 of 28 programs OK - tools/build.py all --strict --version pal: 28 of 28 OK - tools/build.py all --strict --version us2: 28 of 28 OK - python3 -m unittest discover -s tests: 719 tests OK (1 skipped) - tests/check_repository.py: passes; tools/progress.py --check: current No functions added (8527 of 8527 USA v1.01 already matched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5SuSWfsnhvdxHUytjjSze
ByteMatch progress reportSCPS_150.56
No function changes. SCKA_200.11
No function changes. SCUS_972.68_v2
No function changes. SCES_516.07
No function changes. SCUS_972.68
No function changes. Commit 1a9bd7d · Ratchet & Clank: Going Commando on ByteMatch |
Lynder063
added a commit
that referenced
this pull request
Nov 15, 2026
…nitions too Carry rac1-decomp's naming scheme (docs/contributing/names.md, style.md): - config/names.tsv is the table (symbol, name, tier, source, evidence, alternatives); config/names_local.tsv holds names given from reading the code; tools/names.py (local, header, apply-defs, apply, check, rename, lookup) generates include/names.h and include/names/*.h, one part per level plus executable.h and shared_levels.h. - Definitions, bodies, extern lines and prototypes use the readable name; INCLUDE_ASM/ASM_FUNC lines, __asm__ labels and SDATA() keep the address. tools/srcnames.py maps readable names back for the tools that look for a definition by address: check.py, progress.py, fakematch.py, fcheck.py and tests/check_repository.py read source through it. - The 7,463 names PR #464 gave are respelled snake_case, system first (UpdateYetiMoby -> yeti_update, gActiveYetiCount -> g_active_yeti_count); a level's copy of a shared routine puts the level after the system (hero_l04_update_state_machine). Library routines keep their own spelling. The 1,045 names from before (recovered names and RAC1 counterparts) keep theirs. A name that is already an identifier in src/ is left out instead of suffixed (12: memcpy, strlen, rand, ...). - AGENTS.md's naming rule now points at the rac1 scheme; new docs/contributing/names.md and style.md. - test_rectangle_forwarding's mock common.h includes the real names.h. 8,495 names in names.h; 7,944 definitions and about 415k uses renamed. Checked: - tools/build.py all --strict: 28 of 28 programs OK - tools/build.py all --strict --version pal: 28 of 28 OK - tools/build.py all --strict --version us2: 28 of 28 OK - python3 -m unittest discover -s tests: 719 tests OK (1 skipped) - tests/check_repository.py, tools/progress.py --check, tools/names.py check, tools/fakematch.py: pass Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5SuSWfsnhvdxHUytjjSze
Lynder063
added a commit
that referenced
this pull request
Nov 15, 2026
…s ids - The camelCase locals, parameters and file-local struct fields PR #464 introduced are respelled snake_case (pathPoint -> path_point), as rac1-decomp's style asks: 6,043 names in 1,091 files. Only names whose every use in the file came from PR #464 were changed, and none that would clash with a readable name, a header identifier or another name in the file. - include/moby_classes.h (included by common.h) names the 198 moby class ids that have a label in docs/game/moby-dispatch.tsv; a label several ids share gets _2, _3 ... in id order. The 661 `0x10D0 /* Y.E.T.I. */` labels in code become MOBY_CLASS_YETI and so on. Unlabelled classes keep their number and `/* moby class N */` comment. Only identifiers and literals spelled through macros changed. Checked: - tools/build.py all --strict: 28 of 28 programs OK - tools/build.py all --strict --version pal: 28 of 28 OK - tools/build.py all --strict --version us2: 28 of 28 OK - python3 -m unittest discover -s tests: 719 tests OK (1 skipped) - tests/check_repository.py, tools/progress.py --check, tools/names.py check, tools/fakematch.py: pass Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E5SuSWfsnhvdxHUytjjSze
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.
What
A readability pass over every USA v1.01 C unit (
src/core,src/game,src/levels, 3,500+ files, about 8,150 functions):s0,arg0,temp_v0,var_a1, ...) andunkXXfields of file-local structs are renamed to meaningful names (moby,vars,pathPoint, ...).docs/game/moby-dispatch.tsv, e.g.0x10D0 /* Y.E.T.I. */, or/* moby class N */when the class has no label.include/names.hgains 7,463 descriptive aliases (8,508 in all), following the file's own rule. Definitions andexterndeclarations keep the catalogue names (func_…,D_…), and bodies use the readable ones (about 156k call sites).UpdateArcticLeviathanMoby,UpdateYetiMoby,GlowAllMystics,gActiveYetiCount._L11,_00115250).src/,include/ornonmatching/is also suffixed, so no new macro can change another unit or release.ASM_FUNC/handwritten routines, have no alias yet.common.hnow includenames.hnear the top.src/game/0029B658-rc2.ckeeps its call by address becausetest_rectangle_forwardingcompiles it against a mockcommon.h.config/fakematch.tsvhas one row reordered bytools/fakematch.py --write.Only identifiers and comments changed. No types, expressions, constants or statement order were touched. A token-level diff of every file against
mastershowed differences only at identifier positions.Checked
tools/check.pyon every function in every changed file: all places matchpython3 tools/build.py all --strict: 28 of 28 programs OKpython3 tools/build.py all --strict --version pal: 28 of 28 OKpython3 tools/build.py all --strict --version us2: 28 of 28 OKpython3 -m unittest discover -s tests: 719 tests OK (1 skipped)python3 tests/check_repository.py: passespython3 tools/progress.py --check: report current, 8527 matched functionsThis PR adds no functions and leaves
progress/report.jsonuntouched. JP and KR sources were not changed or built.🤖 Generated with Claude Code
https://claude.ai/code/session_01E5SuSWfsnhvdxHUytjjSze