Emulator Issues #11811

Patch HLE Functions fails to patch some log functions when there are multiple functions with the same name

Added by pokechu22 8 months ago. Updated 16 days ago.

% Done:


Operating system:
Issue type:
Relates to usability:
Relates to performance:
Relates to maintainability:
Regression start:
Fixed in:


Game Name?

Wii Fit (many games probably work, but it can be reproduced in an obvious way with Wii Fit)

Game ID?


MD5 Hash?


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?

  1. Start Wii Fit.
  2. Pause the game.
  3. Enable the debugging UI and enable code display.
  4. Generate symbols from the signature database.
  5. Observe that there are several symbols named ___blank (in this case, 5).
  6. 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
  7. 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.)

  8. Pause the game again.

  9. Set a breakpoint at 8015aaac.

  10. Resume the game. Observe that that breakpoint is almost immediately hit, and is repeatedly hit upon unpausing, but no messages are printed.

  11. Remove the breakpoint. (The game should still be paused from the breakpoint, though.)

  12. Rename the symbol at 8015aaac to printf.

  13. Patch HLE functions a second time.

  14. 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?

Yes, 5.0-10738.

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


#1 Updated by sepalani 6 months ago

#2 Updated by JosJuice 16 days ago

  • Fixed in set to 5.0-10956
  • Status changed from New to Fixed

Also available in: Atom PDF