summaryrefslogtreecommitdiff
path: root/plugins/bladesio1/sio1.c
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/bladesio1/sio1.c
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/bladesio1/sio1.c')
-rwxr-xr-xplugins/bladesio1/sio1.c44
1 files changed, 41 insertions, 3 deletions
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");
}
/******************************************************************************/