Added support for multiple transferpak games #570
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.
Description
This PR adds support for loading different GB games on transferpak for each controller. This allows, for example, to play Pokemon Red for P1, Blue for P2, and Yellow for P3 on Pokemon Stadium
How it works (For the End-User)
Until now, you had to have both the .gb and .sav files alongside the N64 ROM (and with the same name), having this structure:
But now you have to create a .pak folder and inside place the .gb and .sav files for every controller, naming them from 1.gb to 4.gb. For example:
Also, you can combine both the old and the new methods (the newer one has higher priority). For example:
With that, only the first player will have a different ROM while other players will use the same pokemon stadium.z64.gb ROM.
How it's implemented (for Libretro maintainers)
Now the global variables
retro_transferpak_rom_path
andretro_transferpak_ram_path
are string arrays of fixed length of 4 (one for each controller). Then, on startup, the core will search for each .gb and .sav file (naming from 1 to 4) inside the{GAME_FILE_NAME}.pak
folder. If there is no .gb or .sav file for that controller, then it'll rollback to the old method and, in case there are those files, it'll assign those files for that specific controller.So, in pseudo code, it'd be something like this: