From 1c69696a9a8878971c4fa925b074498dab757857 Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Tue, 21 Jun 2005 22:08:21 +0000 Subject: Patches needed to build for SYMBIAN32 WINS/GCC added. Test built for Symbian and run on P910i without any major problems. Test built for MSVC6. Changed parts seems to compile ok but there are some problems with MSVC6 and some of the targets which the EPOC build does n't support (KYRA,SAGA). svn-id: r18430 --- base/engine.cpp | 6 +++++- base/engine.h | 2 +- base/gameDetector.cpp | 13 +++++++++---- base/main.cpp | 21 ++++++++++++++++++--- 4 files changed, 33 insertions(+), 9 deletions(-) (limited to 'base') diff --git a/base/engine.cpp b/base/engine.cpp index f48ca83c96..824d1a15f8 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -193,13 +193,17 @@ void CDECL warning(const char *s, ...) { va_list va; va_start(va, s); +#ifdef __SYMBIAN32__ + vsprintf(buf, s, va); +#else vsnprintf(buf, STRINGBUFLEN, s, va); +#endif va_end(va); #ifdef __GP32__ //ph0x FIXME: implement fprint? printf("WARNING: %s\n", buf); #else -#ifndef _WIN32_WCE +#if !defined (_WIN32_WCE) && !defined (__SYMBIAN32__) fprintf(stderr, "WARNING: %s!\n", buf); #endif #endif diff --git a/base/engine.h b/base/engine.h index 42212be230..4a0cc7aadb 100644 --- a/base/engine.h +++ b/base/engine.h @@ -20,7 +20,7 @@ #ifndef ENGINE_H #define ENGINE_H - +#include "stdafx.h" #include "common/scummsys.h" #include "common/str.h" diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 0195c13f14..c38e4c4232 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -48,7 +48,7 @@ #endif // DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :) -#ifdef __PALM_OS__ +#if defined(__PALM_OS__) || defined(__SYMBIAN32__) static const char USAGE_STRING[] = "NoUsageString"; // save more data segment space #else static const char USAGE_STRING[] = @@ -194,7 +194,12 @@ GameDetector::GameDetector() { #endif _dumpScripts = false; + +#if defined(__SYMBIAN32__) + _force1xOverlay = true; +#else _force1xOverlay = false; +#endif memset(&_game, 0, sizeof(_game)); _plugin = 0; @@ -588,15 +593,15 @@ bool GameDetector::detectGame() { realGame = ConfMan.get("gameid"); else realGame = _targetName; - printf("Looking for %s\n", realGame.c_str()); + debug(1, "Looking for %s\n", realGame.c_str()); _game = findGame(realGame, &_plugin); if (_game.name) { - printf("Trying to start game '%s'\n", _game.description); + debug(1, "Trying to start game '%s'\n", _game.description); return true; } else { - printf("Failed game detection\n"); + debug(1, "Failed game detection\n"); return false; } } diff --git a/base/main.cpp b/base/main.cpp index ed364da20f..224681896d 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -136,6 +136,9 @@ const char* stackCookie = "$STACK: 655360\0"; #include #define STDOUT_FILE TEXT("stdout.txt") #define STDERR_FILE TEXT("stderr.txt") +#elif defined(__SYMBIAN32__) // Symbian does not like any output to the console through any *print* function +#define STDOUT_FILE SYMBIAN32_DOC_DIR "scummvm.stdout.txt" +#define STDERR_FILE SYMBIAN32_DOC_DIR "scummvm.stderr.txt" #endif #if defined(QTOPIA) @@ -143,7 +146,7 @@ const char* stackCookie = "$STACK: 655360\0"; extern "C" int main(int argc, char *argv[]); #endif -#if defined(MACOSX) || defined(QTOPIA) +#if defined(MACOSX) || defined(QTOPIA) || defined(__SYMBIAN32__) #include #elif !defined(__MORPHOS__) && !defined(__DC__) && !defined(__GP32__) #undef main @@ -315,7 +318,8 @@ extern "C" int scummvm_main(int argc, char *argv[]) { #else extern "C" int main(int argc, char *argv[]) { #endif - char *cfgFilename = NULL, *s=argv[1]; + char *cfgFilename = NULL; + char *s=NULL;//argv[1]; SumthinWicked says: cannot assume that argv!=NULL here! eg. Symbian's CEBasicAppUI::SDLStartL() calls as main(0,NULL), if you want to change plz #ifdef __SYMBIAN32__ bool running = true; #if defined(UNIX) @@ -324,7 +328,8 @@ extern "C" int main(int argc, char *argv[]) { #endif // Code copied from SDL_main -#if defined(WIN32) && defined(NO_CONSOLE) +#if (defined(WIN32) && defined(NO_CONSOLE)) || defined(__SYMBIAN32__) +// Symbian does not like any output to the console through any *print* function /* Flush the output in case anything is queued */ fclose(stdout); @@ -353,7 +358,9 @@ extern "C" int main(int argc, char *argv[]) { } #endif } +#ifndef __SYMBIAN32__ // fcn not supported on Symbian setlinebuf(stdout); /* Line buffered */ +#endif setbuf(stderr, NULL); /* No buffering */ #endif //defined(WIN32) && defined(USE_CONSOLE) @@ -490,7 +497,11 @@ void CDECL debug(int level, const char *s, ...) { return; va_start(va, s); +#ifdef __SYMBIAN32__ + vsprintf(buf, s, va); +#else vsnprintf(buf, STRINGBUFLEN, s, va); +#endif va_end(va); debugHelper(buf); @@ -501,7 +512,11 @@ void CDECL debug(const char *s, ...) { va_list va; va_start(va, s); +#ifdef __SYMBIAN32__ + vsprintf(buf, s, va); +#else vsnprintf(buf, STRINGBUFLEN, s, va); +#endif va_end(va); debugHelper(buf); -- cgit v1.2.3