(uxnemu) Display usage when no roms and no params
This commit is contained in:
parent
453f491918
commit
1bf0ffc5e5
|
@ -59,6 +59,8 @@ main(int argc, char **argv)
|
|||
return emu_error("Boot", "Failed");
|
||||
if(!system_load(&u, argv[i++]))
|
||||
return emu_error("Load", "Failed");
|
||||
if(i == argc)
|
||||
u.dev[0x17] = CONSOLE_END;
|
||||
if(!uxn_eval(&u, PAGE_PROGRAM))
|
||||
return u.dev[0x0f] & 0x7f;
|
||||
for(; i < argc; i++) {
|
||||
|
|
|
@ -496,13 +496,15 @@ main(int argc, char **argv)
|
|||
/* default resolution */
|
||||
screen_resize(&uxn_screen, WIDTH, HEIGHT);
|
||||
/* default zoom */
|
||||
if(strcmp(argv[i], "-1x") == 0 || strcmp(argv[i], "-2x") == 0 || strcmp(argv[i], "-3x") == 0)
|
||||
if(argc > 1 && (strcmp(argv[i], "-1x") == 0 || strcmp(argv[i], "-2x") == 0 || strcmp(argv[i], "-3x") == 0))
|
||||
set_zoom(argv[i++][1] - '0');
|
||||
else if(SDL_GetCurrentDisplayMode(0, &DM) == 0)
|
||||
set_zoom(DM.w / 1280);
|
||||
if(i == argc)
|
||||
return error("usage", "uxnemu [-2x][-3x] file.rom");
|
||||
/* load rom */
|
||||
if(!start(&u, argv[i]))
|
||||
return error("usage", "uxnemu [-2x][-3x] file.rom");
|
||||
return error("Start", "Failed");
|
||||
rom_path = argv[i++];
|
||||
/* read arguments */
|
||||
for(; i < argc; i++) {
|
||||
|
|
Loading…
Reference in New Issue