frontend: don't update during reset
authornotaz <notasas@gmail.com>
Fri, 4 Jan 2013 22:06:41 +0000 (00:06 +0200)
committernotaz <notasas@gmail.com>
Sat, 5 Jan 2013 17:21:12 +0000 (19:21 +0200)
otherwise update thread may collect input events that really
belong to UI. Another hack :(

frontend/main.c
frontend/main.h
frontend/plugin_lib.c

index bd48898..43a1a03 100644 (file)
@@ -48,7 +48,7 @@ extern int iUseInterpolation;
 extern int iXAPitch;
 extern int iVolume;
 
 extern int iXAPitch;
 extern int iVolume;
 
-int ready_to_go;
+int ready_to_go, g_resetting;
 unsigned long gpuDisp;
 char cfgfile_basename[MAXPATHLEN];
 int state_slot;
 unsigned long gpuDisp;
 char cfgfile_basename[MAXPATHLEN];
 int state_slot;
@@ -676,6 +676,7 @@ void SysReset() {
        // so we need to prevent updateLace() call..
        void *real_lace = GPU_updateLace;
        GPU_updateLace = dummy_lace;
        // so we need to prevent updateLace() call..
        void *real_lace = GPU_updateLace;
        GPU_updateLace = dummy_lace;
+       g_resetting = 1;
 
        // reset can run code, timing must be set
        pl_timing_prepare(Config.PsxType);
 
        // reset can run code, timing must be set
        pl_timing_prepare(Config.PsxType);
@@ -686,6 +687,7 @@ void SysReset() {
        CDR_stop();
 
        GPU_updateLace = real_lace;
        CDR_stop();
 
        GPU_updateLace = real_lace;
+       g_resetting = 0;
 }
 
 void SysClose() {
 }
 
 void SysClose() {
index 45e0aeb..d971890 100644 (file)
@@ -52,7 +52,7 @@ int emu_load_state(int slot);
 void set_cd_image(const char *fname);
 
 extern unsigned long gpuDisp;
 void set_cd_image(const char *fname);
 
 extern unsigned long gpuDisp;
-extern int ready_to_go;
+extern int ready_to_go, g_resetting;
 
 extern char hud_msg[64];
 extern int hud_new_msg;
 
 extern char hud_msg[64];
 extern int hud_new_msg;
index 472a1b2..dfff868 100644 (file)
@@ -606,6 +606,9 @@ void pl_frame_limit(void)
        struct timeval now;
        int diff, usadj;
 
        struct timeval now;
        int diff, usadj;
 
+       if (g_resetting)
+               return;
+
        vsync_cnt++;
 
        /* doing input here because the pad is polled
        vsync_cnt++;
 
        /* doing input here because the pad is polled