From 268ec45780af883ada402772c14118ac6c241a54 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 4 Mar 2023 11:07:11 -0800 Subject: [PATCH] (Screen) Use fast timer if vector short is set --- src/uxnemu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index 09f1bbd..7c9d70a 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -439,6 +439,7 @@ run(Uxn *u) { Uint64 now = SDL_GetPerformanceCounter(), frame_end, frame_interval = SDL_GetPerformanceFrequency() / 60; for(;;) { + Uint16 screen_vector = PEEK16(&u->dev[0x20]); /* .System/halt */ if(u->dev[0x0f]) return error("Run", "Ended."); @@ -446,11 +447,11 @@ run(Uxn *u) exec_deadline = now + deadline_interval; if(!handle_events(u)) return 0; - uxn_eval(u, PEEK16(&u->dev[0x20])); + uxn_eval(u, screen_vector); if(uxn_screen.fg.changed || uxn_screen.bg.changed) redraw(); now = SDL_GetPerformanceCounter(); - if(u->dev[0x20]) { + if(screen_vector) { if(!BENCH && ((Sint64)(frame_end - now)) > 0) { SDL_Delay((frame_end - now) / ms_interval); now = frame_end;