[romfs] Add romfslite mod folder support (Totk Ultracam) (#2730)

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.

Utilised by Ultracam 3.0. Credit to Zephyron (Citron)

Co-authored-by: Zephyron <zephyron@citron-emu.org>

Co-authored-by: Zephyron <zephyron@citron-emu.org>
Reviewed-on: eden-emu/eden#2730
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
This commit is contained in:
JPikachu 2025-10-14 00:12:12 +02:00 committed by crueter
parent e157b3fa96
commit 8ae7cfe96a
Signed by untrusted user: crueter
GPG key ID: 425ACD2D4830EBC6
2 changed files with 16 additions and 3 deletions

View file

@ -1,8 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
package org.yuzu.yuzu_emu.utils package org.yuzu.yuzu_emu.utils
object AddonUtil { object AddonUtil {
val validAddonDirectories = listOf("cheats", "exefs", "romfs") val validAddonDirectories = listOf("cheats", "exefs", "romfs", "romfslite")
} }

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
@ -379,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)));
@ -537,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");
@ -563,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");
} }