Skip to content

Basic filesystem patching support#11

Draft
patataofcourse wants to merge 15 commits into
masterfrom
fs
Draft

Basic filesystem patching support#11
patataofcourse wants to merge 15 commits into
masterfrom
fs

Conversation

@patataofcourse

@patataofcourse patataofcourse commented Aug 26, 2024

Copy link
Copy Markdown
Owner

Starting a PR to more easily see changes. This is still very much a WIP.

The purpose of this is to load files from a specific folder in the SD - later on functionality will be added for Barista to load mod files into this folder. This "LayeredFS" implementation respects Megamix's order in file loading*.

There's also a split of Hooks.cpp into several different files - this is most likely only the first step in reorganization cause things are currently a mess.

TODO:

  • Implement FS code for US
  • Make sure everything boots and functions normally with no mods applied
  • Implement loading external files for US
  • Make sure everything loads properly with mods applied
  • EU/KR support

Since the whole "region/language folders" stuff was added on localization, JP support here would be more involved. For that reason, we'll be leaving that for the future.


* Megamix loads files for specific regions and languages in this order:
RELAfolder -> REfolder -> folder
...where RE is the code for the specific region (JP/US/EU/KR) and LA is the code for the specific language (JP/EN/GE/IT/FR/ES/KR).

Usual LayeredFS implementations will therefore result in the game's region-specific files taking precedence over the mod's region-generic files, due to the order in checking becoming:
mod/RELAfolder -> game/RELAfolder -> mod/REfolder -> game/REfolder -> mod/folder -> game/folder
This would mean that, for example, a modded file placed in cellanim instead of UScellanim would get ignored by the game, since the original version would be found first.

This implementation instead always tries to load the modded files first and foremost, removing the need to duplicate substituted files in different regions/languages. The way Saltwater goes about loading files is:
mod/RELAfolder -> mod/REfolder -> mod/folder -> game/RELAfolder -> game/REfolder -> game/folder

This means that this implementation had to be specifically tailored to Megamix's file loading system, which unfortunately puts a lot more of a burden on us (since we can't just use one of the existing solutions out there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant