summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-28 11:21:36 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2009-11-28 11:21:36 +0000
commita65beee9c26b98f6193d1c4541a4c9c8cf2e7c47 (patch)
tree1794ec3a6e74d9422980f2a3602cf2a63d6d5f15
parent563be503378575ae84154a75f63ce63f05dadd3e (diff)
downloadpcsxr-a65beee9c26b98f6193d1c4541a4c9c8cf2e7c47.tar.gz
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@38381 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--ChangeLog2
-rw-r--r--gui/Gtk2Gui.c4
-rw-r--r--gui/Linux.h3
-rw-r--r--gui/LnxMain.c72
4 files changed, 41 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index 58ed2729..75bd640c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,8 @@ November 28, 2009 Wei Mingzhi <weimingzhi@gmail.com>
* gui/MemcardDlg.c: Added.
* gui/MemcardDlg.h: Likewise.
* gui/Makefile.am: Added MemcardDlg.c.
+ * gui/LnxMain.c: Minor cleanup.
+ * gui/Linux.h: Likewise.
November 27, 2009 Wei Mingzhi <weimingzhi@gmail.com>
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 <gtk/gtk.h>
@@ -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
@@ -43,16 +43,11 @@
#include <X11/extensions/XTest.h>
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<argc; i++) {
if (!strcmp(argv[i], "-runcd")) runcd = RUN_CD;
- else if (!strcmp(argv[i], "-nogui")) UseGui = DONT_USE_GUI;
+ else if (!strcmp(argv[i], "-nogui")) UseGui = FALSE;
else if (!strcmp(argv[i], "-psxout")) Config.PsxOut = 1;
else if (!strcmp(argv[i], "-load")) loadst = atol(argv[++i]);
else if (!strcmp(argv[i], "-cfg")) {
@@ -339,8 +345,7 @@ int main(int argc, char *argv[]) {
memset(&Config, 0, sizeof(PcsxConfig));
strcpy(Config.Net, "Disabled");
- if (UseGui == USE_GUI)
- gtk_init(NULL, NULL);
+ if (UseGui) gtk_init(NULL, NULL);
CheckSubDir();
ScanAllPlugins();
@@ -348,13 +353,13 @@ int main(int argc, char *argv[]) {
// try to load config
// if the config file doesn't exist
if (LoadConfig() == -1) {
- if (UseGui == DONT_USE_GUI) {
+ if (!UseGui) {
printf(_("PCSX cannot be configured without using the GUI -- you should restart without -nogui.\n"));
return 1;
}
// Uh oh, no config file found, use some defaults
- Config.PsxAuto = 1; /* ADB TODO */
+ Config.PsxAuto = 1;
gchar *str_bios_dir = g_strconcat (getenv("HOME"), BIOS_DIR, NULL);
strcpy(Config.BiosDir, str_bios_dir);
@@ -392,14 +397,11 @@ int main(int argc, char *argv[]) {
chdir(plugin_default_dir); /* TODO Error checking - make sure this directory is available */
g_free(plugin_default_dir);
- if (UseGui != DONT_USE_GUI) {
- cdrfilename[0] = '\0';
- }
+ if (!UseGui) cdrfilename[0] = '\0';
- if (SysInit() == -1)
- return 1;
+ if (SysInit() == -1) return 1;
- if (UseGui == USE_GUI) {
+ if (UseGui) {
StartGui();
} else {
// the following only occurs if the gui isn't started