summaryrefslogtreecommitdiff
path: root/src/core/file_sys/romfs.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2019-11-28 01:18:10 -0500
committerGravatar GitHub2019-11-28 01:18:10 -0500
commitfe65045dcb645ef57d02d617d8153382471732f9 (patch)
tree02d377df3ecfd8abb1229c79cdcde3ba26f02a1f /src/core/file_sys/romfs.cpp
parentpatch_manager: Adds check for disabled cheats to prevent them from being enab... (diff)
parentfilesys/romfs: Remove unused includes (diff)
downloadyuzu-fe65045dcb645ef57d02d617d8153382471732f9.tar.gz
yuzu-fe65045dcb645ef57d02d617d8153382471732f9.tar.xz
yuzu-fe65045dcb645ef57d02d617d8153382471732f9.zip
Merge pull request #3171 from lioncash/internal-link
filesys/romfs: Make ProcessFile and ProcessDirectory internally linked
Diffstat (limited to 'src/core/file_sys/romfs.cpp')
-rw-r--r--src/core/file_sys/romfs.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/file_sys/romfs.cpp b/src/core/file_sys/romfs.cpp
index ebbdf081e..c909d1ce4 100644
--- a/src/core/file_sys/romfs.cpp
+++ b/src/core/file_sys/romfs.cpp
@@ -2,6 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <memory>
6
5#include "common/common_types.h" 7#include "common/common_types.h"
6#include "common/swap.h" 8#include "common/swap.h"
7#include "core/file_sys/fsmitm_romfsbuild.h" 9#include "core/file_sys/fsmitm_romfsbuild.h"
@@ -12,7 +14,7 @@
12#include "core/file_sys/vfs_vector.h" 14#include "core/file_sys/vfs_vector.h"
13 15
14namespace FileSys { 16namespace FileSys {
15 17namespace {
16constexpr u32 ROMFS_ENTRY_EMPTY = 0xFFFFFFFF; 18constexpr u32 ROMFS_ENTRY_EMPTY = 0xFFFFFFFF;
17 19
18struct TableLocation { 20struct TableLocation {
@@ -51,7 +53,7 @@ struct FileEntry {
51static_assert(sizeof(FileEntry) == 0x20, "FileEntry has incorrect size."); 53static_assert(sizeof(FileEntry) == 0x20, "FileEntry has incorrect size.");
52 54
53template <typename Entry> 55template <typename Entry>
54static std::pair<Entry, std::string> GetEntry(const VirtualFile& file, std::size_t offset) { 56std::pair<Entry, std::string> GetEntry(const VirtualFile& file, std::size_t offset) {
55 Entry entry{}; 57 Entry entry{};
56 if (file->ReadObject(&entry, offset) != sizeof(Entry)) 58 if (file->ReadObject(&entry, offset) != sizeof(Entry))
57 return {}; 59 return {};
@@ -99,6 +101,7 @@ void ProcessDirectory(VirtualFile file, std::size_t dir_offset, std::size_t file
99 this_dir_offset = entry.first.sibling; 101 this_dir_offset = entry.first.sibling;
100 } 102 }
101} 103}
104} // Anonymous namespace
102 105
103VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) { 106VirtualDir ExtractRomFS(VirtualFile file, RomFSExtractionType type) {
104 RomFSHeader header{}; 107 RomFSHeader header{};