Previous 199869 Revisions Next

r31313 Friday 18th July, 2014 at 19:39:27 UTC by hap
don't use timeBeginPeriod if options.sleep is enabled
[src/osd/windows]winmain.c

trunk/src/osd/windows/winmain.c
r31312r31313
240240
241241//static HANDLE mm_task = NULL;
242242//static DWORD task_index = 0;
243static int timeresult;
243static int timeresult = !TIMERR_NOERROR;
244244//static MMRESULT result;
245static TIMECAPS caps;
245static TIMECAPS timecaps;
246246
247247static sampling_profiler *profiler = NULL;
248248static symbol_manager *symbols = NULL;
r31312r31313
647647
648648   // crank up the multimedia timer resolution to its max
649649   // this gives the system much finer timeslices
650   timeresult = timeGetDevCaps(&caps, sizeof(caps));
651   if (timeresult == TIMERR_NOERROR)
652      timeBeginPeriod(caps.wPeriodMin);
650   if (!options.sleep())
651   {
652      timeresult = timeGetDevCaps(&timecaps, sizeof(timecaps));
653      if (timeresult == TIMERR_NOERROR)
654         timeBeginPeriod(timecaps.wPeriodMin);
655   }
653656
654657   // set our multimedia tasks if we can
655658//      if (av_set_mm_thread_characteristics != NULL)
r31312r31313
723726
724727   // restore the timer resolution
725728   if (timeresult == TIMERR_NOERROR)
726      timeEndPeriod(caps.wPeriodMin);
729      timeEndPeriod(timecaps.wPeriodMin);
727730
728731   // one last pass at events
729732   winwindow_process_events(machine(), 0, 0);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team