Example #1
0
bool render_screen (bool immediate)
{
	if (savestate_state == STATE_DOSAVE) {
		if (delay_savestate_frame > 0)
			--delay_savestate_frame;
		else {
			CreateScreenshot();
			save_thumb(screenshot_filename);
			savestate_state = 0;
		}
	}

#ifdef WITH_LOGGING
  RefreshLiveInfo();
#endif
  
	return true;
}
Example #2
0
void flush_screen ()
{
	if (savestate_state == STATE_DOSAVE)
	{
    if(delay_savestate_frame > 0)
      --delay_savestate_frame;
    else
    {
	    CreateScreenshot();
		  save_thumb(screenshot_filename);
	    savestate_state = 0;
    }
  }

#ifdef WITH_LOGGING
  RefreshLiveInfo();
#endif

  unsigned long start = read_processor_time();
  if(current_vsync_frame == 0) 
  {
    // Old style for vsync and idle time calc
    if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
      usleep((next_synctime - start) - 750);
    ioctl(fbdev, OMAPFB_WAITFORVSYNC, &current_vsync_frame);
  } 
  else 
    {
    // New style for vsync and idle time calc
    int wait_till = current_vsync_frame;
    do 
    {
      ioctl(fbdev, OMAPFB_WAITFORVSYNC_FRAME, &current_vsync_frame);
    } while (wait_till >= current_vsync_frame);
    
    if(wait_till + 1 != current_vsync_frame) 
    {
      // We missed a vsync...
      next_synctime = 0;
    }
    current_vsync_frame += currprefs.gfx_framerate;
  }
    
  last_synctime = read_processor_time();
  SDL_Flip(prSDLScreen);

  if(!screen_is_picasso)
  	gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;

  if(last_synctime - next_synctime > time_per_frame * (1 + currprefs.gfx_framerate) - 1000 || next_synctime < start)
    adjust_idletime(-1);
  else
    adjust_idletime(next_synctime - start);
  
  if (last_synctime - next_synctime > time_per_frame - (long)5000)
    next_synctime = last_synctime + time_per_frame * (1 + currprefs.gfx_framerate);
  else
    next_synctime = next_synctime + time_per_frame * (1 + currprefs.gfx_framerate);

	init_row_map();
}