Basic filesystem patching support#11
Draft
patataofcourse wants to merge 15 commits into
Draft
Conversation
patataofcourse
marked this pull request as draft
August 26, 2024 18:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
REis the code for the specific region (JP/US/EU/KR) andLAis 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/folderThis would mean that, for example, a modded file placed in
cellaniminstead ofUScellanimwould 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/folderThis 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).