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.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

22 rindas
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. }