summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-22 07:14:27 +0000
committerSND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-22 07:14:27 +0000
commitcd8a6db7e6736696f77c7935dffb883aa5c2996a (patch)
treec1f0298f2d0881575963b68db589e24820c03cc5
parente75205e3a33be2e5ff59508c77c91313d80717ea (diff)
downloadpcsxr-cd8a6db7e6736696f77c7935dffb883aa5c2996a.tar.gz
.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83090 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rwxr-xr-xgui/Plugin.c3
-rwxr-xr-xlibpcsxcore/debug.h3
-rwxr-xr-xlibpcsxcore/plugins.c48
-rwxr-xr-xlibpcsxcore/plugins.h46
-rwxr-xr-xlibpcsxcore/psxcounters.c7
-rwxr-xr-xlibpcsxcore/psxhw.c56
-rw-r--r--plugins/bladesio1/Makefile.am20
-rw-r--r--plugins/bladesio1/gui.c113
-rwxr-xr-xplugins/bladesio1/settings.c67
-rwxr-xr-xplugins/bladesio1/settings.h40
-rwxr-xr-xplugins/bladesio1/sio1.c372
-rwxr-xr-xplugins/bladesio1/sio1.h43
-rw-r--r--plugins/bladesio1/sio1.ui314
-rwxr-xr-xplugins/dfxvideo/draw.c1
-rwxr-xr-xpo/POTFILES.in3
15 files changed, 114 insertions, 1022 deletions
diff --git a/gui/Plugin.c b/gui/Plugin.c
index daf232c8..e7e8c2da 100755
--- a/gui/Plugin.c
+++ b/gui/Plugin.c
@@ -293,6 +293,9 @@ void PADhandleKey(int key) {
break;
default:
GPU_keypressed(key);
+#ifdef ENABLE_SIO1API
+ SIO1_keypressed(key);
+#endif
if (Config.UseNet) NET_keypressed(key);
}
}
diff --git a/libpcsxcore/debug.h b/libpcsxcore/debug.h
index ba89e3d5..f54c4883 100755
--- a/libpcsxcore/debug.h
+++ b/libpcsxcore/debug.h
@@ -53,6 +53,7 @@ char* disR3000AF(u32 code, u32 pc);
//#define LOG_STDOUT
//#define PAD_LOG __Log
+//#define SIO1_LOG __Log
//#define GTE_LOG __Log
//#define CDR_LOG __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log
//#define CDR_LOG_IO __Log("%8.8lx %8.8lx: ", psxRegs.pc, psxRegs.cycle); __Log
@@ -64,7 +65,7 @@ char* disR3000AF(u32 code, u32 pc);
//#define PSXCPU_LOG __Log
#if defined(PSXCPU_LOG) || defined(PSXDMA_LOG) || defined(CDR_LOG) || defined(PSXHW_LOG) || \
- defined(PSXBIOS_LOG) || defined(PSXMEM_LOG) || defined(GTE_LOG) || defined(PAD_LOG)
+ defined(PSXBIOS_LOG) || defined(PSXMEM_LOG) || defined(GTE_LOG) || defined(PAD_LOG) || defined(SIO1_LOG)
#define EMU_LOG __Log
#endif
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c
index ff9b00e4..30b62b0d 100755
--- a/libpcsxcore/plugins.c
+++ b/libpcsxcore/plugins.c
@@ -178,6 +178,7 @@ SIO1readCtrl16 SIO1_readCtrl16;
SIO1readCtrl32 SIO1_readCtrl32;
SIO1readBaud16 SIO1_readBaud16;
SIO1readBaud32 SIO1_readBaud32;
+SIO1update SIO1_update;
SIO1registerCallback SIO1_registerCallback;
#endif
@@ -638,28 +639,29 @@ void CALLBACK SIO1__about(void) {}
void CALLBACK SIO1__pause(void) {}
void CALLBACK SIO1__resume(void) {}
long CALLBACK SIO1__keypressed(int key) { return 0; }
-void CALLBACK SIO1__writeData8(unsigned char val) {}
-void CALLBACK SIO1__writeData16(unsigned short val) {}
-void CALLBACK SIO1__writeData32(unsigned long val) {}
-void CALLBACK SIO1__writeStat16(unsigned short val) {}
-void CALLBACK SIO1__writeStat32(unsigned long val) {}
-void CALLBACK SIO1__writeMode16(unsigned short val) {}
-void CALLBACK SIO1__writeMode32(unsigned long val) {}
-void CALLBACK SIO1__writeCtrl16(unsigned short val) {}
-void CALLBACK SIO1__writeCtrl32(unsigned long val) {}
-void CALLBACK SIO1__writeBaud16(unsigned short val) {}
-void CALLBACK SIO1__writeBaud32(unsigned long val) {}
-unsigned char CALLBACK SIO1__readData8(void) { return 0; }
-unsigned short CALLBACK SIO1__readData16(void) { return 0; }
-unsigned long CALLBACK SIO1__readData32(void) { return 0; }
-unsigned short CALLBACK SIO1__readStat16(void) { return 0; }
-unsigned long CALLBACK SIO1__readStat32(void) { return 0; }
-unsigned short CALLBACK SIO1__readMode16(void) { return 0; }
-unsigned long CALLBACK SIO1__readMode32(void) { return 0; }
-unsigned short CALLBACK SIO1__readCtrl16(void) { return 0; }
-unsigned long CALLBACK SIO1__readCtrl32(void) { return 0; }
-unsigned short CALLBACK SIO1__readBaud16(void) { return 0; }
-unsigned long CALLBACK SIO1__readBaud32(void) { return 0; }
+void CALLBACK SIO1__writeData8(u8 val) {}
+void CALLBACK SIO1__writeData16(u16 val) {}
+void CALLBACK SIO1__writeData32(u32 val) {}
+void CALLBACK SIO1__writeStat16(u16 val) {}
+void CALLBACK SIO1__writeStat32(u32 val) {}
+void CALLBACK SIO1__writeMode16(u16 val) {}
+void CALLBACK SIO1__writeMode32(u32 val) {}
+void CALLBACK SIO1__writeCtrl16(u16 val) {}
+void CALLBACK SIO1__writeCtrl32(u32 val) {}
+void CALLBACK SIO1__writeBaud16(u16 val) {}
+void CALLBACK SIO1__writeBaud32(u32 val) {}
+u8 CALLBACK SIO1__readData8(void) { return 0; }
+u16 CALLBACK SIO1__readData16(void) { return 0; }
+u32 CALLBACK SIO1__readData32(void) { return 0; }
+u16 CALLBACK SIO1__readStat16(void) { return 0; }
+u32 CALLBACK SIO1__readStat32(void) { return 0; }
+u16 CALLBACK SIO1__readMode16(void) { return 0; }
+u32 CALLBACK SIO1__readMode32(void) { return 0; }
+u16 CALLBACK SIO1__readCtrl16(void) { return 0; }
+u32 CALLBACK SIO1__readCtrl32(void) { return 0; }
+u16 CALLBACK SIO1__readBaud16(void) { return 0; }
+u32 CALLBACK SIO1__readBaud32(void) { return 0; }
+void CALLBACK SIO1__update(uint32_t t) {};
void CALLBACK SIO1__registerCallback(void (CALLBACK *callback)(void)) {};
#define LoadSio1Sym1(dest, name) \
@@ -703,6 +705,7 @@ static int LoadSIO1plugin(const char *SIO1dll) {
LoadSio1Sym0(writeCtrl32, "SIO1writeCtrl32");
LoadSio1Sym0(writeBaud16, "SIO1writeBaud16");
LoadSio1Sym0(writeBaud32, "SIO1writeBaud32");
+ LoadSio1Sym0(readData8, "SIO1readData8");
LoadSio1Sym0(readData16, "SIO1readData16");
LoadSio1Sym0(readData32, "SIO1readData32");
LoadSio1Sym0(readStat16, "SIO1readStat16");
@@ -713,6 +716,7 @@ static int LoadSIO1plugin(const char *SIO1dll) {
LoadSio1Sym0(readCtrl32, "SIO1readCtrl32");
LoadSio1Sym0(readBaud16, "SIO1readBaud16");
LoadSio1Sym0(readBaud32, "SIO1readBaud32");
+ LoadSio1Sym0(update, "SIO1update");
LoadSio1Sym0(registerCallback, "SIO1registerCallback");
return 0;
diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h
index 27b92822..f8cfdf44 100755
--- a/libpcsxcore/plugins.h
+++ b/libpcsxcore/plugins.h
@@ -348,28 +348,29 @@ typedef void (CALLBACK* SIO1about)(void);
typedef void (CALLBACK* SIO1pause)(void);
typedef void (CALLBACK* SIO1resume)(void);
typedef long (CALLBACK* SIO1keypressed)(int);
-typedef void (CALLBACK* SIO1writeData8)(unsigned char);
-typedef void (CALLBACK* SIO1writeData16)(unsigned short);
-typedef void (CALLBACK* SIO1writeData32)(unsigned long);
-typedef void (CALLBACK* SIO1writeStat16)(unsigned short);
-typedef void (CALLBACK* SIO1writeStat32)(unsigned long);
-typedef void (CALLBACK* SIO1writeMode16)(unsigned short);
-typedef void (CALLBACK* SIO1writeMode32)(unsigned long);
-typedef void (CALLBACK* SIO1writeCtrl16)(unsigned short);
-typedef void (CALLBACK* SIO1writeCtrl32)(unsigned long);
-typedef void (CALLBACK* SIO1writeBaud16)(unsigned short);
-typedef void (CALLBACK* SIO1writeBaud32)(unsigned long);
-typedef unsigned char (CALLBACK* SIO1readData8)(void);
-typedef unsigned short (CALLBACK* SIO1readData16)(void);
-typedef unsigned long (CALLBACK* SIO1readData32)(void);
-typedef unsigned short (CALLBACK* SIO1readStat16)(void);
-typedef unsigned long (CALLBACK* SIO1readStat32)(void);
-typedef unsigned short (CALLBACK* SIO1readMode16)(void);
-typedef unsigned long (CALLBACK* SIO1readMode32)(void);
-typedef unsigned short (CALLBACK* SIO1readCtrl16)(void);
-typedef unsigned long (CALLBACK* SIO1readCtrl32)(void);
-typedef unsigned short (CALLBACK* SIO1readBaud16)(void);
-typedef unsigned long (CALLBACK* SIO1readBaud32)(void);
+typedef void (CALLBACK* SIO1writeData8)(u8);
+typedef void (CALLBACK* SIO1writeData16)(u16);
+typedef void (CALLBACK* SIO1writeData32)(u32);
+typedef void (CALLBACK* SIO1writeStat16)(u16);
+typedef void (CALLBACK* SIO1writeStat32)(u32);
+typedef void (CALLBACK* SIO1writeMode16)(u16);
+typedef void (CALLBACK* SIO1writeMode32)(u32);
+typedef void (CALLBACK* SIO1writeCtrl16)(u16);
+typedef void (CALLBACK* SIO1writeCtrl32)(u32);
+typedef void (CALLBACK* SIO1writeBaud16)(u16);
+typedef void (CALLBACK* SIO1writeBaud32)(u32);
+typedef u8 (CALLBACK* SIO1readData8)(void);
+typedef u16 (CALLBACK* SIO1readData16)(void);
+typedef u32 (CALLBACK* SIO1readData32)(void);
+typedef u16 (CALLBACK* SIO1readStat16)(void);
+typedef u32 (CALLBACK* SIO1readStat32)(void);
+typedef u16 (CALLBACK* SIO1readMode16)(void);
+typedef u32 (CALLBACK* SIO1readMode32)(void);
+typedef u16 (CALLBACK* SIO1readCtrl16)(void);
+typedef u32 (CALLBACK* SIO1readCtrl32)(void);
+typedef u16 (CALLBACK* SIO1readBaud16)(void);
+typedef u32 (CALLBACK* SIO1readBaud32)(void);
+typedef void (CALLBACK* SIO1update)(uint32_t);
typedef void (CALLBACK* SIO1registerCallback)(void (CALLBACK *callback)(void));
// SIO1 function pointers
@@ -405,6 +406,7 @@ extern SIO1readCtrl16 SIO1_readCtrl16;
extern SIO1readCtrl32 SIO1_readCtrl32;
extern SIO1readBaud16 SIO1_readBaud16;
extern SIO1readBaud32 SIO1_readBaud32;
+extern SIO1update SIO1_update;
extern SIO1registerCallback SIO1_registerCallback;
#endif
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index 631c21f0..8cc2ee9b 100755
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -286,6 +286,13 @@ void psxRcntUpdate()
}
}
+#ifdef ENABLE_SIO1API
+ if( SIO1_update )
+ {
+ SIO1_update( 0 );
+ }
+#endif
+
// VSync irq.
if( hSyncCount == VBlankStart[Config.PsxType] )
{
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c
index 06f00d03..0fdfd1d0 100755
--- a/libpcsxcore/psxhw.c
+++ b/libpcsxcore/psxhw.c
@@ -41,7 +41,7 @@ u8 psxHwRead8(u32 add) {
unsigned char hard;
switch (add) {
- case 0x1f801040: hard = sioRead8();break;
+ case 0x1f801040: hard = sioRead8(); break;
#ifdef ENABLE_SIO1API
case 0x1f801050: hard = SIO1_readData8(); break;
#endif
@@ -68,11 +68,13 @@ u16 psxHwRead16(u32 add) {
switch (add) {
#ifdef PSXHW_LOG
- case 0x1f801070: PSXHW_LOG("IREG 16bit read %x\n", psxHu16(0x1070));
+ case 0x1f801070:
+ PSXHW_LOG("IREG 16bit read %x\n", psxHu16(0x1070));
return psxHu16(0x1070);
#endif
#ifdef PSXHW_LOG
- case 0x1f801074: PSXHW_LOG("IMASK 16bit read %x\n", psxHu16(0x1074));
+ case 0x1f801074:
+ PSXHW_LOG("IMASK 16bit read %x\n", psxHu16(0x1074));
return psxHu16(0x1074);
#endif
@@ -110,15 +112,33 @@ u16 psxHwRead16(u32 add) {
#ifdef ENABLE_SIO1API
case 0x1f801050:
hard = SIO1_readData16();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read16 %x; ret = %x\n", add&0xf, hard);
+#endif
return hard;
case 0x1f801054:
hard = SIO1_readStat16();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read16 %x; ret = %x\n", add&0xf, hard);
+#endif
+ return hard;
+ case 0x1f801058:
+ hard = SIO1_readMode16();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read16 %x; ret = %x\n", add&0xf, hard);
+#endif
return hard;
case 0x1f80105a:
hard = SIO1_readCtrl16();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read16 %x; ret = %x\n", add&0xf, hard);
+#endif
return hard;
case 0x1f80105e:
hard = SIO1_readBaud16();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read16 %x; ret = %x\n", add&0xf, hard);
+#endif
return hard;
#endif
case 0x1f801100:
@@ -213,6 +233,9 @@ u32 psxHwRead32(u32 add) {
#ifdef ENABLE_SIO1API
case 0x1f801050:
hard = SIO1_readData32();
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 read32 ;ret = %x\n", hard);
+#endif
return hard;
#endif
#ifdef PSXHW_LOG
@@ -221,11 +244,13 @@ u32 psxHwRead32(u32 add) {
return psxHu32(0x1060);
#endif
#ifdef PSXHW_LOG
- case 0x1f801070: PSXHW_LOG("IREG 32bit read %x\n", psxHu32(0x1070));
+ case 0x1f801070:
+ PSXHW_LOG("IREG 32bit read %x\n", psxHu32(0x1070));
return psxHu32(0x1070);
#endif
#ifdef PSXHW_LOG
- case 0x1f801074: PSXHW_LOG("IMASK 32bit read %x\n", psxHu32(0x1074));
+ case 0x1f801074:
+ PSXHW_LOG("IMASK 32bit read %x\n", psxHu32(0x1074));
return psxHu32(0x1074);
#endif
@@ -407,15 +432,33 @@ void psxHwWrite16(u32 add, u16 value) {
#ifdef ENABLE_SIO1API
case 0x1f801050:
SIO1_writeData16(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write16 %x, %x\n", add&0xf, value);
+#endif
return;
case 0x1f801054:
SIO1_writeStat16(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write16 %x, %x\n", add&0xf, value);
+#endif
+ return;
+ case 0x1f801058:
+ SIO1_writeMode16(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write16 %x, %x\n", add&0xf, value);
+#endif
return;
case 0x1f80105a:
SIO1_writeCtrl16(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write16 %x, %x\n", add&0xf, value);
+#endif
return;
case 0x1f80105e:
SIO1_writeBaud16(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write16 %x, %x\n", add&0xf, value);
+#endif
return;
#endif
case 0x1f801070:
@@ -524,6 +567,9 @@ void psxHwWrite32(u32 add, u32 value) {
#ifdef ENABLE_SIO1API
case 0x1f801050:
SIO1_writeData32(value);
+#ifdef SIO1_LOG
+ SIO1_LOG("sio1 write32 %x\n", value);
+#endif
return;
#endif
#ifdef PSXHW_LOG
diff --git a/plugins/bladesio1/Makefile.am b/plugins/bladesio1/Makefile.am
deleted file mode 100644
index b8ac8aa7..00000000
--- a/plugins/bladesio1/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-bindir = @libdir@/games/psemu/
-libdir = @libdir@/games/psemu/
-
-lib_LTLIBRARIES = libBladeSio1.la
-
-libBladeSio1_la_SOURCES = sio1.c sio1.h settings.c settings.h
-libBladeSio1_la_LDFLAGS = -module -avoid-version
-
-AM_CPPFLAGS = -DLOCALE_DIR=\"${datadir}/locale/\" \
- -DDATADIR=\"${datadir}/psemu/\" \
- $(GTK3_CFLAGS) \
- -I../../libpcsxcore -I../../include
-
-bin_PROGRAMS = cfgBladeSio1
-cfgBladeSio1_SOURCES = gui.c
-cfgBladeSio1_LDADD = $(GTK3_LIBS)
-
-glade_DATA = sio1.ui
-gladedir = $(datadir)/psemu/
-EXTRA_DIST = $(glade_DATA)
diff --git a/plugins/bladesio1/gui.c b/plugins/bladesio1/gui.c
deleted file mode 100644
index e7839e68..00000000
--- a/plugins/bladesio1/gui.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-
-#include "psxcommon.h"
-#include "psemu_plugin_defs.h"
-
-#include "settings.h"
-#include "sio1.h"
-
-/******************************************************************************/
-
-Settings settings;
-
-/******************************************************************************/
-
-static
-s32 configure()
-{
- GtkBuilder *builder;
- GtkWidget *widget, *MainWindow;
-
- //settingsRead();
-
- builder = gtk_builder_new();
-
- if (!gtk_builder_add_from_file(builder, DATADIR "sio1.ui", NULL)) {
- g_warning("We could not load the interface!");
- return 0;
- }
-
- MainWindow = gtk_builder_get_object(builder, "dlgStart");
- gtk_window_set_title(GTK_WINDOW(MainWindow), _("Link cable"));
-
- if (settings.player == 1) {
- widget = gtk_builder_get_object(builder, "rbServer");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
- } else {
- widget = gtk_builder_get_object(builder, "rbClient");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
- }
-
- if (gtk_dialog_run(GTK_DIALOG(MainWindow)) == GTK_RESPONSE_OK) {
- widget = gtk_builder_get_object(builder, "tbServerIP");
- strncpy(settings.ip, gtk_entry_get_text(GTK_ENTRY(widget)), sizeof(settings.ip) - 1);
-
- widget = gtk_builder_get_object(builder, "tbPort");
- settings.port = atoi(gtk_entry_get_text(GTK_ENTRY(widget)));
-
- widget = gtk_builder_get_object(builder, "rbServer");
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
- settings.player = 1;
- } else {
- settings.player = 2;
- }
-
- //settingsWrite();
-
- gtk_widget_destroy(MainWindow);
- return 1;
- }
-
- gtk_widget_destroy(MainWindow);
-
- return 0;
-}
-
-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);
-#endif
-
- gtk_init(&argc, &argv);
-
- if(argc > 1)
- {
- if(!strcmp(argv[1], "configure"))
- {
- return configure();
- }
- if(!strcmp(argv[1], "about"))
- {
- return about();
- }
- }
-
- return 0;
-}
-
-/******************************************************************************/
diff --git a/plugins/bladesio1/settings.c b/plugins/bladesio1/settings.c
deleted file mode 100755
index 3d6a96cd..00000000
--- a/plugins/bladesio1/settings.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************
- * 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 02110-1301 USA. *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "psxcommon.h"
-#include "psemu_plugin_defs.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
deleted file mode 100755
index bd297678..00000000
--- a/plugins/bladesio1/settings.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- * 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 02110-1301 USA. *
- ***************************************************************************/
-
-#ifndef _SETTINGS_H_
-#define _SETTINGS_H_
-
-/******************************************************************************/
-
-typedef struct Settings
-{
- s32 enabled;
- s32 player;
- char ip[32];
- u16 port;
-} Settings;
-
-/******************************************************************************/
-
-void settingsRead();
-void settingsWrite();
-
-/******************************************************************************/
-
-#endif // _SETTINGS_H_
diff --git a/plugins/bladesio1/sio1.c b/plugins/bladesio1/sio1.c
deleted file mode 100755
index 36da09d1..00000000
--- a/plugins/bladesio1/sio1.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/***************************************************************************
- * 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 02110-1301 USA. *
- ***************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdint.h>
-#include <sys/stat.h>
-
-#include "psxcommon.h"
-#include "psemu_plugin_defs.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;
-
-static void (CALLBACK *irqCallback)() = 0;
-
-Settings settings;
-
-/* sio status flags.
- */
-enum
-{
- SR_TXRDY = 0x0001,
- SR_RXRDY = 0x0002,
- SR_TXU = 0x0004,
- SR_PERROR = 0x0008,
- SR_OE = 0x0010,
- SR_FE = 0x0020,
- SR_0040 = 0x0040, // ?
- SR_DSR = 0x0080,
- SR_CTS = 0x0100,
- SR_IRQ = 0x0200
-};
-
-/* sio mode flags.
- */
-enum
-{
- MR_BR_1 = 0x0001,
- MR_BR_16 = 0x0002,
- MR_BR_64 = 0x0003,
- MR_CHLEN_5 = 0x0000,
- MR_CHLEN_6 = 0x0004,
- MR_CHLEN_7 = 0x0008,
- MR_CHLEN_8 = 0x000C,
- MR_PEN = 0x0010,
- MR_P_EVEN = 0x0020,
- MR_SB_00 = 0x0000,
- MR_SB_01 = 0x0040,
- MR_SB_10 = 0x0080,
- MR_SB_11 = 0x00C0
-};
-
-/* sio control flags.
- */
-enum
-{
- CR_TXEN = 0x0001,
- CR_DTR = 0x0002,
- CR_RXEN = 0x0004,
- CR_0008 = 0x0008, // ?
- CR_ERRRST = 0x0010,
- CR_RTS = 0x0020,
- CR_RST = 0x0040,
- CR_0080 = 0x0080, // HM?
- CR_BUFSZ_1 = 0x0000,
- CR_BUFSZ_2 = 0x0100,
- CR_BUFSZ_4 = 0x0200,
- CR_BUFSZ_8 = 0x0300,
- CR_TXIEN = 0x0400,
- CR_RXIEN = 0x0800,
- CR_DSRIEN = 0x1000,
- CR_2000 = 0x2000 // CTSIEN?
-};
-
-static u8 dataReg[8];
-static u16 statReg;
-static u16 modeReg;
-static u16 ctrlReg;
-static u16 baudReg;
-
-/******************************************************************************/
-
-long CALLBACK SIO1init()
-{
- printf("SIO1init()\n");
- return 0;
-}
-
-long CALLBACK SIO1shutdown()
-{
- printf("SIO1shutdown()\n");
- return 0;
-}
-
-/******************************************************************************/
-
-long CALLBACK SIO1open( unsigned long *gpuDisp )
-{
- printf("SIO1open()\n");
-
- settingsRead();
-
- memset(dataReg, 0x00, sizeof(dataReg));
- statReg = SR_TXRDY | SR_TXU | SR_DSR | SR_CTS;
- modeReg = 0x0000;
- ctrlReg = 0x0000;
- baudReg = 0x0000;
-
- return 0;
-}
-
-long CALLBACK SIO1close()
-{
- printf("SIO1close()\n");
- return 0;
-}
-
-/******************************************************************************/
-
-void CALLBACK SIO1pause()
-{
- printf("SIO1pause()\n");
-}
-
-void CALLBACK SIO1resume()
-{
- printf("SIO1resume()\n");
-}
-
-/******************************************************************************/
-
-long CALLBACK SIO1keypressed( int val )
-{
- return 0;
-}
-
-/******************************************************************************/
-
-/* Write.
- */
-
-void CALLBACK SIO1writeData8(unsigned char val)
-{
- printf("SIO1writeData8(%.2x)\n", val);
-}
-
-void CALLBACK SIO1writeData16(unsigned short val)
-{
- printf("SIO1writeData16(%.4x)\n", val);
-}
-
-void CALLBACK SIO1writeData32(unsigned long val)
-{
- printf("SIO1writeData32(%.8x)\n", val);
-}
-
-void CALLBACK SIO1writeStat16(unsigned short val)
-{
- printf("SIO1writeStat16(%.4x)\n", val);
-}
-
-void CALLBACK SIO1writeStat32(unsigned long val)
-{
- printf("SIO1writeStat32(%.8x)\n", val);
-}
-
-void CALLBACK SIO1writeMode16(unsigned short val)
-{
- printf("SIO1writeMode16(%.4x)\n", val);
- modeReg = val;
-}
-
-void CALLBACK SIO1writeMode32(unsigned long val)
-{
- printf("SIO1writeMode32(%.8x)\n", val);
- modeReg = val;
-}
-
-void CALLBACK SIO1writeCtrl16(unsigned short val)
-{
- printf("SIO1writeCtrl16(%.4x)\n", val);
- ctrlReg = val;
-}
-
-void CALLBACK SIO1writeCtrl32(unsigned long val)
-{
- printf("SIO1writeCtrl32(%.8x)\n", val);
- ctrlReg = val;
-}
-
-void CALLBACK SIO1writeBaud16(unsigned short val)
-{
- printf("SIO1writeBaud16(%.4x)\n", val);
- baudReg = val;
-}
-
-void CALLBACK SIO1writeBaud32(unsigned long val)
-{
- printf("SIO1writeBaud32(%.8x)\n", val);
- baudReg = val;
-}
-
-/* Read.
- */
-
-unsigned char CALLBACK SIO1readData8()
-{
- printf("SIO1readData8()\n");
- return 0;
-}
-
-unsigned short CALLBACK SIO1readData16()
-{
- printf("SIO1readData16()\n");
- return 0;
-}
-
-unsigned long CALLBACK SIO1readData32()
-{
- printf("SIO1readData32()\n");
- return 0;
-}
-
-unsigned short CALLBACK SIO1readStat16()
-{
- printf("SIO1readStat16() : %.4x\n", statReg);
- return statReg;
-}
-
-unsigned long CALLBACK SIO1readStat32()
-{
- printf("SIO1readStat32() : %.4x\n", statReg);
- return statReg;
-}
-
-unsigned short CALLBACK SIO1readMode16()
-{
- printf("SIO1readMode16() : %.4x\n", modeReg);
- return modeReg;
-}
-
-unsigned long CALLBACK SIO1readMode32()
-{
- printf("SIO1readMode32() : %.4x\n", modeReg);
- return modeReg;
-}
-
-unsigned short CALLBACK SIO1readCtrl16()
-{
- printf("SIO1readCtrl16() : %.4x\n", ctrlReg);
- return ctrlReg;
-}
-
-unsigned long CALLBACK SIO1readCtrl32()
-{
- printf("SIO1readCtrl32() : %.4x\n", ctrlReg);
- return ctrlReg;
-}
-
-unsigned short CALLBACK SIO1readBaud16()
-{
- printf("SIO1readBaud16() : %.4x\n", baudReg);
- return baudReg;
-}
-
-unsigned long CALLBACK SIO1readBaud32()
-{
- printf("SIO1readBaud32() : %.4x\n", baudReg);
- return baudReg;
-}
-
-/******************************************************************************/
-
-void CALLBACK SIO1registerCallback(void (CALLBACK *callback)())
-{
- irqCallback = callback;
-}
-
-/******************************************************************************/
-
-unsigned long CALLBACK PSEgetLibType()
-{
- return PSE_LT_SIO1;
-}
-
-char* CALLBACK PSEgetLibName()
-{
- return _(pluginName);
-}
-
-unsigned long CALLBACK PSEgetLibVersion()
-{
- return version << 16 | revision << 8 | build;
-}
-
-long CALLBACK SIO1test()
-{
- return 0;
-}
-
-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()
-{
- ExecCfg("about");
-}
-
-void CALLBACK SIO1configure()
-{
- ExecCfg("configure");
-}
-
-/******************************************************************************/
diff --git a/plugins/bladesio1/sio1.h b/plugins/bladesio1/sio1.h
deleted file mode 100755
index 8e03c728..00000000
--- a/plugins/bladesio1/sio1.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- * 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 02110-1301 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_
diff --git a/plugins/bladesio1/sio1.ui b/plugins/bladesio1/sio1.ui
deleted file mode 100644
index bdad3a1d..00000000
--- a/plugins/bladesio1/sio1.ui
+++ /dev/null
@@ -1,314 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="dlgStart">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="type_hint">normal</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="btnStart">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-network</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Start Game</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="btnOffline">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkImage" id="image3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-no</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Play Offline</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Select here if you'll be Server (Player1) or Client (Player2).
-
-If you select Server you must Copy your IP address to the Clipboard and paste if (Ctrl+V) wherever the Client can see it.
-
-If you selected Client please enter the IP address the Server gave to you in the IP Address Control.</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">8</property>
- <property name="row_spacing">12</property>
- <child>
- <object class="GtkButton" id="btnCopyIP">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <child>
- <object class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-copy</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Copy PC IP to Clipboard</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="tbServerIP">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">15</property>
- <property name="invisible_char">●</property>
- <signal name="activate" handler="on_tbServerIP_activate" swapped="no"/>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkRadioButton" id="rbServer">
- <property name="label" translatable="yes">Server (Player1)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </object>
- </child>
- <child>
- <object class="GtkRadioButton" id="rbClient">
- <property name="label" translatable="yes">Client (Player2)</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="xalign">0</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">rbServer</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="padding">2</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Do not change if not necessary (remember it must be changed on both sides).</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Port Number</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="tbPort">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">5</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-5">btnStart</action-widget>
- <action-widget response="-6">btnOffline</action-widget>
- </action-widgets>
- </object>
-</interface>
diff --git a/plugins/dfxvideo/draw.c b/plugins/dfxvideo/draw.c
index 2e4d0d3b..8cdaa624 100755
--- a/plugins/dfxvideo/draw.c
+++ b/plugins/dfxvideo/draw.c
@@ -49,7 +49,6 @@ unsigned short usCursorActive = 0;
#include <sys/ipc.h>
#include <sys/shm.h>
-#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XShm.h>
int xv_port = -1;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 25c36002..953ed3b5 100755
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -92,8 +92,7 @@ plugins/peopsxgl/prim.c
plugins/peopsxgl/soft.c
plugins/peopsxgl/texture.c
plugins/bladesio1/gui.c
-plugins/bladesio1/settings.c
-plugins/bladesio1/settings.h
+plugins/bladesio1/cfg.c
plugins/bladesio1/sio1.c
[type: gettext/glade]plugins/bladesio1/sio1.ui
plugins/bladesio1/sio1.h