void osd_init(running_machine *machine) { int watchdog = options_get_int(mame_options(), WINOPTION_WATCHDOG); const char *stemp; // thread priority if (!(machine->debug_flags & DEBUG_FLAG_OSD_ENABLED)) SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY)); // ensure we get called on the way out add_exit_callback(machine, osd_exit); // get number of processors stemp = options_get_string(mame_options(), WINOPTION_NUMPROCESSORS); osd_num_processors = 0; if (strcmp(stemp, "auto") != 0) { osd_num_processors = atoi(stemp); if (osd_num_processors < 1) { mame_printf_warning("Warning: numprocessors < 1 doesn't make much sense. Assuming auto ...\n"); osd_num_processors = 0; } } // initialize the subsystems winvideo_init(machine); winsound_init(machine); wininput_init(machine); winoutput_init(machine); // hook up the debugger log if (options_get_bool(mame_options(), WINOPTION_OSLOG)) add_logerror_callback(machine, output_oslog); // 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); // set our multimedia tasks if we can // if (av_set_mm_thread_characteristics != NULL) // mm_task = (*av_set_mm_thread_characteristics)(TEXT("Playback"), &task_index); start_profiler(); // if a watchdog thread is requested, create one if (watchdog != 0) { watchdog_reset_event = CreateEvent(NULL, FALSE, FALSE, NULL); assert_always(watchdog_reset_event != NULL, "Failed to create watchdog reset event"); watchdog_exit_event = CreateEvent(NULL, TRUE, FALSE, NULL); assert_always(watchdog_exit_event != NULL, "Failed to create watchdog exit event"); watchdog_thread = CreateThread(NULL, 0, watchdog_thread_entry, (LPVOID)(FPTR)watchdog, 0, NULL); assert_always(watchdog_thread != NULL, "Failed to create watchdog thread"); } }
void osd_init(running_machine *machine) { // thread priority if (!options_get_bool(mame_options(), OPTION_DEBUG)) SetThreadPriority(GetCurrentThread(), options_get_int(mame_options(), WINOPTION_PRIORITY)); // ensure we get called on the way out add_exit_callback(machine, osd_exit); // initialize the subsystems winvideo_init(machine); winsound_init(machine); wininput_init(machine); winoutput_init(machine); // hook up the debugger log if (options_get_bool(mame_options(), WINOPTION_OSLOG)) add_logerror_callback(machine, output_oslog); // 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); // set our multimedia tasks if we can // if (av_set_mm_thread_characteristics != NULL) // mm_task = (*av_set_mm_thread_characteristics)(TEXT("Playback"), &task_index); start_profiler(); }
int osd_init(running_machine *machine) { extern int win_erroroslog; int result = 0; if (result == 0) result = winvideo_init(machine); if (result == 0) result = wininput_init(machine); if (result == 0) winoutput_init(machine); #ifdef MESS if (result == 0) result = win_parallel_init(); #endif if (win_erroroslog) add_logerror_callback(machine, output_oslog); return result; }