Work on most of the remaining functions needed for vs mode - #3267
Draft
MarkMcCaskey wants to merge 31 commits into
Draft
Work on most of the remaining functions needed for vs mode#3267MarkMcCaskey wants to merge 31 commits into
MarkMcCaskey wants to merge 31 commits into
Conversation
Passing the four HUD-colour lookups straight into gm_80160854 instead of staging them in u8 locals removes the last differing rows. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
The three `int[1]` counter arrays were standing in for loop bodies that the original had in helpers: hoisting the two slot-clearing loops into one `ifStock_ClearGObjSlots` and the stock-GObj creation plus the multi-man block into `ifStock_CreateStockGObjs` gives the target's 0x30 frame and register assignment. `ifStock_802FA5BC` still has to stay out of line, so the file-scope `dont_inline` pragma becomes the `_noinline` wrapper idiom already used elsewhere in the tree. `ifStock_804A1ACC.x108` holds the proc GObj, so it is typed `HSD_GObj*` rather than `int`; `ifStock_804A1774.x108` is a real int and is unchanged. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
Both the joint load and the digit-JObj lookup come from inline helpers in the original: each site bills its own stack slot, which accounts for the 0x18 -> 0x10 pad and moves the whole r26-r30 band onto the target's assignment. `tobj` is declared ahead of the loop counter to finish the ordering. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
Report for GALE01 (57cb953 - 0f5ce17)📈 Matched code: 92.92% (+0.19%, +7560 bytes) ✅ 8 new matches
📈 6 improvements in unmatched items
|
97.01% -> 99.95%. The command-list entry is re-read through the global at every field instead of being pooled into a local `HSD_PSCmdList***`, which is what the target's reload-per-store shape asks for; `psTexGroupArray` is addressed by name rather than by subtracting 0x30C from that pointer; and the rect case writes the scale matrix's diagonal (xx/yy/zz) rather than xx/zx/zy — the target's store offsets confirm the diagonal. `ptclref_804D0E5C` is typed `HSD_PSCmdList**` to match how both this function and the target use it, so the 32 casts that spelling would otherwise need go away. particle.c's four index-remap sites keep their old reading with a cast and are byte-identical. The only rows left are the bound check's relocation: the target reads the array symbols.txt calls `psCmdListArray`, not `psNumCmdList`. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
99.47% -> 99.93%. The colour update, the digit animation setup, and the stored-translation read come from inline helpers; splitting them out gives the target's call and frame shape. The two branch-local `GXColor`s copied into the shared one are load-bearing — writing the shared local directly costs 16 points. Two rows remain: one callee-saved web (r28 vs r24) and the staged colour's stack slot (0x14 vs 0x40). Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
97.23% -> 97.34%. The vertex buffer holds 152 entries, not 151 plus a PAD_STACK, which puts the staging slots at the target's displacements. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
95.39% -> 98.78%. The per-player user data is reached by walking a `struct IfStockData*` cursor the way ifStock_802F7EFC already does in this file, and the state struct is re-mentioned in full at each use rather than staged in `r26`. The embedded `+=` in the first store is load-bearing: splitting it into a typed pointer plus a store costs 3 points, and a typed `ifStock_804A1378_x204*` costs 2.9. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
98.38% -> 99.51%. The velocity magnitude is `sqrtf`, not a hand-expanded Newton-Raphson; the JObj matrix is `gen->jobj->mtx` rather than a raw +0x44 byte offset; and the matrix-column normalise block stages through the same local as the velocity output, which is what the target's frame shows. Remaining rows are stack-slot ordering for three staging floats. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
97.29% -> 97.77%, mostly by reordering the segment-dot and length-squared accumulations to the target's operand order and by moving three float decls. Also drops a hack: the 1.0 used across the parameter-clamp branches was being read out of the global `lbColl_804D7A08` to keep it in a callee-saved register. A plain `1.0F` gives the same code, so the global read and the comment explaining it are gone. Source taken from doldecomp#3223. Co-authored-by: Ford Lascari <ford.lascari@gmail.com>
Both objects already matched byte-for-byte in code and data but were still declared Linkable. Includes the `ninja apply` symbols.txt canonicalization. Linked 76.53% -> 76.95% (1058 -> 1060 files). `grgreens` is in the same state per objdiff but changes the DOL when flipped, so it stays Linkable.
99.93% -> 99.96%, from the captured frame layout rather than source guessing. The target stages the three GXColors at 0x38/0x40/0x60, high in the frame and interleaved with 4EDC's own locals. Colours declared inside the inline are expansion temps and always land at the bottom of the frame (0x10/0x14/0x18) -- no statement position or PAD_STACK value moves them, because inline temps are created after every declaration in the caller. So the three GXColors have to be 4EDC's own declarations, and the inline takes them by pointer to keep the web boundary that gives the colour-apply block its register assignment (hoisting the block body instead costs 42 rows). With the colours owned by the caller, PAD_STACK(64) becomes three explicitly sized holes: 28/4/28 reproduces the target's frame exactly (0xf8, colours at 0x38/0x40/0x60), where the single 64-byte pad cannot -- the target's dead space is fragmented and no contiguous 64-byte run fits it. Six rows remain: one callee-saved web on the HUD lookup, and one commutative fadds pair.
Two rows left. The digit-init helper's Hundreds JObj was landing in r28 because its web selects one step before the Tens web, which is the one that claims r24; naming the three JObjs separately renumbers them so the Tens web selects first and both end on r24, as the target has it. coloring_model confirmed the swap reaches the full 34/34 colouring before it was tried.
`ptclref_804D0E5C` is now typed `HSD_PSCmdList**`, so the four `(HSD_PSCmdList*)` casts in efLib_Cb_PtclAppSRTHook are redundant and clang-tidy's readability-redundant-casting fails the build on them (WarningsAsErrors). eflib.o is byte-identical without them.
Use a full-lifetime scalar carrier to place the digit-offset accumulator in MWCC's lowering-object register band. Compensate its four-byte home in the existing pad and preserve the target final add ordering with a double-negative spelling.
Seed the retail literal-pool order behind MUST_MATCH, mark ifstatus.c Matching, and apply the linked ELF's canonical symbols. The full main.dol checksum and dtk symbol diff both pass.
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.
We need:
hsd_8039F05C,
ifStock_802FAEC4,ifStatus_802F61FC,ifStatus_802F5EC0,ifStatus_802F4EDC, ifStock_802F98E8, ftCo_800A75DC, ftCo_800C2600,psDispParticles(off limits for this PR), hsd_8039DAD4, hsd_8039930C, lbColl_80006E58I'm working on psdisp in #3250
I'm taking 3 100% matches and some partial matches from #3223
This PR also links ftCo_0D95 and tyfigupon just as a drive-by clean up