yuzu qt: Add option to dump to SDMC directory

Enables dumping the RomFS to SDMC directory, specifically '[yuzu data
directory]/sdmc/atmosphere/contents/[title_id]/romfs'.
This commit is contained in:
lat9nq
2021-06-14 17:13:08 -04:00
committed by Morph
parent c5e25cffb9
commit bfecd395d4
4 changed files with 23 additions and 7 deletions

View File

@ -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_pa
return;
}
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);