TASEmulators / fceux

FCEUX, a NES Emulator
http://fceux.com
GNU General Public License v2.0
1.23k stars 252 forks source link

[Feature Request] Portable-version file paths #150

Closed Amnesia1000 closed 4 years ago

Amnesia1000 commented 4 years ago

It would be great to be able to configure the folders where the different data generated by the emulator (saved games, saved states, screenshots, records, cheats) or the files needed by the emulator (auxlib.lua, fceux.chm, firmwares) will be saved.

Some type of file could be used, such as Dolphin, creating a portable.txt file, or Citra/Yuzu, creating a "User" folder next to the executable, in addition to placing the FCEUX configuration file next to the executable instead of /home /user/.fceux.

These two implementations would make FCEUX usable in fully portable mode.

zeromus commented 4 years ago

stop writing issues without writing what frontend you're referring to. you're using linux but writing about chm files, so i dunno

mjbudd77 commented 4 years ago

I don't fully understand what you are asking for here. When fceux is packaged for linux, the fceux executable is setup to install into /usr/bin. This directory is for executables only and is not a place for configuration files. Currently fceux config files are stored per user in their $HOME directory under .fceux. Are you saying you want to have their base config directory to be relocatable?

zeromus commented 4 years ago

we're not going to do some cruddy "user" or "portable.txt" hack. This is stupid. Follow XDG specs and users can configure everything themselves. That's the only way to do this, other than not at all, which is also okay.

Amnesia1000 commented 4 years ago

stop writing issues without writing what frontend you're referring to. you're using linux but writing about chm files, so i dunno

Sorry for not giving more information. The "chm" file was only for reference, since when compiling the emulator, I copy everything created in the "bin" folder to the folder where I store the emulators. The "User" folder or the "portable.txt" was just an example. Another example is mGBA that in the configuration lets you choose where the saved games, saved states, screenshots, records will be saved. I'm going to look up some information on XDG specs to see if I can configure where the emulator data will be saved.

I don't fully understand what you are asking for here. When fceux is packaged for linux, the fceux executable is setup to install into /usr/bin. This directory is for executables only and is not a place for configuration files. Currently fceux config files are stored per user in their $HOME directory under .fceux. Are you saying you want to have their base config directory to be relocatable?

Of course, I understand that when you install them through a package manager, or when compiling with the "install" command, the installer goes in the /usr/bin folder and that the configuration is stored in /home/user/.fceux, What I want to propose is for those of us who compile, but do not install, you could set the save and save folder paths of the configuration, as I said in the example, to be able to have the emulator on a disk / pendrive and be able to play on any PC.

mjbudd77 commented 4 years ago

Well, there is really no guarantee that the linux executable will be runnable on any Linux PC. Linux packages vary from distro to distro and even you have two computers that have a matching distro installed, you must then also ensure that all the executable library dependencies are installed. But config files are a different story, I could entertain using an environment variable to tell fceux where to look for its base directory. like checking for $FCEUX_HOME before deciding to use $HOME. Then you could set FCEUX_HOME in the bash environment prior to running the program. Does that sound like an acceptable solution for you?

zeromus commented 4 years ago

That's not what "portable" means. "Portable" in this case (really, the people who picked that word to mean this thing are assholes) means that the program puts ALL files, configs, binaries, documents, etc, in ONE directory, rather than deeply littered all over the filesystem in the traditional unix way

Amnesia1000 commented 4 years ago

Well, there is really no guarantee that the linux executable will be runnable on any Linux PC. Linux packages vary from distro to distro and even you have two computers that have a matching distro installed, you must then also ensure that all the executable library dependencies are installed. But config files are a different story, I could entertain using an environment variable to tell fceux where to look for its base directory. like checking for $FCEUX_HOME before deciding to use $HOME. Then you could set FCEUX_HOME in the bash environment prior to running the program. Does that sound like an acceptable solution for you?

Great idea, but the only thing I didn't understand was to set FCEUX_HOME in the bash environment prior to running the program. Generally what I do is create a .sh file next to the executable (for example fceux.sh), where I put the arguments to execute (for example "gamemoderun ./fceux").

Amnesia1000 commented 4 years ago

That's not what "portable" means. "Portable" in this case (really, the people who picked that word to mean this thing are assholes) means that the program puts ALL files, configs, binaries, documents, etc, in ONE directory, rather than deeply littered all over the filesystem in the traditional unix way

Yes, that's what I mean, all files are in one directory. When the emulator is compiled, that's what it does, it places all the files in a single folder (fceux/bin), which will then be "distributed" to their corresponding folders (bin, lib, locale, etc). The idea is that this folder can be any where the executable is (as long as it is not a root folder since it would ask for root permissions). Sorry if it is not understood, I communicate using google translate and maybe I am not very explicit or I do not understand what I want to communicate.

mjbudd77 commented 4 years ago

In my experience, installing linux executables to computers without packaging them appropriately (so that a package manager can keep track of dependencies) is extremely bad practice. The FCEUX_HOME idea will enable you set the environment variable in your shell script to make the fceux program use that as its new base directory for config files. To do this, export FCEUX_HOME=path_to_dir; or technically you can just override the HOME env var in this same way in your shell script and then I don't have to change any code. If you export an environment variable inside a shell script, that variable will only exist within the scope of the script. It will not affect the environment of parent processes.

zeromus commented 4 years ago

It's for stuff built locally, man.

zeromus commented 4 years ago

HOME=$cd ./fceux or somesuch

Amnesia1000 commented 4 years ago

In my experience, installing linux executables to computers without packaging them appropriately (so that a package manager can keep track of dependencies) is extremely bad practice. The FCEUX_HOME idea will enable you set the environment variable in your shell script to make the fceux program use that as its new base directory for config files. To do this, export FCEUX_HOME=path_to_dir; or technically you can just override the HOME env var in this same way in your shell script and then I don't have to change any code. If you export an environment variable inside a shell script, that variable will only exist within the scope of the script. It will not affect the environment of parent processes.

Yes I know that, but I have 3 identical PCs, one at each of my jobs and another at home, that's why I was referring to portability, but set the environment variable is great, I didn't know about that, right now I'm going to try it Thank you very much again.