summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/game_list.cpp12
-rw-r--r--src/yuzu/game_list.h7
-rw-r--r--src/yuzu/main.cpp8
-rw-r--r--src/yuzu/main.h3
4 files changed, 23 insertions, 7 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index da956c99b..e44907be8 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::stri
521 QAction* remove_custom_config = remove_menu->addAction(tr("Remove Custom Configuration")); 521 QAction* remove_custom_config = remove_menu->addAction(tr("Remove Custom Configuration"));
522 remove_menu->addSeparator(); 522 remove_menu->addSeparator();
523 QAction* remove_all_content = remove_menu->addAction(tr("Remove All Installed Contents")); 523 QAction* remove_all_content = remove_menu->addAction(tr("Remove All Installed Contents"));
524 QAction* dump_romfs = context_menu.addAction(tr("Dump RomFS")); 524 QMenu* dump_romfs_menu = context_menu.addMenu(tr("Dump RomFS"));
525 QAction* dump_romfs = dump_romfs_menu->addAction(tr("Dump RomFS"));
526 QAction* dump_romfs_sdmc = dump_romfs_menu->addAction(tr("Dump RomFS to SDMC"));
525 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard")); 527 QAction* copy_tid = context_menu.addAction(tr("Copy Title ID to Clipboard"));
526 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry")); 528 QAction* navigate_to_gamedb_entry = context_menu.addAction(tr("Navigate to GameDB entry"));
527 context_menu.addSeparator(); 529 context_menu.addSeparator();
@@ -570,8 +572,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
570 connect(remove_custom_config, &QAction::triggered, [this, program_id, path]() { 572 connect(remove_custom_config, &QAction::triggered, [this, program_id, path]() {
571 emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration, path); 573 emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration, path);
572 }); 574 });
573 connect(dump_romfs, &QAction::triggered, 575 connect(dump_romfs, &QAction::triggered, [this, program_id, path]() {
574 [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); }); 576 emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::Normal);
577 });
578 connect(dump_romfs_sdmc, &QAction::triggered, [this, program_id, path]() {
579 emit DumpRomFSRequested(program_id, path, DumpRomFSTarget::SDMC);
580 });
575 connect(copy_tid, &QAction::triggered, 581 connect(copy_tid, &QAction::triggered,
576 [this, program_id]() { emit CopyTIDRequested(program_id); }); 582 [this, program_id]() { emit CopyTIDRequested(program_id); });
577 connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() { 583 connect(navigate_to_gamedb_entry, &QAction::triggered, [this, program_id]() {
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index b630e34ff..50402da51 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -45,6 +45,11 @@ enum class GameListRemoveTarget {
45 CustomConfiguration, 45 CustomConfiguration,
46}; 46};
47 47
48enum class DumpRomFSTarget {
49 Normal,
50 SDMC,
51};
52
48enum class InstalledEntryType { 53enum class InstalledEntryType {
49 Game, 54 Game,
50 Update, 55 Update,
@@ -92,7 +97,7 @@ signals:
92 void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type); 97 void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type);
93 void RemoveFileRequested(u64 program_id, GameListRemoveTarget target, 98 void RemoveFileRequested(u64 program_id, GameListRemoveTarget target,
94 const std::string& game_path); 99 const std::string& game_path);
95 void DumpRomFSRequested(u64 program_id, const std::string& game_path); 100 void DumpRomFSRequested(u64 program_id, const std::string& game_path, DumpRomFSTarget target);
96 void CopyTIDRequested(u64 program_id); 101 void CopyTIDRequested(u64 program_id);
97 void NavigateToGamedbEntryRequested(u64 program_id, 102 void NavigateToGamedbEntryRequested(u64 program_id,
98 const CompatibilityList& compatibility_list); 103 const CompatibilityList& compatibility_list);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 20f65d233..08128effb 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
1880 } 1880 }
1881} 1881}
1882 1882
1883void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path) { 1883void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_path,
1884 DumpRomFSTarget target) {
1884 const auto failed = [this] { 1885 const auto failed = [this] {
1885 QMessageBox::warning(this, tr("RomFS Extraction Failed!"), 1886 QMessageBox::warning(this, tr("RomFS Extraction Failed!"),
1886 tr("There was an error copying the RomFS files or the user " 1887 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_pa
1908 return; 1909 return;
1909 } 1910 }
1910 1911
1911 const auto dump_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir); 1912 const auto dump_dir =
1913 target == DumpRomFSTarget::Normal
1914 ? Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir)
1915 : Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir) / "atmosphere" / "contents";
1912 const auto romfs_dir = fmt::format("{:016X}/romfs", *romfs_title_id); 1916 const auto romfs_dir = fmt::format("{:016X}/romfs", *romfs_title_id);
1913 1917
1914 const auto path = Common::FS::PathToUTF8String(dump_dir / romfs_dir); 1918 const auto path = Common::FS::PathToUTF8String(dump_dir / romfs_dir);
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 11f152cbe..c86c2f35e 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -34,6 +34,7 @@ class QProgressDialog;
34class WaitTreeWidget; 34class WaitTreeWidget;
35enum class GameListOpenTarget; 35enum class GameListOpenTarget;
36enum class GameListRemoveTarget; 36enum class GameListRemoveTarget;
37enum class DumpRomFSTarget;
37enum class InstalledEntryType; 38enum class InstalledEntryType;
38class GameListPlaceholder; 39class GameListPlaceholder;
39 40
@@ -244,7 +245,7 @@ private slots:
244 void OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type); 245 void OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type);
245 void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target, 246 void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target,
246 const std::string& game_path); 247 const std::string& game_path);
247 void OnGameListDumpRomFS(u64 program_id, const std::string& game_path); 248 void OnGameListDumpRomFS(u64 program_id, const std::string& game_path, DumpRomFSTarget target);
248 void OnGameListCopyTID(u64 program_id); 249 void OnGameListCopyTID(u64 program_id);
249 void OnGameListNavigateToGamedbEntry(u64 program_id, 250 void OnGameListNavigateToGamedbEntry(u64 program_id,
250 const CompatibilityList& compatibility_list); 251 const CompatibilityList& compatibility_list);