summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-14 23:14:57 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-14 23:14:57 +0000
commitbb9c6f0355aacbdddc5e83de8ab0e2707d1348e5 (patch)
tree898306ea1071621ab76f907a8dfab7629178d681 /plugins
parentf1d5f92e6bfbff24667a766610f7171bcf6d7116 (diff)
downloadpcsxr-bb9c6f0355aacbdddc5e83de8ab0e2707d1348e5.tar.gz
...
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82904 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bladesio1/gui.c44
-rwxr-xr-xplugins/bladesio1/settings.c3
-rwxr-xr-xplugins/bladesio1/settings.h5
-rwxr-xr-xplugins/bladesio1/sio1.c44
4 files changed, 81 insertions, 15 deletions
diff --git a/plugins/bladesio1/gui.c b/plugins/bladesio1/gui.c
index d08d308f..e7839e68 100644
--- a/plugins/bladesio1/gui.c
+++ b/plugins/bladesio1/gui.c
@@ -5,6 +5,9 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
+#include "psxcommon.h"
+#include "psemu_plugin_defs.h"
+
#include "settings.h"
#include "sio1.h"
@@ -14,7 +17,8 @@ Settings settings;
/******************************************************************************/
-long CFGopen()
+static
+s32 configure()
{
GtkBuilder *builder;
GtkWidget *widget, *MainWindow;
@@ -64,22 +68,42 @@ long CFGopen()
return 0;
}
-int main( int argc, char *argv[] )
+static
+s32 about()
+{
+ const char *authors[]= {"edgbla <edgbla@yandex.ru>", NULL};
+ GtkWidget *widget;
+
+ widget = gtk_about_dialog_new();
+ gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(widget), "Link Cable");
+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(widget), "1.0");
+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(widget), authors);
+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(widget), "http://www.codeplex.com/pcsxr/");
+
+ gtk_dialog_run(GTK_DIALOG(widget));
+ gtk_widget_destroy(widget);
+}
+
+int main(int argc, char *argv[])
{
#ifdef ENABLE_NLS
- setlocale( LC_ALL, "" );
- bindtextdomain( GETTEXT_PACKAGE, LOCALE_DIR );
- bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" );
- textdomain( GETTEXT_PACKAGE );
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
#endif
- gtk_init( &argc, &argv );
+ gtk_init(&argc, &argv);
- if( argc > 1 )
+ if(argc > 1)
{
- if( !strcmp(argv[1], "open") )
+ if(!strcmp(argv[1], "configure"))
+ {
+ return configure();
+ }
+ if(!strcmp(argv[1], "about"))
{
- return CFGopen();
+ return about();
}
}
diff --git a/plugins/bladesio1/settings.c b/plugins/bladesio1/settings.c
index 39deab32..3d6a96cd 100755
--- a/plugins/bladesio1/settings.c
+++ b/plugins/bladesio1/settings.c
@@ -22,6 +22,9 @@
#include <string.h>
#include <fcntl.h>
+#include "psxcommon.h"
+#include "psemu_plugin_defs.h"
+
#include "settings.h"
#include "sio1.h"
diff --git a/plugins/bladesio1/settings.h b/plugins/bladesio1/settings.h
index c78c1a1b..bd297678 100755
--- a/plugins/bladesio1/settings.h
+++ b/plugins/bladesio1/settings.h
@@ -24,9 +24,10 @@
typedef struct Settings
{
- long player;
+ s32 enabled;
+ s32 player;
char ip[32];
- unsigned short port;
+ u16 port;
} Settings;
/******************************************************************************/
diff --git a/plugins/bladesio1/sio1.c b/plugins/bladesio1/sio1.c
index cba060d1..36da09d1 100755
--- a/plugins/bladesio1/sio1.c
+++ b/plugins/bladesio1/sio1.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include <sys/stat.h>
#include "psxcommon.h"
#include "psemu_plugin_defs.h"
@@ -318,17 +319,54 @@ unsigned long CALLBACK PSEgetLibVersion()
return version << 16 | revision << 8 | build;
}
-void CALLBACK SIO1about()
+long CALLBACK SIO1test()
{
+ return 0;
}
-long CALLBACK SIO1test()
+void ExecCfg(char *arg) {
+ char cfg[256];
+ struct stat buf;
+
+ strcpy(cfg, "./cfgBladeSio1");
+ if (stat(cfg, &buf) != -1) {
+ int pid = fork();
+ if (pid == 0) {
+ if (fork() == 0) {
+ execl(cfg, "cfgBladeSio1", arg, NULL);
+ }
+ exit(0);
+ } else if (pid > 0) {
+ waitpid(pid, NULL, 0);
+ }
+ return;
+ }
+
+ strcpy(cfg, "./cfg/cfgBladeSio1");
+ if (stat(cfg, &buf) != -1) {
+ int pid = fork();
+ if (pid == 0) {
+ if (fork() == 0) {
+ execl(cfg, "cfgBladeSio1", arg, NULL);
+ }
+ exit(0);
+ } else if (pid > 0) {
+ waitpid(pid, NULL, 0);
+ }
+ return;
+ }
+
+ fprintf(stderr, "cfgBladeSio1 file not found!\n");
+}
+
+void CALLBACK SIO1about()
{
- return 0;
+ ExecCfg("about");
}
void CALLBACK SIO1configure()
{
+ ExecCfg("configure");
}
/******************************************************************************/