mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-28 05:06:42 +00:00
Add BootMii NAND import functionality
This commit is contained in:
parent
9d070a5df7
commit
6bccc13f3b
9 changed files with 331 additions and 0 deletions
|
@ -316,6 +316,8 @@ private:
|
|||
void OnShowCheatsWindow(wxCommandEvent& event);
|
||||
void OnLoadWiiMenu(wxCommandEvent& event);
|
||||
void OnInstallWAD(wxCommandEvent& event);
|
||||
void OnImportBootMiiBackup(wxCommandEvent& event);
|
||||
void OnExtractCertificates(wxCommandEvent& event);
|
||||
void OnFifoPlayer(wxCommandEvent& event);
|
||||
void OnConnectWiimote(wxCommandEvent& event);
|
||||
void GameListChanged(wxCommandEvent& event);
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "Core/State.h"
|
||||
|
||||
#include "DiscIO/NANDContentLoader.h"
|
||||
#include "DiscIO/NANDImporter.h"
|
||||
|
||||
#include "DolphinWX/AboutDolphin.h"
|
||||
#include "DolphinWX/Cheats/CheatsWindow.h"
|
||||
|
@ -168,6 +169,8 @@ void CFrame::BindMenuBarEvents()
|
|||
Bind(wxEVT_MENU, &CFrame::OnNetPlay, this, IDM_NETPLAY);
|
||||
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::OnExtractCertificates, this, IDM_EXTRACT_CERTIFICATES);
|
||||
Bind(wxEVT_MENU, &CFrame::OnFifoPlayer, this, IDM_FIFOPLAYER);
|
||||
Bind(wxEVT_MENU, &CFrame::OnConnectWiimote, this, IDM_CONNECT_WIIMOTE1, IDM_CONNECT_BALANCEBOARD);
|
||||
|
||||
|
@ -1219,6 +1222,37 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void CFrame::OnImportBootMiiBackup(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (!AskYesNoT("Merging a new NAND over your currently selected NAND will overwrite any channels "
|
||||
"and savegames that already exist. This process is not reversible, so it is "
|
||||
"recommended that you keep backups of both NANDs. Are you sure you want to "
|
||||
"continue?"))
|
||||
return;
|
||||
|
||||
wxString path = wxFileSelector(
|
||||
_("Select a BootMii NAND backup to import"), wxEmptyString, wxEmptyString, wxEmptyString,
|
||||
_("BootMii NAND backup file (*.bin)") + "|*.bin|" + wxGetTranslation(wxALL_FILES),
|
||||
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST, this);
|
||||
const std::string file_name = WxStrToStr(path);
|
||||
if (file_name.empty())
|
||||
return;
|
||||
|
||||
wxProgressDialog dialog(_("Importing NAND backup"), _("Working..."), 100, this,
|
||||
wxPD_APP_MODAL | wxPD_ELAPSED_TIME | wxPD_SMOOTH);
|
||||
DiscIO::NANDImporter().ImportNANDBin(file_name,
|
||||
[&dialog](size_t current_entry, size_t total_entries) {
|
||||
dialog.SetRange(total_entries);
|
||||
dialog.Update(current_entry);
|
||||
});
|
||||
UpdateLoadWiiMenuItem();
|
||||
}
|
||||
|
||||
void CFrame::OnExtractCertificates(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
DiscIO::NANDImporter().ExtractCertificates(File::GetUserPath(D_WIIROOT_IDX));
|
||||
}
|
||||
|
||||
void CFrame::UpdateLoadWiiMenuItem() const
|
||||
{
|
||||
GetMenuBar()->Refresh(true, nullptr);
|
||||
|
|
|
@ -101,6 +101,8 @@ enum
|
|||
IDM_LOAD_WII_MENU,
|
||||
IDM_MENU_INSTALL_WAD,
|
||||
IDM_LIST_INSTALL_WAD,
|
||||
IDM_IMPORT_NAND,
|
||||
IDM_EXTRACT_CERTIFICATES,
|
||||
IDM_FIFOPLAYER,
|
||||
IDM_CONNECT_WIIMOTE1,
|
||||
IDM_CONNECT_WIIMOTE2,
|
||||
|
|
|
@ -219,6 +219,8 @@ wxMenu* MainMenuBar::CreateToolsMenu() const
|
|||
tools_menu->Append(IDM_NETPLAY, _("Start &NetPlay..."));
|
||||
tools_menu->Append(IDM_MENU_INSTALL_WAD, _("Install WAD..."));
|
||||
tools_menu->Append(IDM_LOAD_WII_MENU, dummy_string);
|
||||
tools_menu->Append(IDM_IMPORT_NAND, _("Import BootMii NAND Backup..."));
|
||||
tools_menu->Append(IDM_EXTRACT_CERTIFICATES, _("Extract Certificates from NAND"));
|
||||
tools_menu->Append(IDM_FIFOPLAYER, _("FIFO Player"));
|
||||
tools_menu->AppendSeparator();
|
||||
tools_menu->AppendSubMenu(wiimote_menu, _("Connect Wii Remotes"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue