Closed lordelan closed 4 months ago
I'm.. not really sure I can do something to help on this. Atmosphere's extensions allow me to replace a title's exefs (instead of messing around copying stuff to /titles), but won't allow romfs.
I don't know if you can detect when a title is closed by a user to start an event just then, but if yes, this could be the way to go:
Only thing that has to been taken care of is the case that the Switch freezes or is forced to shut down while title is running so that "closing title event" didn't happen properly.
Well, "moving" pretty big folders/files sounds more like a dirty practice IMO, but it's the only solution I can think of
You're probably right, moving takes too long and is too risky (in case of crashes or memory issues). Renaming on the other hand is almost instant speed so maybe there's a clever way to handle it just by that.
One possible way could be: User puts it like this: sd:\atmosphere\titles\00050000101C9500_linkle sd:\atmosphere\titles\00050000101C9500_zelda
Launching the vanilla icon does nothing obviously. Launching the Linkle clone/shortcut/howeveryouwannacallit looks for that titleID folder in sd:\atmosphere\titles\ that has a "_" after the titleID and removes the "_linkle". Launching the Princess Zelda clone/shortcut does the same for "_zelda"
If you place a small ulaunch.ini in each of those folders containing the string that is the mod name, you can even handle crashes. I mean sd:\atmosphere\titles\00050000101C9500linkle\ulaunch.ini containing only the word "linkle". That has the benefit (e.g. in case of a crash) that if a user launches the vanilla Breath of the Wild, where LayeredFS should be disabled, if there's a folder named only this: sd:\atmosphere\titles\00050000101C9500 You can then look if there's a ulaunch.ini in it. If yes, the Switch crashed while a mod has been used so you could read the content of that file, rename the folder back to 00050000101C9500 + "" + [content of ulaunch.ini] before the game is launched so it launches in "vanilla mode". By checking for a ulaunch.ini this way before any title is started you won't even need an event handling when the user closes a title as written above. It's just solved everytime the user launches any of the game versions (either vanilla or a mod).
I'm aware that this increases loading times before the game is actually launched though (if a ulaunch.ini and renaming magic has to be done before each launching) but maybe it's done fast enough.
The goal is to have separate mods for the same game available on the home screen. Think of Breath of the Wild. There's a Linkle mod and a Zelda mod for example. For some reason sometimes you might wanna play the vanilla game (without LayeredFS active), sometimes the Linkle Mod and sometimes the princess Zelda mod.
To achieve this, instead of putting those mods in sd:\atmosphere\titles[titleID of BotW]\ we could put them like this:
sd:\ulaunch\titles[titleID of BotW]\mods\linkle\ sd:\ulaunch\titles[titleID of BotW]\mods\princess_zelda\
Then two more things have to be done: