0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-26 15:53:01 +00:00

emu: start -> run, remove return type

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-06-29 15:43:28 +02:00
parent d0fb331aa4
commit 5e71c0bfc8
2 changed files with 9 additions and 12 deletions

View file

@ -99,15 +99,14 @@ nil_talk(Device *d, Uint8 b0, Uint8 w)
#pragma mark - Generics #pragma mark - Generics
static int static void
start(Uxn *u) run(Uxn *u)
{ {
if(!evaluxn(u, PAGE_PROGRAM)) if(!evaluxn(u, PAGE_PROGRAM))
return error("Reset", "Failed"); error("Reset", "Failed");
if(mempeek16(devconsole->dat, 0)) else if(mempeek16(devconsole->dat, 0))
while(read(0, &devconsole->dat[0x2], 1) > 0) while(read(0, &devconsole->dat[0x2], 1) > 0)
evaluxn(u, mempeek16(devconsole->dat, 0)); evaluxn(u, mempeek16(devconsole->dat, 0));
return 1;
} }
int int
@ -139,7 +138,7 @@ main(int argc, char **argv)
portuxn(&u, 0xe, "empty", nil_talk); portuxn(&u, 0xe, "empty", nil_talk);
portuxn(&u, 0xf, "empty", nil_talk); portuxn(&u, 0xf, "empty", nil_talk);
start(&u); run(&u);
if(argc > 2) if(argc > 2)
printstack(&u.wst); printstack(&u.wst);

View file

@ -343,8 +343,8 @@ stdin_handler(void *p)
(void)p; (void)p;
} }
static int static void
start(Uxn *u) run(Uxn *u)
{ {
evaluxn(u, 0x0100); evaluxn(u, 0x0100);
redraw(u); redraw(u);
@ -356,8 +356,7 @@ start(Uxn *u)
while(SDL_PollEvent(&event) != 0) { while(SDL_PollEvent(&event) != 0) {
switch(event.type) { switch(event.type) {
case SDL_QUIT: case SDL_QUIT:
quit(); return;
break;
case SDL_TEXTINPUT: case SDL_TEXTINPUT:
devctrl->dat[3] = event.text.text[0]; /* fall-thru */ devctrl->dat[3] = event.text.text[0]; /* fall-thru */
case SDL_KEYDOWN: case SDL_KEYDOWN:
@ -396,7 +395,6 @@ start(Uxn *u)
SDL_Delay(clamp(16.666f - elapsed, 0, 1000)); SDL_Delay(clamp(16.666f - elapsed, 0, 1000));
} }
} }
return 1;
} }
int int
@ -438,7 +436,7 @@ main(int argc, char **argv)
mempoke16(devscreen->dat, 2, ppu.hor * 8); mempoke16(devscreen->dat, 2, ppu.hor * 8);
mempoke16(devscreen->dat, 4, ppu.ver * 8); mempoke16(devscreen->dat, 4, ppu.ver * 8);
start(&u); run(&u);
quit(); quit();
return 0; return 0;
} }