From 5ed8ffa653e5bbcdcc86bd2b499669c3abbb12c7 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Fri, 4 Jun 2010 00:31:29 +0000 Subject: 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 --- ChangeLog | 6 ++++++ gui/Plugin.c | 20 ++++++++++++++------ 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 + + * 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 * 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(); -- cgit v1.2.3