Some small corrections - #773
Merged
Merged
Conversation
Four separate defects, all visible once the aura loop is read against the
retail body:
- `ap = (_xFXAura*)ap->dangle` advanced the cursor by the offset of `dangle`
(0x1C) rather than by sizeof(_xFXAura), which DWARF gives as 0x24. The array
was being walked misaligned. It is a plain `ap++`; retail emits
`addi r30,r30,36`.
- The billboard size arguments were hardcoded to 0 where retail loads
`ap->size` (offset 16). RenderRotatedBillboard is currently an empty stub, so
there is no behaviour change today, but the arguments are now correct.
- `RwRenderStateGet(rwRENDERSTATEFOGTYPE, (void*)0x1)` passed the integer 1
where RenderWare writes the out-value -- a store to address 1 -- and queried
the wrong enumerator. It is
`RwRenderStateGet(rwRENDERSTATEFOGENABLE, &fogstate)`, which is what the
otherwise-unused `fogstate` local, present in the DWARF, is for.
- The matching restore then wrote a hardcoded 0x10 instead of the saved value.
xFXAuraRender 84.0660% -> 100%
matched functions 6401 -> 6402
xFX is the only unit that changes; the DOL sha1 is unchanged.
The frame-time constant was written 0.01666667f, which rounds to 0x3C88888A.
The .sdata2 of the reference object holds 0x3C888889 -- exactly 1/60 in single
precision, i.e. one more digit: 0.016666667f.
This corrects the emitted constant rather than any instruction, so it moves the
data section only:
zNPCTypeRobot .sdata2 25.2475% -> 25.7426%
No function reaches 100% from it and the matched-function count is unchanged at
6402. zNPCTypeRobot is the only unit that changes; the DOL sha1 is unchanged.
|
| Section | From | To | Bytes | |
|---|---|---|---|---|
| 📈 | .text |
29.75% | 29.81% | +15 |
| Function | From | To | Bytes | |
|---|---|---|---|---|
| ✅ | xFXAuraRender() |
96.25% | 100.00% | +15 |
joeyballentine
marked this pull request as ready for review
August 3, 2026 20:19
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.
While looking into compiler patches, I noticed the patched compiler produced worse fuzzy matches for a few functions. Some were able to 100% after the patch, but two were able to 100% with the stock compiler. Rather than include those fixes in a PR with the patch, I decided to make a separate PR