diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-14 23:14:57 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-02-14 23:14:57 +0000 |
| commit | bb9c6f0355aacbdddc5e83de8ab0e2707d1348e5 (patch) | |
| tree | 898306ea1071621ab76f907a8dfab7629178d681 /plugins/bladesio1/sio1.c | |
| parent | f1d5f92e6bfbff24667a766610f7171bcf6d7116 (diff) | |
| download | pcsxr-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-x | plugins/bladesio1/sio1.c | 44 |
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"); } /******************************************************************************/ |
