summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorbooto <remornicus@gmail.com>2017-01-25 01:06:24 -0500
committerbooto <remornicus@gmail.com>2017-01-25 01:11:48 -0500
commitd16ca2e5c877fb2129c38b81a938c5002cf592d8 (patch)
tree133cf81f5b47c3e9686b0b0ca302db3e08e0d42b /Source/Core
parent3ba388138dea25d5fad3835eebc4d256e18bbb40 (diff)
Load IOS from TMD when launching non-IOS title.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/IOS/ES/ES.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp
index 048b1a84c5..1cac5ee73c 100644
--- a/Source/Core/Core/IOS/ES/ES.cpp
+++ b/Source/Core/Core/IOS/ES/ES.cpp
@@ -1043,12 +1043,20 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
// (supposedly when trying to re-open those files).
DiscIO::CNANDContentManager::Access().ClearCache();
+ u64 ios_to_load = 0;
std::string tContentFile;
- if ((u32)(TitleID >> 32) != 0x00000001 || TitleID == TITLEID_SYSMENU)
+ if ((u32)(TitleID >> 32) == 0x00000001 && TitleID != TITLEID_SYSMENU)
+ {
+ ios_to_load = TitleID;
+ bSuccess = true;
+ }
+ else
{
const DiscIO::CNANDContentLoader& ContentLoader = AccessContentDevice(TitleID);
if (ContentLoader.IsValid())
{
+ ios_to_load = 0x0000000100000000ULL | ContentLoader.GetIosVersion();
+
u32 bootInd = ContentLoader.GetBootIndex();
const DiscIO::SNANDContent* pContent = ContentLoader.GetContentByIndex(bootInd);
if (pContent)
@@ -1059,7 +1067,8 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
if (pDolLoader->IsValid())
{
- pDolLoader->Load(); // TODO: Check why sysmenu does not load the DOL correctly
+ pDolLoader->Load();
+ // TODO: Check why sysmenu does not load the DOL correctly
// NAND titles start with address translation off at 0x3400 (via the PPC bootstub)
//
// The state of other CPU registers (like the BAT registers) doesn't matter much
@@ -1067,25 +1076,15 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
MSR = 0;
PC = 0x3400;
bSuccess = true;
- bReset = true;
}
else
{
PanicAlertT("IOCTL_ES_LAUNCH: The DOL file is invalid!");
- bSuccess = false;
}
}
}
}
- else // IOS, MIOS, BC etc
- {
- // We need to reset any open resources and do the memory setup
- // IOS does on launch.
- if (SetupMemory(TitleID))
- {
- bSuccess = true;
- }
- }
+
if (!bSuccess)
{
PanicAlertT(
@@ -1105,6 +1104,8 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
Reset(true);
Reinit();
+ SetupMemory(ios_to_load);
+ bReset = true;
if (!SConfig::GetInstance().m_bt_passthrough_enabled)
{