aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gameDetector.cpp36
-rw-r--r--main.cpp18
2 files changed, 38 insertions, 16 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp
index cc364a653c..c6922776ea 100644
--- a/gameDetector.cpp
+++ b/gameDetector.cpp
@@ -37,22 +37,26 @@ static const char USAGE_STRING[] =
"Syntax:\n"
"\tscummvm [-v] [-d[<num>]] [-n] [-b<num>] [-t<num>] [-s<num>] [-p<path>] [-m<num>] [-f] game\n"
"Flags:\n"
- "\t-v - show version info and exit\n"
- "\t-c<num> - use cdrom <num> for cd audio\n"
- "\t-d[<num>] - enable debug output (level <num>)\n"
- "\t-n - no subtitles for speech\n"
- "\t-b<num> - start in room <num>\n"
- "\t-t<num> - set music tempo. Suggested: 1F0000\n"
- "\t-p<path> - look for game in <path>\n"
- "\t-m<num> - set music volume to <num> (0-100)\n"
- "\t-s<num> - set sfx volume to <num> (0-255)\n"
- "\t-e<mode> - set music engine. see readme.txt for details\n"
- "\t-r - emulate roland mt32 instruments\n"
- "\t-f - fullscreen mode\n"
- "\t-g<mode> - graphics mode. normal,2x,3x,2xsai,super2xsai,supereagle.advmame2x\n"
- "\t-a - specify game is amiga version\n"
- "\t-w[<file>]- write the config file\n"
- "\t-l<file> - load a different config file\n"
+ "\t-v - show version info and exit\n"
+ "\t-c<num> - use cdrom <num> for cd audio\n"
+ "\t-d[<num>] - enable debug output (debug level [1])\n"
+ "\t-n - no subtitles for speech\n"
+ "\t-b<num> - start in room <num>\n"
+ "\t-t<num> - set music tempo (suggested: 1F0000)\n"
+ "\t-p<path> - look for game in <path>\n"
+ "\t-m<num> - set music volume to <num> (0-100)\n"
+ "\t-s<num> - set sfx volume to <num> (0-255)\n"
+ "\t-e<mode> - set music engine (see readme.txt for details)\n"
+ "\t-r - emulate roland mt32 instruments\n"
+ "\t-f - fullscreen mode\n"
+ "\t-g<mode> - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle.advmame2x)\n"
+ "\t-a - specify game is amiga version\n"
+#if defined(UNIX) || defined(UNIX_X11)
+ "\t-w[<file>] - write to config file [~/.scummvmrc]\n"
+#else
+ "\t-w[<file>] - write to config file [scummvm.ini]\n"
+#endif
+ "\t-l<file> - load config file instead of default\n"
;
void GameDetector::updateconfig()
diff --git a/main.cpp b/main.cpp
index 188545d399..f4916f51c7 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,7 +42,16 @@ Config * scummcfg;
#undef main
#endif
+#if defined(UNIX) || defined(UNIX_X11)
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256
+#endif
+#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#else
#define DEFAULT_CONFIG_FILE "scummvm.ini"
+#endif
+
int main(int argc, char *argv[])
{
@@ -79,7 +88,16 @@ int main(int argc, char *argv[])
fclose(argf);
#endif
+
+#if defined(UNIX) || defined(UNIX_X11)
+ char scummhome[MAXPATHLEN];
+ if(getenv("HOME") != NULL)
+ sprintf(scummhome,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE);
+ else strcpy(scummhome,DEFAULT_CONFIG_FILE);
+ scummcfg = new Config(scummhome, "scummvm");
+#else
scummcfg = new Config(DEFAULT_CONFIG_FILE, "scummvm");
+#endif
scummcfg->set("versioninfo", SCUMMVM_VERSION);
if (detector.detectMain(argc, argv))
return (-1);