Emulator Issues #11811
Patch HLE Functions fails to patch some log functions when there are multiple functions with the same name
Wii Fit (many games probably work, but it can be reproduced in an obvious way with Wii Fit)
What's the problem? Describe what went wrong.
"Patch HLE Functions" seems to not patch all of the functions. As far as I can tell, this happens when multiple of them have the same name (and as far as I can tell, the one with the lowest address is the only one that is patched). This is confusing because the output indicates that it patched all of them, but then most of them fail to work, making it seem like they're just never called (and hiding potentially useful messages).
What steps will reproduce the problem?
- Start Wii Fit.
- Pause the game.
- Enable the debugging UI and enable code display.
- Generate symbols from the signature database.
- Observe that there are several symbols named
___blank(in this case, 5).
Patch HLE functions. Observe that the output from doing so looks like this:
30:57:712 core\hle\hle.cpp:143 I[HLE]: Patching OSPanic 80133c54 30:57:721 core\hle\hle.cpp:143 I[HLE]: Patching vprintf 800c3090 30:57:738 core\hle\hle.cpp:143 I[HLE]: Patching ___blank 800d9c74 30:57:738 core\hle\hle.cpp:143 I[HLE]: Patching ___blank 8010ee74 30:57:738 core\hle\hle.cpp:143 I[HLE]: Patching ___blank 8010f100 30:57:739 core\hle\hle.cpp:143 I[HLE]: Patching ___blank 8015aaac 30:57:742 core\hle\hle.cpp:143 I[HLE]: Patching ___blank 8028bba4 30:57:743 core\hle\hle.cpp:143 I[HLE]: Patching __write_console 800c8ee4
Resume the game. Observe that few/no messages are printed. (For Wii Fit, one way to get a message is to open the HOME menu, which causes
WUDStopSyncSimple()to be printed; this shows that it did at least patch something.
WUDStopSyncSimple()is printed from 800d6e14 by calling 800d9c74.)
Pause the game again.
Set a breakpoint at 8015aaac.
Resume the game. Observe that that breakpoint is almost immediately hit, and is repeatedly hit upon unpausing, but no messages are printed.
Remove the breakpoint. (The game should still be paused from the breakpoint, though.)
Rename the symbol at 8015aaac to printf.
Patch HLE functions a second time.
Observe that now,
WPADSetSamplingCallback()is printed repeatedly, along with some other messages. (
WPADSetSamplingCallback()is printed from 8014fbb0)
Is the issue present in the latest development version?
Is the issue present in the latest stable version?
I was unable to reproduce in 5.0, as I couldn't find a way to enable the debug UI and thus patch HLE. I don't have time to bisect to find when this feature was added to check if it was broken from the start.
What are your PC specifications?
- CPU: AMD A6-340M APU with Radeon(tm) Graphics, 1500 Mhz, 4 Core(s), 4 Logical Processor(s)
- GPU: AMD Radeon HD 6520G
- OS: Windows 10 Pro (Insider preview) 10.10.18362 Build 18362