diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp index 2ccf0cdcc4..888173ed9a 100644 --- a/Source/Core/Core/Boot/Boot.cpp +++ b/Source/Core/Core/Boot/Boot.cpp @@ -524,6 +524,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard, NOTICE_LOG_FMT(BOOT, "Booting from disc: {}", disc.path); const DiscIO::VolumeDisc* volume = SetDisc(system.GetDVDInterface(), std::move(disc.volume), disc.auto_disc_change_paths); + AchievementManager::GetInstance().LoadGame(volume); if (!volume) return false; @@ -642,17 +643,17 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard, if (!Load_BS2(system, ipl.path)) return false; + const DiscIO::VolumeDisc* volume = nullptr; if (ipl.disc) { NOTICE_LOG_FMT(BOOT, "Inserting disc: {}", ipl.disc->path); - SetDisc(system.GetDVDInterface(), DiscIO::CreateDiscForCore(ipl.disc->path), - ipl.disc->auto_disc_change_paths); - } - else - { - AchievementManager::GetInstance().LoadGame(nullptr); + + volume = SetDisc(system.GetDVDInterface(), DiscIO::CreateDiscForCore(ipl.disc->path), + ipl.disc->auto_disc_change_paths); } + AchievementManager::GetInstance().LoadGame(volume); + SConfig::OnTitleDirectlyBooted(guard); return true; } diff --git a/Source/Core/Core/HW/DVD/DVDInterface.cpp b/Source/Core/Core/HW/DVD/DVDInterface.cpp index 33b0efc548..8420366ffb 100644 --- a/Source/Core/Core/HW/DVD/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVD/DVDInterface.cpp @@ -420,8 +420,6 @@ void DVDInterface::SetDisc(std::unique_ptr disc, m_auto_disc_change_index = 0; } - AchievementManager::GetInstance().LoadGame(disc.get()); - // Assume that inserting a disc requires having an empty disc before if (had_disc != has_disc) ExpansionInterface::g_rtc_flags[ExpansionInterface::RTCFlag::DiscChanged] = true; @@ -444,6 +442,7 @@ void DVDInterface::AutoChangeDiscCallback(Core::System& system, u64 userdata, s6 void DVDInterface::EjectDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate) { + AchievementManager::GetInstance().LoadGame(nullptr); system.GetDVDInterface().SetDisc(nullptr, {}); } @@ -454,9 +453,14 @@ void DVDInterface::InsertDiscCallback(Core::System& system, u64 userdata, s64 cy DiscIO::CreateDiscForCore(di.m_disc_path_to_insert); if (new_disc) + { + AchievementManager::GetInstance().LoadGame(new_disc.get()); di.SetDisc(std::move(new_disc), {}); + } else + { PanicAlertFmtT("The disc that was about to be inserted couldn't be found."); + } di.m_disc_path_to_insert.clear(); }