static void osd_exit(running_machine *machine) { // take down the watchdog thread if it exists if (watchdog_thread != NULL) { SetEvent(watchdog_exit_event); WaitForSingleObject(watchdog_thread, INFINITE); CloseHandle(watchdog_reset_event); CloseHandle(watchdog_exit_event); CloseHandle(watchdog_thread); watchdog_reset_event = NULL; watchdog_exit_event = NULL; watchdog_thread = NULL; } stop_profiler(); // turn off our multimedia tasks // if (av_revert_mm_thread_characteristics != NULL) // (*av_revert_mm_thread_characteristics)(mm_task); // restore the timer resolution if (timeresult == TIMERR_NOERROR) timeEndPeriod(caps.wPeriodMin); // one last pass at events winwindow_process_events(machine, 0); }
int osd_update(mame_time emutime) { win_window_info *window; // if we're throttling, paused, or if the UI is up, synchronize if (effective_throttle()) update_throttle(emutime); // update the FPS computations update_fps(emutime); // update all the windows, but only if we're not skipping this frame if (!skiptable[effective_frameskip()][frameskip_counter]) { profiler_mark(PROFILER_BLIT); for (window = win_window_list; window != NULL; window = window->next) winwindow_video_window_update(window); profiler_mark(PROFILER_END); } // if we're throttling and autoframeskip is on, adjust if (effective_throttle() && effective_autoframeskip() && frameskip_counter == 0) update_autoframeskip(); // poll the joystick values here winwindow_process_events(TRUE); wininput_poll(); check_osd_inputs(); // increment the frameskip counter frameskip_counter = (frameskip_counter + 1) % FRAMESKIP_LEVELS; // return whether or not to skip the next frame return skiptable[effective_frameskip()][frameskip_counter]; }
void windows_osd_interface::poll_input(void) { // poll the joystick values here winwindow_process_events(machine(), TRUE, FALSE); wininput_poll(machine()); check_osd_inputs(machine()); }
void winwindow_process_events_periodic(void) { osd_ticks_t curr; assert(GetCurrentThreadId() == main_threadid); // update once every 1/8th of a second curr = osd_ticks(); if (curr - last_event_check < osd_ticks_per_second() / 8) return; winwindow_process_events(TRUE); }
void windows_osd_interface::update(bool skip_redraw) { // ping the watchdog on each update winmain_watchdog_ping(); // if we're not skipping this redraw, update all windows if (!skip_redraw) for (win_window_info *window = win_window_list; window != NULL; window = window->next) winwindow_video_window_update(window); // poll the joystick values here winwindow_process_events(machine(), TRUE, FALSE); wininput_poll(machine()); check_osd_inputs(machine()); }
static void osd_exit(running_machine *machine) { stop_profiler(); // turn off our multimedia tasks // if (av_revert_mm_thread_characteristics != NULL) // (*av_revert_mm_thread_characteristics)(mm_task); // restore the timer resolution if (timeresult == TIMERR_NOERROR) timeEndPeriod(caps.wPeriodMin); // one last pass at events winwindow_process_events(0); }
void windows_osd_interface::update(bool skip_redraw) { // ping the watchdog on each update winmain_watchdog_ping(); // if we're not skipping this redraw, update all windows if (!skip_redraw) for (win_window_info *window = win_window_list; window != NULL; window = window->next) winwindow_video_window_update(window); // poll the joystick values here winwindow_process_events(machine(), TRUE, FALSE); wininput_poll(machine()); check_osd_inputs(machine()); // if we're running, disable some parts of the debugger if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0) debugger_update(); }
void windows_osd_interface::update(bool skip_redraw) { osd_common_t::update(skip_redraw); // if we're not skipping this redraw, update all windows if (!skip_redraw) { // profiler_mark(PROFILER_BLIT); for (auto window : osd_common_t::s_window_list) window->update(); // profiler_mark(PROFILER_END); } // poll the joystick values here winwindow_process_events(machine(), TRUE, FALSE); poll_input(machine()); check_osd_inputs(); // if we're running, disable some parts of the debugger if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0) debugger_update(); }
int utf8_main(int argc, char **argv) { int game_index; char *ext; int res = 0; HMODULE library; // initialize common controls InitCommonControls(); // set up exception handling pass_thru_filter = SetUnhandledExceptionFilter(exception_filter); #ifndef WINUI // check for double-clicky starts if (check_for_double_click_start(argc) != 0) return 1; #endif // see if we can use TryEnterCriticalSection try_enter_critical_section = NULL; library = LoadLibrary(TEXT("kernel32.dll")); if (library != NULL) try_enter_critical_section = (try_enter_critical_section_ptr)GetProcAddress(library, "TryEnterCriticalSection"); strcpy(mapfile_name, argv[0]); ext = strchr(mapfile_name, '.'); if (ext) strcpy(ext, ".map"); else strcat(mapfile_name, ".map"); // parse config and cmdline options game_index = cli_frontend_init(argc, argv); // have we decided on a game? if (game_index != -1) { TIMECAPS caps; MMRESULT result; // crank up the multimedia timer resolution to its max // this gives the system much finer timeslices result = timeGetDevCaps(&caps, sizeof(caps)); if (result == TIMERR_NOERROR) timeBeginPeriod(caps.wPeriodMin); start_profiler(); // run the game res = run_game(game_index); stop_profiler(); // restore the timer resolution if (result == TIMERR_NOERROR) timeEndPeriod(caps.wPeriodMin); } // one last pass at events winwindow_process_events(0); // close errorlog, input and playback cli_frontend_exit(); return res; }