From a49169e81906d230fd6bfc7546acc6f763f4c321 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Tue, 23 Apr 2019 14:38:18 -0400 Subject: [PATCH] filesystem: Add const qualification to various accessors --- src/core/file_sys/romfs_factory.cpp | 5 +- src/core/file_sys/romfs_factory.h | 4 +- src/core/file_sys/savedata_factory.cpp | 7 +- src/core/file_sys/savedata_factory.h | 7 +- src/core/file_sys/sdmc_factory.cpp | 2 +- src/core/file_sys/sdmc_factory.h | 2 +- .../hle/service/filesystem/filesystem.cpp | 68 ++++++++++--------- src/core/hle/service/filesystem/filesystem.h | 68 ++++++++++--------- src/core/hle/service/filesystem/fsp_srv.cpp | 8 +-- src/yuzu_cmd/default_ini.h | 6 +- 10 files changed, 94 insertions(+), 83 deletions(-) diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index c3ee4a158..84cd4684c 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -35,7 +35,7 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { this->update_raw = std::move(update_raw); } -ResultVal RomFSFactory::OpenCurrentProcess() { +ResultVal RomFSFactory::OpenCurrentProcess() const { if (!updatable) return MakeResult(file); @@ -44,7 +44,8 @@ ResultVal RomFSFactory::OpenCurrentProcess() { patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); } -ResultVal RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) { +ResultVal RomFSFactory::Open(u64 title_id, StorageId storage, + ContentRecordType type) const { std::shared_ptr res; switch (storage) { diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index 7724c0b23..da63a313a 100644 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -33,8 +33,8 @@ public: ~RomFSFactory(); void SetPackedUpdate(VirtualFile update_raw); - ResultVal OpenCurrentProcess(); - ResultVal Open(u64 title_id, StorageId storage, ContentRecordType type); + ResultVal OpenCurrentProcess() const; + ResultVal Open(u64 title_id, StorageId storage, ContentRecordType type) const; private: VirtualFile file; diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index c63815332..f77cc02ac 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp @@ -71,7 +71,7 @@ SaveDataFactory::SaveDataFactory(VirtualDir save_directory) : dir(std::move(save SaveDataFactory::~SaveDataFactory() = default; ResultVal SaveDataFactory::Create(SaveDataSpaceId space, - const SaveDataDescriptor& meta) { + const SaveDataDescriptor& meta) const { PrintSaveDataDescriptorWarnings(meta); const auto save_directory = @@ -88,7 +88,8 @@ ResultVal SaveDataFactory::Create(SaveDataSpaceId space, return MakeResult(std::move(out)); } -ResultVal SaveDataFactory::Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) { +ResultVal SaveDataFactory::Open(SaveDataSpaceId space, + const SaveDataDescriptor& meta) const { const auto save_directory = GetFullPath(space, meta.type, meta.title_id, meta.user_id, meta.save_id); @@ -165,7 +166,7 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id, } void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, - SaveDataSize new_value) { + SaveDataSize new_value) const { const auto path = GetFullPath(SaveDataSpaceId::NandUser, type, title_id, user_id, 0); const auto dir = GetOrCreateDirectoryRelative(this->dir, path); diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h index 738038ee0..991e57aa1 100644 --- a/src/core/file_sys/savedata_factory.h +++ b/src/core/file_sys/savedata_factory.h @@ -64,8 +64,8 @@ public: explicit SaveDataFactory(VirtualDir dir); ~SaveDataFactory(); - ResultVal Create(SaveDataSpaceId space, const SaveDataDescriptor& meta); - ResultVal Open(SaveDataSpaceId space, const SaveDataDescriptor& meta); + ResultVal Create(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; + ResultVal Open(SaveDataSpaceId space, const SaveDataDescriptor& meta) const; VirtualDir GetSaveDataSpaceDirectory(SaveDataSpaceId space) const; @@ -74,7 +74,8 @@ public: u128 user_id, u64 save_id); SaveDataSize ReadSaveDataSize(SaveDataType type, u64 title_id, u128 user_id) const; - void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, SaveDataSize new_value); + void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, + SaveDataSize new_value) const; private: VirtualDir dir; diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index 743e2e63a..5113a1ca6 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp @@ -21,7 +21,7 @@ SDMCFactory::SDMCFactory(VirtualDir dir_) SDMCFactory::~SDMCFactory() = default; -ResultVal SDMCFactory::Open() { +ResultVal SDMCFactory::Open() const { return MakeResult(dir); } diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h index 164fd9435..42dc4e08a 100644 --- a/src/core/file_sys/sdmc_factory.h +++ b/src/core/file_sys/sdmc_factory.h @@ -19,7 +19,7 @@ public: explicit SDMCFactory(VirtualDir dir); ~SDMCFactory(); - ResultVal Open(); + ResultVal Open() const; VirtualDir GetSDMCContentDirectory() const; diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 76a860c6d..31d5fd79b 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -241,6 +241,10 @@ ResultVal VfsDirectoryServiceWrapper::GetEntryType( return FileSys::ERROR_PATH_NOT_FOUND; } +FileSystemController::FileSystemController() = default; + +FileSystemController::~FileSystemController() = default; + ResultCode FileSystemController::RegisterRomFS(std::unique_ptr&& factory) { romfs_factory = std::move(factory); LOG_DEBUG(Service_FS, "Registered RomFS"); @@ -278,7 +282,7 @@ void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { romfs_factory->SetPackedUpdate(std::move(update_raw)); } -ResultVal FileSystemController::OpenRomFSCurrentProcess() { +ResultVal FileSystemController::OpenRomFSCurrentProcess() const { LOG_TRACE(Service_FS, "Opening RomFS for current process"); if (romfs_factory == nullptr) { @@ -289,9 +293,8 @@ ResultVal FileSystemController::OpenRomFSCurrentProcess() return romfs_factory->OpenCurrentProcess(); } -ResultVal FileSystemController::OpenRomFS(u64 title_id, - FileSys::StorageId storage_id, - FileSys::ContentRecordType type) { +ResultVal FileSystemController::OpenRomFS( + u64 title_id, FileSys::StorageId storage_id, FileSys::ContentRecordType type) const { LOG_TRACE(Service_FS, "Opening RomFS for title_id={:016X}, storage_id={:02X}, type={:02X}", title_id, static_cast(storage_id), static_cast(type)); @@ -304,7 +307,7 @@ ResultVal FileSystemController::OpenRomFS(u64 title_id, } ResultVal FileSystemController::CreateSaveData( - FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) { + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const { LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", static_cast(space), save_struct.DebugInfo()); @@ -316,7 +319,7 @@ ResultVal FileSystemController::CreateSaveData( } ResultVal FileSystemController::OpenSaveData( - FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& descriptor) { + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& descriptor) const { LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", static_cast(space), descriptor.DebugInfo()); @@ -328,7 +331,7 @@ ResultVal FileSystemController::OpenSaveData( } ResultVal FileSystemController::OpenSaveDataSpace( - FileSys::SaveDataSpaceId space) { + FileSys::SaveDataSpaceId space) const { LOG_TRACE(Service_FS, "Opening Save Data Space for space_id={:01X}", static_cast(space)); if (save_data_factory == nullptr) { @@ -338,7 +341,7 @@ ResultVal FileSystemController::OpenSaveDataSpace( return MakeResult(save_data_factory->GetSaveDataSpaceDirectory(space)); } -ResultVal FileSystemController::OpenSDMC() { +ResultVal FileSystemController::OpenSDMC() const { LOG_TRACE(Service_FS, "Opening SDMC"); if (sdmc_factory == nullptr) { @@ -348,7 +351,8 @@ ResultVal FileSystemController::OpenSDMC() { return sdmc_factory->Open(); } -ResultVal FileSystemController::OpenBISPartition(FileSys::BisPartitionId id) { +ResultVal FileSystemController::OpenBISPartition( + FileSys::BisPartitionId id) const { LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", static_cast(id)); if (bis_factory == nullptr) { @@ -364,7 +368,7 @@ ResultVal FileSystemController::OpenBISPartition(FileSys::B } ResultVal FileSystemController::OpenBISPartitionStorage( - FileSys::BisPartitionId id) { + FileSys::BisPartitionId id) const { LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", static_cast(id)); if (bis_factory == nullptr) { @@ -432,7 +436,7 @@ u64 FileSystemController::GetTotalSpaceSize(FileSys::StorageId id) const { } FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataType type, - u64 title_id, u128 user_id) { + u64 title_id, u128 user_id) const { if (save_data_factory == nullptr) { return {0, 0}; } @@ -465,7 +469,7 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy } void FileSystemController::WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, - FileSys::SaveDataSize new_value) { + FileSys::SaveDataSize new_value) const { if (save_data_factory != nullptr) save_data_factory->WriteSaveDataSize(type, title_id, user_id, new_value); } @@ -477,19 +481,19 @@ void FileSystemController::SetGameCard(FileSys::VirtualFile file) { gamecard_placeholder = std::make_unique(dir); } -FileSys::XCI* FileSystemController::GetGameCard() { +FileSys::XCI* FileSystemController::GetGameCard() const { return gamecard.get(); } -FileSys::RegisteredCache* FileSystemController::GetGameCardContents() { +FileSys::RegisteredCache* FileSystemController::GetGameCardContents() const { return gamecard_registered.get(); } -FileSys::PlaceholderCache* FileSystemController::GetGameCardPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetGameCardPlaceholder() const { return gamecard_placeholder.get(); } -FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() { +FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() const { LOG_TRACE(Service_FS, "Opening System NAND Contents"); if (bis_factory == nullptr) @@ -498,7 +502,7 @@ FileSys::RegisteredCache* FileSystemController::GetSystemNANDContents() { return bis_factory->GetSystemNANDContents(); } -FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() { +FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() const { LOG_TRACE(Service_FS, "Opening User NAND Contents"); if (bis_factory == nullptr) @@ -507,7 +511,7 @@ FileSys::RegisteredCache* FileSystemController::GetUserNANDContents() { return bis_factory->GetUserNANDContents(); } -FileSys::RegisteredCache* FileSystemController::GetSDMCContents() { +FileSys::RegisteredCache* FileSystemController::GetSDMCContents() const { LOG_TRACE(Service_FS, "Opening SDMC Contents"); if (sdmc_factory == nullptr) @@ -516,7 +520,7 @@ FileSys::RegisteredCache* FileSystemController::GetSDMCContents() { return sdmc_factory->GetSDMCContents(); } -FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() const { LOG_TRACE(Service_FS, "Opening System NAND Placeholder"); if (bis_factory == nullptr) @@ -525,7 +529,7 @@ FileSys::PlaceholderCache* FileSystemController::GetSystemNANDPlaceholder() { return bis_factory->GetSystemNANDPlaceholder(); } -FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() const { LOG_TRACE(Service_FS, "Opening User NAND Placeholder"); if (bis_factory == nullptr) @@ -534,7 +538,7 @@ FileSys::PlaceholderCache* FileSystemController::GetUserNANDPlaceholder() { return bis_factory->GetUserNANDPlaceholder(); } -FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() { +FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() const { LOG_TRACE(Service_FS, "Opening SDMC Placeholder"); if (sdmc_factory == nullptr) @@ -544,7 +548,7 @@ FileSys::PlaceholderCache* FileSystemController::GetSDMCPlaceholder() { } FileSys::RegisteredCache* FileSystemController::GetRegisteredCacheForStorage( - FileSys::StorageId id) { + FileSys::StorageId id) const { switch (id) { case FileSys::StorageId::None: case FileSys::StorageId::Host: @@ -564,7 +568,7 @@ FileSys::RegisteredCache* FileSystemController::GetRegisteredCacheForStorage( } FileSys::PlaceholderCache* FileSystemController::GetPlaceholderCacheForStorage( - FileSys::StorageId id) { + FileSys::StorageId id) const { switch (id) { case FileSys::StorageId::None: case FileSys::StorageId::Host: @@ -583,7 +587,7 @@ FileSys::PlaceholderCache* FileSystemController::GetPlaceholderCacheForStorage( return nullptr; } -FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() { +FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() const { LOG_TRACE(Service_FS, "Opening system NAND content directory"); if (bis_factory == nullptr) @@ -592,7 +596,7 @@ FileSys::VirtualDir FileSystemController::GetSystemNANDContentDirectory() { return bis_factory->GetSystemNANDContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() { +FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() const { LOG_TRACE(Service_FS, "Opening user NAND content directory"); if (bis_factory == nullptr) @@ -601,7 +605,7 @@ FileSys::VirtualDir FileSystemController::GetUserNANDContentDirectory() { return bis_factory->GetUserNANDContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() { +FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() const { LOG_TRACE(Service_FS, "Opening SDMC content directory"); if (sdmc_factory == nullptr) @@ -610,7 +614,7 @@ FileSys::VirtualDir FileSystemController::GetSDMCContentDirectory() { return sdmc_factory->GetSDMCContentDirectory(); } -FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() { +FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() const { LOG_TRACE(Service_FS, "Opening NAND image directory"); if (bis_factory == nullptr) @@ -619,7 +623,7 @@ FileSys::VirtualDir FileSystemController::GetNANDImageDirectory() { return bis_factory->GetImageDirectory(); } -FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() { +FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() const { LOG_TRACE(Service_FS, "Opening SDMC image directory"); if (sdmc_factory == nullptr) @@ -628,7 +632,7 @@ FileSys::VirtualDir FileSystemController::GetSDMCImageDirectory() { return sdmc_factory->GetImageDirectory(); } -FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId id) { +FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId id) const { switch (id) { case ContentStorageId::System: return GetSystemNANDContentDirectory(); @@ -641,7 +645,7 @@ FileSys::VirtualDir FileSystemController::GetContentDirectory(ContentStorageId i return nullptr; } -FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) { +FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) const { switch (id) { case ImageDirectoryId::NAND: return GetNANDImageDirectory(); @@ -652,7 +656,7 @@ FileSys::VirtualDir FileSystemController::GetImageDirectory(ImageDirectoryId id) return nullptr; } -FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) { +FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) const { LOG_TRACE(Service_FS, "Opening mod load root for tid={:016X}", title_id); if (bis_factory == nullptr) @@ -661,7 +665,7 @@ FileSys::VirtualDir FileSystemController::GetModificationLoadRoot(u64 title_id) return bis_factory->GetModificationLoadRoot(title_id); } -FileSys::VirtualDir FileSystemController::GetModificationDumpRoot(u64 title_id) { +FileSys::VirtualDir FileSystemController::GetModificationDumpRoot(u64 title_id) const { LOG_TRACE(Service_FS, "Opening mod dump root for tid={:016X}", title_id); if (bis_factory == nullptr) diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index 2eb3a641d..4d7da3b6f 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h @@ -52,59 +52,63 @@ enum class ImageDirectoryId : u32 { class FileSystemController { public: + FileSystemController(); + ~FileSystemController(); + ResultCode RegisterRomFS(std::unique_ptr&& factory); ResultCode RegisterSaveData(std::unique_ptr&& factory); ResultCode RegisterSDMC(std::unique_ptr&& factory); ResultCode RegisterBIS(std::unique_ptr&& factory); void SetPackedUpdate(FileSys::VirtualFile update_raw); - ResultVal OpenRomFSCurrentProcess(); + ResultVal OpenRomFSCurrentProcess() const; ResultVal OpenRomFS(u64 title_id, FileSys::StorageId storage_id, - FileSys::ContentRecordType type); - ResultVal CreateSaveData(FileSys::SaveDataSpaceId space, - const FileSys::SaveDataDescriptor& save_struct); - ResultVal OpenSaveData(FileSys::SaveDataSpaceId space, - const FileSys::SaveDataDescriptor& save_struct); - ResultVal OpenSaveDataSpace(FileSys::SaveDataSpaceId space); - ResultVal OpenSDMC(); - ResultVal OpenBISPartition(FileSys::BisPartitionId id); - ResultVal OpenBISPartitionStorage(FileSys::BisPartitionId id); + FileSys::ContentRecordType type) const; + ResultVal CreateSaveData( + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; + ResultVal OpenSaveData( + FileSys::SaveDataSpaceId space, const FileSys::SaveDataDescriptor& save_struct) const; + ResultVal OpenSaveDataSpace(FileSys::SaveDataSpaceId space) const; + ResultVal OpenSDMC() const; + ResultVal OpenBISPartition(FileSys::BisPartitionId id) const; + ResultVal OpenBISPartitionStorage(FileSys::BisPartitionId id) const; u64 GetFreeSpaceSize(FileSys::StorageId id) const; u64 GetTotalSpaceSize(FileSys::StorageId id) const; - FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id); + FileSys::SaveDataSize ReadSaveDataSize(FileSys::SaveDataType type, u64 title_id, + u128 user_id) const; void WriteSaveDataSize(FileSys::SaveDataType type, u64 title_id, u128 user_id, - FileSys::SaveDataSize new_value); + FileSys::SaveDataSize new_value) const; void SetGameCard(FileSys::VirtualFile file); - FileSys::XCI* GetGameCard(); + FileSys::XCI* GetGameCard() const; - FileSys::RegisteredCache* GetSystemNANDContents(); - FileSys::RegisteredCache* GetUserNANDContents(); - FileSys::RegisteredCache* GetSDMCContents(); - FileSys::RegisteredCache* GetGameCardContents(); + FileSys::RegisteredCache* GetSystemNANDContents() const; + FileSys::RegisteredCache* GetUserNANDContents() const; + FileSys::RegisteredCache* GetSDMCContents() const; + FileSys::RegisteredCache* GetGameCardContents() const; - FileSys::PlaceholderCache* GetSystemNANDPlaceholder(); - FileSys::PlaceholderCache* GetUserNANDPlaceholder(); - FileSys::PlaceholderCache* GetSDMCPlaceholder(); - FileSys::PlaceholderCache* GetGameCardPlaceholder(); + FileSys::PlaceholderCache* GetSystemNANDPlaceholder() const; + FileSys::PlaceholderCache* GetUserNANDPlaceholder() const; + FileSys::PlaceholderCache* GetSDMCPlaceholder() const; + FileSys::PlaceholderCache* GetGameCardPlaceholder() const; - FileSys::RegisteredCache* GetRegisteredCacheForStorage(FileSys::StorageId id); - FileSys::PlaceholderCache* GetPlaceholderCacheForStorage(FileSys::StorageId id); + FileSys::RegisteredCache* GetRegisteredCacheForStorage(FileSys::StorageId id) const; + FileSys::PlaceholderCache* GetPlaceholderCacheForStorage(FileSys::StorageId id) const; - FileSys::VirtualDir GetSystemNANDContentDirectory(); - FileSys::VirtualDir GetUserNANDContentDirectory(); - FileSys::VirtualDir GetSDMCContentDirectory(); + FileSys::VirtualDir GetSystemNANDContentDirectory() const; + FileSys::VirtualDir GetUserNANDContentDirectory() const; + FileSys::VirtualDir GetSDMCContentDirectory() const; - FileSys::VirtualDir GetNANDImageDirectory(); - FileSys::VirtualDir GetSDMCImageDirectory(); + FileSys::VirtualDir GetNANDImageDirectory() const; + FileSys::VirtualDir GetSDMCImageDirectory() const; - FileSys::VirtualDir GetContentDirectory(ContentStorageId id); - FileSys::VirtualDir GetImageDirectory(ImageDirectoryId id); + FileSys::VirtualDir GetContentDirectory(ContentStorageId id) const; + FileSys::VirtualDir GetImageDirectory(ImageDirectoryId id) const; - FileSys::VirtualDir GetModificationLoadRoot(u64 title_id); - FileSys::VirtualDir GetModificationDumpRoot(u64 title_id); + FileSys::VirtualDir GetModificationLoadRoot(u64 title_id) const; + FileSys::VirtualDir GetModificationDumpRoot(u64 title_id) const; // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function // above is called. diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 525fda19f..305d9e176 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -32,8 +32,8 @@ namespace Service::FileSystem { struct SizeGetter { - std::function free; - std::function total; + std::function get_free_size; + std::function get_total_size; static SizeGetter FromStorageId(const FileSystemController& fsc, FileSys::StorageId id) { return { @@ -485,7 +485,7 @@ public: IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(size.free()); + rb.Push(size.get_free_size()); } void GetTotalSpaceSize(Kernel::HLERequestContext& ctx) { @@ -493,7 +493,7 @@ public: IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); - rb.Push(size.total()); + rb.Push(size.get_total_size()); } private: diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index e66d2f89b..a6171c3ed 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -175,17 +175,17 @@ use_virtual_sd = # Whether or not to enable gamecard emulation # 1: Yes, 0 (default): No -gamecard_inserted = +gamecard_inserted = # Whether or not the gamecard should be emulated as the current game # If 'gamecard_inserted' is 0 this setting is irrelevant # 1: Yes, 0 (default): No -gamecard_current_game = +gamecard_current_game = # Path to an XCI file to use as the gamecard # If 'gamecard_inserted' is 0 this setting is irrelevant # If 'gamecard_current_game' is 1 this setting is irrelevant -gamecard_path = +gamecard_path = [System] # Whether the system is docked