From d32320da0f181eb62c377cb64e70f2cb54a1fc87 Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Tue, 11 Apr 2006 18:08:51 +0000 Subject: Added now required palm_main(...) function svn-id: r21799 --- backends/PalmOS/Src/modules.cpp | 27 ++++++++++++++++++++++++- backends/PalmOS/Src/native/zodiacARM.cpp | 34 ++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) (limited to 'backends/PalmOS/Src') 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 //#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(); -- cgit v1.2.3