From 39703b5d5e74ab89b425dbba9b01c7b9bf6c9691 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Mon, 20 Nov 2017 12:00:59 +0300 Subject: [PATCH] Add command line flag to start in surf mode #397 --- src/console.c | 14 +++++++++++++- src/console.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/console.c b/src/console.c index 89549ed..c8db285 100644 --- a/src/console.c +++ b/src/console.c @@ -2550,11 +2550,12 @@ static void tick(Console* console) printLine(console); commandDone(console); console->active = true; + return; } } else - { + { if(console->cursor.delay) console->cursor.delay--; @@ -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__) diff --git a/src/console.h b/src/console.h index 4e33096..c21bd9e 100644 --- a/src/console.h +++ b/src/console.h @@ -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);