From aea46e7cb290b770ece05112259e1b09d77b35f2 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Tue, 25 Apr 2023 00:01:17 -0400 Subject: Implement built in Extractor for Windows (#2730) * wip * const * split zapd into two targets * Workingish. * fix working dir and copy xmls on build (#2) * dont change current working dir with dialog prompts * copy asset xmls to target dir * make zpadlib public * Messagebox. * Check for WIN32 * threading * Cleanups to the exporter and main. * Multi extraction. * Fix byteswap header includes. * Fix another byteswap include. * fix again. * stddef size_t * Add other targets for ZAPDLib * Non windows. * IDYES IDNO * Linux fixes * hopefully remove switch and wiiu from building extractor * Please? * validate roms and add another valid rom * ifdef out extract.h for switch and wiiu * Maybe update lux * Remove ZAPDlib from switch and WiiU * more rules * Update soh/soh/Extractor/Extract.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update ZAPDTR/ZAPD/ExecutableMain.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update ZAPDTR/ZAPD/CMakeLists.txt Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update ZAPDTR/ZAPD/GameConfig.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update ZAPDTR/ZAPD/Globals.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update ZAPDTR/ZAPD/Main.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/CMakeLists.txt Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/soh/Extractor/Extract.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/soh/Extractor/Extract.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Update soh/soh/Extractor/Extract.cpp Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * the last fix * Add context to a comment --------- Co-authored-by: Adam Bird Co-authored-by: Adam Bird Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> --- soh/src/code/main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'soh/src/code') 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 #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. -- cgit v1.2.3