summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/MenuBar.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-10-06 21:45:28 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-10-08 18:57:58 +0200
commit02e17594b06151e652a1b51ce1018ce4747feecd (patch)
treeddeb6c96b916e2f827d1b2341c1f31aea4afd67f /Source/Core/DolphinQt2/MenuBar.cpp
parente1c0b8d01124f13d07d0b7bd0e271e88b1178d0d (diff)
WiiUtils: Attempt to fix the NAND more aggressively
Change the repair logic to fix issues more aggressively by deleting bad titles. This is necessary because of a bug in Dolphin's WAD boot code. The UI code was updated to inform the user about titles that will be deleted if they continue a repair, before deleting anything.
Diffstat (limited to 'Source/Core/DolphinQt2/MenuBar.cpp')
-rw-r--r--Source/Core/DolphinQt2/MenuBar.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp
index b7b7410e6f..401f7f4d7e 100644
--- a/Source/Core/DolphinQt2/MenuBar.cpp
+++ b/Source/Core/DolphinQt2/MenuBar.cpp
@@ -22,6 +22,7 @@
#include "Core/IOS/IOS.h"
#include "Core/Movie.h"
#include "Core/State.h"
+#include "Core/TitleDatabase.h"
#include "Core/WiiUtils.h"
#include "DiscIO/NANDImporter.h"
#include "DolphinQt2/AboutDialog.h"
@@ -537,21 +538,37 @@ void MenuBar::ExportWiiSaves()
void MenuBar::CheckNAND()
{
IOS::HLE::Kernel ios;
- if (WiiUtils::CheckNAND(ios))
+ WiiUtils::NANDCheckResult result = WiiUtils::CheckNAND(ios);
+ if (!result.bad)
{
QMessageBox::information(this, tr("NAND Check"), tr("No issues have been detected."));
return;
}
- if (QMessageBox::question(
- this, tr("NAND Check"),
- tr("The emulated NAND is damaged. System titles such as the Wii Menu and "
- "the Wii Shop Channel may not work correctly.\n\n"
- "Do you want to try to repair the NAND?")) != QMessageBox::Yes)
+ QString message = tr("The emulated NAND is damaged. System titles such as the Wii Menu and "
+ "the Wii Shop Channel may not work correctly.\n\n"
+ "Do you want to try to repair the NAND?");
+ if (!result.titles_to_remove.empty())
{
- return;
+ message += tr("\n\nWARNING: Fixing this NAND requires the deletion of titles that have "
+ "incomplete data on the NAND, including all associated save data. "
+ "By continuing, the following title(s) will be removed:\n\n");
+ Core::TitleDatabase title_db;
+ for (const u64 title_id : result.titles_to_remove)
+ {
+ const std::string name = title_db.GetTitleName(title_id);
+ message += !name.empty() ?
+ QStringLiteral("%1 (%2)")
+ .arg(QString::fromStdString(name))
+ .arg(title_id, 16, 16, QLatin1Char('0')) :
+ QStringLiteral("%1").arg(title_id, 16, 16, QLatin1Char('0'));
+ message += QStringLiteral("\n");
+ }
}
+ if (QMessageBox::question(this, tr("NAND Check"), message) != QMessageBox::Yes)
+ return;
+
if (WiiUtils::RepairNAND(ios))
{
QMessageBox::information(this, tr("NAND Check"), tr("The NAND has been repaired."));