summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-06-04 00:31:29 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-06-04 00:31:29 +0000
commit5ed8ffa653e5bbcdcc86bd2b499669c3abbb12c7 (patch)
tree71a6516c5469c3e142bbbf6946d615cbc1cbae14
parentb0063e567d1882b0256e7752eb45a2164b9caeca (diff)
downloadpcsxr-5ed8ffa653e5bbcdcc86bd2b499669c3abbb12c7.tar.gz
GTK GUI: Hack-fixed the bug which causes crash when loading state with dynarec CPU core. A large amount of refactor is needed for a proper fix.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@50866 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--ChangeLog6
-rw-r--r--gui/Plugin.c20
2 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b13f581a..6ff66be5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Jun 4, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
+
+ * gui/Plugin.c: Hack-fixed the bug which causes crash when loading state
+ with dynarec CPU core. A large amount of refactor is needed for a proper
+ fix.
+
Jun 3, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
* libpcsxcore/cheat.c: Fixed endianness issue (not tested).
diff --git a/gui/Plugin.c b/gui/Plugin.c
index 4f9c3a3f..867fce03 100644
--- a/gui/Plugin.c
+++ b/gui/Plugin.c
@@ -75,8 +75,6 @@ void gpuShowPic() {
}
}
-
-
void KeyStateSave(int i) {
gchar *state_filename;
@@ -93,10 +91,14 @@ void KeyStateLoad(int i) {
state_load (state_filename);
g_free (state_filename);
-}
+ // HACKHACK: prevent crash when using recompiler due to execution not
+ // returned from compiled code. This WILL cause memory leak, however a
+ // large amount of refactor is needed for a proper fix.
+ if (Config.Cpu == CPU_DYNAREC) psxCpu->Execute();
+}
-static short modctrl=0, modalt=0;
+static short modctrl = 0, modalt = 0;
/* Handle keyboard keystrokes */
void PADhandleKey(int key) {
@@ -178,7 +180,7 @@ void PADhandleKey(int key) {
state_save (state_filename);
g_free (state_filename);
-
+
if (ShowPic) { ShowPic = 0; gpuShowPic(); }
break;
@@ -191,8 +193,14 @@ void PADhandleKey(int key) {
case XK_F3:
state_filename = get_state_filename (StatesC);
state_load (state_filename);
-
+
g_free (state_filename);
+
+ // HACKHACK: prevent crash when using recompiler due to execution not
+ // returned from compiled code. This WILL cause memory leak, however a
+ // large amount of refactor is needed for a proper fix.
+ if (Config.Cpu == CPU_DYNAREC) psxCpu->Execute();
+
break;
case XK_F4:
gpuShowPic();