Browse Source

[file_sys] fix romfs_ext mods (#3914)

Makes them show up in the menu & also let's them load from SDMC

Note: the android edit is totally untested and I've no clue of Kotlin but I don't see a reason why it shouldn't work

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3914
Reviewed-by: crueter <crueter@eden-emu.dev>
pull/3504/head
smiRaphi 1 week ago
committed by crueter
parent
commit
28a2ff1b94
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 4
      src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/AddonUtil.kt
  2. 15
      src/core/file_sys/patch_manager.cpp

4
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/AddonUtil.kt

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

15
src/core/file_sys/patch_manager.cpp

@ -569,12 +569,11 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t
layers.emplace_back(std::move(extracted));
auto layered = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers));
if (layered == nullptr) {
auto layered_ext = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers_ext));
if (layered == nullptr && layered_ext == nullptr) {
return;
}
auto layered_ext = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers_ext));
auto packed = CreateRomFS(std::move(layered), std::move(layered_ext));
if (packed == nullptr) {
return;
@ -943,6 +942,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfs")) ||
IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfslite")))
AppendCommaIfNotEmpty(types, "LayeredFS");
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "romfs_ext")))
AppendCommaIfNotEmpty(types, "ExtLayeredFS");
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(mod, "cheats")))
AppendCommaIfNotEmpty(types, "Cheats");
@ -965,13 +966,13 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
const auto sdmc_mod_dir = fs_controller.GetSDMCModificationLoadRoot(title_id);
if (sdmc_mod_dir != nullptr) {
std::string types;
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "exefs"))) {
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "exefs")))
AppendCommaIfNotEmpty(types, "LayeredExeFS");
}
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs")) ||
IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfslite"))) {
IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfslite")))
AppendCommaIfNotEmpty(types, "LayeredFS");
}
if (IsDirValidAndNonEmpty(FindSubdirectoryCaseless(sdmc_mod_dir, "romfs_ext")))
AppendCommaIfNotEmpty(types, "ExtLayeredFS");
if (!types.empty()) {
const auto mod_disabled =

Loading…
Cancel
Save