ComputerSoftware
ComputerSoftware copied to clipboard
(enhancement) XDG Complient Config Location + User Location Selection
Integrate Control Edit into Emulator and allow user to specify controller config path, on linux having it in the same directory as the binary creates permission issues.
I have been able to use EditControls on Ubuntu with no permission issues. Even then, you will still need to have permissions in your directory because both emulator and EditControls need to be able to save their XMLs and their log files locally.
About integrating them, EditControls could indeed be integrated within the emulator. But it is a design decision to not do it. This Vircon32 emulator is also meant to serve as an implementation example, to show other people how to write their own emulators. For this it is preferrable to keep secondary functions such as control customization (that can get complex at times) separate from the emulator core functions.
Also, keep in mind that at some point there will be other ports of the emulator (such as a web version with Emscripten). I believe it will be beneficial to keep this part separate in case other versions implement control customizations in other ways, or not at all.
I have been able to use EditControls on Ubuntu with no permission issues. Even then, you will still need to have permissions in your directory because both emulator and EditControls need to be able to save their XMLs and their log files locally.
About integrating them, EditControls could indeed be integrated within the emulator. But it is a design decision to not do it. This Vircon32 emulator is also meant to serve as an implementation example, to show other people how to write their own emulators. For this it is preferrable to keep secondary functions such as control customization (that can get complex at times) separate from the emulator core functions.
Also, keep in mind that at some point there will be other ports of the emulator (such as a web version with Emscripten). I believe it will be beneficial to keep this part separate in case other versions implement control customizations in other ways, or not at all.
I still believe it will be necessary to have the ability for the user or maintainer to point to a separate location rather than the binary root. On Linux files like this are meant to be in the users home directory, such as /home/user/.config/Vircon32, these files should not be going to the binary location.
But, even if you wanted to store some configuration for the program to use different folders, how would the program know where to find that configuration? It would still need to access that information from some predetermined place. The most obvious place is the program's folder, which will work fine on all operating systems.
You could use a library like libconfig https://github.com/hyperrealm/libconfig
You could use a library like libconfig https://github.com/hyperrealm/libconfig
Oh I didn't mean the format. We are already using XML, so if new configuration files are needed they can be XML too (that way we would not introduce an additional dependency to the project). What I mean is: say you want to have a setting that tells you what path to use for settings. But you would have to store this in some settings file too! So you would not solve much, because you would need to know the path to open the file before reading it.
Also, another benefit of storing the settings locally is that you can have several instances of the emulator in different folders and they don't need to share the same settings. For example when developing or testing you might want to have a temporary folder with an older emulator version, or with a different bios, or with different settings.
You could use a library like libconfig https://github.com/hyperrealm/libconfig
Oh I didn't mean the format. We are already using XML, so if new configuration files are needed they can be XML too (that way we would not introduce an additional dependency to the project). What I mean is: say you want to have a setting that tells you what path to use for settings. But you would have to store this in some settings file too! So you would not solve much, because you would need to know the path to open the file before reading it.
Also, another benefit of storing the settings locally is that you can have several instances of the emulator in different folders and they don't need to share the same settings. For example when developing or testing you might want to have a temporary folder with an older emulator version, or with a different bios, or with different settings.
My point is the emulator should respect the XDG standard unless the user specifies a config location. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html using libconfig you can easily respect the XDG standard while allowing the user to optionally pass a different location. This is the standard all other emulators (retroarch, dolphin, etc) follow and should likewise be adopted for this project.
I see. I don't mind trying to follow XDG standard, but I will look to adapt our XML loading scheme to it. Changing all code related to settings would have too large of an impact in the code, and would also make currently saved config files not compatible.
I have other things to work with at the moment, so I will leave this issue open for now until the moment comes to adapt to XDG.
I see. I don't mind trying to follow XDG standard, but I will look to adapt our XML loading scheme to it. Changing all code related to settings would have too large of an impact in the code, and would also make currently saved config files not compatible.
I have other things to work with at the moment, so I will leave this issue open for now until the moment comes to adapt to XDG.
Understandable, I get busy as well but when I have the free time I'll try to help.