drhelius / Gearsystem

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

Automatically update SDL game controllers DB #51

Closed marfox closed 2 years ago

marfox commented 2 years ago

Hi there and thanks for this wonderful emulator!

The main goal of this pull request is to ensure up-to-date support of game controllers for Linux, MacOS, and BSD platforms. In other words: no more need for manually updating gamecontrollerdb.txt in the platforms/{linux,macos,bsd} directories.

Implementation details:

Important

From now on, a fresh clone of this repository will require to init and update the submodule, otherwise the symbolic links will be broken. Run the following commands at the project root folder (see https://git-scm.com/book/en/v2/Git-Tools-Submodules):

$ git submodule init
$ git submodule update
drhelius commented 2 years ago

Thanks a lot for the effort but I have to admit that I hate git submodules.

I made three different emulators that share code and sometimes thought about making some common libraries and other common git repos in the past. Instead I tried to keep things simple as much as possible, sometimes that means I need to duplicate code and other things. It's a trade off but I opted this way.

The end result is simple code, simple integrations and simple builds in all platforms that any kind of user can follow and replicate without too much trouble.

Regarding the gamecontrollerdb.txt, yes is a pain, I may try to add something inside the emulator to auto update it, or maybe use GitHub Actions to automatically build and create the released artifacts with the updated file.

Again, thanks for your effort, I'm very sorry I can't accept this PR, hope you understand.

marfox commented 2 years ago

Hey @drhelius , no worries, designs decisions are up to you.

I don't see any reason why you hate git submodules and why they would complicate things: I'm not a fan neither, but I thought they would be the most elegant solution, instead of scripting a way to fetch the latest gamecontrollerdb.txt, which is already under git version control.

Never mind, but as a user I'd greatly appreciate to have my game controller work out of the box, which was obviously not the case for me.

Thanks again for the emulator!