uxn

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

commit 5e71c0bfc8092d16a47a9268daa44379c0985a97
parent d0fb331aa4fa350929a5acb39a36f62d27024245
Author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
Date:   Tue, 29 Jun 2021 15:43:28 +0200

emu: start -> run, remove return type

Diffstat:
Msrc/uxncli.c | 11+++++------
Msrc/uxnemu.c | 10++++------
2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/uxncli.c b/src/uxncli.c @@ -99,15 +99,14 @@ nil_talk(Device *d, Uint8 b0, Uint8 w) #pragma mark - Generics -static int -start(Uxn *u) +static void +run(Uxn *u) { if(!evaluxn(u, PAGE_PROGRAM)) - return error("Reset", "Failed"); - if(mempeek16(devconsole->dat, 0)) + error("Reset", "Failed"); + else if(mempeek16(devconsole->dat, 0)) while(read(0, &devconsole->dat[0x2], 1) > 0) evaluxn(u, mempeek16(devconsole->dat, 0)); - return 1; } int @@ -139,7 +138,7 @@ main(int argc, char **argv) portuxn(&u, 0xe, "empty", nil_talk); portuxn(&u, 0xf, "empty", nil_talk); - start(&u); + run(&u); if(argc > 2) printstack(&u.wst); diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -343,8 +343,8 @@ stdin_handler(void *p) (void)p; } -static int -start(Uxn *u) +static void +run(Uxn *u) { evaluxn(u, 0x0100); redraw(u); @@ -356,8 +356,7 @@ start(Uxn *u) while(SDL_PollEvent(&event) != 0) { switch(event.type) { case SDL_QUIT: - quit(); - break; + return; case SDL_TEXTINPUT: devctrl->dat[3] = event.text.text[0]; /* fall-thru */ case SDL_KEYDOWN: @@ -396,7 +395,6 @@ start(Uxn *u) SDL_Delay(clamp(16.666f - elapsed, 0, 1000)); } } - return 1; } int @@ -438,7 +436,7 @@ main(int argc, char **argv) mempoke16(devscreen->dat, 2, ppu.hor * 8); mempoke16(devscreen->dat, 4, ppu.ver * 8); - start(&u); + run(&u); quit(); return 0; }