summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/fsmitm_romfsbuild.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/file_sys/fsmitm_romfsbuild.cpp b/src/core/file_sys/fsmitm_romfsbuild.cpp
index 2a913ce82..4aa8ae369 100644
--- a/src/core/file_sys/fsmitm_romfsbuild.cpp
+++ b/src/core/file_sys/fsmitm_romfsbuild.cpp
@@ -26,6 +26,7 @@
#include "common/alignment.h"
#include "common/assert.h"
#include "core/file_sys/fsmitm_romfsbuild.h"
+#include "core/file_sys/ips_layer.h"
#include "core/file_sys/vfs.h"
#include "core/file_sys/vfs_vector.h"
@@ -138,6 +139,9 @@ void RomFSBuildContext::VisitDirectory(VirtualDir root_romfs,
for (const auto& kv : entries) {
if (kv.second == VfsEntryType::Directory) {
+ if (dir->GetSubdirectory(kv.first + ".stub") != nullptr)
+ continue;
+
const auto child = std::make_shared<RomFSBuildDirectoryContext>();
// Set child's path.
child->cur_path_ofs = parent->path_len + 1;
@@ -151,6 +155,9 @@ void RomFSBuildContext::VisitDirectory(VirtualDir root_romfs,
child_dirs.push_back(child);
}
} else {
+ if (dir->GetFile(kv.first + ".stub") != nullptr)
+ continue;
+
const auto child = std::make_shared<RomFSBuildFileContext>();
// Set child's path.
child->cur_path_ofs = parent->path_len + 1;
@@ -162,6 +169,13 @@ void RomFSBuildContext::VisitDirectory(VirtualDir root_romfs,
child->source = root_romfs->GetFileRelative(child->path);
+ if (dir->GetFile(kv.first + ".ips") != nullptr) {
+ const auto ips = dir->GetFile(kv.first + ".ips");
+ auto patched = PatchIPS(child->source, ips);
+ if (patched != nullptr)
+ child->source = std::move(patched);
+ }
+
child->size = child->source->GetSize();
AddFile(parent, child);