void throttle_interval_event(int index) { event_repeat(index, 27000000 / 60); gui_do_stuff(); throttle_timer_wait(); }
static void event_dispatch (struct event *e, struct event **p, unsigned long long ts) { sexpr t = e->then; e->queue_time = dt_from_unix (ts); output (e->output); event_repeat (e, p); if (!eolp (t)) { event_add (t); } event_queue (); }
static void watchdog_event(int index) { if (watchdog.control & 1) { watchdog.status = 1; if (watchdog.control & 2) { gui_console_printf("[CEmu] Watchdog reset triggered.\n"); cpuEvents |= EVENT_RESET; } if (watchdog.control & 4) { cpu_nmi(); gui_console_printf("[CEmu] Watchdog NMI triggered.\n"); } event_repeat(index, watchdog.load); } }
static void watchdog_event(int index) { (void)index; if (watchdog.control & 1) { if (--watchdog.count == 0) { watchdog.status = 1; watchdog.count = watchdog.load; } } if ((watchdog.count == 0) && ((watchdog.control & 2) || (watchdog.control & 1))) { cpu_events |= EVENT_RESET; gui_console_printf("Watchdog reset triggered..."); } else { //intrpt_trigger(INT_WATCHDOG, INTERRUPT_SET); // TODO event_repeat(SCHED_WATCHDOG, watchdog.load); } }
void throttle_interval_event(int index) { event_repeat(index, 27000000 / 100); /* Throttle interval (defined arbitrarily as 100Hz) - used for * keeping the emulator speed down, and other miscellaneous stuff * that needs to be done periodically */ static int intervals = 0, prev_intervals = 0; intervals += 1; usblink_timer(); usblink_queue_do(); int c = gui_getchar(); if(c != -1) serial_byte_in((char) c); gdbstub_recv(); rdebug_recv(); // Calculate speed auto interval_end = std::chrono::high_resolution_clock::now(); static auto prev = interval_end; static double speed = 1.0; auto time = std::chrono::duration_cast<std::chrono::microseconds>(interval_end - prev).count(); if (time >= 500000) { speed = (double)10000 * (intervals - prev_intervals) / time; gui_show_speed(speed); prev_intervals = intervals; prev = interval_end; } gui_do_stuff(true); if (!turbo_mode) throttle_timer_wait(); }
void throttle_interval_event(int index) { event_repeat(index, 27000000 / 60); static int intervals = 0, prev_intervals = 0; intervals += 1; // Calculate speed auto interval_end = std::chrono::high_resolution_clock::now(); static auto prev = interval_end; static double speed = 1.0; auto time = std::chrono::duration_cast<std::chrono::microseconds>(interval_end - prev).count(); if (time >= 500000) { speed = (double)10000 * (intervals - prev_intervals) / time; prev_intervals = intervals; prev = interval_end; } gui_do_stuff(true); if (speed > 0.7) { throttle_timer_wait(); } }
static void rtc_event(int index) { /* Update exactly once a second */ event_repeat(index, 32768); if (rtc.control & 1) { rtc.interrupt |= 1; } rtc.readSec++; if (rtc.readSec > 59) { rtc.readSec = 0; if (rtc.control & 2) { rtc.interrupt |= 2; intrpt_set(INT_RTC, true); } rtc.readMin++; if (rtc.readMin > 59) { rtc.readMin = 0; if (rtc.control & 4) { rtc.interrupt |= 4; intrpt_set(INT_RTC, true); } rtc.readHour++; if (rtc.readHour > 23) { rtc.readHour = 0; if (rtc.control & 8) { rtc.interrupt |= 8; intrpt_set(INT_RTC, true); } rtc.readDay++; } } } if ((rtc.control & 16) && (rtc.readSec == rtc.alarmSec) && (rtc.readMin == rtc.alarmMin) && (rtc.readHour == rtc.alarmHour)) { rtc.interrupt |= 16; intrpt_set(INT_RTC, true); } }