Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLE: Fix hook flag for HBReload #10186

Merged
merged 1 commit into from Oct 26, 2021
Merged

Conversation

leoetlino
Copy link
Member

The reload stub is at a fixed address (0x80001800) so its hook flag
should be HookFlag::Fixed.

Otherwise the hook is installed by HLE::PatchFixedFunctions but
immediately removed by HLE::PatchFunctions (which is called by
HLE::Reload right after PatchFixedFunctions).

Should fix https://bugs.dolphin-emu.org/issues/12716

The reload stub is at a fixed address (0x80001800) so its hook flag
should be HookFlag::Fixed.

Otherwise the hook is installed by HLE::PatchFixedFunctions but
immediately removed by HLE::PatchFunctions (which is called by
HLE::Reload right after PatchFixedFunctions).

Should fix https://bugs.dolphin-emu.org/issues/12716
Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested with an empty main with both DOL and ELF files. It does fix the issue on my end.

@JosJuice JosJuice merged commit 05b4aec into dolphin-emu:master Oct 26, 2021
9 of 10 checks passed
@AdmiralCurtiss
Copy link
Contributor

AdmiralCurtiss commented Oct 31, 2021

This makes Newer Super Mario Bros. Wii crash on the Wiimote warning screen.

30:01:045 Core\PowerPC\Jit64\Jit.cpp:835 W[PowerPC]: ISI exception at 0x00000000
30:01:049 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: ******** EXCEPTION OCCURRED! ********
30:01:051 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: FrameMemory:9008F0C0H
30:01:052 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: ---MainInfo---
30:01:053 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: CONTEXT:80359938H  (ISI EXCEPTION)
30:01:053 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: SRR0:   00000000H   SRR1:4000B032H
30:01:053 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: DSISR:  00000000H   DAR: 00000000H
30:01:054 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: ---EXCEPTION_INFO_TRACE---
30:01:054 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: -------------------------------- TRACE
30:01:054 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: Address:   BackChain   LR save
30:01:054 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: 8043FEA8:  00000000    00000000 
30:01:054 Core\HW\EXI\EXI_DeviceIPL.cpp:306 N[OSREPORT]: --------------------------------

e: Only when Cheats are globally disabled. Works fine if they are on.

e2: Seems like Newer injects some code at 0x80001800 which is broken by this patch:

// HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code
// handler
if (!Config::Get(Config::MAIN_ENABLE_CHEATS))
{
Patch(0x80001800, "HBReload");
Memory::CopyToEmu(0x00001804, "STUBHAXX", 8);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants