Add command line flag to start in surf mode #397

This commit is contained in:
BADIM-PC\Vadim 2017-11-20 12:00:59 +03:00
parent 20d0950dca
commit 39703b5d5e
2 changed files with 14 additions and 1 deletions

View File

@ -2550,6 +2550,7 @@ static void tick(Console* console)
printLine(console);
commandDone(console);
console->active = true;
return;
}
}
@ -2564,6 +2565,12 @@ static void tick(Console* console)
}
console->tickCounter++;
if(console->startSurf)
{
console->startSurf = false;
gotoSurf();
}
}
static void cmdLoadCart(Console* console, const char* name)
@ -2757,6 +2764,7 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config,
.colorBuffer = console->colorBuffer,
.fs = fs,
.showGameMenu = false,
.startSurf = false,
};
memset(console->buffer, 0, CONSOLE_BUFFER_SIZE);
@ -2802,8 +2810,12 @@ void initConsole(Console* console, tic_mem* tic, FileSystem* fs, Config* config,
}
for (s32 i = 1; i < argc; i++)
{
if(strcmp(argv[i], "-nosound") == 0)
config->data.noSound = true;
else if(strcmp(argv[i], "-surf") == 0)
console->startSurf = true;
}
}
#if defined(__EMSCRIPTEN__)

View File

@ -88,6 +88,7 @@ struct Console
u32 tickCounter;
bool active;
bool showGameMenu;
bool startSurf;
void(*load)(Console*, const char* name);
bool(*loadProject)(Console*, const char* data, s32 size, tic_cartridge* dst);