feat: Add romfslite mod folder support (Atmosphere 1.9.5)

Support the romfslite folder type introduced in Atmosphere 1.9.5 for
memory-optimized mod loading. The emulator now detects and loads
romfslite folders the same way as romfs folders.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-10-11 20:24:18 +10:00
parent c8b3f0c98c
commit df14b96c6b
2 changed files with 10 additions and 3 deletions

View File

@@ -4,5 +4,5 @@
package org.citron.citron_emu.utils package org.citron.citron_emu.utils
object AddonUtil { object AddonUtil {
val validAddonDirectories = listOf("cheats", "exefs", "romfs") val validAddonDirectories = listOf("cheats", "exefs", "romfs", "romfslite")
} }

View File

@@ -382,6 +382,11 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t
if (romfs_dir != nullptr) if (romfs_dir != nullptr)
layers.emplace_back(std::make_shared<CachedVfsDirectory>(std::move(romfs_dir))); layers.emplace_back(std::make_shared<CachedVfsDirectory>(std::move(romfs_dir)));
// Support for romfslite introduced in Atmosphere 1.9.5
auto romfslite_dir = FindSubdirectoryCaseless(subdir, "romfslite");
if (romfslite_dir != nullptr)
layers.emplace_back(std::make_shared<CachedVfsDirectory>(std::move(romfslite_dir)));
auto ext_dir = FindSubdirectoryCaseless(subdir, "romfs_ext"); auto ext_dir = FindSubdirectoryCaseless(subdir, "romfs_ext");
if (ext_dir != nullptr) if (ext_dir != nullptr)
layers_ext.emplace_back(std::make_shared<CachedVfsDirectory>(std::move(ext_dir))); layers_ext.emplace_back(std::make_shared<CachedVfsDirectory>(std::move(ext_dir)));
@@ -540,7 +545,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
if (layeredfs) if (layeredfs)
AppendCommaIfNotEmpty(types, "LayeredExeFS"); AppendCommaIfNotEmpty(types, "LayeredExeFS");
} }
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfs"))) if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfs")) ||
IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfslite")))
AppendCommaIfNotEmpty(types, "LayeredFS"); AppendCommaIfNotEmpty(types, "LayeredFS");
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "cheats"))) if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "cheats")))
AppendCommaIfNotEmpty(types, "Cheats"); AppendCommaIfNotEmpty(types, "Cheats");
@@ -566,7 +572,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "exefs"))) { if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "exefs"))) {
AppendCommaIfNotEmpty(types, "LayeredExeFS"); AppendCommaIfNotEmpty(types, "LayeredExeFS");
} }
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs"))) { if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs")) ||
IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfslite"))) {
AppendCommaIfNotEmpty(types, "LayeredFS"); AppendCommaIfNotEmpty(types, "LayeredFS");
} }