VERY experimental Nintendo Switch 2 emulator
C++
sdmc_factory: Add SD Card size getters
Zach Hilmana4b2e1c5ce9a
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cppindex a5f1dcc5c8..743e2e63ad 100644--- a/src/core/file_sys/sdmc_factory.cpp+++ b/src/core/file_sys/sdmc_factory.cpp@@ -6,6 +6,7 @@#include "core/file_sys/registered_cache.h"#include "core/file_sys/sdmc_factory.h"#include "core/file_sys/xts_archive.h"+#include "core/settings.h"namespace FileSys {@@ -40,4 +41,12 @@ VirtualDir SDMCFactory::GetImageDirectory() const {return GetOrCreateDirectoryRelative(dir, "/Nintendo/Album");}+u64 SDMCFactory::GetSDMCFreeSpace() const {+ return GetSDMCTotalSpace() - dir->GetSize();+}++u64 SDMCFactory::GetSDMCTotalSpace() const {+ return static_cast<u64>(Settings::values.sdmc_size);+}+} // namespace FileSysdiff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.hindex abe6cc41c2..164fd94356 100644--- a/src/core/file_sys/sdmc_factory.h+++ b/src/core/file_sys/sdmc_factory.h@@ -28,6 +28,9 @@ public:VirtualDir GetImageDirectory() const;+ u64 GetSDMCFreeSpace() const;+ u64 GetSDMCTotalSpace() const;+private:VirtualDir dir;