drhelius / Gearsystem

Sega Master System / Game Gear / SG-1000 emulator and debugger for macOS, Windows, Linux, BSD and RetroArch.
https://x.com/drhelius
GNU General Public License v3.0
265 stars 46 forks source link

Make use of containing ROM folder optional #98

Closed TomChapple closed 6 months ago

TomChapple commented 6 months ago

As alluded to in #95, it does not make much sense to provide an option to use a ROM's containing directory as a place to store resources if permission does not exist. This is most likely to happen when using APIs such as the Portal API to gain access to individual files.

It is possible to detect if we are in a contained environment using environment variables, but I feel as though it may introduce unnecessary overhead for something we should likely know ahead of time during build.

I was originally going to have the combo removed altogether if there was only one option, but I decided against it for simplicity of this pull request. This is something I can implement, but I'm notorious for over-engineering, so I would rather push this now.

One area I wish to receive feedback on is the name of the preprocessor directive: PREVENT_ROM_FOLDER_USAGE. I'm not sure what convention is being used, given that those starting with GS_ tend to be focused on the functionality itself rather than the GUI. I'm happy to change this directive's name if it is preferred.