From 3b10969f9ebd72a5d40e9c5c6405ae394a91fdf9 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 2 Apr 2023 20:27:15 -0700 Subject: [PATCH] Fixed issue where a screen redraw might occur after it has been unset --- src/uxnemu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index c87db59..958a336 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -448,7 +448,7 @@ run(Uxn *u) { Uint64 now = SDL_GetPerformanceCounter(), frame_end, frame_interval = SDL_GetPerformanceFrequency() / 60; for(;;) { - Uint16 screen_vector = PEEK2(&u->dev[0x20]); + Uint16 screen_vector; /* .System/halt */ if(u->dev[0x0f]) return error("Run", "Ended."); @@ -456,6 +456,7 @@ run(Uxn *u) exec_deadline = now + deadline_interval; if(!handle_events(u)) return 0; + screen_vector = PEEK2(&u->dev[0x20]); uxn_eval(u, screen_vector); if(uxn_screen.fg.changed || uxn_screen.bg.changed) redraw();