VERY experimental Nintendo Switch 2 emulator
C++
yuzu qt: Add option to dump to SDMC directory
lat9nq7d09c0a69444
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cppindex da956c99b3..e44907be8e 100644--- a/src/yuzu/game_list.cpp+++ b/src/yuzu/game_list.cpp@@ -521,7 +521,9 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::striQAction* remove_custom_config = remove_menu->addAction(tr("Remove Custom Configuration"));remove_menu->addSeparator();QAction* remove_all_content = remove_menu->addAction(tr("Remove All Installed Contents"));- QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS"));+ QMenu* dump_romfs_menu = context_menu.addMenu(tr("Dump RomFS"));+ QAction* dump_romfs = dump_romfs_menu->addAction(tr("Dump RomFS"));+ QAction* dump_romfs_sdmc = dump_romfs_menu->addAction(tr("Dump RomFS to SDMC"));QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));context_menu.addSeparator();@@ -570,8 +572,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::striconnect(remove_custom_config, &QAction::triggered, [this, program_id, path]() {emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration, path);});- connect(dump_romfs, &QAction::triggered,- [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); });+ connect(dump_romfs, &QAction::triggered, [this, program_id, path]() {+ emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::Normal);+ });+ connect(dump_romfs_sdmc, &QAction::triggered, [this, program_id, path]() {+ emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::SDMC);+ });connect(copy_tid, &QAction::triggered,[this, program_id]() { emit CopyTIDRequested(program_id); });connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.hindex b630e34ffa..50402da51c 100644--- a/src/yuzu/game_list.h+++ b/src/yuzu/game_list.h@@ -45,6 +45,11 @@ enum class GameListRemoveTarget {CustomConfiguration,};+enum class DumpRomFSTarget {+ Normal,+ SDMC,+};+enum class InstalledEntryType {Game,Update,@@ -92,7 +97,7 @@ signals:void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type);void RemoveFileRequested(u64 program_id, GameListRemoveTarget target,const std::string& game_path);- void DumpRomFSRequested(u64 program_id, const std::string& game_path);+ void DumpRomFSRequested(u64 program_id, const std::string& game_path, DumpRomFSTarget target);void CopyTIDRequested(u64 program_id);void NavigateToGamedbEntryRequested(u64 program_id,const CompatibilityList& compatibility_list);diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cppindex 20f65d2331..08128effb0 100644--- a/src/yuzu/main.cpp+++ b/src/yuzu/main.cpp@@ -1880,7 +1880,8 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g}}-void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path) {+void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path,+ DumpRomFSTarget target) {const auto failed = [this] {QMessageBox::warning(this, tr("RomFS Extraction Failed!"),tr("There was an error copying the RomFS files or the user "@@ -1908,7 +1909,10 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pareturn;}- const auto dump_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir);+ const auto dump_dir =+ target == DumpRomFSTarget::Normal+ ? Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir)+ : Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "atmosphere" / "contents";const auto romfs_dir = fmt::format("{:016X}/romfs", *romfs_title_id);const auto path = Common::FS::PathToUTF8String(dump_dir / romfs_dir);diff --git a/src/yuzu/main.h b/src/yuzu/main.hindex 11f152cbea..c86c2f35e8 100644--- a/src/yuzu/main.h+++ b/src/yuzu/main.h@@ -34,6 +34,7 @@ class QProgressDialog;class WaitTreeWidget;enum class GameListOpenTarget;enum class GameListRemoveTarget;+enum class DumpRomFSTarget;enum class InstalledEntryType;class GameListPlaceholder;@@ -244,7 +245,7 @@ private slots:void OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type);void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target,const std::string& game_path);- void OnGameListDumpRomFS(u64 program_id, const std::string& game_path);+ void OnGameListDumpRomFS(u64 program_id, const std::string& game_path, DumpRomFSTarget target);void OnGameListCopyTID(u64 program_id);void OnGameListNavigateToGamedbEntry(u64 program_id,const CompatibilityList& compatibility_list);