+ // calc vsync offset to sync timing code with vsync\r
+ if (currentConfig.EmuOpt&0x2000) {\r
+ gettimeofday(&tval, 0);\r
+ gp2x_video_wait_vsync();\r
+ gettimeofday(&tval, 0);\r
+ vsync_offset = tval.tv_usec;\r
+ while (vsync_offset >= target_frametime)\r
+ vsync_offset -= target_frametime;\r
+ if (!vsync_offset) vsync_offset++;\r
+ printf("vsync_offset: %i\n", vsync_offset);\r
+ } else\r
+ vsync_offset = 0;\r
+\r