Mods folder: RomFS mods in the emulator layout #321
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!321
Loading…
Reference in a new issue
No description provided.
Delete branch "mods-folder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hookshot already asks for mods (
hos_mods_init,hos_mods_romfs,hos_mods_dir_extrasinhos_main.candnn_fs.c), butmkw_glue.canswered with stubs, so the only way to try a changed game file was theHOS_FS_OVERLAYtest switch. This adds the loader.What it does
host/mods.cis the RomFS part of Skybound's loader (NotRexed/SkyboundTotka64-kit/hos/mods.c, MIT, commit4315342):mods/<name>/romfs/...besidehookshot.exe, orHOS_MODS=<dir>, in the layout emulators use, so their RomFS mods work as they are. Deeper layouts (contents/<title id>/<name>/romfs) work too.-or_are off; when two mods have the same file, the last-sorted one wins.mods: <path> <- <file>).HOS_FS_OVERLAYis unchanged and still wins over a mod.Changes from Skybound's file
host/posixfinds the mods folder.Left out: exefs patches (
.pchtxt,.ips). The code is compiled ahead of time, and the game folder has onlyimage.bin, not the module map Skybound places data patches with. A mod'sexefsfolder is logged as left out.I also added a short "Mods" section to the readme.
Tested
make_game.pyand the release builder's own toolchain:compiled in 1089s, 0 failed.Pack/ZsDic.pack.zsloggedmods: Pack/ZsDic.pack.zs <- ...\mods\r1-test\romfs\Pack\ZsDic.pack.zs, and loading went on to 60 fps.-offfolder was skipped.HOS_FS_OVERLAYalso set, the overlay copy was opened instead of the mod's.7ef5f40afterwards. In the files this touches, onlymkw_glue.cchanged upstream (two lines).clang -fsyntax-onlyonmods.c,mkw_glue.candnn_fs.cpasses on the rebased tree.host/posixwith glibc headers; not linked or run.Context: we're building a randomizer that writes its output as an emulator-layout mod folder. With this it drops into
mods\as is.