diff options
author | Lars Persson | 2005-06-21 22:08:21 +0000 |
---|---|---|
committer | Lars Persson | 2005-06-21 22:08:21 +0000 |
commit | 1c69696a9a8878971c4fa925b074498dab757857 (patch) | |
tree | d8f4f2cfea1a3e01bb7f5f5c58fb812d8029ca96 | |
parent | 4564f0d3bf0d40f5a2ca125df0682969adc8431c (diff) | |
download | scummvm-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
-rw-r--r-- | backends/intern.h | 3 | ||||
-rw-r--r-- | base/engine.cpp | 6 | ||||
-rw-r--r-- | base/engine.h | 2 | ||||
-rw-r--r-- | base/gameDetector.cpp | 13 | ||||
-rw-r--r-- | base/main.cpp | 21 | ||||
-rw-r--r-- | common/array.h | 7 | ||||
-rw-r--r-- | common/config-file.cpp | 2 | ||||
-rw-r--r-- | common/config-manager.cpp | 4 | ||||
-rw-r--r-- | common/debugger.cpp | 2 | ||||
-rw-r--r-- | common/debugger.h | 5 | ||||
-rw-r--r-- | common/list.h | 7 | ||||
-rw-r--r-- | common/map.h | 7 | ||||
-rw-r--r-- | common/scummsys.h | 28 | ||||
-rw-r--r-- | common/singleton.h | 8 | ||||
-rw-r--r-- | common/system.cpp | 2 | ||||
-rw-r--r-- | common/util.cpp | 7 | ||||
-rw-r--r-- | graphics/surface.h | 3 | ||||
-rw-r--r-- | gui/console.cpp | 2 | ||||
-rw-r--r-- | gui/credits.h | 6 | ||||
-rw-r--r-- | gui/newgui.cpp | 5 | ||||
-rw-r--r-- | queen/debug.cpp | 1 | ||||
-rw-r--r-- | queen/debug.h | 1 | ||||
-rw-r--r-- | scumm/dialogs.cpp | 10 | ||||
-rw-r--r-- | scumm/imuse.cpp | 6 | ||||
-rw-r--r-- | scumm/logic_he.cpp | 19 | ||||
-rw-r--r-- | scumm/player_nes.h | 8 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 2 | ||||
-rw-r--r-- | scumm/thumbnail.cpp | 2 | ||||
-rw-r--r-- | simon/debugger.h | 1 | ||||
-rw-r--r-- | simon/simon.cpp | 9 | ||||
-rw-r--r-- | sky/debug.cpp | 2 | ||||
-rw-r--r-- | sky/debug.h | 1 | ||||
-rw-r--r-- | sound/fmopl.cpp | 4 | ||||
-rw-r--r-- | sound/mididrv.cpp | 8 | ||||
-rwxr-xr-x | tools/credits.pl | 3 |
35 files changed, 168 insertions, 49 deletions
diff --git a/backends/intern.h b/backends/intern.h index 56b78d14c8..5b8f712ee1 100644 --- a/backends/intern.h +++ b/backends/intern.h @@ -37,12 +37,15 @@ extern OSystem *OSystem_MAC_create(int gfx_mode, bool full_screen); extern OSystem *OSystem_GP32_create(); extern OSystem *OSystem_PALMOS_create(); extern OSystem *OSystem_PS2_create(); +extern OSystem *OSystem_SymbianOS_create(); #ifdef _WIN32_WCE #define SAMPLES_PER_SEC 22050 #define SAMPLES_PER_SEC_OLD 11025 #define SAMPLES_PER_SEC_NEW 22050 +#elif defined(__SYMBIAN32__) +#define SAMPLES_PER_SEC 16000 #elif defined(__PLAYSTATION2__) #define SAMPLES_PER_SEC 48000 // the SPU can't handle anything else #else 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); diff --git a/common/array.h b/common/array.h index 8116e94c9a..63b7fca533 100644 --- a/common/array.h +++ b/common/array.h @@ -47,7 +47,12 @@ public: _data[i] = array._data[i]; } - ~Array<T>() { +#ifdef __SYMBIAN32__ + ~Array() +#else + ~Array<T>() +#endif + { if (_data) delete [] _data; } diff --git a/common/config-file.cpp b/common/config-file.cpp index bec91a789e..5ce5ca4d8d 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -250,7 +250,7 @@ void ConfigFile::removeKey(const String &key, const String §ion) { Section *s = getSection(section); if (s) - return s->removeKey(key); + s->removeKey(key); } bool ConfigFile::getKey(const String &key, const String §ion, String &value) const { diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 8cd2ed3222..0d11ec6dd3 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -86,13 +86,15 @@ void ConfigManager::loadDefaultConfigFile() { else strcpy(configFile, DEFAULT_CONFIG_FILE); #else - #if defined (WIN32) && !defined(_WIN32_WCE) + #if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) GetWindowsDirectory(configFile, MAXPATHLEN); strcat(configFile, "\\" DEFAULT_CONFIG_FILE); #elif defined(__PALM_OS__) strcpy(configFile,"/PALM/Programs/ScummVM/" DEFAULT_CONFIG_FILE); #elif defined(__PLAYSTATION2__) strcpy(configFile, "mc0:ScummVM/" DEFAULT_CONFIG_FILE); + #elif defined (__SYMBIAN32__) + strcpy(configFile, SYMBIAN32_DOC_DIR DEFAULT_CONFIG_FILE); #else strcpy(configFile, DEFAULT_CONFIG_FILE); #endif diff --git a/common/debugger.cpp b/common/debugger.cpp index 8d967a1792..360ce8489f 100644 --- a/common/debugger.cpp +++ b/common/debugger.cpp @@ -65,6 +65,7 @@ int Debugger<T>::DebugPrintf(const char *format, ...) { return count; } +#ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :) template <class T> void Debugger<T>::attach(const char *entry) { @@ -105,6 +106,7 @@ void Debugger<T>::onFrame() { detach(); } } +#endif // of ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :) // Main Debugger Loop template <class T> diff --git a/common/debugger.h b/common/debugger.h index d93b6175a5..bf028a9cb5 100644 --- a/common/debugger.h +++ b/common/debugger.h @@ -38,9 +38,14 @@ public: int DebugPrintf(const char *format, ...); +#ifndef __SYMBIAN32__ // gcc/UIQ doesn't like the debugger code for some reason? Actually get a cc1plus core dump here :) virtual void onFrame(); virtual void attach(const char *entry = 0); +#else + void onFrame() {} + void attach(const char *entry = 0) {} +#endif bool isAttached() const { return _isAttached; } protected: diff --git a/common/list.h b/common/list.h index 7de13c2f91..03d6076635 100644 --- a/common/list.h +++ b/common/list.h @@ -121,7 +121,12 @@ public: insert(begin(), list.begin(), list.end()); } - ~List<T>() { +#ifndef __SYMBIAN32__ + ~List<T>() +#else + ~List() +#endif + { clear(); delete _anchor; } diff --git a/common/map.h b/common/map.h index ad264580a5..0dac581bd2 100644 --- a/common/map.h +++ b/common/map.h @@ -110,7 +110,12 @@ public: _header->_right = _header->_left = _header; } - virtual ~Map<Key, Value, Comparator>() { +#ifndef __SYMBIAN32__ + virtual ~Map<Key, Value, Comparator>() +#else + ~Map() +#endif + { clearNodes(_root); delete _header; _root = _header = 0; diff --git a/common/scummsys.h b/common/scummsys.h index a0ba3622c1..b1d7c13166 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -38,6 +38,11 @@ #define PI 3.14159265358979323846 #endif +// make sure we really are compiling for WIN32 +#ifndef WIN32 +#undef _MSC_VER +#endif + #if defined(_MSC_VER) #define scumm_stricmp stricmp @@ -289,6 +294,29 @@ typedef unsigned char byte; typedef unsigned int uint; #endif +#elif defined __SYMBIAN32__ // AnotherGuest / Sprawl / SumthinWicked + + #define scumm_stricmp strcasecmp + #define scumm_strnicmp strncasecmp + + #define CDECL + #define SCUMM_NEED_ALIGNMENT + #define SCUMM_LITTLE_ENDIAN + #define CHECK_HEAP + + #define FORCEINLINE inline + #define _HEAPOK 0 + typedef unsigned char byte; + typedef unsigned char uint8; + typedef unsigned short int uint16; + typedef unsigned long int uint32; + typedef unsigned int uint; + typedef signed char int8; + typedef signed short int int16; + typedef signed long int int32; + + #define START_PACK_STRUCTS pack (push,1) + #define END_PACK_STRUCTS pack(pop) #else #error No system type defined #endif diff --git a/common/singleton.h b/common/singleton.h index 5be31e2c24..dec2844124 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -45,7 +45,7 @@ private: * and you specialise makeInstance to return an instance of a subclass. */ //template <class T> -#if defined (_WIN32_WCE) || defined (_MSC_VER) +#if defined (_WIN32_WCE) || defined (_MSC_VER) || defined (__WINS__) //FIXME evc4 and msvc7 doesn't like it as private member public: #endif @@ -69,7 +69,11 @@ public: } protected: Singleton<T>() { } - virtual ~Singleton<T>() { } +#ifdef __SYMBIAN32__ + virtual ~Singleton() { } +#else + virtual ~Singleton<T>() { } +#endif typedef T SingletonBaseType; }; diff --git a/common/system.cpp b/common/system.cpp index 16b707e79e..1a717f292b 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -56,6 +56,8 @@ OSystem *OSystem::makeInstance() { return OSystem_PALMOS_create(); #elif defined(__PLAYSTATION2__) return OSystem_PS2_create(); +#elif defined(__SYMBIAN32__) // SumthinWicked / Sprawl + return OSystem_SymbianOS_create(); #else /* SDL is the default driver for now */ return OSystem_SDL_create(); diff --git a/common/util.cpp b/common/util.cpp index b1b657462e..831284d428 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -82,7 +82,12 @@ void hexdump(const byte * data, int len, int bytesPerLine) { RandomSource::RandomSource() { // Use system time as RNG seed. Normally not a good idea, if you are using // a RNG for security purposes, but good enough for our purposes. - setSeed(time(0)); +#if defined (__SYMBIAN32__) && defined (__WINS__) + uint32 seed = 0; // Symbian produces RT crash on time(0) +#else + uint32 seed = time(0); +#endif + setSeed(seed); } void RandomSource::setSeed(uint32 seed) { diff --git a/graphics/surface.h b/graphics/surface.h index fcdadf3b4a..2e98ec0bef 100644 --- a/graphics/surface.h +++ b/graphics/surface.h @@ -40,7 +40,8 @@ struct Surface { Surface() : pixels(0), w(0), h(0), pitch(0), bytesPerPixel(0) {} inline const void *getBasePtr(int x, int y) const { - return static_cast<const void *>(static_cast<const byte *>(pixels) + y * pitch + x * bytesPerPixel); + // SumthinWicked says: I was getting a typecast error here from GCC/UIQ: might need an #ifdef __SYMBIAN32__ + return static_cast<const void *>(static_cast<byte *>(pixels) + y * pitch + x * bytesPerPixel); } inline void *getBasePtr(int x, int y) { diff --git a/gui/console.cpp b/gui/console.cpp index 03163fb7ca..34dd303a31 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -542,6 +542,8 @@ int ConsoleDialog::vprintf(const char *format, va_list argptr) { #if defined(WIN32) int count = _vsnprintf(buf, sizeof(buf), format, argptr); +#elif defined(__SYMBIAN32__) + int count = vsprintf(buf, format, argptr); #else int count = vsnprintf(buf, sizeof(buf), format, argptr); #endif diff --git a/gui/credits.h b/gui/credits.h index 305b589dfa..51e7a17726 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -40,6 +40,8 @@ static const char *credits[] = { "\\L\\c2"" MT-32 emulator", "\\L\\c0"" Jochen Hoenicke", "\\L\\c2"" Speaker & PCjr sound support, Adlib work", +"\\L\\c0"" Jurgen Braam", +"\\L\\c2"" Port: EPOC/SymbianOS maintainer", "\\L\\c0""", "\\C\\c1""Retired Team Members:", "\\L\\c0"" Ralph Brorsen", @@ -105,6 +107,10 @@ static const char *credits[] = { "\\L\\c2"" SDL-based OpenGL renderer", "\\L\\c0"" Tim ???", "\\L\\c2"" Initial MI1 CD music support", +"\\L\\c0"" Andreas Karlsson", +"\\L\\c2"" Port: EPOC/SymbianOS, ESDL", +"\\L\\c0"" Lars Persson", +"\\L\\c2"" Port: EPOC/SymbianOS, Audio System, Alignment fixes, ESDL", "\\L\\c0""", "\\L\\c0""And to all the contributors, users, and beta testers we've missed. Thanks!", "\\L\\c0""", diff --git a/gui/newgui.cpp b/gui/newgui.cpp index fcaa45c819..5b8ab36ffc 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -48,6 +48,11 @@ enum { kKeyRepeatSustainDelay = 100 }; +#if defined(__SYMBIAN32__) // Testing: could be removed? Just making sure that an CVS update doesn't break my code :P +#define USE_AUTO_SCALING false +#else +#define USE_AUTO_SCALING false +#endif // Constructor NewGui::NewGui() : _needRedraw(false), diff --git a/queen/debug.cpp b/queen/debug.cpp index 26840975ea..d01d941eda 100644 --- a/queen/debug.cpp +++ b/queen/debug.cpp @@ -51,6 +51,7 @@ Debugger::Debugger(QueenEngine *vm) DCmd_Register("song", &Debugger::Cmd_Song); } +Debugger::~Debugger() {} // we need this here for __SYMBIAN32__ void Debugger::preEnter() { } diff --git a/queen/debug.h b/queen/debug.h index fd61f3c5bf..f4ecbda9a0 100644 --- a/queen/debug.h +++ b/queen/debug.h @@ -32,6 +32,7 @@ class Debugger : public Common::Debugger<Debugger> { public: Debugger(QueenEngine *vm); + virtual ~Debugger(); // we need this here for __SYMBIAN32__ archaic gcc/UIQ int flags() const { return _flags; } diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 3f79b18d65..cba5ed83d9 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -214,8 +214,8 @@ public: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); const String &getResultString() const; - void setList(const StringList& list) { GUI::ChooserDialog::setList(list); } - int runModal() { return GUI::ChooserDialog::runModal(); } + void setList(const StringList& list) { GUI_ChooserDialog::setList(list); } + int runModal() { return GUI_ChooserDialog::runModal(); } }; SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode) @@ -316,7 +316,7 @@ void SaveLoadChooserEx::setList(const StringList& list) { int SaveLoadChooserEx::runModal() { _gfxWidget->setGfx(0); - int ret = GUI::Dialog::runModal(); + int ret = Dialog::runModal(); return ret; } @@ -339,7 +339,7 @@ void SaveLoadChooserEx::handleCommand(CommandSender *sender, uint32 cmd, uint32 close(); break; case GUI::kListSelectionChangedCmd: { - const Graphics::Surface *thumb; + Graphics::Surface *thumb; thumb = _scumm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem); _gfxWidget->setGfx(thumb); delete thumb; @@ -357,7 +357,7 @@ void SaveLoadChooserEx::handleCommand(CommandSender *sender, uint32 cmd, uint32 case kCloseCmd: setResult(-1); default: - GUI::Dialog::handleCommand(sender, cmd, data); + Dialog::handleCommand(sender, cmd, data); } } diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index a06395b064..a27db42e00 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -1263,7 +1263,7 @@ void IMuseInternal::initMT32(MidiDriver *midi) { void IMuseInternal::initGM(MidiDriver *midi) { byte buffer[11]; - + int i=0; // General MIDI System On message // Resets all GM devices to default settings memcpy(&buffer[0], "\xF0\x7E\x7F\x09\x01\xF7", 6); @@ -1321,13 +1321,13 @@ void IMuseInternal::initGM(MidiDriver *midi) { // Set Channels 1-16 Reverb to 64, which is the // equivalent of MT-32 default Reverb Level 5 - for (int i = 0; i < 16; ++i) + for (i = 0; i < 16; ++i) midi->send(( 64 << 16) | (91 << 8) | (0xB0 | i)); debug(2, "GM Controller 91 Change: Channels 1-16 Reverb Level is 64"); // Set Channels 1-16 Pitch Bend Sensitivity to // 12 semitones; then lock the RPN by setting null. - for (int i = 0; i < 16; ++i) { + for (i = 0; i < 16; ++i) { midi->send(( 0 << 16) | (100 << 8) | (0xB0 | i)); midi->send(( 0 << 16) | (101 << 8) | (0xB0 | i)); midi->send(( 12 << 16) | (6 << 8) | (0xB0 | i)); diff --git a/scumm/logic_he.cpp b/scumm/logic_he.cpp index db1a88ec85..9909fbb0a3 100644 --- a/scumm/logic_he.cpp +++ b/scumm/logic_he.cpp @@ -401,8 +401,9 @@ int32 LogicHEfunshop::dispatch(int op, int numArgs, int32 *args) { void LogicHEfunshop::op_1004(int32 *args) { double data[8], at, sq; int32 x, y; + int i=0; - for (int i = 0; i <= 6; i += 2) { + for (i = 0; i <= 6; i += 2) { data[i] = getFromArray(args[0], 0, 519 + i); data[i + 1] = getFromArray(args[0], 0, 519 + i + 1); } @@ -414,14 +415,14 @@ void LogicHEfunshop::op_1004(int32 *args) { return; } - for (int i = 0; i <= 6; i += 2) { + for (i = 0; i <= 6; i += 2) { data[i] -= (double)x; data[i + 1] -= (double)y; } double a1 = (double)args[1] * DEG2RAD; - for (int i = 0; i <= 6; i += 2) { + for (i = 0; i <= 6; i += 2) { at = atan2(data[i + 1], data[i]); sq = hypot(data[i + 1], data[i]); @@ -435,14 +436,14 @@ void LogicHEfunshop::op_1004(int32 *args) { int minx = 2; int miny = 3; - for (int i = 0; i <= 6; i += 2) { + for (i = 0; i <= 6; i += 2) { if (data[i] < data[minx]) minx = i; if (data[i + 1] < data[miny]) miny = i + 1; } - for (int i = 0; i <= 6; i += 2) { + for (i = 0; i <= 6; i += 2) { data[i] -= data[minx]; data[i + 1] -= data[miny]; @@ -454,8 +455,8 @@ void LogicHEfunshop::op_1004(int32 *args) { void LogicHEfunshop::op_1005(int32 *args) { double data[8]; double args1, args2; - - for (int i = 520; i <= 526; i += 2) { + int i=0; + for (i = 520; i <= 526; i += 2) { data[i - 520] = getFromArray(args[0], 0, i - 1); data[i - 520 + 1] = getFromArray(args[0], 0, i); } @@ -463,12 +464,12 @@ void LogicHEfunshop::op_1005(int32 *args) { args1 = args[1] * 0.01 + 1; args2 = args[2] * 0.01 + 1; - for (int i = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { data[2 * i] *= args1; data[2 * i + 1] *= args2; } - for (int i = 520; i <= 526; i += 2) { + for (i = 520; i <= 526; i += 2) { putInArray(args[0], 0, i - 1, scumm_round(data[i - 520])); putInArray(args[0], 0, i, scumm_round(data[i - 520 + 1])); } diff --git a/scumm/player_nes.h b/scumm/player_nes.h index 1c5ec00c5e..ed939b0ab7 100644 --- a/scumm/player_nes.h +++ b/scumm/player_nes.h @@ -35,6 +35,10 @@ namespace Scumm { class ScummEngine; +static const int MAXVOLUME = 0x7F; +static const int NUMSLOTS = 3; +static const int NUMCHANS = 4; + /** * Scumm NES sound/music driver. */ @@ -77,10 +81,6 @@ private: int _current_sample; int _maxvol; - static const int MAXVOLUME = 0x7F; - static const int NUMSLOTS = 3; - static const int NUMCHANS = 4; - struct slot { int framesleft; int id; diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index fd5bc55315..8f8645b5f5 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -1198,8 +1198,8 @@ void SmushPlayer::tryCmpFile(const char *filename) { if (i == NULL) { error("invalid filename : %s", filename); } - char fname[260]; #ifdef USE_MAD + char fname[260]; memcpy(fname, filename, i - filename); strcpy(fname + (i - filename), ".mp3"); _compressedFile.open(fname); diff --git a/scumm/thumbnail.cpp b/scumm/thumbnail.cpp index 701b651b31..ac760afab7 100644 --- a/scumm/thumbnail.cpp +++ b/scumm/thumbnail.cpp @@ -103,7 +103,9 @@ Graphics::Surface *ScummEngine::loadThumbnail(Common::InSaveFile *file) { void ScummEngine::saveThumbnail(Common::OutSaveFile *file) { Graphics::Surface thumb; +#ifndef DISABLE_HQ_SCALERS // fcn has dep on HQ_SCALERS: thumbnail gets created as empty if (!createThumbnailFromScreen(&thumb)) +#endif thumb.create(kThumbnailWidth, kThumbnailHeight2, sizeof(uint16)); ThumbnailHeader header; diff --git a/simon/debugger.h b/simon/debugger.h index 975a4489a0..c4e230608e 100644 --- a/simon/debugger.h +++ b/simon/debugger.h @@ -31,6 +31,7 @@ class SimonEngine; class Debugger : public Common::Debugger<Debugger> { public: Debugger(SimonEngine *vm); + virtual ~Debugger() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ protected: SimonEngine *_vm; diff --git a/simon/simon.cpp b/simon/simon.cpp index ccb8ddfc6d..4a998fcc83 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -268,7 +268,7 @@ static const char* bad_versions[3] = { SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) : Engine(syst), midi(syst) { - + int j =0; _vcPtr = 0; _vc_get_out_of_code = 0; _gameOffsetsPtr = 0; @@ -321,11 +321,11 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst) if (Common::md5_file(buf, md5sum)) { char md5str[32+1]; - for (int j = 0; j < 16; j++) { + for (j = 0; j < 16; j++) { sprintf(md5str + j*2, "%02x", (int)md5sum[j]); } - for (int j = 0; j < 3; j++) { + for (j = 0; j < 3; j++) { if (!strcmp(md5str, bad_versions[j])) error("Cracked versions aren't supported"); } @@ -1697,6 +1697,7 @@ uint SimonEngine::get_fcs_ptr_3_index(FillOrCopyStruct *fcs) { return i; error("get_fcs_ptr_3_index: not found"); + return 0; } void SimonEngine::lock() { @@ -2280,6 +2281,7 @@ TextLocation *SimonEngine::getTextLocation(uint a) { default: error("text, invalid value %d", a); } + return NULL; } void SimonEngine::o_print_str() { @@ -3040,6 +3042,7 @@ uint SimonEngine::itemPtrToID(Item *id) { if (_itemArrayPtr[i] == id) return i; error("itemPtrToID: not found"); + return 0; } void SimonEngine::o_pathfind(int x, int y, uint var_1, uint var_2) { diff --git a/sky/debug.cpp b/sky/debug.cpp index 28b979f776..e33589f962 100644 --- a/sky/debug.cpp +++ b/sky/debug.cpp @@ -1290,6 +1290,8 @@ Debugger::Debugger(Logic *logic, Mouse *mouse, Screen *screen, SkyCompact *skyCo DCmd_Register("section", &Debugger::Cmd_Section); } +Debugger::~Debugger() {} // we need this here for __SYMBIAN32__ + void Debugger::preEnter() { } diff --git a/sky/debug.h b/sky/debug.h index 30908693be..6eb5b6c0b3 100644 --- a/sky/debug.h +++ b/sky/debug.h @@ -36,6 +36,7 @@ class SkyCompact; class Debugger : public Common::Debugger<Debugger> { public: Debugger(Logic *logic, Mouse *mouse, Screen *screen, SkyCompact *skyCompact); + virtual ~Debugger(); // we need this here for __SYMBIAN32__ archaic gcc/UIQ bool showGrid() { return _showGrid; } protected: diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp index 1ebe1b0348..40a73e465e 100644 --- a/sound/fmopl.cpp +++ b/sound/fmopl.cpp @@ -34,7 +34,7 @@ #include "common/util.h" -#ifdef _WIN32_WCE +#if defined (_WIN32_WCE)|| defined (__SYMBIAN32__) #include "common/config-manager.h" #endif @@ -1167,7 +1167,7 @@ FM_OPL *makeAdlibOPL(int rate) { // We need to emulate one YM3812 chip int env_bits = FMOPL_ENV_BITS_HQ; int eg_ent = FMOPL_EG_ENT_HQ; -#ifdef _WIN32_WCE +#if defined (_WIN32_WCE)|| defined(__SYMBIAN32__) if (ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) { env_bits = FMOPL_ENV_BITS_HQ; eg_ent = FMOPL_EG_ENT_HQ; diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 424ed915e8..35da9cb015 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -33,7 +33,7 @@ static const struct MidiDriverDescription midiDrivers[] = { {"auto", "Default", MD_AUTO}, {"null", "No music", MD_NULL}, -#if defined(WIN32) && !defined(_WIN32_WCE) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) {"windows", "Windows MIDI", MD_WINDOWS}, #endif @@ -126,7 +126,7 @@ int MidiDriver::detectMusicDriver(int midiFlags) { if (musicDriver == MD_AUTO || musicDriver < 0) { if (midiFlags & MDT_PREFER_NATIVE) { if (musicDriver == MD_AUTO) { - #if defined(WIN32) && !defined(_WIN32_WCE) + #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) musicDriver = MD_WINDOWS; // MD_WINDOWS is default MidiDriver on windows targets #elif defined(MACOSX) musicDriver = MD_COREAUDIO; @@ -134,7 +134,7 @@ int MidiDriver::detectMusicDriver(int midiFlags) { musicDriver = MD_YPA1; // TODO : change this and use Zodiac driver when needed #elif defined(__MORPHOS__) musicDriver = MD_ETUDE; - #elif defined(_WIN32_WCE) || defined(UNIX) || defined(X11_BACKEND) + #elif defined(_WIN32_WCE) || defined(UNIX) || defined(X11_BACKEND) || defined (__SYMBIAN32__) // Always use MIDI emulation via adlib driver on CE and UNIX device // TODO: We should, for the Unix targets, attempt to detect @@ -195,7 +195,7 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) { case MD_ZODIAC: return MidiDriver_Zodiac_create(); #endif #endif -#if defined(WIN32) && !defined(_WIN32_WCE) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) case MD_WINDOWS: return MidiDriver_WIN_create(); #endif #if defined(__MORPHOS__) diff --git a/tools/credits.pl b/tools/credits.pl index eb3b64c81b..7c35ce167d 100755 --- a/tools/credits.pl +++ b/tools/credits.pl @@ -337,6 +337,8 @@ begin_credits("Credits"); add_person("Hans-Jörg Frieden", "", "Port: AmigaOS 4"); add_person("Jerome Fisher", "KingGuppy", "MT-32 emulator"); add_person("Jochen Hoenicke", "hoenicke", "Speaker & PCjr sound support, Adlib work"); + add_person("Lars Persson", "AnotherGuest", "Port: EPOC/SymbianOS, ESDL"); + add_person("Jurgen Braam", "SumthinWicked", "Port: EPOC/SymbianOS maintainer"); end_section(); @@ -374,6 +376,7 @@ begin_credits("Credits"); add_person("Johannes Schickel", "LordHoto", "Thumbnails for ScummEngine"); add_person("André Souza", "", "SDL-based OpenGL renderer"); add_person("Tim ???", "realmz", "Initial MI1 CD music support"); + add_person("Andreas Karlsson", "Sprawl", "Port: EPOC/SymbianOS"); end_section(); |