uxn

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

commit b1ba95336c5208bbf0f7a15b294007e9ccf9bfbc
parent 5e2bb92e4c1f4cd26e0828a3c9738f1f85104f50
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Tue, 11 Jan 2022 23:50:41 +0000

Remove unistd.h from uxnemu.c.

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

diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -1,5 +1,4 @@ #include <stdio.h> -#include <unistd.h> #include <time.h> #include "uxn.h" @@ -90,7 +89,7 @@ stdin_handler(void *p) { SDL_Event event; event.type = stdin_event; - while(read(0, &event.cbutton.button, 1) > 0) + while(fread(&event.cbutton.button, 1, 1, stdin) > 0) SDL_PushEvent(&event); return 0; (void)p; @@ -183,8 +182,12 @@ system_deo_special(Device *d, Uint8 port) static void console_deo(Device *d, Uint8 port) { - if(port > 0x7) - write(port - 0x7, (char *)&d->dat[port], 1); + FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr + : 0; + if(fd) { + fputc(d->dat[port], fd); + fflush(fd); + } } static Uint8