From 5f4cb9ba051e55d7477787bacae4d843c1aff951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 19 Feb 2024 19:29:54 +0000 Subject: [PATCH 1/2] uxnemu: delay for 25ms if failed to push stdin event - queue is probably full --- src/uxnemu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 src/uxnemu.c diff --git a/src/uxnemu.c b/src/uxnemu.c old mode 100644 new mode 100755 index 75843fc..a183126 --- 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; } From 6e960c7ad366d0e737aa5d2a763cb779201d1952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Mon, 19 Feb 2024 19:33:51 +0000 Subject: [PATCH 2/2] fix a few warnings and update version dates --- src/uxncli.c | 4 ++-- src/uxnemu.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/uxncli.c diff --git a/src/uxncli.c b/src/uxncli.c old mode 100644 new mode 100755 index 220ed40..c9173c9 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -47,11 +47,11 @@ main(int argc, char **argv) int i = 1; Uxn u = {0}; Uint8 dev[0x100] = {0}; - u.dev = (Uint8 *)&dev; + u.dev = dev; if(i == argc) return system_error("usage:", "uxncli [-v] file.rom [args..]"); if(argv[i][0] == '-' && argv[i][1] == 'v') - return system_error("Uxncli - Varvara Emulator(CLI)", "18 Feb 2024."); + return system_error("Uxncli - Varvara Emulator(CLI)", "19 Feb 2024."); if(!system_init(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++])) return system_error("Init", "Failed to initialize uxn."); /* eval */ diff --git a/src/uxnemu.c b/src/uxnemu.c index a183126..799472b 100755 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -496,12 +496,12 @@ main(int argc, char **argv) Uxn u = {0}; Uint8 dev[0x100] = {0}; Uxn u_audio = {0}; - u.dev = (Uint8 *)&dev; - u_audio.dev = (Uint8 *)&dev; + u.dev = dev; + u_audio.dev = dev; /* flags */ if(argc > 1 && argv[i][0] == '-') { if(!strcmp(argv[i], "-v")) - return system_error("Uxnemu - Varvara Emulator(GUI)", "18 Feb 2024."); + return system_error("Uxnemu - Varvara Emulator(GUI)", "19 Feb 2024."); else if(!strcmp(argv[i], "-2x")) set_zoom(2, 0); else if(!strcmp(argv[i], "-3x"))