aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorLars Persson2005-06-21 22:08:21 +0000
committerLars Persson2005-06-21 22:08:21 +0000
commit1c69696a9a8878971c4fa925b074498dab757857 (patch)
treed8f4f2cfea1a3e01bb7f5f5c58fb812d8029ca96 /base
parent4564f0d3bf0d40f5a2ca125df0682969adc8431c (diff)
downloadscummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.tar.gz
scummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.tar.bz2
scummvm-rg350-1c69696a9a8878971c4fa925b074498dab757857.zip
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
Diffstat (limited to 'base')
-rw-r--r--base/engine.cpp6
-rw-r--r--base/engine.h2
-rw-r--r--base/gameDetector.cpp13
-rw-r--r--base/main.cpp21
4 files changed, 33 insertions, 9 deletions
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 <cstdio>
#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 <SDL.h>
#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);