summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winmain.c
diff options
context:
space:
mode:
author Michaël Banaan Ananas <happppp@users.noreply.github.com>2014-07-18 19:39:27 +0000
committer Michaël Banaan Ananas <happppp@users.noreply.github.com>2014-07-18 19:39:27 +0000
commit307c7aeeef91a3307e2f3dc12b8eafd8df05f6eb (patch)
treea546abffc2d3c9fdd47c84e0c1431233a2a1f5d0 /src/osd/windows/winmain.c
parent8abfa8c0e11417f217d7b9ce40d0eca88b8f1b63 (diff)
don't use timeBeginPeriod if options.sleep is enabled
Diffstat (limited to 'src/osd/windows/winmain.c')
-rw-r--r--src/osd/windows/winmain.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index c24112c2207..c6e4f549c6e 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -240,9 +240,9 @@ static running_machine *g_current_machine;
//static HANDLE mm_task = NULL;
//static DWORD task_index = 0;
-static int timeresult;
+static int timeresult = !TIMERR_NOERROR;
//static MMRESULT result;
-static TIMECAPS caps;
+static TIMECAPS timecaps;
static sampling_profiler *profiler = NULL;
static symbol_manager *symbols = NULL;
@@ -647,9 +647,12 @@ void windows_osd_interface::init(running_machine &machine)
// crank up the multimedia timer resolution to its max
// this gives the system much finer timeslices
- timeresult = timeGetDevCaps(&caps, sizeof(caps));
- if (timeresult == TIMERR_NOERROR)
- timeBeginPeriod(caps.wPeriodMin);
+ if (!options.sleep())
+ {
+ timeresult = timeGetDevCaps(&timecaps, sizeof(timecaps));
+ if (timeresult == TIMERR_NOERROR)
+ timeBeginPeriod(timecaps.wPeriodMin);
+ }
// set our multimedia tasks if we can
// if (av_set_mm_thread_characteristics != NULL)
@@ -723,7 +726,7 @@ void windows_osd_interface::osd_exit()
// restore the timer resolution
if (timeresult == TIMERR_NOERROR)
- timeEndPeriod(caps.wPeriodMin);
+ timeEndPeriod(timecaps.wPeriodMin);
// one last pass at events
winwindow_process_events(machine(), 0, 0);