NESe (pronounced "Nessie") is a NES emulator based on the e6502 emulator, also written in C with a focus on speed and portability for use on embedded platforms, especially ARM.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

22 wiersze
376B

  1. #include "timer.h"
  2. #include <SDL2/SDL.h>
  3. time_us time_now(void) {
  4. return (SDL_GetTicks64() * 1000U);
  5. }
  6. void time_sleep(time_us sleep_us) {
  7. SDL_Delay(sleep_us / 1000U);
  8. }
  9. time_us time_sleep_until(time_us t_target) {
  10. time_us t_now = time_now();
  11. time_us t_diff = t_target - t_now;
  12. if (t_diff > 0) {
  13. time_sleep(t_diff);
  14. }
  15. return t_diff;
  16. }