GamePatch: add second FFL endian-swap signature for Mario Kart 8#1867
Open
iPixzl wants to merge 1 commit intocemu-project:mainfrom
Open
GamePatch: add second FFL endian-swap signature for Mario Kart 8#1867iPixzl wants to merge 1 commit intocemu-project:mainfrom
iPixzl wants to merge 1 commit intocemu-project:mainfrom
Conversation
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.
Add second FFL float-array endian-swap signature for Mario Kart 8
What
Adds a second byte-pattern signature for the existing FFL endian-swap HLE hook in
GamePatch.cpp. The original signature is hardcoded to one specific compiled form of the helper and doesn't match Mario Kart 8's build, so the hook silently fails to install and Miis render with missing/broken facial features in-game.Why v1 doesn't match MK8
Both functions are semantically identical — same loop body (
lfsx → bl byte-swap helper → stfsx → index increment → loop) and same register usage — but MK8's compiler scheduled 7 of the 14 prologue instructions in a different order, mostly register saves and themr r30, r3argument move. A simple byte mask can't cleanly cover it since the differences are positional rather than per-byte, so a second full signature is the cleanest option.Verification
Tested on MK8 EU v81 (
00050000-1010ed00) againstmain(b9b46ec).0x02720bc8in MK8 via the PPC debugger, confirmed structural match to the function the v1 signature targets.log.txtcontainsHLE: Hook FFL float array endian swap function (v2) at 0x02720bc8, Miis render correctly.This may also fix Bug #77 but I haven't tested Super Mario Maker or the Wii U Menu.
Safety
Strictly additive. v1 is tried first; v2 is only attempted on failure. Games currently hitting v1 are unaffected. Games hitting neither signature behave exactly as before.
Changes
src/Cafe/GamePatch.cpp:ffl_floatArrayEndianSwap_v2[](56 bytes)GamePatch_scan()tries v2 as a fallback if v1 doesn't match(v1)/(v2)suffix to the debug log to distinguish which signature matched