DVDInterface: Remove VolumeIsValid

It's the same as IsDiscInside.
This commit is contained in:
JosJuice 2016-01-30 19:03:59 +01:00
parent 3b632f5990
commit a176bf0229
4 changed files with 11 additions and 17 deletions

View File

@ -50,7 +50,7 @@ bool CBoot::DVDRead(u64 dvd_offset, u32 output_address, u32 length, bool decrypt
void CBoot::Load_FST(bool _bIsWii) void CBoot::Load_FST(bool _bIsWii)
{ {
if (!DVDInterface::VolumeIsValid()) if (!DVDInterface::IsDiscInside())
return; return;
const DiscIO::IVolume& volume = DVDInterface::GetVolume(); const DiscIO::IVolume& volume = DVDInterface::GetVolume();
@ -267,7 +267,7 @@ bool CBoot::BootUp()
case SConfig::BOOT_ISO: case SConfig::BOOT_ISO:
{ {
DVDInterface::SetVolumeName(_StartupPara.m_strFilename); DVDInterface::SetVolumeName(_StartupPara.m_strFilename);
if (!DVDInterface::VolumeIsValid()) if (!DVDInterface::IsDiscInside())
return false; return false;
const DiscIO::IVolume& pVolume = DVDInterface::GetVolume(); const DiscIO::IVolume& pVolume = DVDInterface::GetVolume();
@ -336,7 +336,7 @@ bool CBoot::BootUp()
{ {
BS2Success = EmulatedBS2(dolWii); BS2Success = EmulatedBS2(dolWii);
} }
else if ((!DVDInterface::VolumeIsValid() || else if ((!DVDInterface::IsDiscInside() ||
DVDInterface::GetVolume().GetVolumeType() != DiscIO::Platform::WII_DISC) && DVDInterface::GetVolume().GetVolumeType() != DiscIO::Platform::WII_DISC) &&
!_StartupPara.m_strDefaultISO.empty()) !_StartupPara.m_strDefaultISO.empty())
{ {

View File

@ -67,7 +67,7 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
// to 0x80000000 according to YAGCD 4.2. // to 0x80000000 according to YAGCD 4.2.
// It's possible to boot DOL and ELF files without a disc inserted // It's possible to boot DOL and ELF files without a disc inserted
if (DVDInterface::VolumeIsValid()) if (DVDInterface::IsDiscInside())
DVDRead(/*offset*/ 0x00000000, /*address*/ 0x00000000, 0x20, false); // write disc info DVDRead(/*offset*/ 0x00000000, /*address*/ 0x00000000, 0x20, false); // write disc info
PowerPC::HostWrite_U32(0x0D15EA5E, PowerPC::HostWrite_U32(0x0D15EA5E,
@ -100,7 +100,7 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader HLE::Patch(0x81300000, "OSReport"); // HLE OSReport for Apploader
if (!DVDInterface::VolumeIsValid()) if (!DVDInterface::IsDiscInside())
return false; return false;
// Load Apploader to Memory - The apploader is hardcoded to begin at 0x2440 on the disc, // Load Apploader to Memory - The apploader is hardcoded to begin at 0x2440 on the disc,
@ -255,7 +255,7 @@ bool CBoot::SetupWiiMemory(u64 ios_title_id)
*/ */
// When booting a WAD or the system menu, there will probably not be a disc inserted // When booting a WAD or the system menu, there will probably not be a disc inserted
if (DVDInterface::VolumeIsValid()) if (DVDInterface::IsDiscInside())
DVDRead(0x00000000, 0x00000000, 0x20, false); // Game Code DVDRead(0x00000000, 0x00000000, 0x20, false); // Game Code
Memory::Write_U32(0x0D15EA5E, 0x00000020); // Another magic word Memory::Write_U32(0x0D15EA5E, 0x00000020); // Another magic word
@ -306,7 +306,7 @@ bool CBoot::SetupWiiMemory(u64 ios_title_id)
bool CBoot::EmulatedBS2_Wii() bool CBoot::EmulatedBS2_Wii()
{ {
INFO_LOG(BOOT, "Faking Wii BS2..."); INFO_LOG(BOOT, "Faking Wii BS2...");
if (!DVDInterface::VolumeIsValid()) if (!DVDInterface::IsDiscInside())
return false; return false;
if (DVDInterface::GetVolume().GetVolumeType() != DiscIO::Platform::WII_DISC) if (DVDInterface::GetVolume().GetVolumeType() != DiscIO::Platform::WII_DISC)

View File

@ -419,7 +419,7 @@ static void DTKStreamingCallback(const std::vector<u8>& audio_data, s64 cycles_l
void Init() void Init()
{ {
_assert_(!VolumeIsValid()); _assert_(!IsDiscInside());
DVDThread::Start(); DVDThread::Start();
@ -486,7 +486,7 @@ bool SetVolumeName(const std::string& disc_path)
DVDThread::WaitUntilIdle(); DVDThread::WaitUntilIdle();
s_inserted_volume = DiscIO::CreateVolumeFromFilename(disc_path); s_inserted_volume = DiscIO::CreateVolumeFromFilename(disc_path);
SetLidOpen(); SetLidOpen();
return VolumeIsValid(); return IsDiscInside();
} }
bool SetVolumeDirectory(const std::string& full_path, bool is_wii, bool SetVolumeDirectory(const std::string& full_path, bool is_wii,
@ -496,12 +496,7 @@ bool SetVolumeDirectory(const std::string& full_path, bool is_wii,
s_inserted_volume = s_inserted_volume =
DiscIO::CreateVolumeFromDirectory(full_path, is_wii, apploader_path, DOL_path); DiscIO::CreateVolumeFromDirectory(full_path, is_wii, apploader_path, DOL_path);
SetLidOpen(); SetLidOpen();
return VolumeIsValid(); return IsDiscInside();
}
bool VolumeIsValid()
{
return s_inserted_volume != nullptr;
} }
bool IsDiscInside() bool IsDiscInside()

View File

@ -108,12 +108,11 @@ void DoState(PointerWrap& p);
void RegisterMMIO(MMIO::Mapping* mmio, u32 base); void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
// Disc access (don't call GetVolume unless you know that VolumeIsValid() == true) // Disc access (don't call GetVolume unless you know that IsDiscInside() == true)
const DiscIO::IVolume& GetVolume(); const DiscIO::IVolume& GetVolume();
bool SetVolumeName(const std::string& disc_path); bool SetVolumeName(const std::string& disc_path);
bool SetVolumeDirectory(const std::string& disc_path, bool is_wii, bool SetVolumeDirectory(const std::string& disc_path, bool is_wii,
const std::string& apploader_path = "", const std::string& DOL_path = ""); const std::string& apploader_path = "", const std::string& DOL_path = "");
bool VolumeIsValid();
bool IsDiscInside(); bool IsDiscInside();
void ChangeDiscAsHost(const std::string& new_path); // Can only be called by the host thread void ChangeDiscAsHost(const std::string& new_path); // Can only be called by the host thread
void ChangeDiscAsCPU(const std::string& new_path); // Can only be called by the CPU thread void ChangeDiscAsCPU(const std::string& new_path); // Can only be called by the CPU thread