RE: [Caprice32-devel] Re: Linux binary package
An emulator of the Amstrad CPC 8bit home computer range
Status: Alpha
Brought to you by:
udoewich
|
From: Ulrich D. <cap...@cy...> - 2004-06-21 21:58:56
|
Andreas wrote: > How about an algorithm like this: > > 1. Look for a config file in the current dir > 2. Look for a config file in the homedir of the user > 3. Look for a config file in /etc > > This ways you can have 1. special configurations, 2. user wide > configurations, 3. system wide configurations. > > A user who installs Caprice32 via RPM automatically gets a default > configuration in /etc. He can copy it to his homedir and make = individual > changes if he wants. Sounds good, as long as it doesn't break it for the Windows build. ;) > If the configuration file is also written to by Caprice32 things get = more > complicated. I want to do this is a future version of Arnold, so the > preferences set via the GUI will be persistent. I intend doing it by = just > writing the config file to the users homedir as .arnoldrc. If this = file > does not exist it will be created on first invocation of Arnold. You > could also choose to go this road for Caprice32. Of course this is > entirely platform dependent. The Windows version for example could = store > the same settings in the registry. But then you don't have a user > editable config file and need to provide GUI controls for each and = every > option. The current SDL version of Caprice32 is still missing a few utility functions I had in the 3.x Windows versions. Among them is of course the config write routine. The only reason it's not already in the source = tree is that we're currently not changing the configuration during run-time. = Once we've got a GUI in place, we need to be able to write to the .cfg file again. I'd rather not add too much platform dependent code (like writing = to the Windows Registry, or writing to the /etc directory)... > Btw.: I think storing the config file of Caprice32 in the same = location > as the binary is not a decent idea IMHO if the binary is installed to > something like /usr/bin or /usr/local/bin. Config files should never = live > inside these directorys, but only in /etc or the users homedir. Of = couse > things are different if Caprice32 lives in its own directory hierachy > like /usr/local/caprice32. Games like ut2004 install that way and can > therefore have the same directory structure on Windows and on Linux. = To > make invocation on the command line easier, the installer puts a = symbolic > link to the main executable into /usr/local/bin. Of course ut2004 = comes > which hunderds of files which are needed to run the game. Doing this = for > just a config file and maybe a bunch of ROMs might be overkill. We may have to stick with the current scheme for the sake of platform independence... unless we come up with something that works for all = parties (i.e. host environments) involved. > P.s. Sorry for making long comments without actually contributing = code. I > am just trying to help. If I get on your nerves just say so and I will > try to stop it. ;-) Not at all! Any contributions are welcome, even if it's just ideas or (constructive) criticism. ;) Ulrich. |