From 27b22e87651d61d493a31b46babcb64637f44947 Mon Sep 17 00:00:00 2001 From: EGAMatsu Date: Mon, 3 Jun 2024 02:05:31 -0500 Subject: [PATCH] Use console-style launching (App just closes, but it's a start.) --- src/Platform_MacClassic.c | 29 +++++++++++++++++++++++++++-- src/Window_MacClassic.c | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/Platform_MacClassic.c b/src/Platform_MacClassic.c index d358b7193..e5ff72d8c 100644 --- a/src/Platform_MacClassic.c +++ b/src/Platform_MacClassic.c @@ -76,8 +76,8 @@ void Mem_Free(void* mem) { *------------------------------------------------------Logging/Time-------------------------------------------------------* *#########################################################################################################################*/ void Platform_Log(const char* msg, int len) { - write(STDOUT_FILENO, msg, len); - write(STDOUT_FILENO, "\n", 1); + //write(STDOUT_FILENO, msg, len); + //write(STDOUT_FILENO, "\n", 1); } TimeMS DateTime_CurrentUTC(void) { @@ -313,6 +313,7 @@ static cc_result Process_RawStart(const char* path, char** argv) { static cc_result Process_RawGetExePath(char* path, int* len); +/* cc_result Process_StartGame2(const cc_string* args, int numArgs) { char raw[GAME_MAX_CMDARGS][NATIVE_STR_LEN]; char path[NATIVE_STR_LEN]; @@ -332,6 +333,24 @@ cc_result Process_StartGame2(const cc_string* args, int numArgs) { argv[j] = NULL; return Process_RawStart(path, argv); } +*/ + +static char gameArgs[GAME_MAX_CMDARGS][STRING_SIZE]; +static int gameNumArgs; +static cc_bool gameHasArgs; + +cc_result Process_StartGame2(const cc_string* args, int numArgs) { + for (int i = 0; i < numArgs; i++) + { + String_CopyToRawArray(gameArgs[i], &args[i]); + } + + Platform_LogConst("START CLASSICUBE"); + gameHasArgs = true; + gameNumArgs = numArgs; + return 0; +} + void Process_Exit(cc_result code) { exit(code); } cc_result Process_StartOpen(const cc_string* args) { @@ -418,10 +437,16 @@ cc_bool Platform_DescribeError(cc_result res, cc_string* dst) { } #endif +static void Platform_InitSpecific(void) { + Platform_SingleProcess = true; +} + void Platform_Init(void) { printf("Macintosh ClassiCube has started to init.\n"); // Test, just to see if it's actually *running* at all. Platform_LoadSysFonts(); Stopwatch_Init(); + + Platform_ReadonlyFilesystem = true; } cc_result Platform_Encrypt(const void* data, int len, cc_string* dst) { diff --git a/src/Window_MacClassic.c b/src/Window_MacClassic.c index c62e7aa87..6c1826831 100644 --- a/src/Window_MacClassic.c +++ b/src/Window_MacClassic.c @@ -20,7 +20,7 @@ BitMap bitmapScreen; #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 224 -static cc_bool launcherMode; +static cc_bool launcherMode = true; /*########################################################################################################################* *--------------------------------------------------Public implementation--------------------------------------------------*