--- mazeofgalious-0.62.dfsg2.orig/main.cpp
+++ mazeofgalious-0.62.dfsg2/main.cpp
@@ -8,6 +8,10 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include "SDL/SDL.h"
 #include "SDL_mixer.h"
 #include "sound.h"
@@ -40,7 +44,7 @@
 int init_time=0;
 
 /* Paths: */ 
-char *default_g_path="graphics/original/";
+char *default_g_path="graphics/alternate/";
 char *default_s_path="sound/original/";
 char **g_paths=0;
 int n_g_paths=0,act_g_path=0;
@@ -48,6 +52,9 @@
 char **s_paths=0;
 int n_s_paths=0,act_s_path=0;
 char *s_path=0;
+
+char *confdir;
+char *datadir="/usr/share/games/mazeofgalious/";
 
 extern int music_volume,sfx_volume;
 extern int fighting_demon;
@@ -103,6 +110,18 @@
 int main(int argc, char** argv)
 {
 	setupTickCount();
+	mode_t mode;
+
+	confdir=(char*)malloc(strlen(getenv("HOME"))+50);
+	strcpy(confdir,getenv("HOME"));
+	strcat(confdir,"/.mog");
+	chdir(confdir);
+	mode=S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP;
+	mkdir(confdir,mode);
+
+	printf("Configuration: %s\n",confdir);
+	printf("Data: %s\n",datadir);
+	chdir(datadir);
 #endif
 
 	int time,act_time;
@@ -165,7 +184,9 @@
 						g_path=g_paths[act_g_path];
 						ReleaseGraphics();
 						ReloadGraphics(SCREEN_X,SCREEN_Y);
+						chdir(confdir);
 						guardar_configuracion("MoG.cfg");
+						chdir(datadir);
 						if (fighting_demon!=0) redo_demonintro(fighting_demon,0,SCREEN_X,SCREEN_Y);
 					} /* if */ 
 					if (event.key.keysym.sym==SDLK_F11) {
@@ -176,13 +197,17 @@
 						ReleaseSound(false);
 						ReloadSound();
 						music_recovery();
+						chdir(confdir);
 						guardar_configuracion("MoG.cfg");
+						chdir(datadir);
 						Mix_VolumeMusic(music_volume);
 						SetSFXVolume(sfx_volume);
 					} /* if */ 
 
 					if (event.key.keysym.sym==SDLK_d) {
+						chdir(confdir);
 						write_debug_report("debug-report.txt");
+						chdir(datadir);
 					} /* if */ 
                     break;
 
@@ -204,6 +229,7 @@
 
 			SDL_Flip(screen);
 		}
+		SDL_Delay(1);
 	}
 
 
