diff options
author | Chris Apers | 2006-04-11 18:08:51 +0000 |
---|---|---|
committer | Chris Apers | 2006-04-11 18:08:51 +0000 |
commit | d32320da0f181eb62c377cb64e70f2cb54a1fc87 (patch) | |
tree | 7434b966ea9ca2ffec4d2019473c44cc6b1f0a2e /backends/PalmOS/Src | |
parent | cbe570756b64631292d3448d2c72b536879173ae (diff) | |
download | scummvm-rg350-d32320da0f181eb62c377cb64e70f2cb54a1fc87.tar.gz scummvm-rg350-d32320da0f181eb62c377cb64e70f2cb54a1fc87.tar.bz2 scummvm-rg350-d32320da0f181eb62c377cb64e70f2cb54a1fc87.zip |
Added now required palm_main(...) function
svn-id: r21799
Diffstat (limited to 'backends/PalmOS/Src')
-rw-r--r-- | backends/PalmOS/Src/modules.cpp | 27 | ||||
-rwxr-xr-x | backends/PalmOS/Src/native/zodiacARM.cpp | 34 |
2 files changed, 58 insertions, 3 deletions
diff --git a/backends/PalmOS/Src/modules.cpp b/backends/PalmOS/Src/modules.cpp index e27e85eaf3..73c7c117bb 100644 --- a/backends/PalmOS/Src/modules.cpp +++ b/backends/PalmOS/Src/modules.cpp @@ -91,6 +91,31 @@ void run(int argc, char *argv[]) { #else +#include "stdafx.h" +#include "base/main.h" +#include "be_zodiac.h" +#include "be_os5ex.h" + +static void palm_main(int argc, char **argvP) { +#ifdef COMPILE_OS5 + if (gVars->advancedMode) + g_system = new OSystem_PalmOS5Ex(); + else + g_system = new OSystem_PalmOS5(); +#elif defined(COMPILE_ZODIAC) + g_system = new OSystem_PalmZodiac(); +#else + #error "No target defined." +#endif + + assert(g_system); + + // Invoke the actual ScummVM main entry point: + scummvm_main(argc, argvP); + + g_system->quit(); // TODO: Consider removing / replacing this! +} + void run(int argc, char *argv[]) { MathlibInit(); @@ -119,7 +144,7 @@ void run(int argc, char *argv[]) { // be sure to have a VG void *__ptr = StuffsForceVG(); - DO_EXIT( main(argc, argv); ) + DO_EXIT( palm_main(argc, argv); ) // be sure to release features memory FREE_FTR(ftrBufferOverlay) diff --git a/backends/PalmOS/Src/native/zodiacARM.cpp b/backends/PalmOS/Src/native/zodiacARM.cpp index b4f85d391b..20e8f52b80 100755 --- a/backends/PalmOS/Src/native/zodiacARM.cpp +++ b/backends/PalmOS/Src/native/zodiacARM.cpp @@ -37,10 +37,41 @@ #include <AdnDebugMgr.h> //#define DEBUG_ARM +#include "stdafx.h" +#include "base/main.h" +#include "be_zodiac.h" +#include "be_os5ex.h" + GlobalsDataType g_vars; GlobalsDataPtr gVars = &g_vars; UInt32 g_stackSize; +static void palm_main(int argc, char **argvP) { +#ifdef COMPILE_OS5 + if (gVars->advancedMode) + g_system = new OSystem_PalmOS5Ex(); + else + g_system = new OSystem_PalmOS5(); +#elif defined(COMPILE_ZODIAC) + g_system = new OSystem_PalmZodiac(); +#else + #error "No target defined." +#endif + + assert(g_system); + + // Invoke the actual ScummVM main entry point: + extern void initGlobalHashes(); + initGlobalHashes(); + + scummvm_main(argc, argvP); + + extern void freeGlobalHashes(); + freeGlobalHashes(); + + g_system->quit(); // TODO: Consider removing / replacing this! +} + static void Go() { void *tmp; char **argvP; @@ -76,8 +107,7 @@ static void Go() { if (HWR_INIT(INIT_VIBRATOR)) gVars->vibrator = RumbleInit(); // run ... - extern int main(int, char **); - DO_EXIT ( main(argc, argvP); ) + DO_EXIT ( palm_main(argc, argvP); ) // release if (HWR_INIT(INIT_VIBRATOR)) RumbleRelease(); |