commit b5fa665cdbd76122bf08f87655eed4da2b729ec5 parent 6d95f000b145893871ad82688a2c2687482b9572 Author: Devine Lu Linvega <aliceffekt@gmail.com> Date: Thu, 26 Jan 2023 09:35:56 -0800 Reduce refresh requests without screen vector Diffstat:
M | src/uxnemu.c | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -445,10 +445,13 @@ run(Uxn *u) if(uxn_screen.fg.changed || uxn_screen.bg.changed) redraw(); now = SDL_GetPerformanceCounter(); - if(!BENCH && ((Sint64)(frame_end - now)) > 0) { - SDL_Delay((frame_end - now) / ms_interval); - now = frame_end; - } + if(u->dev[0x20]) { + if(!BENCH && ((Sint64)(frame_end - now)) > 0) { + SDL_Delay((frame_end - now) / ms_interval); + now = frame_end; + } + } else + SDL_WaitEvent(NULL); } return error("SDL_WaitEvent", SDL_GetError()); }