summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-07-07 13:52:32 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-07-07 13:52:32 +0000
commit337765356b5fd420d3cab3349caa34eec2f98e65 (patch)
treeac569bb639779ab741be53329c406008b2108c33 /plugins
parent2bcdda648da39be8d65bd9c0c96c87861c775c2e (diff)
downloadpcsxr-337765356b5fd420d3cab3349caa34eec2f98e65.tar.gz
Sio1 plugin (dummy).
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@54273 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'plugins')
-rw-r--r--plugins/bladesio1/Makefile.am21
-rw-r--r--plugins/bladesio1/gui.c32
-rw-r--r--plugins/bladesio1/settings.c64
-rw-r--r--plugins/bladesio1/settings.h39
-rw-r--r--plugins/bladesio1/sio1.c226
-rw-r--r--plugins/bladesio1/sio1.glade237
-rw-r--r--plugins/bladesio1/sio1.h43
7 files changed, 462 insertions, 0 deletions
diff --git a/plugins/bladesio1/Makefile.am b/plugins/bladesio1/Makefile.am
new file mode 100644
index 00000000..8b16ff24
--- /dev/null
+++ b/plugins/bladesio1/Makefile.am
@@ -0,0 +1,21 @@
+bindir = @libdir@/games/psemu/
+libdir = @libdir@/games/psemu/
+
+lib_LTLIBRARIES = libBladeSio1.la
+
+libBladeSio1_la_SOURCES = sio1.c settings.c
+libBladeSio1_la_LDFLAGS = -module -avoid-version
+
+INCLUDES = -DPIXMAPDIR=\"${datadir}/pixmaps/\" \
+ -DLOCALE_DIR=\"${datadir}/locale/\" \
+ -DDATADIR=\"${datadir}/psemu/\" \
+ $(GTK2_CFLAGS) $(GLADE2_CFLAGS) \
+ -I../../libpcsxcore -I../../include
+
+bin_PROGRAMS = cfgBladeSio1
+cfgBladeSio1_SOURCES = gui.c
+cfgBladeSio1_LDADD = $(GTK2_LIBS) $(GLADE2_LIBS)
+
+glade_DATA = sio1.glade2
+gladedir = $(datadir)/psemu/
+EXTRA_DIST = $(glade_DATA)
diff --git a/plugins/bladesio1/gui.c b/plugins/bladesio1/gui.c
new file mode 100644
index 00000000..342d1d55
--- /dev/null
+++ b/plugins/bladesio1/gui.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+
+long CFGopen()
+{
+ return 0;
+}
+
+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 );
+#endif
+
+ gtk_set_locale();
+ gtk_init( &argc, &argv );
+
+ if( !strcmp(argv[1], "open") )
+ {
+ return CFGopen();
+ }
+
+ return 0;
+}
diff --git a/plugins/bladesio1/settings.c b/plugins/bladesio1/settings.c
new file mode 100644
index 00000000..b560bf2b
--- /dev/null
+++ b/plugins/bladesio1/settings.c
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Blade_Arma *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
+ ***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+
+#include "settings.h"
+#include "sio1.h"
+
+/******************************************************************************/
+
+static const char configName[] = "bladesio1.cfg";
+
+/******************************************************************************/
+
+void settingsRead()
+{
+ FILE *file;
+
+ file = fopen( configName, "rb" );
+ if( file )
+ {
+ fread( &settings, 1, sizeof(settings), file );
+ fclose( file );
+ }
+ else
+ {
+ settings.player = 1;
+ strcpy( settings.ip, "127.0.0.1" );
+ settings.port = 33307;
+ }
+}
+
+void settingsWrite()
+{
+ FILE *file;
+
+ file = fopen( configName, "wb" );
+ if( file )
+ {
+ fwrite( &settings, 1, sizeof(settings), file );
+ fclose( file );
+ }
+}
+
+/******************************************************************************/
diff --git a/plugins/bladesio1/settings.h b/plugins/bladesio1/settings.h
new file mode 100644
index 00000000..a08f110c
--- /dev/null
+++ b/plugins/bladesio1/settings.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Blade_Arma *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
+ ***************************************************************************/
+
+#ifndef _SETTINGS_H_
+#define _SETTINGS_H_
+
+/******************************************************************************/
+
+typedef struct Settings
+{
+ long player;
+ char ip[32];
+ unsigned short port;
+} Settings;
+
+/******************************************************************************/
+
+void settingsRead();
+void settingsWrite();
+
+/******************************************************************************/
+
+#endif // _SETTINGS_H_
diff --git a/plugins/bladesio1/sio1.c b/plugins/bladesio1/sio1.c
new file mode 100644
index 00000000..9a43afc4
--- /dev/null
+++ b/plugins/bladesio1/sio1.c
@@ -0,0 +1,226 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Blade_Arma *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
+ ***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "settings.h"
+#include "sio1.h"
+
+/******************************************************************************/
+
+static char *pluginName = N_("Sio1 Driver");
+
+static const unsigned char version = 1;
+static const unsigned char revision = 1;
+static const unsigned char build = 1;
+
+Settings settings;
+
+/******************************************************************************/
+
+long CALLBACK SIO1init()
+{
+ return 0;
+}
+
+long CALLBACK SIO1shutdown()
+{
+ return 0;
+}
+
+/******************************************************************************/
+
+long CALLBACK SIOopen( unsigned long *gpuDisp )
+{
+ settingsRead();
+
+ return 0;
+}
+
+long CALLBACK SIO1close()
+{
+ return 0;
+}
+
+/******************************************************************************/
+
+void CALLBACK SIO1pause()
+{
+}
+
+void CALLBACK SIO1resume()
+{
+}
+
+/******************************************************************************/
+
+long CALLBACK SIO1keypressed( int val )
+{
+ return 0;
+}
+
+/******************************************************************************/
+
+void CALLBACK SIO1writeData8(unsigned char val)
+{
+}
+
+void CALLBACK SIO1writeData16(unsigned short val)
+{
+}
+
+void CALLBACK SIO1writeData32(unsigned long val)
+{
+}
+
+void CALLBACK SIO1writeStat16(unsigned short val)
+{
+}
+
+void CALLBACK SIO1writeStat32(unsigned long val)
+{
+}
+
+void CALLBACK SIO1writeMode16(unsigned short val)
+{
+}
+
+void CALLBACK SIO1writeMode32(unsigned long val)
+{
+}
+
+void CALLBACK SIO1writeCtrl16(unsigned short val)
+{
+}
+
+void CALLBACK SIO1writeCtrl32(unsigned long val)
+{
+}
+
+void CALLBACK SIO1writeBaud16(unsigned short val)
+{
+}
+
+void CALLBACK SIO1writeBaud32(unsigned long val)
+{
+}
+
+unsigned char CALLBACK SIO1readData8(void)
+{
+ return 0;
+}
+
+unsigned short CALLBACK SIO1readData16(void)
+{
+ return 0;
+}
+
+unsigned long CALLBACK SIO1readData32(void)
+{
+ return 0;
+}
+
+unsigned short CALLBACK SIO1readStat16(void)
+{
+ return 0;
+}
+
+unsigned long CALLBACK SIO1readStat32(void)
+{
+ return 0;
+}
+
+unsigned short CALLBACK SIO1readMode16(void)
+{
+ return 0;
+}
+
+unsigned long CALLBACK SIO1readMode32(void)
+{
+ return 0;
+}
+
+unsigned short CALLBACK SIO1readCtrl16(void)
+{
+ return 0;
+}
+
+unsigned long CALLBACK SIO1readCtrl32(void)
+{
+ return 0;
+}
+
+unsigned short CALLBACK SIO1readBaud16(void)
+{
+ return 0;
+}
+
+unsigned long CALLBACK SIO1readBaud32(void)
+{
+ return 0;
+}
+
+
+/******************************************************************************/
+
+void CALLBACK SIO1registerCallback(void (CALLBACK *callback)(void))
+{
+}
+
+/******************************************************************************/
+/*
+long CALLBACK SIO1queryPlayer()
+{
+ return settings.player;
+}
+*/
+/******************************************************************************/
+
+unsigned long CALLBACK PSEgetLibType()
+{
+ #define PSE_LT_SIO1 32
+ return PSE_LT_SIO1;
+}
+
+char* CALLBACK PSEgetLibName()
+{
+ return _(pluginName);
+}
+
+unsigned long CALLBACK PSEgetLibVersion()
+{
+ return version << 16 | revision << 8 | build;
+}
+
+void CALLBACK SIO1about()
+{
+}
+
+long CALLBACK SIO1test()
+{
+ return 0;
+}
+
+void CALLBACK SIO1configure()
+{
+}
+
+/******************************************************************************/
diff --git a/plugins/bladesio1/sio1.glade2 b/plugins/bladesio1/sio1.glade2
new file mode 100644
index 00000000..6a6971ee
--- /dev/null
+++ b/plugins/bladesio1/sio1.glade2
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.8 -->
+ <!-- interface-naming-policy project-wide -->
+ <widget class="GtkDialog" id="dialog">
+ <property name="border_width">5</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/plugins/bladesio1/sio1.h b/plugins/bladesio1/sio1.h
new file mode 100644
index 00000000..6638de68
--- /dev/null
+++ b/plugins/bladesio1/sio1.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2010 by Blade_Arma *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
+ ***************************************************************************/
+
+#ifndef _SIO1_H_
+#define _SIO1_H_
+
+//#include "config.h"
+
+/******************************************************************************/
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _(x) gettext(x)
+#define N_(x) (x)
+#else
+#define _(x) (x)
+#define N_(x) (x)
+#endif
+
+#define CALLBACK
+
+extern Settings settings;
+
+/******************************************************************************/
+
+#endif // _SIO1_H_