uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 5f4cb9ba051e55d7477787bacae4d843c1aff951
parent 1bba517f3716e166a0d52224f43c100b44b12289
Author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
Date:   Mon, 19 Feb 2024 19:29:54 +0000

uxnemu: delay for 25ms if failed to push stdin event - queue is probably full

Diffstat:
Msrc/uxnemu.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -131,8 +131,10 @@ stdin_handler(void *p) SDL_Event event; USED(p); event.type = stdin_event; - while(read(0, &event.cbutton.button, 1) > 0 && SDL_PushEvent(&event) >= 0) - ; + while(read(0, &event.cbutton.button, 1) > 0){ + while(SDL_PushEvent(&event) < 0) + SDL_Delay(25); /* slow down - the queue is most likely full */ + } return 0; }