From b0d2df0bad4d62f7d9977dfb1ac4358986e576df Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Fri, 14 Jan 2011 07:08:12 +0000 Subject: [PATCH] HLE jump to loader (homebrew) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6845 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Boot/Boot.cpp | 5 +++++ Source/Core/Core/Src/HLE/HLE.cpp | 5 ++++- Source/Core/Core/Src/HLE/HLE_Misc.cpp | 9 +++++++++ Source/Core/Core/Src/HLE/HLE_Misc.h | 1 + Source/Core/DolphinWX/Src/Frame.cpp | 2 -- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index 1f8ec982d7..3516dd85bf 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -164,6 +164,11 @@ bool CBoot::BootUp() NOTICE_LOG(BOOT, "Booting %s", _StartupPara.m_strFilename.c_str()); + // HLE jump to loader (homebrew) + Memory::Write_U32(((1 & 0x3f) << 26) | 10, 0x80001800); + const u8 stubstr[] = { 'S', 'T', 'U', 'B', 'H', 'A', 'X', 'X' }; + Memory::WriteBigEData(stubstr, 0x80001804, 8); + g_symbolDB.Clear(); VideoInterface::Preset(_StartupPara.bNTSC); switch (_StartupPara.m_BootType) diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index 14b4a0e89e..6ea41d6777 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -89,7 +89,10 @@ static const SPatch OSPatches[] = //{ ".kill_infinites", HLE_Misc::FZero_kill_infinites }, // special // { "GXPeekZ", HLE_Misc::GXPeekZ}, - // { "GXPeekARGB", HLE_Misc::GXPeekARGB}, + // { "GXPeekARGB", HLE_Misc::GXPeekARGB}, + + // Name doesn't matter, installed in CBoot::BootUp() + { "HBReload", HLE_Misc::HBReload }, }; static const SPatch OSBreakPoints[] = diff --git a/Source/Core/Core/Src/HLE/HLE_Misc.cpp b/Source/Core/Core/Src/HLE/HLE_Misc.cpp index 422d4f15b7..7c9f8fa2ec 100644 --- a/Source/Core/Core/Src/HLE/HLE_Misc.cpp +++ b/Source/Core/Core/Src/HLE/HLE_Misc.cpp @@ -21,6 +21,8 @@ #include "../PowerPC/PowerPC.h" #include "../HW/Memmap.h" +#include "PluginSpecs.h" +#include "../Host.h" namespace HLE_Misc { @@ -274,4 +276,11 @@ f8 *= f1 NPC = LR; } +void HBReload() +{ + // There isn't much we can do. Just stop cleanly. + PowerPC::Pause(); + Host_Message(WM_USER_STOP); +} + } diff --git a/Source/Core/Core/Src/HLE/HLE_Misc.h b/Source/Core/Core/Src/HLE/HLE_Misc.h index 7e6dddcff0..6c932258a7 100644 --- a/Source/Core/Core/Src/HLE/HLE_Misc.h +++ b/Source/Core/Core/Src/HLE/HLE_Misc.h @@ -38,6 +38,7 @@ namespace HLE_Misc void FZ_sqrt(); void FZ_sqrt_internal(); void FZ_rsqrt_internal(); + void HBReload(); } #endif diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index ceb93aef3f..81d650e938 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -662,11 +662,9 @@ void CFrame::OnHostMessage(wxCommandEvent& event) break; #endif -#if defined(HAVE_X11) && HAVE_X11 case WM_USER_STOP: DoStop(); break; -#endif } }