DVDInterface: Remove GetVolume

For thread safety reasons, the currently inserted volume must
only be accessed by the DVD thread (or by the CPU thread if it
calls DVDThread::WaitUntilIdle() first). After this commit,
only DVDThread.cpp can access the volume, which prevents code in
other files from accessing the volume in a non-threadsafe way.
This commit is contained in:
JosJuice
2016-09-24 14:43:03 +02:00
parent 5a55957741
commit 2a2db16087
8 changed files with 157 additions and 81 deletions

View File

@ -120,13 +120,6 @@ static void ReinitHardware()
SystemTimers::ChangePPCClock(SystemTimers::Mode::GC);
}
static void UpdateRunningGame()
{
DVDThread::WaitUntilIdle();
SConfig::GetInstance().m_BootType = SConfig::BOOT_MIOS;
SConfig::GetInstance().SetRunningGameMetadata(DVDInterface::GetVolume());
}
constexpr u32 ADDRESS_INIT_SEMAPHORE = 0x30f8;
bool Load()
@ -176,7 +169,8 @@ bool Load()
Memory::Write_U32(0x00000000, ADDRESS_INIT_SEMAPHORE);
NOTICE_LOG(IOS, "IPL ready.");
UpdateRunningGame();
SConfig::GetInstance().m_BootType = SConfig::BOOT_MIOS;
DVDThread::UpdateRunningGameMetadata();
return true;
}
} // namespace MIOS