From a65beee9c26b98f6193d1c4541a4c9c8cf2e7c47 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Sat, 28 Nov 2009 11:21:36 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38381 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- gui/Gtk2Gui.c | 4 +--- gui/Linux.h | 3 +-- gui/LnxMain.c | 72 ++++++++++++++++++++++++++++++----------------------------- 3 files changed, 39 insertions(+), 40 deletions(-) (limited to 'gui') diff --git a/gui/Gtk2Gui.c b/gui/Gtk2Gui.c index f023a7c4..dbccbf35 100644 --- a/gui/Gtk2Gui.c +++ b/gui/Gtk2Gui.c @@ -38,8 +38,6 @@ #include "MemcardDlg.h" -extern int UseGui; - PSEgetLibType PSE_getLibType = NULL; PSEgetLibVersion PSE_getLibVersion = NULL; PSEgetLibName PSE_getLibName = NULL; @@ -1748,7 +1746,7 @@ void SysMessage(char *fmt, ...) { msg[strlen(msg) - 1] = 0; if (!UseGui) { - printf ("%s\n", msg); + fprintf(stderr, "%s\n", msg); return; } diff --git a/gui/Linux.h b/gui/Linux.h index 1f8e0e3f..5048f7f1 100644 --- a/gui/Linux.h +++ b/gui/Linux.h @@ -21,7 +21,6 @@ #include "config.h" -/* FIXME */ #include "../libpcsxcore/psxcommon.h" #include @@ -37,7 +36,7 @@ #define STATES_DIR "/.pcsx/sstates/" #define CHEATS_DIR "/.pcsx/cheats/" -extern int UseGui; +extern gboolean UseGui; char cfgfile[MAXPATHLEN]; /* ADB Comment this out - make a local var, or at least use gchar funcs */ char cfgfile_basename[MAXPATHLEN]; /* ADB Comment this out - make a local var, or at least use gchar funcs */ diff --git a/gui/LnxMain.c b/gui/LnxMain.c index 53b2bf7f..f3561472 100644 --- a/gui/LnxMain.c +++ b/gui/LnxMain.c @@ -42,17 +42,12 @@ #include -enum { - DONT_USE_GUI = 0, - USE_GUI -}; - enum { RUN = 0, RUN_CD, }; -int UseGui = USE_GUI; +gboolean UseGui = TRUE; static void CreateMemcard(char *filename, char *conf_mcd) { gchar *mcd; @@ -143,25 +138,25 @@ static void ScanBios(gchar* scandir) { dir = opendir(scandir); if (dir != NULL) { while ((ent = readdir(dir)) != NULL) { - filename = g_build_filename (scandir, ent->d_name, NULL); + filename = g_build_filename(scandir, ent->d_name, NULL); if (match(filename, ".*\\.bin$") == 0 && match(filename, ".*\\.BIN$") == 0) { continue; /* Skip this file */ } else { /* Create a symlink from this file to the directory ~/.pcsx/plugin */ - linkname = g_build_filename (getenv("HOME"), BIOS_DIR, ent->d_name, NULL); + linkname = g_build_filename(getenv("HOME"), BIOS_DIR, ent->d_name, NULL); symlink(filename, linkname); - g_free (linkname); + g_free(linkname); } - g_free (filename); + g_free(filename); } closedir(dir); } } -static void CheckSymlinksInPath (char* dotdir) { +static void CheckSymlinksInPath(char* dotdir) { DIR *dir; struct dirent *ent; struct stat stbuf; @@ -203,9 +198,16 @@ static void ScanAllPlugins (void) { ScanPlugins("/usr/local/lib64/games/psemu/lib/"); ScanPlugins("/usr/local/lib64/games/psemu/config/"); ScanPlugins("/usr/local/lib64/games/psemu/"); + ScanPlugins("/usr/lib32/games/psemu/"); + ScanPlugins("/usr/lib32/games/psemu/lib/"); + ScanPlugins("/usr/lib32/games/psemu/config/"); + ScanPlugins("/usr/local/lib32/games/psemu/lib/"); + ScanPlugins("/usr/local/lib32/games/psemu/config/"); + ScanPlugins("/usr/local/lib32/games/psemu/"); ScanPlugins(DEF_PLUGIN_DIR); ScanPlugins(DEF_PLUGIN_DIR "/lib"); ScanPlugins(DEF_PLUGIN_DIR "/lib64"); + ScanPlugins(DEF_PLUGIN_DIR "/lib32"); ScanPlugins(DEF_PLUGIN_DIR "/config"); // scan some default locations to find bioses @@ -213,6 +215,8 @@ static void ScanAllPlugins (void) { ScanBios("/usr/lib/games/psemu/bios"); ScanBios("/usr/lib64/games/psemu"); ScanBios("/usr/lib64/games/psemu/bios"); + ScanBios("/usr/lib32/games/psemu"); + ScanBios("/usr/lib32/games/psemu/bios"); ScanBios("/usr/share/psemu"); ScanBios("/usr/share/psemu/bios"); ScanBios("/usr/share/pcsx"); @@ -221,6 +225,8 @@ static void ScanAllPlugins (void) { ScanBios("/usr/local/lib/games/psemu/bios"); ScanBios("/usr/local/lib64/games/psemu"); ScanBios("/usr/local/lib64/games/psemu/bios"); + ScanBios("/usr/local/lib32/games/psemu"); + ScanBios("/usr/local/lib32/games/psemu/bios"); ScanBios("/usr/local/share/psemu"); ScanBios("/usr/local/share/psemu/bios"); ScanBios("/usr/local/share/pcsx"); @@ -230,28 +236,28 @@ static void ScanAllPlugins (void) { ScanBios(PACKAGE_DATA_DIR "/bios"); ScanBios(PSEMU_DATA_DIR "/bios"); - currentdir = g_strconcat (getenv("HOME"), "/.psemu-plugins/", NULL); + currentdir = g_strconcat(getenv("HOME"), "/.psemu-plugins/", NULL); ScanPlugins(currentdir); - g_free (currentdir); + g_free(currentdir); - currentdir = g_strconcat (getenv("HOME"), "/.psemu/", NULL); + currentdir = g_strconcat(getenv("HOME"), "/.psemu/", NULL); ScanPlugins(currentdir); - g_free (currentdir); + g_free(currentdir); /* Check for bad links in ~/.pcsx/plugins/ */ - currentdir = g_build_filename (getenv("HOME"), PLUGINS_DIR, NULL); - CheckSymlinksInPath (currentdir); - g_free (currentdir); + currentdir = g_build_filename(getenv("HOME"), PLUGINS_DIR, NULL); + CheckSymlinksInPath(currentdir); + g_free(currentdir); /* Check for bad links in ~/.pcsx/plugins/cfg */ - currentdir = g_build_filename (getenv("HOME"), PLUGINS_CFG_DIR, NULL); - CheckSymlinksInPath (currentdir); - g_free (currentdir); + currentdir = g_build_filename(getenv("HOME"), PLUGINS_CFG_DIR, NULL); + CheckSymlinksInPath(currentdir); + g_free(currentdir); /* Check for bad links in ~/.pcsx/bios */ - currentdir = g_build_filename (getenv("HOME"), BIOS_DIR, NULL); - CheckSymlinksInPath (currentdir); - g_free (currentdir); + currentdir = g_build_filename(getenv("HOME"), BIOS_DIR, NULL); + CheckSymlinksInPath(currentdir); + g_free(currentdir); } /* Set the default plugin name */ @@ -284,7 +290,7 @@ int main(int argc, char *argv[]) { // read command line options for (i=1; i