recompilation-caused frameskip workaround
authornotaz <notasas@gmail.com>
Wed, 5 Oct 2011 20:32:35 +0000 (23:32 +0300)
committernotaz <notasas@gmail.com>
Sat, 8 Oct 2011 00:29:24 +0000 (03:29 +0300)
frontend/plugin_lib.c
libpcsxcore/new_dynarec/emu_if.c
libpcsxcore/new_dynarec/new_dynarec.c
libpcsxcore/new_dynarec/new_dynarec.h

index c719f48..084ff1e 100644 (file)
@@ -264,7 +264,7 @@ void pl_update_gun(int *xn, int *xres, int *y, int *in)
 void pl_frame_limit(void)
 {
        static struct timeval tv_old, tv_expect;
-       static int vsync_cnt_prev;
+       static int vsync_cnt_prev, drc_active_vsyncs;
        struct timeval now;
        int diff, usadj;
 
@@ -333,6 +333,17 @@ void pl_frame_limit(void)
                        pl_rearmed_cbs.fskip_advice = 1;
                else if (diff >= 0)
                        pl_rearmed_cbs.fskip_advice = 0;
+
+               // recompilation is not that fast and may cause frame skip on
+               // loading screens and such, resulting in flicker or glitches
+               if (new_dynarec_did_compile) {
+                       if (drc_active_vsyncs < 32)
+                               pl_rearmed_cbs.fskip_advice = 0;
+                       drc_active_vsyncs++;
+               }
+               else
+                       drc_active_vsyncs = 0;
+               new_dynarec_did_compile = 0;
        }
 
        pcnt_start(PCNT_ALL);
index 02433f1..56c6b77 100644 (file)
@@ -300,6 +300,7 @@ unsigned short hword;
 unsigned char byte;
 int pending_exception, stop;
 unsigned int next_interupt;
+int new_dynarec_did_compile;
 void *psxH_ptr;
 void new_dynarec_init() {}
 void new_dyna_start() {}
index 0128758..a263564 100644 (file)
@@ -136,6 +136,7 @@ struct ll_entry
   static const u_int using_tlb=0;
 #endif
   static u_int sp_in_mirror;
+  int new_dynarec_did_compile;
   u_int stop_after_jal;
   extern u_char restore_candidate[512];
   extern int cycle_count;
@@ -8011,6 +8012,7 @@ int new_recompile_block(int addr)
   //rlist();
   start = (u_int)addr&~3;
   //assert(((u_int)addr&1)==0);
+  new_dynarec_did_compile=1;
 #ifdef PCSX
   if(!sp_in_mirror&&(signed int)(psxRegs.GPR.n.sp&0xffe00000)>0x80200000&&
      0x10000<=psxRegs.GPR.n.sp&&(psxRegs.GPR.n.sp&~0xe0e00000)<RAM_SIZE) {
index 14319da..2dfc55a 100644 (file)
@@ -3,6 +3,7 @@
 extern int pcaddr;
 extern int pending_exception;
 extern int stop;
+extern int new_dynarec_did_compile;
 
 void new_dynarec_init();
 void new_dynarec_cleanup();