summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2021-06-11 14:01:57 -0400
committerGravatar Morph2021-06-11 14:04:11 -0400
commitfa2aac1bf5c3f55fde8cf6069ac7957eda109308 (patch)
tree8b1ae01ee32b51c31c8cc401224120b00481e12f /src
parentMerge pull request #6450 from lat9nq/update-sdl (diff)
downloadyuzu-fa2aac1bf5c3f55fde8cf6069ac7957eda109308.tar.gz
yuzu-fa2aac1bf5c3f55fde8cf6069ac7957eda109308.tar.xz
yuzu-fa2aac1bf5c3f55fde8cf6069ac7957eda109308.zip
yuzu: main: Ensure enough space is available for RomFS dumping
This warns the user if there isn't enough free space to dump the entire RomFS to disk. It requires at least the size of the extracted RomFS + 1 GiB as a buffer of free space.
Diffstat (limited to '')
-rw-r--r--src/yuzu/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 19339ff2d..be8933c5c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1946,6 +1946,18 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
1946 const auto full = res == selections.constFirst(); 1946 const auto full = res == selections.constFirst();
1947 const auto entry_size = CalculateRomFSEntrySize(extracted, full); 1947 const auto entry_size = CalculateRomFSEntrySize(extracted, full);
1948 1948
1949 // The minimum required space is the size of the extracted RomFS + 1 GiB
1950 const auto minimum_free_space = extracted->GetSize() + 0x40000000;
1951
1952 if (full && Common::FS::GetFreeSpaceSize(path) < minimum_free_space) {
1953 QMessageBox::warning(this, tr("RomFS Extraction Failed!"),
1954 tr("There is not enough free space at %1 to extract the RomFS. Please "
1955 "free up space or select a different dump directory at "
1956 "Emulation > Configure > System > Filesystem > Dump Root")
1957 .arg(QString::fromStdString(path)));
1958 return;
1959 }
1960
1949 QProgressDialog progress(tr("Extracting RomFS..."), tr("Cancel"), 0, 1961 QProgressDialog progress(tr("Extracting RomFS..."), tr("Cancel"), 0,
1950 static_cast<s32>(entry_size), this); 1962 static_cast<s32>(entry_size), this);
1951 progress.setWindowModality(Qt::WindowModal); 1963 progress.setWindowModality(Qt::WindowModal);