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
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);

View File

@ -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;
}