mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 20:15:56 +00:00
Merge pull request #1101: a mod's file named for another game version is served under its own name, so a sound mod that ships one plays (xellow78-lgtm)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
f23dc9ffb2
6 files changed
+32
-15
No files matched your search
+1
-1
@@ -111,7 +111,7 @@ keeps its textures at a quarter of the size.
|
||||
| On the Mods tab | Why | What to do |
|
||||
|---|---|---|
|
||||
| This folder has no romfs, exefs or cheats files. | The archive was unpacked one level too deep (`mods\Mod\Mod\romfs`), or it holds no game files. | Move the folders up so `romfs` sits directly in the mod's folder. |
|
||||
| ... files are made for another game version and are left out. | The mod's files carry another update's version in their names (`.Product.<number>.`). | Download the mod's release for your game update. |
|
||||
| ... files carry another game version in their names. | The files are named for another update (`.Product.<number>.`) and the game's own files have no such name. They are still served under those names, as on a console, because the game sometimes asks for one; another update's resource size table is the exception and only lends its entries. | Nothing if the mod works. If it does nothing, download its release for your game update. |
|
||||
| Its code patches (exefs) are made for another game version. | The patch files name another update's build id. | Same: get the release for your update. |
|
||||
| This mod brings its own game code (a subsdk plugin or a replaced main). | Mods such as UltraCam ship compiled Switch code. The port cannot load it. | No workaround; the whole mod stays off. |
|
||||
| This mod patches the game code (exefs) in a way the port cannot apply. | The patch writes the game's data, not its code, or changes code in a form the port cannot build. | No workaround; the reason follows on the row. |
|
||||
|
||||
+3
-2
@@ -30,8 +30,9 @@ typedef struct {
|
||||
int kind, enabled;
|
||||
ModProblem problem;
|
||||
uint32_t replaced, added, overridden; // romfs.c: files served (replacing / added), files a higher mod serves
|
||||
uint32_t other_version; // files for another game version (RomFS *.Product.<n>.*, ExeFS patches
|
||||
// for another build), not used
|
||||
uint32_t other_version; // files named for another game version: RomFS *.Product.<n>.* the RomFS
|
||||
// lacks (served under their own names; another version's size table is
|
||||
// not) and ExeFS patches for another build (not used)
|
||||
char overridden_by[256]; // the first higher mod that took one of its files
|
||||
char note[256]; // MOD_EXEFS_UNSUPPORTED: why
|
||||
uint32_t pending, pending_key; // ExeFS patch files the build lacks; FNV-1a of their names and contents
|
||||
|
||||
+13
-3
@@ -340,7 +340,8 @@ static void overlay_push(Overlay o) {
|
||||
}
|
||||
|
||||
// 1 when path names a file of one game version only (Product.<n> in a name: the resource size table, the actor
|
||||
// database and other version-bound files); the RomFS lacking it means it is another version's.
|
||||
// database and other version-bound files); the RomFS lacking it means it is another version's, or a name this version
|
||||
// still asks for (mod_walk_cb).
|
||||
static int other_version(const char *path) {
|
||||
for (const char *p = strstr(path, ".Product."); p; p = strstr(p + 1, ".Product.")) {
|
||||
const char *d = p + strlen(".Product.");
|
||||
@@ -420,9 +421,18 @@ static int mod_walk_cb(const char *leaf, int kind, uint64_t size, void *ctx) {
|
||||
}
|
||||
uint64_t i = index_any_case(path);
|
||||
if (i == UINT64_MAX && other_version(path)) {
|
||||
if (is_restbl(path)) shipped_add(file, w->k + 1, 1); // its entries for this mod's files still apply
|
||||
m->other_version++;
|
||||
return 1;
|
||||
// Another version's resource size table is no file this game opens; its entries for this mod's files still
|
||||
// apply.
|
||||
if (is_restbl(path)) {
|
||||
shipped_add(file, w->k + 1, 1);
|
||||
return 1;
|
||||
}
|
||||
// Any other file is served under its own name below, as an added file, the way LayeredFS shows a console every
|
||||
// file of a mod: the game does ask for names its RomFS lacks. Measured on 1.4.3 with mods on (trace = fs): it
|
||||
// opened Sound/Resource/Pack_MasterSword.Product.110.bars.zs, where its RomFS holds Product.140 and the
|
||||
// unversioned file only. A sound mod that ships its pack under all those names stayed silent while this file
|
||||
// was left out.
|
||||
}
|
||||
PlatFile *f = open_read(file);
|
||||
if (!f) {
|
||||
|
||||
+11
-7
@@ -223,8 +223,9 @@ static const char *const text_en[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MODS_CHEATS] = "Cheats: %d. Switch them on the Cheats tab.",
|
||||
[UI_MENU_MODS_CHEATS_FILE] = "Cheats for this game version are read at start from cheats\\%s in this mod.",
|
||||
[UI_MENU_MODS_BAD_NAME] = "The folder name contains |, which the mod list uses between names. Rename the folder.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "%u of its files are made for another game version and are left out. Look for a "
|
||||
"version of this mod made for your game version.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "%u of its files carry another game version in their names. The game reads them only "
|
||||
"where something asks for those names. If the mod does nothing, look for a version "
|
||||
"of it made for your game version.",
|
||||
[UI_MENU_MODS_UNUSED] = "not used",
|
||||
[UI_MENU_MODS_FPS60] = "60 FPS patch",
|
||||
[UI_MENU_MODS_FPS60_DESC] = "The port's own patch for 60 frames per second. Set it with Frame rate limit on the "
|
||||
@@ -709,8 +710,9 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MODS_CHEATS] = "Читов: %d. Они включаются на вкладке «Читы».",
|
||||
[UI_MENU_MODS_CHEATS_FILE] = "Читы для этой версии игры читаются при запуске из cheats\\%s в этом моде.",
|
||||
[UI_MENU_MODS_BAD_NAME] = "В имени папки есть символ |, которым список модов разделяет имена. Переименуйте папку.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "Файлов для другой версии игры: %u, они пропущены. Поищите версию этого мода для "
|
||||
"вашей версии игры.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "Файлов с другой версией игры в имени: %u. Игра читает их, только когда что-то "
|
||||
"запрашивает эти имена. Если мод не работает, поищите его версию для вашей версии "
|
||||
"игры.",
|
||||
[UI_MENU_MODS_UNUSED] = "не используется",
|
||||
[UI_MENU_MODS_FPS60] = "Патч 60 FPS",
|
||||
[UI_MENU_MODS_FPS60_DESC] = "Собственный патч порта для 60 кадров в секунду. Настраивается «Ограничением частоты "
|
||||
@@ -1039,8 +1041,9 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MODS_CHEATS] = "Cheats: %d. Ligue-os na aba Cheats.",
|
||||
[UI_MENU_MODS_CHEATS_FILE] = "Os cheats desta versão do jogo são lidos ao iniciar de cheats\\%s neste mod.",
|
||||
[UI_MENU_MODS_BAD_NAME] = "O nome da pasta contém |, que a lista de mods usa entre os nomes. Renomeie a pasta.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "%u dos seus arquivos são de outra versão do jogo e ficam de fora. Procure uma versão "
|
||||
"deste mod feita para a sua versão do jogo.",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "%u dos seus arquivos trazem outra versão do jogo no nome. O jogo só os lê quando algo "
|
||||
"pede esses nomes. Se o mod não fizer nada, procure uma versão dele feita para a sua "
|
||||
"versão do jogo.",
|
||||
[UI_MENU_MODS_UNUSED] = "não usado",
|
||||
[UI_MENU_MODS_FPS60] = "Patch de 60 FPS",
|
||||
[UI_MENU_MODS_FPS60_DESC] = "O patch do próprio port para 60 quadros por segundo. Ajuste em Limite de quadros na aba "
|
||||
@@ -1567,7 +1570,8 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = {
|
||||
[UI_MENU_MODS_CHEATS] = "金手指:%d 个。在“金手指”标签页中开关。",
|
||||
[UI_MENU_MODS_CHEATS_FILE] = "此游戏版本的金手指在启动时从此模组的 cheats\\%s 读取。",
|
||||
[UI_MENU_MODS_BAD_NAME] = "文件夹名称含有 |,模组列表用它分隔名称。请重命名该文件夹。",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "它有 %u 个文件是为其他游戏版本制作的,已被跳过。请寻找适用于你的游戏版本的此模组。",
|
||||
[UI_MENU_MODS_OTHER_VERSION] = "它有 %u 个文件的文件名带有其他游戏版本号。只有在有内容请求这些文件名时,游戏才会读取它们。"
|
||||
"如果模组不起作用,请寻找适用于你的游戏版本的此模组。",
|
||||
[UI_MENU_MODS_UNUSED] = "未使用",
|
||||
[UI_MENU_MODS_FPS60] = "60 FPS 补丁",
|
||||
[UI_MENU_MODS_FPS60_DESC] = "移植版自带的 60 帧补丁。在“游戏”页的帧率上限中设置。",
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ typedef enum {
|
||||
UI_MENU_MODS_EXEFS_OTHER,
|
||||
UI_MENU_MODS_EXEFS_ON, // printf: its ExeFS patch files in use
|
||||
UI_MENU_MODS_REPLACES_BUILTIN, // printf: its ExeFS patch files in use, the port's own patch sets they turn off
|
||||
UI_MENU_MODS_OTHER_VERSION, // printf: files made for another game version, left out
|
||||
UI_MENU_MODS_OTHER_VERSION, // printf: files named for another game version, read only when asked for by name
|
||||
UI_MENU_MODS_UNUSED, // under the switch of a mod the port cannot use
|
||||
UI_MENU_MODS_CHEATS, // printf: its cheats as read at start
|
||||
UI_MENU_MODS_CHEATS_FILE, // printf: <build id>.txt, when none were read
|
||||
|
||||
@@ -154,13 +154,15 @@ def main():
|
||||
put(mods, UNI, p2, b'mod-G')
|
||||
# a file of another game version's (no RomFS has a Product.999 table): counted, never served
|
||||
put(mods, 'Low', 'System/Resource/ResourceSizeTable.Product.999.rsizetable.zs', b'mod-H')
|
||||
# any other file named for another version: counted, and served under its name as an added file
|
||||
put(mods, 'Case', 'Sound/Resource/Named.Product.999.bars', b'mod-J')
|
||||
put(mods, 'Lite', 'Lite/added.bin', b'mod-I', part='romfslite') # TKMM's romfslite folder
|
||||
|
||||
code, log = run(args.exe, mods, f'Top|Low|{UNI}|Case')
|
||||
check(code == 0, 'probe-fs passes with five mods (served bytes equal the winners\' files)', log)
|
||||
for line in ('mods: Top: 2 files served (1 replaced, 1 added), 0 overridden',
|
||||
'mods: Low: 1 files served (1 replaced, 0 added), 2 overridden by Top, 1 for another game version',
|
||||
'mods: Case: 0 files served (0 replaced, 0 added), 1 overridden by Top',
|
||||
'mods: Case: 1 files served (0 replaced, 1 added), 1 overridden by Top, 1 for another game version',
|
||||
f'mods: {UNI}: 0 files served (0 replaced, 0 added), 1 overridden by Low',
|
||||
'mods: Lite: 1 files served (0 replaced, 1 added), 0 overridden'):
|
||||
check(line in log, line, log)
|
||||
|
||||
Reference in new issue
Block a user