Don't read from disk when checking volume type

Should be faster than relying on the OS to cache the magic words.
Also gets rid of the odd recursive call in VolumeDirectory.
This commit is contained in:
JosJuice committed 2015-01-17 13:21:02 +01:00
1 parent 11a36ca8e2
commit ace060748b
19 files changed
+61 -56

No files matched your search

+4 -5
View File
@@ -214,8 +214,7 @@ bool CBoot::BootUp()
if (pVolume == nullptr)
break;
bool isoWii = DiscIO::IsVolumeWiiDisc(pVolume);
if (isoWii != _StartupPara.bWii)
if (pVolume->IsWiiDisc() != _StartupPara.bWii)
{
PanicAlertT("Warning - starting ISO in wrong console mode!");
}
@@ -237,7 +236,7 @@ bool CBoot::BootUp()
}
_StartupPara.bWii = VolumeHandler::IsWii();
_StartupPara.bWii = VolumeHandler::IsWiiDisc();
// HLE BS2 or not
if (_StartupPara.bHLE_BS2)
@@ -295,7 +294,7 @@ bool CBoot::BootUp()
{
BS2Success = EmulatedBS2(dolWii);
}
else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultISO.empty())
else if (!VolumeHandler::IsWiiDisc() && !_StartupPara.m_strDefaultISO.empty())
{
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
BS2Success = EmulatedBS2(dolWii);
@@ -345,7 +344,7 @@ bool CBoot::BootUp()
{
BS2Success = EmulatedBS2(elfWii);
}
else if (!VolumeHandler::IsWii() && !_StartupPara.m_strDefaultISO.empty())
else if (!VolumeHandler::IsWiiDisc() && !_StartupPara.m_strDefaultISO.empty())
{
VolumeHandler::SetVolumeName(_StartupPara.m_strDefaultISO);
BS2Success = EmulatedBS2(elfWii);
+1 -3
View File
@@ -21,8 +21,6 @@
#include "Core/HW/Memmap.h"
#include "Core/PowerPC/PowerPC.h"
#include "DiscIO/VolumeCreator.h"
void CBoot::RunFunction(u32 _iAddr)
{
PC = _iAddr;
@@ -320,7 +318,7 @@ bool CBoot::EmulatedBS2_Wii()
// Execute the apploader
bool apploaderRan = false;
if (VolumeHandler::IsValid() && VolumeHandler::IsWii())
if (VolumeHandler::IsValid() && VolumeHandler::IsWiiDisc())
{
// Set up MSR and the BAT SPR registers.
UReg_MSR& m_MSR = ((UReg_MSR&)PowerPC::ppcState.msr);