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.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #include "timer.h"
-
- #include <SDL2/SDL.h>
-
-
- time_us time_now(void) {
- return (SDL_GetTicks64() * 1000U);
- }
-
- void time_sleep(time_us sleep_us) {
- SDL_Delay(sleep_us / 1000U);
- }
-
- time_us time_sleep_until(time_us t_target) {
- time_us t_now = time_now();
- time_us t_diff = t_target - t_now;
- if (t_diff > 0) {
- time_sleep(t_diff);
- }
- return t_diff;
- }
|