Repository navigation
feat(src): match four USA v2.00 functions - #443
Open
gelatinous-bullion wants to merge 1 commit into
Open
gelatinous-bullion wants to merge 1 commit into
gelatinous-bullion wants to merge 1 commit into
Conversation
Four of the release's own functions, each the C of a matched USA v1.01 function with v2.00's differences: - func_US2_002CCAA0 (376 bytes, boot and 27 levels): func_002CBAE0 with three callees renamed; D_001AB910 stays volatile as in func_002CBAE0 and func_002CBC58 (retail rereads it per test and keeps one discarded load; 328 bytes without the qualifier). - func_US2_002957C0 (1,452 bytes, boot and 27 levels): func_00294F10, the allocator's source-line arguments 8 higher, func_0029D4D0 is func_US2_0029E308; same -G64 la-addend flags. - func_US2_L05_0041F478 (3,516 bytes, level 05): func_L05_0041DF58, text ids 0x16A lower, two callees renamed. - func_US2_0026EDE8 (2,348 bytes, boot): func_0026EDE8, skipping resource table 1, the pad's pressed word at 0x1A4, sixteen callees renamed; same call-used flags. Catalogue: func_US2_0026EDE8's row stopped before its `jr $ra; addiu $sp,$sp,0xD0` (no row held those words; a padding nop follows). A measured FUNCTION_END_EXTRA entry, as for PAL's func_PAL_0026EC50, gives them back; tools/carry.py --version us2 --entries changed only that row (2340 -> 2348). Checked on 045f54e: - tools/check.py --version us2: 28/28, 28/28, 1/1, 1/1 places match. - tools/build.py all --strict --version us2: 28 programs OK; each function is placed in every program that has it, none rejected. - tools/build.py all --strict (v1.01): 28 programs OK. - tests/check_repository.py and tools/progress.py --check pass; unit tests pass (the compiler tests run in the rac2-build container). - PAL not checked (no PAL disc); the catalogue entry is v2.00's only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Four of USA v2.00's own functions, each the C of a matched USA v1.01 function with v2.00's differences, plus one measured catalogue entry correction.
func_US2_002CCAA0func_002CBAE0func_US2_002957C0func_00294F10func_0029D4D0isfunc_US2_0029E308; same-G64la-addend flagsfunc_US2_L05_0041F478func_L05_0041DF58func_US2_0026EDE8func_0026EDE8pressedword at 0x1A4 (as elsewhere in v2.00); sixteen callees renamed; same call-used flagsAll four are reserved in my #152 comment. (
func_US2_L04_004127A8, also in that reservation, landed meanwhile in 32707af; this branch is rebased on 045f54e and keeps master's version.)Catalogue entry:
func_US2_0026EDE8The v2.00 boot row stopped at 0x0026F70C, before the function's own
jr $ra; addiu $sp,$sp,0xD0; no row held those two words, and a paddingnopfollows at 0x0026F714. PAL's copy had the same defect (func_PAL_0026EC50). A measuredFUNCTION_END_EXTRAentry,"func_US2_0026EDE8": (2340, 8), gives them back;python3 tools/carry.py --version us2 --entrieschanged only that row (2340 -> 2348 bytes). This also adds 8 bytes to v2.00's total code.volatileinfunc_US2_002CCAA0, for a rulingfunc_US2_002CCAA0matches only withextern volatile int D_001AB910 __attribute__((sda));, the same declarationmasteralready uses in its v1.01 twinfunc_002CBAE0(src/game/002C7748-g8.c) and infunc_002CBC58(src/game/002C7748-panels-g8.c, 62919eb). Retail rereads the word for every test and keeps one load whose value is discarded (the emptyD_0025A058/D_00259B48arm); without the qualifier the function is 328 bytes, not 376.AGENTS.md reserves
volatilefor memory a second context writes. I found no such writer: the boot never stores to-0x36E0($gp), and 0x001AB910 lies in the level programs' data (0 in the boot image, 1 in level 05's). So this follows master's precedent but not the rule's wording. If the maintainers rule against it, the same ruling applies to the two functions on master, and I will move this one tononmatching/with its marker restored.Checks (on 045f54e + this commit)
tools/check.py --version us2:func_US2_002CCAA028 of 28,func_US2_002957C028 of 28,func_US2_L05_0041F4781 of 1,func_US2_0026EDE81 of 1 places match.python3 tools/build.py all --strict --version us2: 28 programs OK (e.g.us2 boot: OK: 2523640 loaded bytes equal; 2664 C functions (896900 bytes)). Every function is inplaced.jsonof each program that has it; no C rejected in any program.python3 tools/build.py all --strict(USA v1.01, sincetools/levels.pychanged): 28 programs OK.python3 tests/check_repository.py: repository checks passed.python3 tools/progress.py --check: the reports of us, pal, us2 agree on every function they share.python3 -m unittest discover -s tests: 355 tests; the 11 compiler-output modules need the 32-bit compiler, so they were run inside therac2-buildcontainer (85 tests, OK); the rest passed on the host.src/us2/.Progress (local
tools/progress.py --version us2, report not committed)🤖 Generated with Claude Code