diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-07 05:25:19 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-07-07 05:25:19 +0000 |
| commit | 14b4acb8311b0c513150e44a8fc300907523d194 (patch) | |
| tree | 03b52524237628153880d2aa7fc0c336ed8db381 /libpcsxcore | |
| parent | dd4b2eaa7fc19e3988b6a6a6e41f0784126ef7b3 (diff) | |
| download | pcsxr-14b4acb8311b0c513150e44a8fc300907523d194.tar.gz | |
#ifdef'ed out Sio1 interface for now (using uninitialized ptr in plugins.c could result in potential bad thing)
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@54254 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/plugins.c | 34 | ||||
| -rw-r--r-- | libpcsxcore/plugins.h | 6 | ||||
| -rw-r--r-- | libpcsxcore/psxhw.c | 76 |
3 files changed, 76 insertions, 40 deletions
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index d1371751..6b23e12e 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -136,6 +136,8 @@ NETrecvPadData NET_recvPadData; NETsetInfo NET_setInfo;
NETkeypressed NET_keypressed;
+#ifdef ENABLE_SIO1API
+
SIO1init SIO1_init;
SIO1shutdown SIO1_shutdown;
SIO1open SIO1_open;
@@ -170,6 +172,8 @@ SIO1readBaud16 SIO1_readBaud16; SIO1readBaud32 SIO1_readBaud32;
SIO1registerCallback SIO1_registerCallback;
+#endif
+
static const char *err;
#define CheckErr(func) { \
@@ -596,6 +600,8 @@ static int LoadNETplugin(const char *NETdll) { return 0;
}
+#ifdef ENABLE_SIO1API
+
void *hSIO1Driver = NULL;
long CALLBACK SIO1__init(void) { return 0; }
@@ -648,13 +654,13 @@ void CALLBACK SIO1irq(void) { static int LoadSIO1plugin(const char *SIO1dll) {
void *drv;
-/*
+
hSIO1Driver = SysLoadLibrary(SIO1dll);
if (hSIO1Driver == NULL) {
SysMessage (_("Could not load SIO1 plugin %s!"), SIO1dll); return -1;
}
drv = hSIO1Driver;
-*/
+
LoadSio1Sym0(init, "SIO1init");
LoadSio1Sym0(shutdown, "SIO1shutdown");
LoadSio1Sym0(open, "SIO1open");
@@ -691,6 +697,8 @@ static int LoadSIO1plugin(const char *SIO1dll) { return 0;
}
+#endif
+
void CALLBACK clearDynarec(void) {
psxCpu->Reset();
}
@@ -727,9 +735,11 @@ int LoadPlugins() { sprintf(Plugin, "%s/%s", Config.PluginsDir, Config.Net);
if (LoadNETplugin(Plugin) == -1) Config.UseNet = FALSE;
}
-
+
+#ifdef ENABLE_SIO1API
sprintf(Plugin, "%s/%s", Config.PluginsDir, Config.Sio1);
- if (LoadSIO1plugin(Plugin) == -1) return -1;
+ if (LoadSIO1plugin(Plugin) == -1) return -1;
+#endif
ret = CDR_init();
if (ret < 0) { SysMessage (_("Error initializing CD-ROM plugin: %d"), ret); return -1; }
@@ -746,9 +756,11 @@ int LoadPlugins() { ret = NET_init();
if (ret < 0) { SysMessage (_("Error initializing NetPlay plugin: %d"), ret); return -1; }
}
-
+
+#ifdef ENABLE_SIO1API
ret = SIO1_init();
- if (ret < 0) { SysMessage (_("Error initializing SIO1 plugin: %d"), ret); return -1; }
+ if (ret < 0) { SysMessage (_("Error initializing SIO1 plugin: %d"), ret); return -1; }
+#endif
SysPrintf(_("Plugins loaded.\n"));
return 0;
@@ -766,7 +778,6 @@ void ReleasePlugins() { if (hSPUDriver != NULL) SPU_shutdown();
if (hPAD1Driver != NULL) PAD1_shutdown();
if (hPAD2Driver != NULL) PAD2_shutdown();
- if (hSIO1Driver != NULL) SIO1_shutdown();
if (Config.UseNet && hNETDriver != NULL) NET_shutdown();
@@ -775,11 +786,18 @@ void ReleasePlugins() { if (hSPUDriver != NULL) SysCloseLibrary(hSPUDriver); hSPUDriver = NULL;
if (hPAD1Driver != NULL) SysCloseLibrary(hPAD1Driver); hPAD1Driver = NULL;
if (hPAD2Driver != NULL) SysCloseLibrary(hPAD2Driver); hPAD2Driver = NULL;
- if (hSIO1Driver != NULL) SysCloseLibrary(hSIO1Driver); hSIO1Driver = NULL;
if (Config.UseNet && hNETDriver != NULL) {
SysCloseLibrary(hNETDriver); hNETDriver = NULL;
}
+
+#ifdef ENABLE_SIO1API
+ if (hSIO1Driver != NULL) {
+ SIO1_shutdown();
+ SysCloseLibrary(hSIO1Driver);
+ hSIO1Driver = NULL;
+ }
+#endif
}
void SetIsoFile(const char *filename) {
diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index 20fde072..68527c5d 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -26,6 +26,8 @@ extern "C" { #include "psxcommon.h"
+//#define ENABLE_SIO1API 1
+
#ifndef _WIN32
typedef void* HWND;
@@ -322,6 +324,8 @@ extern NETrecvPadData NET_recvPadData; extern NETsetInfo NET_setInfo;
extern NETkeypressed NET_keypressed;
+#ifdef ENABLE_SIO1API
+
// SIO1 Functions (link cable)
typedef long (CALLBACK* SIO1init)(void);
typedef long (CALLBACK* SIO1shutdown)(void);
@@ -391,6 +395,8 @@ extern SIO1readBaud16 SIO1_readBaud16; extern SIO1readBaud32 SIO1_readBaud32;
extern SIO1registerCallback SIO1_registerCallback;
+#endif
+
void CALLBACK clearDynarec(void);
void SetIsoFile(const char *filename);
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c index b07b035e..9123f76c 100644 --- a/libpcsxcore/psxhw.c +++ b/libpcsxcore/psxhw.c @@ -40,8 +40,10 @@ u8 psxHwRead8(u32 add) { unsigned char hard; switch (add) { - case 0x1f801040: hard = sioRead8();break; - case 0x1f801050: hard = SIO1_readData8(); break; + case 0x1f801040: hard = sioRead8();break;
+#ifdef ENABLE_SIO1API + case 0x1f801050: hard = SIO1_readData8(); break;
+#endif case 0x1f801800: hard = cdrRead0(); break; case 0x1f801801: hard = cdrRead1(); break; case 0x1f801802: hard = cdrRead2(); break; @@ -103,19 +105,21 @@ u16 psxHwRead16(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read16 %x; ret = %x\n", add&0xf, hard); #endif + return hard;
+#ifdef ENABLE_SIO1API + case 0x1f801050: + hard = SIO1_readData16(); return hard; - case 0x1f801050: - hard = SIO1_readData16(); - return hard; - case 0x1f801054: - hard = SIO1_readStat16(); - return hard; - case 0x1f80105a: - hard = SIO1_readCtrl16(); - return hard; - case 0x1f80105e: - hard = SIO1_readBaud16(); - return hard; + case 0x1f801054: + hard = SIO1_readStat16(); + return hard; + case 0x1f80105a: + hard = SIO1_readCtrl16(); + return hard; + case 0x1f80105e: + hard = SIO1_readBaud16(); + return hard;
+#endif case 0x1f801100: hard = psxRcntRcount(0); #ifdef PSXHW_LOG @@ -204,10 +208,12 @@ u32 psxHwRead32(u32 add) { #ifdef PAD_LOG PAD_LOG("sio read32 ;ret = %x\n", hard); #endif - return hard; + return hard;
+#ifdef ENABLE_SIO1API case 0x1f801050: - hard = SIO1_readData32(); - return hard; + hard = SIO1_readData32(); + return hard;
+#endif #ifdef PSXHW_LOG case 0x1f801060: PSXHW_LOG("RAM size read %x\n", psxHu32(0x1060)); @@ -342,8 +348,10 @@ u32 psxHwRead32(u32 add) { void psxHwWrite8(u32 add, u8 value) { switch (add) { - case 0x1f801040: sioWrite8(value); break; - case 0x1f801050: SIO1_writeData8(value); break; + case 0x1f801040: sioWrite8(value); break;
+#ifdef ENABLE_SIO1API + case 0x1f801050: SIO1_writeData8(value); break;
+#endif case 0x1f801800: cdrWrite0(value); break; case 0x1f801801: cdrWrite1(value); break; case 0x1f801802: cdrWrite2(value); break; @@ -394,19 +402,21 @@ void psxHwWrite16(u32 add, u16 value) { #ifdef PAD_LOG PAD_LOG ("sio write16 %x, %x\n", add&0xf, value); #endif + return;
+#ifdef ENABLE_SIO1API + case 0x1f801050: + SIO1_writeData16(value); + return; + case 0x1f801054: + SIO1_writeStat16(value); return; - case 0x1f801050: - SIO1_writeData16(value); - return; - case 0x1f801054: - SIO1_writeStat16(value); - return; case 0x1f80105a: - SIO1_writeCtrl16(value); - return; + SIO1_writeCtrl16(value); + return; case 0x1f80105e: - SIO1_writeBaud16(value); - return; + SIO1_writeBaud16(value); + return;
+#endif case 0x1f801070: #ifdef PSXHW_LOG PSXHW_LOG("IREG 16bit write %x\n", value); @@ -507,10 +517,12 @@ void psxHwWrite32(u32 add, u32 value) { #ifdef PAD_LOG PAD_LOG("sio write32 %x\n", value); #endif - return; + return;
+#ifdef ENABLE_SIO1API case 0x1f801050: - SIO1_writeData32(value); - return; + SIO1_writeData32(value); + return;
+#endif #ifdef PSXHW_LOG case 0x1f801060: PSXHW_LOG("RAM size write %x\n", value); |
