diff --git a/sphaira/source/dumper.cpp b/sphaira/source/dumper.cpp index dae62f9..9be4f5e 100644 --- a/sphaira/source/dumper.cpp +++ b/sphaira/source/dumper.cpp @@ -30,11 +30,11 @@ struct DumpEntry { struct DumpLocation { const DumpLocationType type; - const char* display_name; + const char* name; }; constexpr DumpLocation DUMP_LOCATIONS[]{ - { DumpLocationType_SdCard, "microSD card (/dumps/NSP/)" }, + { DumpLocationType_SdCard, "microSD card (/dumps/)" }, { DumpLocationType_UsbS2S, "USB transfer (Switch 2 Switch)" }, { DumpLocationType_DevNull, "/dev/null (Speed Test)" }, }; @@ -103,7 +103,6 @@ private: }; Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, BaseSource* source, std::span paths) { - const auto DUMP_PATH = fs::AppendPath(root, "/dumps/NSP"); constexpr s64 BIG_FILE_SIZE = 1024ULL*1024ULL*1024ULL*4ULL; for (auto path : paths) { @@ -111,7 +110,7 @@ Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, Bas pbox->SetTitle(source->GetName(path)); pbox->NewTransfer(path); - const auto temp_path = fs::AppendPath(DUMP_PATH, path + ".temp"); + const auto temp_path = fs::AppendPath(root, path + ".temp"); fs->CreateDirectoryRecursivelyWithPath(temp_path); fs->DeleteFile(temp_path); @@ -134,7 +133,7 @@ Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, Bas )); } - path = fs::AppendPath(DUMP_PATH, path); + path = fs::AppendPath(root, path); fs->DeleteFile(path); R_TRY(fs->RenameFile(temp_path, path)); } @@ -143,7 +142,7 @@ Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, Bas } Result DumpToFileNative(ui::ProgressBox* pbox, BaseSource* source, std::span paths) { - fs::FsNative fs{}; + fs::FsNativeSd fs{}; return DumpToFile(pbox, &fs, "/", source, paths); } @@ -335,7 +334,7 @@ void Dump(std::shared_ptr source, const std::vector& pat for (s32 i = 0; i < std::size(DUMP_LOCATIONS); i++) { if (location_flags & (1 << DUMP_LOCATIONS[i].type)) { dump_entries.emplace_back(DUMP_LOCATIONS[i].type, i); - items.emplace_back(i18n::get(DUMP_LOCATIONS[i].display_name)); + items.emplace_back(i18n::get(DUMP_LOCATIONS[i].name)); } } diff --git a/sphaira/source/ui/menus/game_menu.cpp b/sphaira/source/ui/menus/game_menu.cpp index be072fd..8ca618d 100644 --- a/sphaira/source/ui/menus/game_menu.cpp +++ b/sphaira/source/ui/menus/game_menu.cpp @@ -1108,7 +1108,7 @@ void Menu::DumpGames(u32 flags) { std::vector paths; for (auto& e : nsp_entries) { - paths.emplace_back(e.path); + paths.emplace_back(fs::AppendPath("/dumps/NSP", e.path)); } auto source = std::make_shared(nsp_entries); diff --git a/sphaira/source/ui/menus/gc_menu.cpp b/sphaira/source/ui/menus/gc_menu.cpp index 96f1dff..f13e376 100644 --- a/sphaira/source/ui/menus/gc_menu.cpp +++ b/sphaira/source/ui/menus/gc_menu.cpp @@ -130,15 +130,19 @@ auto BuildFilePath(DumpFileType type, std::span entries) // builds path suiteable for file dumps. auto BuildFullDumpPath(DumpFileType type, std::span entries) -> fs::FsPath { const auto base_path = BuildXciBasePath(entries); + fs::FsPath out; + if (App::GetApp()->m_dump_app_folder.Get()) { if (App::GetApp()->m_dump_append_folder_with_xci.Get()) { - return base_path + ".xci/" + base_path + GetDumpTypeStr(type); + out = base_path + ".xci/" + base_path + GetDumpTypeStr(type); } else { - return base_path + "/" + base_path + GetDumpTypeStr(type); + out = base_path + "/" + base_path + GetDumpTypeStr(type); } } else { - return base_path + GetDumpTypeStr(type); + out = base_path + GetDumpTypeStr(type); } + + return fs::AppendPath("/dumps/XCI", out); } // @Gc is the mount point, S is for secure partion, the remaining is the