diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-04-23 05:31:28 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-04-23 05:31:28 +0000 |
| commit | 29059dcf6e6fbc34c5eacd2a3c70995a1874f02b (patch) | |
| tree | ffa77de5e2e9705fc8a9207ecf081144458c9d26 | |
| parent | c0891807a8123038a34269bfc11606bcb032decf (diff) | |
| download | pcsxr-29059dcf6e6fbc34c5eacd2a3c70995a1874f02b.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@23167 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | gui/Gtk2Gui.c | 17 | ||||
| -rw-r--r-- | gui/LnxMain.c | 34 |
3 files changed, 28 insertions, 28 deletions
@@ -1,3 +1,8 @@ +Apr 23, 2009 Wei Mingzhi <weimingzhi@gmail.com> + + * gui/LnxMain.c: use BIOS_DIR instead of "/.pcsx/bios/". Always set + the default memcard in config when config file does not exist. + Mar 25, 2009 Wei Mingzhi <weimingzhi@gmail.com> * data/pcsx.glade2: Reorganized the menu a bit. Added Cheat Search diff --git a/gui/Gtk2Gui.c b/gui/Gtk2Gui.c index f423d99d..e66889b3 100644 --- a/gui/Gtk2Gui.c +++ b/gui/Gtk2Gui.c @@ -2019,10 +2019,10 @@ void scan_bios_dir (gchar *dirname) { } while ((ent = readdir(dir)) != NULL) { - filename = g_build_filename (dirname, ent->d_name, NULL); - if (is_valid_bios_file (filename)) - add_bios_to_list (g_path_get_basename (filename), g_path_get_basename (filename)); - g_free (filename); + filename = g_build_filename(dirname, ent->d_name, NULL); + if (is_valid_bios_file(filename)) + add_bios_to_list(g_path_get_basename(filename), g_path_get_basename (filename)); + g_free(filename); } closedir(dir); @@ -2051,7 +2051,7 @@ void UpdatePluginsBIOS() { } while ((ent = readdir(dir)) != NULL) { long type, v; - linkname = g_build_filename (Config.PluginsDir, ent->d_name, NULL); + linkname = g_build_filename(Config.PluginsDir, ent->d_name, NULL); // only libraries past this point, not config tools if (strstr(linkname, ".so") == NULL && strstr(linkname, ".dylib") == NULL) @@ -2064,7 +2064,7 @@ void UpdatePluginsBIOS() { continue; } - PSE_getLibType = (PSEgetLibType) dlsym(Handle, "PSEgetLibType"); + PSE_getLibType = (PSEgetLibType)dlsym(Handle, "PSEgetLibType"); if (dlerror() != NULL) { if (strstr(linkname, "gpu") != NULL) type = PSE_LT_GPU; else if (strstr(linkname, "cdr") != NULL) type = PSE_LT_CDR; @@ -2103,15 +2103,14 @@ void UpdatePluginsBIOS() { ComboAddPlugin(Pad2); } } - g_free(linkname); } closedir(dir); /* The BIOS list always contains the PCSX internal BIOS */ - add_bios_to_list (_("Internal HLE Bios"), "HLE"); + add_bios_to_list(_("Internal HLE Bios"), "HLE"); - scan_bios_dir (Config.BiosDir); + scan_bios_dir(Config.BiosDir); } void UpdatePluginsBIOS_UpdateGUI(GladeXML *xml) { 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'; |
