summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-03-17 19:07:41 +0100
committerGitHub <noreply@github.com>2026-03-17 19:07:41 +0100
commit3564a256bf327d48bbf48477690bfcc231f34d67 (patch)
treeddcce2a920ebf10b2f11a4b5a32a112cff02a129 /Source/Core
parent1ab9a867f6df6407a4967fa83858fc171231af46 (diff)
parente123962bca935b048fbd22814f186cb24fd6becb (diff)
Merge pull request #14478 from JosJuice/wii-menu-headache
Move achievements code out of DVDInterface::SetDisc
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Boot/Boot.cpp13
-rw-r--r--Source/Core/Core/HW/DVD/DVDInterface.cpp8
2 files changed, 13 insertions, 8 deletions
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<DiscIO::VolumeDisc> 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();
}