pandora: use quad buffering so that ff doesn't tear
[picodrive.git] / platform / common / emu.c
index b828595..1573d12 100644 (file)
@@ -48,7 +48,8 @@ currentConfig_t currentConfig, defaultConfig;
 int state_slot = 0;\r
 int config_slot = 0, config_slot_current = 0;\r
 int pico_pen_x = 320/2, pico_pen_y = 240/2;\r
-int pico_inp_mode = 0;\r
+int pico_inp_mode;\r
+int flip_after_sync;\r
 int engineState = PGS_Menu;\r
 \r
 static short __attribute__((aligned(4))) sndBuffer[2*44100/50];\r
@@ -1369,10 +1370,8 @@ void emu_loop(void)
                        sprintf(fpsbuff, "%02i/%02i/%02i", frames_shown, bench_fps_s, (bf[0]+bf[1]+bf[2]+bf[3])>>2);\r
                        printf("%s\n", fpsbuff);\r
 #else\r
-                       if (currentConfig.EmuOpt & EOPT_SHOW_FPS) {\r
-                               sprintf(fpsbuff, "%02i/%02i", frames_shown, frames_done);\r
-                               if (fpsbuff[5] == 0) { fpsbuff[5] = fpsbuff[6] = ' '; fpsbuff[7] = 0; }\r
-                       }\r
+                       if (currentConfig.EmuOpt & EOPT_SHOW_FPS)\r
+                               sprintf(fpsbuff, "%02i/%02i  ", frames_shown, frames_done);\r
 #endif\r
                        frames_shown = frames_done = 0;\r
                        timestamp_fps += ms_to_ticks(1000);\r
@@ -1431,7 +1430,8 @@ void emu_loop(void)
                PicoFrame();\r
                pemu_finalize_frame(fpsbuff, notice_msg);\r
 \r
-               // plat_video_flip();\r
+               if (!flip_after_sync)\r
+                       plat_video_flip();\r
 \r
                /* frame limiter */\r
                if (!reset_timing && !(currentConfig.EmuOpt & (EOPT_NO_FRMLIMIT|EOPT_EXT_FRMLIMIT)))\r
@@ -1449,9 +1449,8 @@ void emu_loop(void)
                        }\r
                }\r
 \r
-               // XXX: for some plats it might be better to flip before vsync\r
-               // (due to shadow registers in display hw)\r
-               plat_video_flip();\r
+               if (flip_after_sync)\r
+                       plat_video_flip();\r
 \r
                pframes_done++; frames_done++; frames_shown++;\r
 \r