summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-14 09:29:16 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-05-14 09:29:16 +0000
commitf8420db1aaeb3ed3f6122b379dcc2a1d72093ec4 (patch)
treeb31bcae3b4ac19e79a79887db277c6ccc81ead45
parent830a16adf3b87c887ce43143b7f45fd8d970e608 (diff)
downloadpcsxr-f8420db1aaeb3ed3f6122b379dcc2a1d72093ec4.tar.gz
Fixed crash when launching another game if netplay plugin is selected but not used during the previously running game.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@48030 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--ChangeLog8
-rw-r--r--gui/Plugin.c6
-rw-r--r--libpcsxcore/plugins.c4
-rw-r--r--libpcsxcore/psxbios.c8
-rw-r--r--win32/gui/plugin.c6
5 files changed, 20 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 053307ba..ae34b116 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+May 14, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
+
+ * libpcsxcore/plugins.c: Fixed crash when launching another game if netplay
+ plugin is selected but not used during the previously running game.
+ * libpcsxcore/psxbios.c: Use TRUE/FALSE for Config.UseNet.
+ * gui/Plugin.c: Likewise.
+ * win32/gui/plugin.c: Likewise.
+
May 14, 2010 edgbla <edgbla@yandex.ru>
* libpcsxcore/psxinterpreter.c: Bias was moved into rec/int.
diff --git a/gui/Plugin.c b/gui/Plugin.c
index e5c4cbe8..4f9c3a3f 100644
--- a/gui/Plugin.c
+++ b/gui/Plugin.c
@@ -332,13 +332,13 @@ int _OpenPlugins() {
strcpy(Config.Mcd2, info.MCD2path);
return -2;
} else {
- Config.UseNet = 0;
+ Config.UseNet = FALSE;
}
} else {
if (NET_queryPlayer() == 1) {
- if (SendPcsxInfo() == -1) Config.UseNet = 0;
+ if (SendPcsxInfo() == -1) Config.UseNet = FALSE;
} else {
- if (RecvPcsxInfo() == -1) Config.UseNet = 0;
+ if (RecvPcsxInfo() == -1) Config.UseNet = FALSE;
}
}
NetOpened = TRUE;
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c
index fba84ee1..b70d4220 100644
--- a/libpcsxcore/plugins.c
+++ b/libpcsxcore/plugins.c
@@ -614,9 +614,9 @@ int LoadPlugins() {
void ReleasePlugins() {
if (Config.UseNet) {
int ret = NET_close();
- if (ret < 0) Config.UseNet = 0;
- NetOpened = FALSE;
+ if (ret < 0) Config.UseNet = FALSE;
}
+ NetOpened = FALSE;
if (hCDRDriver != NULL || cdrIsoActive()) CDR_shutdown();
if (hGPUDriver != NULL) GPU_shutdown();
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c
index 2f49fdf6..ff436252 100644
--- a/libpcsxcore/psxbios.c
+++ b/libpcsxcore/psxbios.c
@@ -239,8 +239,8 @@ typedef struct {
static u32 *jmp_int = NULL;
static int *pad_buf = NULL;
-static char *pad_buf1, *pad_buf2;//shadow add
-static int pad_buf1len, pad_buf2len;//shadow add
+static char *pad_buf1 = NULL, *pad_buf2 = NULL;
+static int pad_buf1len, pad_buf2len;
static u32 regs[35];
static EvCB *Event;
@@ -2239,7 +2239,7 @@ void biosInterrupt() {
int i, bufcount;
// if (psxHu32(0x1070) & 0x1) { // Vsync
- if (pad_buf) {
+ if (pad_buf != NULL) {
u32 *buf = (u32*)pad_buf;
if (!Config.UseNet) {
@@ -2288,7 +2288,7 @@ void biosInterrupt() {
netError();
}
}
- if (Config.UseNet && pad_buf1 && pad_buf2) {
+ if (Config.UseNet && pad_buf1 != NULL && pad_buf2 != NULL) {
psxBios_PADpoll(1);
if (NET_sendPadData(pad_buf1, i) == -1)
diff --git a/win32/gui/plugin.c b/win32/gui/plugin.c
index 20a18db3..cab6d36b 100644
--- a/win32/gui/plugin.c
+++ b/win32/gui/plugin.c
@@ -254,16 +254,16 @@ int _OpenPlugins(HWND hWnd) {
strcpy(Config.Mcd2, info.MCD2path);
return -2;
} else {
- Config.UseNet = 0;
+ Config.UseNet = FALSE;
}
} else {
HWND hW = CreateDialog(gApp.hInstance, MAKEINTRESOURCE(IDD_CONNECT), gApp.hWnd, ConnectDlgProc);
ShowWindow(hW, SW_SHOW);
if (NET_queryPlayer() == 1) {
- if (SendPcsxInfo() == -1) Config.UseNet = 0;
+ if (SendPcsxInfo() == -1) Config.UseNet = FALSE;
} else {
- if (RecvPcsxInfo() == -1) Config.UseNet = 0;
+ if (RecvPcsxInfo() == -1) Config.UseNet = FALSE;
}
DestroyWindow(hW);