| ... | ... |
@@ -52,7 +52,7 @@ main(int argc, char **argv) |
| 52 | 52 |
return system_error("Boot", "Failed");
|
| 53 | 53 |
if(!system_load(&u, argv[i++])) |
| 54 | 54 |
return system_error("Load", "Failed");
|
| 55 |
- u.dev[0x17] = i != argc; |
|
| 55 |
+ u.dev[0x17] = argc - i; |
|
| 56 | 56 |
if(!uxn_eval(&u, PAGE_PROGRAM)) |
| 57 | 57 |
return u.dev[0x0f] & 0x7f; |
| 58 | 58 |
for(; i < argc; i++) {
|
| ... | ... |
@@ -244,13 +244,14 @@ init(void) |
| 244 | 244 |
/* Boot */ |
| 245 | 245 |
|
| 246 | 246 |
static int |
| 247 |
-start(Uxn *u, char *rom) |
|
| 247 |
+start(Uxn *u, char *rom, int queue) |
|
| 248 | 248 |
{
|
| 249 | 249 |
free(u->ram); |
| 250 | 250 |
if(!uxn_boot(u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)))) |
| 251 | 251 |
return system_error("Boot", "Failed to start uxn.");
|
| 252 | 252 |
if(!system_load(u, rom)) |
| 253 | 253 |
return system_error("Boot", "Failed to load rom.");
|
| 254 |
+ u->dev[0x17] = queue; |
|
| 254 | 255 |
exec_deadline = SDL_GetPerformanceCounter() + deadline_interval; |
| 255 | 256 |
if(!uxn_eval(u, PAGE_PROGRAM)) |
| 256 | 257 |
return system_error("Boot", "Failed to eval rom.");
|
| ... | ... |
@@ -287,8 +288,8 @@ static void |
| 287 | 288 |
restart(Uxn *u) |
| 288 | 289 |
{
|
| 289 | 290 |
screen_resize(&uxn_screen, WIDTH, HEIGHT); |
| 290 |
- if(!start(u, "launcher.rom")) |
|
| 291 |
- start(u, rom_path); |
|
| 291 |
+ if(!start(u, "launcher.rom", 0)) |
|
| 292 |
+ start(u, rom_path, 0); |
|
| 292 | 293 |
} |
| 293 | 294 |
|
| 294 | 295 |
static Uint8 |
| ... | ... |
@@ -364,7 +365,7 @@ handle_events(Uxn *u) |
| 364 | 365 |
redraw(); |
| 365 | 366 |
else if(event.type == SDL_DROPFILE) {
|
| 366 | 367 |
screen_resize(&uxn_screen, WIDTH, HEIGHT); |
| 367 |
- start(u, event.drop.file); |
|
| 368 |
+ start(u, event.drop.file, 0); |
|
| 368 | 369 |
SDL_free(event.drop.file); |
| 369 | 370 |
} |
| 370 | 371 |
/* Audio */ |
| ... | ... |
@@ -495,8 +496,8 @@ main(int argc, char **argv) |
| 495 | 496 |
/* load rom */ |
| 496 | 497 |
if(i == argc) |
| 497 | 498 |
return system_error("usage", "uxnemu [-2x][-3x] file.rom");
|
| 498 |
- u.dev[0x17] = i != argc - 1; |
|
| 499 |
- if(!start(&u, argv[i])) |
|
| 499 |
+ printf("%d/%d -> %d\n", i, argc, argc - i);
|
|
| 500 |
+ if(!start(&u, argv[i], argc - i)) |
|
| 500 | 501 |
return system_error("Start", "Failed");
|
| 501 | 502 |
rom_path = argv[i++]; |
| 502 | 503 |
/* read arguments */ |