diff --git a/src/32x/Platform_32x.c b/src/32x/Platform_32x.c index 21dcd9120..e7027eb18 100644 --- a/src/32x/Platform_32x.c +++ b/src/32x/Platform_32x.c @@ -4,7 +4,6 @@ #define CC_NO_SOCKETS #define CC_NO_THREADING -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -32,6 +31,7 @@ const cc_result ReturnCode_SocketDropped = -1; const char* Platform_AppNameSuffix = " 32x"; cc_bool Platform_ReadonlyFilesystem = true; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/3ds/Platform_3DS.c b/src/3ds/Platform_3DS.c index 9c9a93152..2c2d6a6a9 100644 --- a/src/3ds/Platform_3DS.c +++ b/src/3ds/Platform_3DS.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -43,6 +42,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " 3DS"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" // https://gbatemp.net/threads/homebrew-development.360646/page-245 // 3DS defaults to stack size of *32 KB*.. way too small diff --git a/src/Platform_MacClassic.c b/src/Platform_MacClassic.c index 9c7d8864d..56989fd45 100644 --- a/src/Platform_MacClassic.c +++ b/src/Platform_MacClassic.c @@ -6,7 +6,6 @@ #define CC_NO_THREADING #define OVERRIDE_MEM_FUNCTIONS -#include "_PlatformBase.h" #include "Stream.h" #include "ExtMath.h" #include "SystemFonts.h" @@ -42,6 +41,7 @@ const char* Platform_AppNameSuffix = " MAC PPC"; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS; cc_bool Platform_ReadonlyFilesystem; +#include "_PlatformBase.h" /*########################################################################################################################* *-----------------------------------------------------Main entrypoint-----------------------------------------------------* diff --git a/src/Platform_N64.c b/src/Platform_N64.c index e4f41fa29..b54469376 100644 --- a/src/Platform_N64.c +++ b/src/Platform_N64.c @@ -6,7 +6,6 @@ #define CC_NO_THREADING #define CC_XTEA_ENCRYPTION -#include "_PlatformBase.h" #include "Stream.h" #include "ExtMath.h" #include "Funcs.h" @@ -26,7 +25,6 @@ #include #include #include -#include "_PlatformConsole.h" const cc_result ReturnCode_FileShareViolation = 1000000000; // not used const cc_result ReturnCode_FileNotFound = ENOENT; @@ -37,6 +35,24 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " N64"; cc_bool Platform_ReadonlyFilesystem = false; +cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "_PlatformBase.h" + + +/*########################################################################################################################* +*-----------------------------------------------------Main entrypoint-----------------------------------------------------* +*#########################################################################################################################*/ +#include "main_impl.h" + +int main(int argc, char** argv) { + SetupProgram(argc, argv); + while (Window_Main.Exists) { + RunProgram(argc, argv); + } + + Window_Free(); + return 0; +} /*########################################################################################################################* @@ -264,6 +280,20 @@ cc_result Process_StartOpen(const cc_string* args) { void Process_Exit(cc_result code) { exit(code); } +cc_result Process_StartGame2(const cc_string* args, int numArgs) { + Platform_LogConst("START CLASSICUBE"); + return SetGameArgs(args, numArgs); +} + +int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* args) { + return GetGameArgs(args); +} + +cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { + return 0; +} + + /*########################################################################################################################* *-------------------------------------------------------Encryption--------------------------------------------------------* diff --git a/src/Platform_Posix.c b/src/Platform_Posix.c index 72e52e297..89f0298f5 100644 --- a/src/Platform_Posix.c +++ b/src/Platform_Posix.c @@ -2,7 +2,6 @@ #if defined CC_BUILD_POSIX #define CC_XTEA_ENCRYPTION -#include "_PlatformBase.h" #include "Stream.h" #include "ExtMath.h" #include "SystemFonts.h" @@ -11,6 +10,7 @@ #include "Utils.h" #include "Errors.h" #include "PackedCol.h" + #include #include #include @@ -53,6 +53,7 @@ cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS; cc_uint8 Platform_Flags; #endif cc_bool Platform_ReadonlyFilesystem; +#include "_PlatformBase.h" /* Operating system specific include files */ #if defined CC_BUILD_DARWIN diff --git a/src/Platform_WinCE.c b/src/Platform_WinCE.c index 54d8216e3..80a7701a0 100644 --- a/src/Platform_WinCE.c +++ b/src/Platform_WinCE.c @@ -1,7 +1,6 @@ #include "Core.h" #if defined CC_BUILD_WINCE -#include "_PlatformBase.h" #include "Stream.h" #include "SystemFonts.h" #include "Funcs.h" @@ -34,6 +33,7 @@ const cc_result ReturnCode_SocketDropped = WSAECONNRESET; const char* Platform_AppNameSuffix = " CE"; cc_bool Platform_ReadonlyFilesystem; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS; +#include "_PlatformBase.h" // Current directory management for Windows CE static WCHAR current_directory[MAX_PATH] = L"\\"; diff --git a/src/Platform_Windows.c b/src/Platform_Windows.c index 620403ebd..50146b886 100644 --- a/src/Platform_Windows.c +++ b/src/Platform_Windows.c @@ -1,7 +1,6 @@ #include "Core.h" #if defined CC_BUILD_WIN -#include "_PlatformBase.h" #include "Stream.h" #include "SystemFonts.h" #include "Funcs.h" @@ -35,6 +34,7 @@ const cc_result ReturnCode_SocketDropped = WSAECONNRESET; const char* Platform_AppNameSuffix = ""; cc_bool Platform_ReadonlyFilesystem; cc_uint8 Platform_Flags; +#include "_PlatformBase.h" /*########################################################################################################################* *-----------------------------------------------------Main entrypoint-----------------------------------------------------* diff --git a/src/UWP/Platform_UWP.cpp b/src/UWP/Platform_UWP.cpp index d14011616..e2f0d390f 100644 --- a/src/UWP/Platform_UWP.cpp +++ b/src/UWP/Platform_UWP.cpp @@ -1,4 +1,3 @@ -#include "../_PlatformBase.h" #include "../Stream.h" #include "../SystemFonts.h" #include "../Funcs.h" @@ -27,6 +26,7 @@ using namespace winrt; using namespace Windows::Foundation; using namespace Windows::System; +#define UWP_STRING(str) ((wchar_t*)(str)->uni) static HANDLE heap; const cc_result ReturnCode_FileShareViolation = ERROR_SHARING_VIOLATION; @@ -39,7 +39,7 @@ const cc_result ReturnCode_SocketDropped = WSAECONNRESET; const char* Platform_AppNameSuffix = ""; cc_bool Platform_ReadonlyFilesystem; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS; -#define UWP_STRING(str) ((wchar_t*)(str)->uni) +#include "../_PlatformBase.h" /*########################################################################################################################* *-----------------------------------------------------Main entrypoint-----------------------------------------------------* diff --git a/src/_PlatformConsole.h b/src/_PlatformConsole.h index ab5019fcc..36a5607d5 100644 --- a/src/_PlatformConsole.h +++ b/src/_PlatformConsole.h @@ -29,11 +29,6 @@ int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* arg // Consoles *sometimes* doesn't use argv[0] for program name and so argc will be 0 // (e.g. when running via some emulators) if (!argc) return 0; - -#if defined CC_BUILD_PS1 || defined CC_BUILD_SATURN - // When running in DuckStation at least, argv was a five element array of empty strings ??? - return 0; -#else argc--; argv++; // skip executable path argument @@ -46,7 +41,6 @@ int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* arg Platform_Log2(" ARG %i = %c", &i, argv[i]); } return count; -#endif } cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { diff --git a/src/amiga/Platform_Amiga.c b/src/amiga/Platform_Amiga.c index d29484a7f..7d49ab2a4 100644 --- a/src/amiga/Platform_Amiga.c +++ b/src/amiga/Platform_Amiga.c @@ -4,7 +4,6 @@ #define CC_NO_THREADING #define OVERRIDE_MEM_FUNCTIONS -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../SystemFonts.h" @@ -31,6 +30,7 @@ const cc_result ReturnCode_SocketDropped = 1000000; const char* Platform_AppNameSuffix = " Amiga"; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" #ifdef __GNUC__ static const char __attribute__((used)) min_stack[] = "$STACK:102400"; diff --git a/src/atari_st/Platform_Atari.c b/src/atari_st/Platform_Atari.c index b6afcaa1b..88a641c92 100644 --- a/src/atari_st/Platform_Atari.c +++ b/src/atari_st/Platform_Atari.c @@ -4,7 +4,6 @@ #define CC_NO_THREADING #define OVERRIDE_MEM_FUNCTIONS -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -31,9 +30,10 @@ const cc_result ReturnCode_SocketInProgess = -1; const cc_result ReturnCode_SocketWouldBlock = -1; const cc_result ReturnCode_SocketDropped = -1; -const char* Platform_AppNameSuffix = " GBA"; +const char* Platform_AppNameSuffix = " Atari"; cc_bool Platform_ReadonlyFilesystem; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/dreamcast/Platform_Dreamcast.c b/src/dreamcast/Platform_Dreamcast.c index dfea327ae..276a61d2d 100644 --- a/src/dreamcast/Platform_Dreamcast.c +++ b/src/dreamcast/Platform_Dreamcast.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -39,6 +38,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " Dreamcast"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" static cc_bool usingSD; diff --git a/src/gba/Platform_GBA.c b/src/gba/Platform_GBA.c index 45db9d448..ec080dbbe 100644 --- a/src/gba/Platform_GBA.c +++ b/src/gba/Platform_GBA.c @@ -4,7 +4,6 @@ #define CC_NO_THREADING #define OVERRIDE_MEM_FUNCTIONS -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -35,6 +34,7 @@ const cc_result ReturnCode_SocketDropped = -1; const char* Platform_AppNameSuffix = " GBA"; cc_bool Platform_ReadonlyFilesystem; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/gcwii/Platform_Gamecube.c b/src/gcwii/Platform_Gamecube.c index 18309a357..49d389c34 100644 --- a/src/gcwii/Platform_Gamecube.c +++ b/src/gcwii/Platform_Gamecube.c @@ -5,7 +5,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -39,6 +38,7 @@ const cc_result ReturnCode_SocketDropped = -EPIPE; const char* Platform_AppNameSuffix = " GameCube"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" #include "Platform_GCWii.h" diff --git a/src/gcwii/Platform_Wii.c b/src/gcwii/Platform_Wii.c index fe41c591a..4cf4f9ff7 100644 --- a/src/gcwii/Platform_Wii.c +++ b/src/gcwii/Platform_Wii.c @@ -5,7 +5,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -40,6 +39,7 @@ const cc_result ReturnCode_SocketDropped = -EPIPE; const char* Platform_AppNameSuffix = " Wii"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" #include "Platform_GCWii.h" diff --git a/src/msdos/Platform_MSDOS.c b/src/msdos/Platform_MSDOS.c index f42c701cf..3672ec24f 100644 --- a/src/msdos/Platform_MSDOS.c +++ b/src/msdos/Platform_MSDOS.c @@ -3,7 +3,6 @@ #define CC_NO_SOCKETS #define CC_NO_THREADING -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../SystemFonts.h" @@ -38,6 +37,7 @@ const cc_result ReturnCode_SocketDropped = -10002; const char* Platform_AppNameSuffix = " DOS"; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* *-----------------------------------------------------Main entrypoint-----------------------------------------------------* diff --git a/src/nds/Platform_NDS.c b/src/nds/Platform_NDS.c index af1db77d1..f5d8605a5 100644 --- a/src/nds/Platform_NDS.c +++ b/src/nds/Platform_NDS.c @@ -5,7 +5,6 @@ #endif #define CC_XTEA_ENCRYPTION -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -53,6 +52,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " NDS"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/ps1/Platform_PS1.c b/src/ps1/Platform_PS1.c index 606f914e3..6e2944878 100644 --- a/src/ps1/Platform_PS1.c +++ b/src/ps1/Platform_PS1.c @@ -4,7 +4,6 @@ #define CC_NO_SOCKETS #define CC_NO_THREADING -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -21,7 +20,6 @@ #include #include #include -void exit(int code) { _boot(); } // The SDK calloc doesn't zero memory, so need to override it void* calloc(size_t num, size_t size) { @@ -29,7 +27,6 @@ void* calloc(size_t num, size_t size) { if (ptr) memset(ptr, 0, num * size); return ptr; } -#include "../_PlatformConsole.h" const cc_result ReturnCode_FileShareViolation = 1000000000; // not used const cc_result ReturnCode_FileNotFound = 99999; @@ -41,6 +38,8 @@ const cc_result ReturnCode_SocketDropped = -1; const char* Platform_AppNameSuffix = " PS1"; cc_bool Platform_ReadonlyFilesystem = true; +cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "../_PlatformBase.h" /*########################################################################################################################* @@ -202,7 +201,20 @@ cc_result Process_StartOpen(const cc_string* args) { return ERR_NOT_SUPPORTED; } -void Process_Exit(cc_result code) { exit(code); } +void Process_Exit(cc_result code) { _boot(); } + +cc_result Process_StartGame2(const cc_string* args, int numArgs) { + Platform_LogConst("START CLASSICUBE"); + return SetGameArgs(args, numArgs); +} + +int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* args) { + return GetGameArgs(args); +} + +cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { + return 0; +} /*########################################################################################################################* diff --git a/src/ps2/Platform_PS2.c b/src/ps2/Platform_PS2.c index 6f31a5fac..0758aefe6 100644 --- a/src/ps2/Platform_PS2.c +++ b/src/ps2/Platform_PS2.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -52,6 +51,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " PS2"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" // extern unsigned char DEV9_irx[]; // extern unsigned int size_DEV9_irx; diff --git a/src/ps3/Platform_PS3.c b/src/ps3/Platform_PS3.c index 7539a636d..c49621aa2 100644 --- a/src/ps3/Platform_PS3.c +++ b/src/ps3/Platform_PS3.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -44,6 +43,7 @@ const cc_result ReturnCode_SocketDropped = NET_EPIPE; const char* Platform_AppNameSuffix = " PS3"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" SYS_PROCESS_PARAM(1001, 256 * 1024); // 256kb stack size diff --git a/src/ps4/Platform_PS4.c b/src/ps4/Platform_PS4.c index 0157d193c..82f63272b 100644 --- a/src/ps4/Platform_PS4.c +++ b/src/ps4/Platform_PS4.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../SystemFonts.h" @@ -43,6 +42,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " PS4"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/psp/Platform_PSP.c b/src/psp/Platform_PSP.c index b74ffc1c0..dfbcbc645 100644 --- a/src/psp/Platform_PSP.c +++ b/src/psp/Platform_PSP.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -33,6 +32,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " PSP"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" PSP_MODULE_INFO("ClassiCube", PSP_MODULE_USER, 1, 0); PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); diff --git a/src/psvita/Platform_PSVita.c b/src/psvita/Platform_PSVita.c index 300617602..e6a11fe91 100644 --- a/src/psvita/Platform_PSVita.c +++ b/src/psvita/Platform_PSVita.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -27,6 +26,7 @@ static int stdout_fd; const char* Platform_AppNameSuffix = " PS Vita"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/saturn/Platform_Saturn.c b/src/saturn/Platform_Saturn.c index 9cb5156a1..f74e405b3 100644 --- a/src/saturn/Platform_Saturn.c +++ b/src/saturn/Platform_Saturn.c @@ -4,7 +4,6 @@ #define CC_NO_SOCKETS #define CC_NO_THREADING -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -27,8 +26,6 @@ void* calloc(size_t num, size_t size) { return ptr; } -#include "../_PlatformConsole.h" - const cc_result ReturnCode_FileShareViolation = 1000000000; // not used const cc_result ReturnCode_FileNotFound = 99999; const cc_result ReturnCode_DirectoryExists = 99999; @@ -39,6 +36,24 @@ const cc_result ReturnCode_SocketDropped = -1; const char* Platform_AppNameSuffix = " Saturn"; cc_bool Platform_ReadonlyFilesystem = true; +cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; +#include "../_PlatformBase.h" + + +/*########################################################################################################################* +*-----------------------------------------------------Main entrypoint-----------------------------------------------------* +*#########################################################################################################################*/ +#include "../main_impl.h" + +int main(int argc, char** argv) { + SetupProgram(argc, argv); + while (Window_Main.Exists) { + RunProgram(argc, argv); + } + + Window_Free(); + return 0; +} /*########################################################################################################################* @@ -214,8 +229,20 @@ void Thread_Sleep(cc_uint32 milliseconds) { /*########################################################################################################################* *--------------------------------------------------------Platform---------------------------------------------------------* *#########################################################################################################################*/ -extern void *__end; +cc_result Process_StartGame2(const cc_string* args, int numArgs) { + Platform_LogConst("START CLASSICUBE"); + return SetGameArgs(args, numArgs); +} +int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, cc_string* args) { + return GetGameArgs(args); +} + +cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { + return 0; +} + +extern void *__end; void Platform_Init(void) { cc_uint32 avail = HWRAM(HWRAM_SIZE) - (uint32_t)&__end; Platform_Log1("Free HWRAM: %i bytes", &avail); diff --git a/src/switch/Platform_Switch.c b/src/switch/Platform_Switch.c index c7bd5fd12..a6cecd99a 100644 --- a/src/switch/Platform_Switch.c +++ b/src/switch/Platform_Switch.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../Funcs.h" @@ -38,6 +37,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " Switch"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" alignas(16) u8 __nx_exception_stack[0x1000]; u64 __nx_exception_stack_size = sizeof(__nx_exception_stack); diff --git a/src/symbian/Platform_Symbian.cpp b/src/symbian/Platform_Symbian.cpp index 513159a35..6525cca96 100644 --- a/src/symbian/Platform_Symbian.cpp +++ b/src/symbian/Platform_Symbian.cpp @@ -1,12 +1,11 @@ -#include "Core.h" -#if defined CC_BUILD_SYMBIAN +#define CC_XTEA_ENCRYPTION +#define OVERRIDE_MEM_FUNCTIONS + extern "C" { #include "Errors.h" #include "Platform.h" #include "Logger.h" #include "String.h" -#define CC_XTEA_ENCRYPTION -#include "_PlatformBase.h" #include "Stream.h" #include "ExtMath.h" #include "SystemFonts.h" @@ -15,7 +14,6 @@ extern "C" { #include "Utils.h" #include "Errors.h" #include "PackedCol.h" -#define OVERRIDE_MEM_FUNCTIONS #include #include @@ -55,6 +53,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " Symbian"; cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT; cc_bool Platform_ReadonlyFilesystem; +#include "_PlatformBase.h" /*########################################################################################################################* @@ -731,5 +730,3 @@ int __aeabi_uidiv(unsigned int a, unsigned int b) } } #endif - -#endif diff --git a/src/symbian/Window_Symbian.cpp b/src/symbian/Window_Symbian.cpp index 28e80c840..b95b3e204 100644 --- a/src/symbian/Window_Symbian.cpp +++ b/src/symbian/Window_Symbian.cpp @@ -1,6 +1,3 @@ -#include "Core.h" -#if defined CC_BUILD_SYMBIAN - #include #include #include @@ -21,6 +18,7 @@ #include #include #include + extern "C" { #include #include @@ -989,5 +987,3 @@ cc_result Process_StartOpen(const cc_string* args) { TRAP(err, err = OpenBrowserL(args)); return (cc_result) err; } - -#endif diff --git a/src/webclient/Platform_Web.c b/src/webclient/Platform_Web.c index ca59d0f38..137892dff 100644 --- a/src/webclient/Platform_Web.c +++ b/src/webclient/Platform_Web.c @@ -1,4 +1,3 @@ -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../SystemFonts.h" @@ -39,6 +38,7 @@ const cc_result ReturnCode_DirectoryExists = _EEXIST; const char* Platform_AppNameSuffix = ""; cc_uint8 Platform_Flags; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/wiiu/Platform_WiiU.c b/src/wiiu/Platform_WiiU.c index 97864dfac..96120a518 100644 --- a/src/wiiu/Platform_WiiU.c +++ b/src/wiiu/Platform_WiiU.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../ExtMath.h" #include "../SystemFonts.h" @@ -53,6 +52,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " Wii U"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/xbox/Platform_Xbox.c b/src/xbox/Platform_Xbox.c index 972feaf83..7c30ad780 100644 --- a/src/xbox/Platform_Xbox.c +++ b/src/xbox/Platform_Xbox.c @@ -2,7 +2,6 @@ #define CC_NO_UPDATER #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../Funcs.h" #include "../Utils.h" @@ -28,6 +27,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " XBox"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################* diff --git a/src/xbox360/Platform_Xbox360.c b/src/xbox360/Platform_Xbox360.c index e3487b6c1..1c0aae698 100644 --- a/src/xbox360/Platform_Xbox360.c +++ b/src/xbox360/Platform_Xbox360.c @@ -3,7 +3,6 @@ #define CC_NO_SOCKETS #define CC_NO_DYNLIB -#include "../_PlatformBase.h" #include "../Stream.h" #include "../Funcs.h" #include "../Utils.h" @@ -38,6 +37,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE; const char* Platform_AppNameSuffix = " XBox 360"; cc_bool Platform_ReadonlyFilesystem; +#include "../_PlatformBase.h" /*########################################################################################################################*