summaryrefslogtreecommitdiff
path: root/gui/LnxMain.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-04-23 05:31:28 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-04-23 05:31:28 +0000
commit29059dcf6e6fbc34c5eacd2a3c70995a1874f02b (patch)
treeffa77de5e2e9705fc8a9207ecf081144458c9d26 /gui/LnxMain.c
parentc0891807a8123038a34269bfc11606bcb032decf (diff)
downloadpcsxr-29059dcf6e6fbc34c5eacd2a3c70995a1874f02b.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@23167 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'gui/LnxMain.c')
-rw-r--r--gui/LnxMain.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/gui/LnxMain.c b/gui/LnxMain.c
index 0b10aaee..202f8928 100644
--- a/gui/LnxMain.c
+++ b/gui/LnxMain.c
@@ -56,11 +56,12 @@ static void CreateMemcard(char *filename, char *conf_mcd) {
gchar *mcd;
struct stat buf;
- mcd = g_build_filename (getenv("HOME"), MEMCARD_DIR, filename, NULL);
+ mcd = g_build_filename(getenv("HOME"), MEMCARD_DIR, filename, NULL);
+
+ strcpy(conf_mcd, mcd);
/* Only create a memory card if an existing one does not exist */
if (stat(mcd, &buf) == -1) {
- strcpy(conf_mcd, mcd);
SysPrintf(_("Creating memory card: %s\n"), mcd);
CreateMcd(mcd);
}
@@ -303,35 +304,30 @@ int main(int argc, char *argv[]) {
// Uh oh, no config file found, use some defaults
Config.PsxAuto = 1; /* ADB TODO */
- gchar *str_bios_dir = g_strconcat (getenv("HOME"), "/.pcsx/bios/", NULL);
+ gchar *str_bios_dir = g_strconcat (getenv("HOME"), BIOS_DIR, NULL);
strcpy(Config.BiosDir, str_bios_dir);
- g_free (str_bios_dir);
+ g_free(str_bios_dir);
gchar *str_plugin_dir = g_strconcat (getenv("HOME"), PLUGINS_DIR, NULL);
strcpy(Config.PluginsDir, str_plugin_dir);
- g_free (str_plugin_dir);
+ g_free(str_plugin_dir);
gtk_init(NULL, NULL);
- // switch to bios dir for scanning
- str_plugin_dir = g_build_filename (getenv("HOME"), BIOS_DIR, NULL);
- chdir (str_plugin_dir);
- g_free (str_plugin_dir);
-
// Update available plugins, but not GUI
UpdatePluginsBIOS();
// Pick some defaults, if they're available
- set_default_plugin (GpuConfS.plist[0], Config.Gpu);
- set_default_plugin (SpuConfS.plist[0], Config.Spu);
- set_default_plugin (CdrConfS.plist[0], Config.Cdr);
- set_default_plugin (Pad1ConfS.plist[0], Config.Pad1);
- set_default_plugin (Pad2ConfS.plist[0], Config.Pad2);
- set_default_plugin (BiosConfS.plist[0], Config.Bios);
+ set_default_plugin(GpuConfS.plist[0], Config.Gpu);
+ set_default_plugin(SpuConfS.plist[0], Config.Spu);
+ set_default_plugin(CdrConfS.plist[0], Config.Cdr);
+ set_default_plugin(Pad1ConfS.plist[0], Config.Pad1);
+ set_default_plugin(Pad2ConfS.plist[0], Config.Pad2);
+ set_default_plugin(BiosConfS.plist[0], Config.Bios);
// create & load default memcards if they don't exist
- CreateMemcard ("card1.mcd", Config.Mcd1);
- CreateMemcard ("card2.mcd", Config.Mcd2);
+ CreateMemcard("card1.mcd", Config.Mcd1);
+ CreateMemcard("card2.mcd", Config.Mcd2);
LoadMcds(Config.Mcd1, Config.Mcd2);
@@ -342,7 +338,7 @@ int main(int argc, char *argv[]) {
// this lets plugins work without modification!
gchar *plugin_default_dir = g_build_filename (getenv("HOME"), PLUGINS_DIR, NULL);
chdir(plugin_default_dir); /* TODO Error checking - make sure this directory is available */
- g_free (plugin_default_dir);
+ g_free(plugin_default_dir);
if (UseGui != DONT_USE_GUI) {
cdrfilename[0] = '\0';