summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/soh/src/code/main.c b/soh/src/code/main.c
index 08e9ecdc1..7ecff0b63 100644
--- a/soh/src/code/main.c
+++ b/soh/src/code/main.c
@@ -10,7 +10,6 @@
#include <libultraship/bridge.h>
#include "soh/CrashHandlerExp.h"
-
s32 gScreenWidth = SCREEN_WIDTH;
s32 gScreenHeight = SCREEN_HEIGHT;
size_t gSystemHeapSize = 0;
@@ -44,11 +43,21 @@ void Main_LogSystemHeap(void) {
}
#ifdef _WIN32
-int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmdshow)
-#else
-int main(int argc, char** argv)
+int SDL_main(int argc, char** argv)
+{
+ AllocConsole();
+ (void)freopen("CONIN$", "r", stdin);
+ (void)freopen("CONOUT$", "w", stdout);
+ (void)freopen("CONOUT$", "w", stderr);
+#ifndef _DEBUG
+ ShowWindow(GetConsoleWindow(), SW_HIDE);
#endif
+
+#else //_WIN32
+int main(int argc, char** argv)
{
+#endif
+
GameConsole_Init();
InitOTR();
// TODO: Was moved to below InitOTR because it requires window to be setup. But will be late to catch crashes.