From eb45ea5f7ff360a6afa64a1c112fc3380d85ec4c Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 8 Apr 2017 00:04:50 +0100 Subject: [PATCH 1/5] Boot: Prevent ELF to be considered as a disc --- Source/Core/Core/Boot/Boot.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 0e65566688..93fa76947f 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -410,10 +410,6 @@ bool CBoot::BootUp() NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultISO.c_str()); DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); } - else - { - DVDInterface::SetVolumeDirectory(_StartupPara.m_strFilename, _StartupPara.bWii); - } // Poor man's bootup if (_StartupPara.bWii) From 31eec8c75ba103c4920a5026bc84db28a9f3af78 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Apr 2017 18:45:01 +0200 Subject: [PATCH 2/5] Boot: Remove useless check No disc is inserted at this point, so IsDiscInside is always false. --- Source/Core/Core/Boot/Boot.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 93fa76947f..d54206a93d 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -340,9 +340,7 @@ bool CBoot::BootUp() { BS2Success = EmulatedBS2(dolWii); } - else if ((!DVDInterface::IsDiscInside() || - DVDInterface::GetVolume().GetVolumeType() != DiscIO::Platform::WII_DISC) && - !_StartupPara.m_strDefaultISO.empty()) + else if (!_StartupPara.m_strDefaultISO.empty()) { DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); BS2Success = EmulatedBS2(dolWii); From 6263830d6d210487289df639f86abbbcdfcaefd6 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Apr 2017 18:48:22 +0200 Subject: [PATCH 3/5] Boot: Always emulate BS2 once when booting a DOL The old code could do it 0, 1 or 2 times. --- Source/Core/Core/Boot/Boot.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index d54206a93d..f69a8c794f 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -334,16 +334,12 @@ bool CBoot::BootUp() PanicAlertT("Warning - starting DOL in wrong console mode!"); } - bool BS2Success = false; - if (dolWii) { - BS2Success = EmulatedBS2(dolWii); } else if (!_StartupPara.m_strDefaultISO.empty()) { DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); - BS2Success = EmulatedBS2(dolWii); } if (!_StartupPara.m_strDVDRoot.empty()) @@ -351,10 +347,9 @@ bool CBoot::BootUp() NOTICE_LOG(BOOT, "Setting DVDRoot %s", _StartupPara.m_strDVDRoot.c_str()); DVDInterface::SetVolumeDirectory(_StartupPara.m_strDVDRoot, dolWii, _StartupPara.m_strApploader, _StartupPara.m_strFilename); - BS2Success = EmulatedBS2(dolWii); } - if (!BS2Success) + if (!EmulatedBS2(dolWii)) { // Set up MSR and the BAT SPR registers. UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr); From 0b78386044690ec1ba3869f413d7774a9bd59a63 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Apr 2017 18:48:59 +0200 Subject: [PATCH 4/5] Boot: Allow setting a default ISO for Wii DOLs I have no idea why there was a special case preventing this... --- Source/Core/Core/Boot/Boot.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index f69a8c794f..b669b44b2c 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -334,13 +334,8 @@ bool CBoot::BootUp() PanicAlertT("Warning - starting DOL in wrong console mode!"); } - if (dolWii) - { - } - else if (!_StartupPara.m_strDefaultISO.empty()) - { + if (!_StartupPara.m_strDefaultISO.empty()) DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); - } if (!_StartupPara.m_strDVDRoot.empty()) { From 9d73196e4f8a03451fde3320182ef0640ee4fc18 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 8 Apr 2017 18:51:26 +0200 Subject: [PATCH 5/5] Boot: Make default ISO code for DOLs consistent with ELFs --- Source/Core/Core/Boot/Boot.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index b669b44b2c..f2f77676de 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -334,15 +334,17 @@ bool CBoot::BootUp() PanicAlertT("Warning - starting DOL in wrong console mode!"); } - if (!_StartupPara.m_strDefaultISO.empty()) - DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); - if (!_StartupPara.m_strDVDRoot.empty()) { NOTICE_LOG(BOOT, "Setting DVDRoot %s", _StartupPara.m_strDVDRoot.c_str()); DVDInterface::SetVolumeDirectory(_StartupPara.m_strDVDRoot, dolWii, _StartupPara.m_strApploader, _StartupPara.m_strFilename); } + else if (!_StartupPara.m_strDefaultISO.empty()) + { + NOTICE_LOG(BOOT, "Loading default ISO %s", _StartupPara.m_strDefaultISO.c_str()); + DVDInterface::SetVolumeName(_StartupPara.m_strDefaultISO); + } if (!EmulatedBS2(dolWii)) {