trunk/src/osd/windows/winmain.c
| r31312 | r31313 | |
| 240 | 240 | |
| 241 | 241 | //static HANDLE mm_task = NULL; |
| 242 | 242 | //static DWORD task_index = 0; |
| 243 | | static int timeresult; |
| 243 | static int timeresult = !TIMERR_NOERROR; |
| 244 | 244 | //static MMRESULT result; |
| 245 | | static TIMECAPS caps; |
| 245 | static TIMECAPS timecaps; |
| 246 | 246 | |
| 247 | 247 | static sampling_profiler *profiler = NULL; |
| 248 | 248 | static symbol_manager *symbols = NULL; |
| r31312 | r31313 | |
| 647 | 647 | |
| 648 | 648 | // crank up the multimedia timer resolution to its max |
| 649 | 649 | // 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 | } |
| 653 | 656 | |
| 654 | 657 | // set our multimedia tasks if we can |
| 655 | 658 | // if (av_set_mm_thread_characteristics != NULL) |
| r31312 | r31313 | |
| 723 | 726 | |
| 724 | 727 | // restore the timer resolution |
| 725 | 728 | if (timeresult == TIMERR_NOERROR) |
| 726 | | timeEndPeriod(caps.wPeriodMin); |
| 729 | timeEndPeriod(timecaps.wPeriodMin); |
| 727 | 730 | |
| 728 | 731 | // one last pass at events |
| 729 | 732 | winwindow_process_events(machine(), 0, 0); |