mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.

Home Page:http://pegasus-frontend.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reloading the game cache automatically.

Midnite59 opened this issue · comments

So I am making this console with Pegasus as a front end. I want to have it dynamically update when a cartridge is connected. How would I be able to do this if I can?

Hi! I assume you're making some custom controller chip or an USB device based solution. When you plug the cartridge into the device, your operating system probably generates some system event, which should be captured by Pegasus. You probably have to modify Pegasus' source code to listen to the system event your device generates, add the cartridge's drive to the list of game directories, and refresh the game list. I've never tried doing this, but these links seem to be useful: https://stackoverflow.com/questions/29414329/is-there-a-qt-solution-for-detecting-usb-events-insertion-and-removal

(Not sure if this is the kind of answer you were looking for.)

Guess I have to wait so someone PRs it for me. (Kinda dumb)

What I really wanted to do was find a bash command or such to reload the game cache with a script. I know you can make scripts for certain events, but I was wondering if there was a command, directory to delete, or some flag that would reload the games. I would love to know if there was a way to do it without modifying the source (Since I am dumb as heck)

Pegasus calls external scripts based on actions done inside Pegasus, but it doesn't monitor external files or commands for changes. I think the closest you could do is to just restart Pegasus: If you can write a script that detects the connection/disconnection of the cartridge, then there you can quit Pegasus, modify its config file that stores the game directories (which is a plain text file), and then restart Pegasus.

I think I'll close this issue, as it sounds very specific to the device you're building, but the workaround mentioned above could be used.