summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index e8c7b4f487..592f338cd2 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -185,6 +185,7 @@ void CFrame::BindMenuBarEvents()
Bind(wxEVT_MENU, &CFrame::OnInstallWAD, this, IDM_MENU_INSTALL_WAD);
Bind(wxEVT_MENU, &CFrame::OnLoadWiiMenu, this, IDM_LOAD_WII_MENU);
Bind(wxEVT_MENU, &CFrame::OnImportBootMiiBackup, this, IDM_IMPORT_NAND);
+ Bind(wxEVT_MENU, &CFrame::OnCheckNAND, this, IDM_CHECK_NAND);
Bind(wxEVT_MENU, &CFrame::OnExtractCertificates, this, IDM_EXTRACT_CERTIFICATES);
for (const int idm : {IDM_PERFORM_ONLINE_UPDATE_CURRENT, IDM_PERFORM_ONLINE_UPDATE_EUR,
IDM_PERFORM_ONLINE_UPDATE_JPN, IDM_PERFORM_ONLINE_UPDATE_KOR,
@@ -1308,6 +1309,48 @@ void CFrame::OnImportBootMiiBackup(wxCommandEvent& WXUNUSED(event))
UpdateLoadWiiMenuItem();
}
+void CFrame::OnCheckNAND(wxCommandEvent&)
+{
+ IOS::HLE::Kernel ios;
+ WiiUtils::NANDCheckResult result = WiiUtils::CheckNAND(ios);
+ if (!result.bad)
+ {
+ wxMessageBox(_("No issues have been detected."), _("NAND Check"), wxOK | wxICON_INFORMATION);
+ return;
+ }
+
+ wxString message = _("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())
+ {
+ message += _("\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() ? StringFromFormat("%s (%016" PRIx64 ")", name.c_str(), title_id) :
+ StringFromFormat("%016" PRIx64, title_id);
+ message += "\n";
+ }
+ }
+
+ if (wxMessageBox(message, _("NAND Check"), wxYES_NO) != wxYES)
+ return;
+
+ if (WiiUtils::RepairNAND(ios))
+ {
+ wxMessageBox(_("The NAND has been repaired."), _("NAND Check"), wxOK | wxICON_INFORMATION);
+ return;
+ }
+
+ wxMessageBox(_("The NAND could not be repaired. It is recommended to back up "
+ "your current data and start over with a fresh NAND."),
+ _("NAND Check"), wxOK | wxICON_ERROR);
+}
+
void CFrame::OnExtractCertificates(wxCommandEvent& WXUNUSED(event))
{
DiscIO::NANDImporter().ExtractCertificates(File::GetUserPath(D_WIIROOT_IDX));