Skip to content

Conversation

@Denellyne
Copy link
Contributor

@Denellyne Denellyne commented Jan 14, 2026

This PR addresses the issue #1787 , before launching a game it checks it the passed rom is a compressed file, if it is then extracts to a temporary folder and passes that path to the launcher.
As of now It doesn't check if the extracted file already exists but that's easy to do and I will do later.

Fixes #1787

… gameswitcher and is a zipped rom the extracted file is deleted
Changed the location of the extracted roms to be inside of the rom folder itself
Made so that every extracted file gets renamed to the name of the zipped file and handles multiple files with the same extension gracefully
@Denellyne
Copy link
Contributor Author

Denellyne commented Jan 16, 2026

The previous implementation was very bare-bones, this commit addresses that.
First of all, the location of the extracted roms was changed to the rom folder itself, though in a hidden folder so it doesn't get detected.
Also it guarantees that the files with multiple extensions get extracted correctly.

It's important to mention that this actually creates a problem because it goes from the order of files in the archive, as such we should had a way to actually select the rom you want to play if there's more than one and only rename the files to the same as the archive IF there's only 1, if said problem arises the way to fix would be this:

  • Add a folder per game in the temporary rom folder
  • Add a screen to select the actual rom you wish to be one you want to play and rename that one, every other file can keep its name, so for example, if it's a multi-disk game then you can just use the other rom when you need to switch disk.
  • When the GameSwitcher closes that game delete the whole folder.

Given the fact that most games supported, afaik, are single rom files then this should be a no-problem.

There is another solution tho, given only a few selected cores show this problem, we can just have a script on the launch of those cores to clean after themselves, or do what we are doing here but simpler because we don't need to do a generic solution.

Really the problem is that, whilst retroarch decompresses the roms by itself and stores them in ram whilst the core is running, some cores do not support this, which in-turn makes retroarch write the rom to memory, making it a permanent file cluttering the rom folder.

Then again, the upside of this solution is that you don't need to extract the rom in every boot, making the startup after the first run faster.

@Denellyne Denellyne marked this pull request as draft January 16, 2026 14:48
@Denellyne Denellyne marked this pull request as ready for review January 16, 2026 14:58
@Denellyne
Copy link
Contributor Author

Denellyne commented Jan 16, 2026

The optimal solution then should be:

Keep the temporary rom folder and the deletion of the extracted rom as is but instead of calling a generic script we call a specific script which is located inside the rom folder of each core, those who don't need any special handling can have a symbolic-link to the script I built, the rest have their own custom script and we return the rom-path of that script to the caller, making it so it seems nothing was done while launching the game.

I am not one to play multi-disc games or arcade games so someone would have to do the handling for those games, but then again , if anything else, we could just have a script there that returns the path to the archived rom anyway if retroarch handles it properly.

I will try to implement this solution later today.

… deletes the roms after the gameswitcher closes the game

It allows in the future to add an option to add cores to be handled this way for faster boots which would be desireable
@Denellyne
Copy link
Contributor Author

Denellyne commented Jan 16, 2026

So this commit changes the way things are handled.
Everything is more or less the same except only those faulty cores are handled by my script.
This also makes it so that in the future we can add an option for other cores to be handled by my script making compressed roms faster to boot.

@Denellyne
Copy link
Contributor Author

Just implemented the feature that enables the user to use the compressed roms script if they wish to, but beware its mandatory for GBA and GG games, given their cores are faulty, and it ignores the check for PS1 and ARCADE given their filetypes.

Also added info to the options in the GLO as a bonus

@Aemiii91 Aemiii91 changed the base branch from main to v4.5-dev January 18, 2026 00:31
@Aemiii91 Aemiii91 added this to the v4.5 milestone Jan 18, 2026
@Denellyne
Copy link
Contributor Author

@Aemiii91 It's ready to be merged if you agree

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.

Game Switcher leaves uncompressed rom (GBA & GG)

2 participants