aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/PalmOS/Src/be_base.cpp5
-rw-r--r--backends/platform/gp2x/gp2x.cpp2
-rw-r--r--backends/platform/iphone/osys_iphone.cpp6
-rw-r--r--backends/platform/iphone/osys_iphone.h1
-rw-r--r--backends/platform/sdl/sdl.cpp108
-rw-r--r--backends/platform/sdl/sdl.h3
-rw-r--r--backends/platform/symbian/README25
-rw-r--r--backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg1
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in2
-rw-r--r--backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg3
-rw-r--r--backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg1
-rw-r--r--backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg1
-rw-r--r--backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in2
-rw-r--r--backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg3
-rw-r--r--backends/platform/symbian/src/SymbianActions.cpp20
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp33
-rw-r--r--backends/platform/symbian/src/SymbianOS.h3
-rw-r--r--backends/platform/symbian/src/main_features.inl39
-rw-r--r--backends/platform/symbian/src/portdefs.h1
-rw-r--r--backends/platform/wii/Makefile99
-rw-r--r--backends/platform/wii/gx_supp.cpp47
-rw-r--r--backends/platform/wii/gx_supp.h7
-rw-r--r--backends/platform/wii/main.cpp4
-rw-r--r--backends/platform/wii/osystem.cpp34
-rw-r--r--backends/platform/wii/osystem.h7
-rw-r--r--backends/platform/wii/osystem_gfx.cpp75
-rw-r--r--backends/platform/wince/CEActionsPocket.cpp19
-rw-r--r--backends/platform/wince/CEActionsSmartphone.cpp19
-rw-r--r--backends/platform/wince/CEkeys/EventsBuffer.cpp3
-rw-r--r--backends/platform/wince/Makefile4
-rw-r--r--backends/platform/wince/missing/missing.cpp11
-rw-r--r--backends/platform/wince/wince-sdl.cpp22
32 files changed, 460 insertions, 150 deletions
diff --git a/backends/platform/PalmOS/Src/be_base.cpp b/backends/platform/PalmOS/Src/be_base.cpp
index afb3f15bae..32e68bde9f 100644
--- a/backends/platform/PalmOS/Src/be_base.cpp
+++ b/backends/platform/PalmOS/Src/be_base.cpp
@@ -30,6 +30,9 @@
#include "backends/timer/default/default-timer.h"
#include "sound/mixer.h"
+#define DEFAULT_SAVE_PATH "/PALM/Programs/ScummVM/Saved"
+
+
OSystem_PalmBase::OSystem_PalmBase() {
_overlayVisible = false;
@@ -100,7 +103,7 @@ void OSystem_PalmBase::initBackend() {
// Create the savefile manager, if none exists yet (we check for this to
// allow subclasses to provide their own).
if (_saveMgr == 0) {
- _saveMgr = new DefaultSaveFileManager();
+ _saveMgr = new DefaultSaveFileManager(DEFAULT_SAVE_PATH);
}
// Create and hook up the mixer, if none exists yet (we check for this to
diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp
index c138f6c54d..e5f062ed35 100644
--- a/backends/platform/gp2x/gp2x.cpp
+++ b/backends/platform/gp2x/gp2x.cpp
@@ -219,7 +219,7 @@ void OSystem_GP2X::initBackend() {
// Create the savefile manager, if none exists yet (we check for this to
// allow subclasses to provide their own).
if (_savefile == 0) {
- _savefile = new DefaultSaveFileManager();
+ _savefile = new DefaultSaveFileManager(savePath);
}
// Create and hook up the mixer, if none exists yet (we check for this to
diff --git a/backends/platform/iphone/osys_iphone.cpp b/backends/platform/iphone/osys_iphone.cpp
index fdef911d0a..3d5571cf3a 100644
--- a/backends/platform/iphone/osys_iphone.cpp
+++ b/backends/platform/iphone/osys_iphone.cpp
@@ -88,7 +88,7 @@ int OSystem_IPHONE::timerHandler(int t) {
}
void OSystem_IPHONE::initBackend() {
- _savefile = new DefaultSaveFileManager();
+ _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH);
_timer = new DefaultTimerManager();
gettimeofday(&_startTime, NULL);
@@ -1196,10 +1196,6 @@ const char* OSystem_IPHONE::getConfigPath() {
return SCUMMVM_PREFS_PATH;
}
-const char* OSystem_IPHONE::getSavePath() {
- return SCUMMVM_SAVE_PATH;
-}
-
void OSystem_IPHONE::migrateApp() {
// Migrate to the new 1.1.3 directory structure, if needed.
diff --git a/backends/platform/iphone/osys_iphone.h b/backends/platform/iphone/osys_iphone.h
index af883a62c9..c058686c8c 100644
--- a/backends/platform/iphone/osys_iphone.h
+++ b/backends/platform/iphone/osys_iphone.h
@@ -172,7 +172,6 @@ public:
static void migrateApp();
static const char* getConfigPath();
- static const char* getSavePath();
protected:
inline void addDirtyRect(int16 x1, int16 y1, int16 w, int16 h);
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index d8394b5c9c..5c3b87309d 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -23,9 +23,18 @@
*
*/
+#if defined(WIN32)
+#include <windows.h>
+#if defined(ARRAYSIZE)
+// winnt.h defines ARRAYSIZE, but we want our own one... - this is needed before including util.h
+#undef ARRAYSIZE
+#endif
+#endif
+
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/events.h"
+#include "common/file.h"
#include "common/util.h"
#include "backends/saves/default/default-saves.h"
@@ -40,6 +49,7 @@
#define SAMPLES_PER_SEC 22050
//#define SAMPLES_PER_SEC 44100
+
/*
* Include header files needed for the getFilesystemFactory() method.
*/
@@ -52,6 +62,18 @@
#endif
+#if defined(UNIX)
+#ifdef MACOSX
+#define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences"
+#else
+#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#endif
+#else
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+#endif
+
+
+
static Uint32 timer_handler(Uint32 interval, void *param) {
((DefaultTimerManager *)param)->handler();
return interval;
@@ -245,6 +267,92 @@ FilesystemFactory *OSystem_SDL::getFilesystemFactory() {
#endif
}
+static Common::String getDefaultConfigFileName() {
+ char configFile[MAXPATHLEN];
+#if defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+ OSVERSIONINFO win32OsVersion;
+ ZeroMemory(&win32OsVersion, sizeof(OSVERSIONINFO));
+ win32OsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&win32OsVersion);
+ // Check for non-9X version of Windows.
+ if (win32OsVersion.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) {
+ // Use the Application Data directory of the user profile.
+ if (win32OsVersion.dwMajorVersion >= 5) {
+ if (!GetEnvironmentVariable("APPDATA", configFile, sizeof(configFile)))
+ error("Unable to access application data directory");
+ } else {
+ if (!GetEnvironmentVariable("USERPROFILE", configFile, sizeof(configFile)))
+ error("Unable to access user profile directory");
+
+ strcat(configFile, "\\Application Data");
+ CreateDirectory(configFile, NULL);
+ }
+
+ strcat(configFile, "\\ScummVM");
+ CreateDirectory(configFile, NULL);
+ strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
+
+ if (fopen(configFile, "r") == NULL) {
+ // Check windows directory
+ char oldConfigFile[MAXPATHLEN];
+ GetWindowsDirectory(oldConfigFile, MAXPATHLEN);
+ strcat(oldConfigFile, "\\" DEFAULT_CONFIG_FILE);
+ if (fopen(oldConfigFile, "r")) {
+ printf("The default location of the config file (scummvm.ini) in ScummVM has changed,\n");
+ printf("under Windows NT4/2000/XP/Vista. You may want to consider moving your config\n");
+ printf("file from the old default location:\n");
+ printf("%s\n", oldConfigFile);
+ printf("to the new default location:\n");
+ printf("%s\n\n", configFile);
+ strcpy(configFile, oldConfigFile);
+ }
+ }
+ } else {
+ // Check windows directory
+ GetWindowsDirectory(configFile, MAXPATHLEN);
+ strcat(configFile, "\\" DEFAULT_CONFIG_FILE);
+ }
+#elif defined(UNIX)
+ // On UNIX type systems, by default we store the config file inside
+ // to the HOME directory of the user.
+ //
+ // GP2X is Linux based but Home dir can be read only so do not use
+ // it and put the config in the executable dir.
+ //
+ // On the iPhone, the home dir of the user when you launch the app
+ // from the Springboard, is /. Which we don't want.
+ const char *home = getenv("HOME");
+ if (home != NULL && strlen(home) < MAXPATHLEN)
+ snprintf(configFile, MAXPATHLEN, "%s/%s", home, DEFAULT_CONFIG_FILE);
+ else
+ strcpy(configFile, DEFAULT_CONFIG_FILE);
+#else
+ strcpy(configFile, DEFAULT_CONFIG_FILE);
+#endif
+
+ return configFile;
+}
+
+Common::SeekableReadStream *OSystem_SDL::openConfigFileForReading() {
+ Common::File *confFile = new Common::File();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+Common::WriteStream *OSystem_SDL::openConfigFileForWriting() {
+ Common::DumpFile *confFile = new Common::DumpFile();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
void OSystem_SDL::setWindowCaption(const char *caption) {
SDL_WM_SetCaption(caption, caption);
}
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 4ad588f5f5..1c1381ec5c 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -210,6 +210,9 @@ public:
virtual Common::SaveFileManager *getSavefileManager();
virtual FilesystemFactory *getFilesystemFactory();
+ virtual Common::SeekableReadStream *openConfigFileForReading();
+ virtual Common::WriteStream *openConfigFileForWriting();
+
protected:
bool _inited;
diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README
index 8ab729a4d0..db46dae8de 100644
--- a/backends/platform/symbian/README
+++ b/backends/platform/symbian/README
@@ -1,11 +1,11 @@
ScummVM - ScummVM ported to EPOC/SymbianOS
- Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
- Copyright (C) 2007 Lars 'AnotherGuest' Persson
- Copyright (C) 2007 Jurgen 'SumthinWicked' Braam
- Copyright (C) 2007 ScummVM Team
+ Copyright (C) 2008 ScummVM Team
+ Copyright (C) 2003-2008 Lars 'AnotherGuest' Persson
+ Copyright (C) 2002008 Jurgen 'SumthinWicked' Braam
+ Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
$Id$
@@ -13,21 +13,21 @@ About ScummVM
--------------
The original ports (uptil 0.7.1) were made by Andreas Karlsson and Lars Persson.
The main transition to 0.8.0CVS and all relevant changes were done by Jurgen Braam.
- Jurgen and Lars have successfully transfered all needed changes into CVS, with additional helpful tools for Symbian OS
+ Jurgen and Lars have successfully transfered all needed changes into CVS/SVN, with additional helpful tools for Symbian OS
- Release version: 0.10.0
+ Release version: 0.12.0
* This version is only supported on Symbian OS 9 devices due to compiler constraints for older devices. (That means UIQ3 and S60V3 devices)
- * Updated to SDL version 1.2.11 (previous version used was 1.2.8)
+ * Updated to SDL version 1.2.13 (previous version used was 1.2.2)
* Information about S60 devices can be found here http://wiki.scummvm.org/index.php/SymbianOS_S60
* Information about UIQ devices can be found here http://wiki.scummvm.org/index.php/SymbianOS_UIQ
* Best source of general information is the ScummVM forum, http://forums.scummvm.org
- * SVN builds (not frequently updated) can be found at http://anotherguest.k0.se
+ * SVN builds (not frequently updated) can be found at http://www.anotherguest.se
Games supported
---------------
The Symbian port of ScummVM supports all but Sword1 & 2 games. Some games might not run properly due to screenresolution or memory constraints.
-
+ Minimum free memory requirement is about 12MB to be able to start and run ScummVM, this is enough for most older games, but newer more resource hungry games, might require more.
Building ScummVM
---------------------
@@ -38,7 +38,7 @@ Building ScummVM
Lets just say the framework needs quite some time to set up and takes a while
to get used to. If you choose to continue you will need the following items:
- - UIQ 3.0 SDK (To build for UIQ3 devices)
+ - UIQ 3.x SDK (To build for UIQ3 devices)(Build scripts in SDK need tweaking in order to build scummvm since Symbian OS GCCE never builds as large projects as ScummVM before)
- UIQ 2.1 SDK (To build for UIQ2 devices);
http://www.symbian.com/developer/sdks_uiq.asp
@@ -72,8 +72,7 @@ Building ScummVM
http://flac.sourceforge.net/
- libmpeg2, a free MPEG-2 video stream decoder
- http://libmpeg2.sourceforge.net/
-
+ http://libmpeg2.sourceforge.net
Compiling ScummVM
-----------------
@@ -89,7 +88,7 @@ Building ScummVM
PETRAN.EXE will be the executable that is started.
- SDL: the latest version of SDL at this point in time is 1.2.12. This version
+ SDL: the latest version of SDL at this point in time is 1.2.13. This version
works great for compiling on other platforms.
zlib: the zlib-x.x.x.tar.gz does not come with UIQ .mpp build files, that's why
diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg
index 3afb7a094c..3f88ec918c 100644
--- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg
+++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg
@@ -52,6 +52,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat"
+"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall
""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL
diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
index 3fea916e43..8daf76138c 100644
--- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
@@ -50,7 +50,7 @@ LANG SC
END
EPOCSTACKSIZE 80000
-EPOCHEAPSIZE 3000000 64000000
+EPOCHEAPSIZE 5000000 64000000
START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
index a7126db4c8..6bd1fbd047 100644
--- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
+++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg
@@ -16,7 +16,7 @@
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;
; $URL:$
-; $Id:$
+; $Id$
;
;
@@ -63,6 +63,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"c:\data\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat"
+"..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall
""-"c:\data\scummvm\scummvm.ini",FILENULL
diff --git a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg
index 94d457b93a..29e318a479 100644
--- a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg
+++ b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg
@@ -53,6 +53,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat"
+"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall
""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL
diff --git a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg
index ca7f08d85f..0173da7699 100644
--- a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg
+++ b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg
@@ -53,6 +53,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat"
+"..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall
""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL
diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
index 0013d061ca..cf3d0c1d7b 100644
--- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
+++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in
@@ -51,7 +51,7 @@ LANG SC
END
EPOCSTACKSIZE 80000
-EPOCHEAPSIZE 3000000 64000000
+EPOCHEAPSIZE 5000000 64000000
START BITMAP ScummVM.mbm
TARGETPATH \Resource\Apps
diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
index 5d6ce01525..0883c88a21 100644
--- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
+++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg
@@ -16,7 +16,7 @@
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;
; $URL:$
-; $Id:$
+; $Id$
;
;
@@ -61,6 +61,7 @@
"..\..\..\..\dists\engine-data\sky.cpt"-"c:\shared\scummvm\sky.cpt"
"..\..\..\..\dists\engine-data\igor.tbl"-"c:\shared\scummvm\igor.tbl"
"..\..\..\..\dists\engine-data\lure.dat"-"c:\shared\scummvm\lure.dat"
+"..\..\..\..\dists\engine-data\drascula.dat"-"c:\shared\scummvm\drascula.dat"
; Config/log files: 'empty' will automagically be removed on uninstall
""-"c:\shared\scummvm\scummvm.ini",FILENULL
diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp
index 8fc35e9f8d..60e402632f 100644
--- a/backends/platform/symbian/src/SymbianActions.cpp
+++ b/backends/platform/symbian/src/SymbianActions.cpp
@@ -129,17 +129,20 @@ void SymbianActions::initInstanceGame() {
bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0);
bool is_sword1 = (gameid == "sword1");
bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0);
- bool is_sky = (strncmp(gameid.c_str(), "sky", 3) == 0);
- bool is_saga = (gameid == "saga");
+ bool is_queen = (gameid == "queen");
+ bool is_sky = (gameid == "sky");
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
- bool is_queen = (strncmp(gameid.c_str(), "queen", 5) == 0);
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
- bool is_kyra = (gameid == "kyra1");
+ bool is_saga = (gameid == "saga");
+ bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0);
bool is_samnmax = (gameid == "samnmax");
bool is_cine = (gameid == "cine");
bool is_touche = (gameid == "touche");
bool is_agi = (gameid == "agi");
bool is_parallaction = (gameid == "parallaction");
+ bool is_lure = (gameid == "lure");
+ bool is_feeble = (gameid == "feeble");
+ bool is_drascula = (strncmp(gameid.c_str(), "drascula",8) == 0);
Actions::initInstanceGame();
@@ -150,16 +153,16 @@ void SymbianActions::initInstanceGame() {
// Save
- if (is_simon || is_sword2 || is_gob || is_kyra || is_touche)
+ if (is_simon || is_sword2 || is_gob || is_kyra || is_touche || is_feeble)
_action_enabled[ACTION_SAVE] = false;
else {
_action_enabled[ACTION_SAVE] = true;
if (is_queen) {
- _key_action[ACTION_SAVE].setKey(Common::ASCII_F5, Common::KEYCODE_F5); // F1 key for FOTAQ
+ _key_action[ACTION_SAVE].setKey(Common::ASCII_F1, Common::KEYCODE_F1); // F1 key for FOTAQ
} else if (is_sky) {
_key_action[ACTION_SAVE].setKey(Common::ASCII_F5, Common::KEYCODE_F5);
- } else if (is_cine) {
+ } else if (is_cine || is_drascula) {
_key_action[ACTION_SAVE].setKey(Common::ASCII_F10, Common::KEYCODE_F10); // F10
} else if (is_agi) {
_key_action[ACTION_SAVE].setKey(Common::ASCII_ESCAPE, Common::KEYCODE_ESCAPE);
@@ -175,7 +178,8 @@ void SymbianActions::initInstanceGame() {
// Skip text
if (!is_cine && !is_parallaction)
_action_enabled[ACTION_SKIP_TEXT] = true;
- if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche)
+ if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
+ is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula)
_key_action[ACTION_SKIP_TEXT].setKey(Common::KEYCODE_ESCAPE, Common::KEYCODE_ESCAPE); // Escape key
else {
_key_action[ACTION_SKIP_TEXT].setKey(SDLK_PERIOD);
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index e3a4027d79..0ce44d1704 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -30,6 +30,7 @@
#include "backends/platform/symbian/src/SymbianActions.h"
#include "common/config-manager.h"
#include "common/events.h"
+#include "common/file.h"
#include "gui/Actions.h"
#include "gui/Key.h"
#include "gui/message.h"
@@ -42,6 +43,10 @@
#define SAMPLES_PER_SEC 16000
#endif
+
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+
+
#define KInputBufferLength 128
// Symbian libc file functionality in order to provide shared file handles
struct TSymbianFileEntry {
@@ -122,6 +127,34 @@ FilesystemFactory *OSystem_SDL_Symbian::getFilesystemFactory() {
return &SymbianFilesystemFactory::instance();
}
+static Common::String getDefaultConfigFileName() {
+ char configFile[MAXPATHLEN];
+ strcpy(configFile, Symbian::GetExecutablePath());
+ strcat(configFile, DEFAULT_CONFIG_FILE);
+ return configFile;
+}
+
+Common::SeekableReadStream *OSystem_SDL_Symbian::openConfigFileForReading() {
+ Common::File *confFile = new Common::File();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+Common::WriteStream *OSystem_SDL_Symbian::openConfigFileForWriting() {
+ Common::DumpFile *confFile = new Common::DumpFile();
+ assert(confFile);
+ if (!confFile->open(getDefaultConfigFileName())) {
+ delete confFile;
+ confFile = 0;
+ }
+ return confFile;
+}
+
+
OSystem_SDL_Symbian::zoneDesc OSystem_SDL_Symbian::_zones[TOTAL_ZONES] = {
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
diff --git a/backends/platform/symbian/src/SymbianOS.h b/backends/platform/symbian/src/SymbianOS.h
index 71d24f6286..68a6fb492f 100644
--- a/backends/platform/symbian/src/SymbianOS.h
+++ b/backends/platform/symbian/src/SymbianOS.h
@@ -71,6 +71,9 @@ protected:
static void symbianMixCallback(void *s, byte *samples, int len);
virtual FilesystemFactory *getFilesystemFactory();
+
+ virtual Common::SeekableReadStream *openConfigFileForReading();
+ virtual Common::WriteStream *openConfigFileForWriting();
public:
// vibration support
#ifdef USE_VIBRA_SE_PXXX
diff --git a/backends/platform/symbian/src/main_features.inl b/backends/platform/symbian/src/main_features.inl
index f572ddb3dd..30bbbea52c 100644
--- a/backends/platform/symbian/src/main_features.inl
+++ b/backends/platform/symbian/src/main_features.inl
@@ -27,62 +27,61 @@
// we want a list of supported engines visible in the program,
// because we also release special builds with only one engine
-#ifndef DISABLE_SCUMM
+#ifdef ENABLE_SCUMM
"SCUMM "
#endif
-#ifndef DISABLE_AGOS
+#ifdef ENABLE_AGOS
"AGOS "
#endif
-#ifndef DISABLE_SKY
+#ifdef ENABLE_SKY
"Sky "
#endif
-#ifndef DISABLE_QUEEN
+#ifdef ENABLE_QUEEN
"Queen "
#endif
-#ifndef DISABLE_GOB
+#ifdef ENABLE_GOB
"Gob "
#endif
-#ifndef DISABLE_SAGA
+#ifdef ENABLE_SAGA
"Saga "
#endif
-#ifndef DISABLE_KYRA
+#ifdef ENABLE_KYRA
"Kyra "
#endif
-#ifndef DISABLE_SWORD1
+#ifdef ENABLE_SWORD1
"Sword1 "
#endif
-#ifndef DISABLE_SWORD2
+#ifdef ENABLE_SWORD2
"Sword2 "
#endif
-#ifndef DISABLE_CINE
+#ifdef ENABLE_CINE
"Cine "
#endif
-#ifndef DISABLE_LURE
+#ifdef ENABLE_LURE
"Lure "
#endif
-#ifndef DISABLE_AGI
+#ifdef ENABLE_AGI
"AGI "
#endif
-#ifndef DISABLE_TOUCHE
+#ifdef ENABLE_TOUCHE
"Touche "
#endif
-#ifndef DISABLE_DRASCULA
+#ifdef ENABLE_DRASCULA
"Drascula "
#endif
-#ifndef DISABLE_IGOR
+#ifdef ENABLE_IGOR
"Igor "
#endif
-#ifndef DISABLE_PARALLACTION
+#ifdef ENABLE_PARALLACTION
"Parallaction "
#endif
-#ifndef DISABLE_CRUISE
+#ifdef ENABLE_CRUISE
"Cruise "
#endif
-#ifndef DISABLE_MADE
+#ifdef ENABLE_MADE
"MADE "
#endif
-
-#ifndef DISABLE_M4
+#ifdef ENABLE_M4
"M4 "
#endif
diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h
index 06a4cf374c..4577824b33 100644
--- a/backends/platform/symbian/src/portdefs.h
+++ b/backends/platform/symbian/src/portdefs.h
@@ -157,5 +157,6 @@ void inline *scumm_bsearch(const void *key, const void *base, size_t nmemb, size
namespace Symbian {
extern void FatalError(const char *msg);
extern char* GetExecutablePath();
+#define DYNAMIC_MODULES 1
}
#endif
diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile
index a52ceb1774..90ebcccb66 100644
--- a/backends/platform/wii/Makefile
+++ b/backends/platform/wii/Makefile
@@ -1,26 +1,32 @@
+# this enables port specific debug messages and redirects stdout/err over
+# usbgecko in memcard slot b
DEBUG_WII = 1
-ENABLE_SCUMM = 1
-ENABLE_SCUMM_7_8 = 1
-ENABLE_HE = 1
-# ENABLE_AGI = 1
-ENABLE_AGOS = 1
-ENABLE_CINE = 1
-ENABLE_CRUISE = 1
-ENABLE_DRASCULA = 1
-ENABLE_GOB = 1
-ENABLE_IGOR = 1
-ENABLE_KYRA = 1
-ENABLE_LURE = 1
-ENABLE_M4 = 1
-ENABLE_MADE = 1
-ENABLE_PARALLACTION = 1
-ENABLE_QUEEN = 1
-ENABLE_SAGA = 1
-ENABLE_SKY = 1
-ENABLE_SWORD1 = 1
-ENABLE_SWORD2 = 1
-ENABLE_TOUCHE = 1
+# builds a gamecube version. cleanup object files before flipping this
+GAMECUBE = 0
+
+ENABLE_SCUMM = STATIC_PLUGIN
+ENABLE_SCUMM_7_8 = STATIC_PLUGIN
+ENABLE_HE = STATIC_PLUGIN
+# ENABLE_AGI = STATIC_PLUGIN
+ENABLE_AGOS = STATIC_PLUGIN
+ENABLE_CINE = STATIC_PLUGIN
+ENABLE_CRUISE = STATIC_PLUGIN
+ENABLE_DRASCULA = STATIC_PLUGIN
+ENABLE_GOB = STATIC_PLUGIN
+ENABLE_IGOR = STATIC_PLUGIN
+ENABLE_KYRA = STATIC_PLUGIN
+ENABLE_LURE = STATIC_PLUGIN
+ENABLE_M4 = STATIC_PLUGIN
+ENABLE_MADE = STATIC_PLUGIN
+ENABLE_PARALLACTION = STATIC_PLUGIN
+ENABLE_QUEEN = STATIC_PLUGIN
+ENABLE_SAGA = STATIC_PLUGIN
+ENABLE_SKY = STATIC_PLUGIN
+ENABLE_SWORD1 = STATIC_PLUGIN
+ENABLE_SWORD2 = STATIC_PLUGIN
+ENABLE_TINSEL = STATIC_PLUGIN
+ENABLE_TOUCHE = STATIC_PLUGIN
DISABLE_HQ_SCALERS = 1
DISABLE_SCALERS = 1
@@ -30,7 +36,11 @@ USE_MAD = 1
USE_TREMOR = 1
USE_FLAC = 1
USE_MPEG2 = 1
+ifeq ($(GAMECUBE),1)
+USE_MT32EMU = 0
+else
USE_MT32EMU = 1
+endif
srcdir = ../../..
VPATH = $(srcdir)
@@ -54,21 +64,28 @@ MKDIR = mkdir -p
RM = rm -f
CP = cp -f
+ifeq ($(GAMECUBE),1)
+TARGET = scummvm-gc
+MACHDEP = -DGEKKO -DGAMECUBE -mogc -mcpu=750 -meabi -mhard-float \
+ -ffunction-sections -fdata-sections -fmodulo-sched
+LIBDIR = $(DEVKITPRO)/libogc/lib/cube
+LIBS = -lstdc++ -lfat -logc -lm
+else
TARGET = scummvm-wii
-
MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float \
-ffunction-sections -fdata-sections -fmodulo-sched
+LIBDIR = $(DEVKITPRO)/libogc/lib/wii
+LIBS = -lstdc++ -lfat -lwiiuse -lbte -logc -lm
+endif
INCDIR = $(srcdir) . $(srcdir)/engines/ $(DEVKITPRO)/libogc/include
-LIBDIR = $(DEVKITPRO)/libogc/lib/wii
CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ -Wno-multichar -Wno-long-long \
- -Wno-unknown-pragmas -Wno-reorder -fno-exceptions -fno-rtti
+ -Wno-unknown-pragmas -Wno-reorder -fno-exceptions -fno-rtti
CXXFLAGS += $(addprefix -I,$(INCDIR))
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map
LDFLAGS += $(addprefix -L,$(LIBDIR))
-LIBS = -lstdc++ -lfat -lwiiuse -lbte -logc -lm
CXXFLAGS += -I$(DEVKITPRO)/3rd/wii/include
LDFLAGS += -L$(DEVKITPRO)/3rd/wii/lib
@@ -138,19 +155,27 @@ distclean-wii:
@-$(RM) dist
upload:
+ifeq ($(GAMECUBE),1)
+ $(DEVKITPPC)/bin/geckoupload $(TARGET).dol
+else
$(DEVKITPPC)/bin/wiiload $(TARGET).dol
+endif
dist:
- $(MKDIR) dist/apps/scummvm
- $(CP) $(TARGET).dol dist/apps/scummvm/boot.dol
- $(CP) $(DISTPATH)/meta.xml dist/apps/scummvm/
- $(CP) $(DISTPATH)/icon.png dist/apps/scummvm/
- $(CP) $(DISTPATH)/READMII dist/apps/scummvm/
- $(CP) $(srcdir)/AUTHORS dist/apps/scummvm/
- $(CP) $(srcdir)/COPYING dist/apps/scummvm/
- $(CP) $(srcdir)/COPYRIGHT dist/apps/scummvm/
- $(CP) $(srcdir)/NEWS dist/apps/scummvm/
- $(CP) $(srcdir)/README dist/apps/scummvm/
- $(CP) $(DIST_FILES_THEMES) dist/apps/scummvm/
- $(CP) $(DIST_FILES_ENGINEDATA) dist/apps/scummvm/
+ $(MKDIR) dist/scummvm
+ifeq ($(GAMECUBE),1)
+ $(CP) $(TARGET).dol dist/scummvm/
+else
+ $(CP) $(TARGET).dol dist/scummvm/boot.dol
+ $(CP) $(DISTPATH)/meta.xml dist/scummvm/
+ $(CP) $(DISTPATH)/icon.png dist/scummvm/
+endif
+ $(CP) $(DISTPATH)/READMII dist/scummvm/
+ $(CP) $(srcdir)/AUTHORS dist/scummvm/
+ $(CP) $(srcdir)/COPYING dist/scummvm/
+ $(CP) $(srcdir)/COPYRIGHT dist/scummvm/
+ $(CP) $(srcdir)/NEWS dist/scummvm/
+ $(CP) $(srcdir)/README dist/scummvm/
+ $(CP) $(DIST_FILES_THEMES) dist/scummvm/
+ $(CP) $(DIST_FILES_ENGINEDATA) dist/scummvm/
diff --git a/backends/platform/wii/gx_supp.cpp b/backends/platform/wii/gx_supp.cpp
index 4c7b8ed58a..436deddbb8 100644
--- a/backends/platform/wii/gx_supp.cpp
+++ b/backends/platform/wii/gx_supp.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
* Generic GX Support for Emulators
* softdev 2007
+* dhewg 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,12 +22,13 @@
* These are pretty standard functions to setup and use GX scaling.
****************************************************************************/
-#include <gccore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
+#include "gx_supp.h"
+
#define DEFAULT_FIFO_SIZE (256 * 1024)
#define HASPECT 320
@@ -39,18 +41,19 @@ extern "C" {
/*** 2D ***/
static u32 whichfb;
static u32 *xfb[2];
-static GXRModeObj *vmode;
+GXRModeObj *vmode = NULL;
/*** 3D GX ***/
static u8 *gp_fifo;
/*** Texture memory ***/
-static u8 *texturemem;
+static u8 *texturemem = NULL;
static u32 texturesize;
-GXTexObj texobj;
+static GXTexObj texobj;
static Mtx view;
static u16 vwidth, vheight, oldvwidth, oldvheight;
+static float tex_xT = 0.0f, tex_yT = 0.0f;
/* New texture based scaler */
typedef struct tagcamera {
@@ -74,6 +77,10 @@ static camera cam = {
void GX_InitVideo() {
vmode = VIDEO_GetPreferredMode(NULL);
+
+ vmode->viWidth = 678;
+ vmode->viXOrigin = (VI_MAX_WIDTH_PAL - 678) / 2;
+
VIDEO_Configure(vmode);
xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(vmode));
@@ -93,6 +100,15 @@ void GX_InitVideo() {
VIDEO_WaitVSync();
}
+void GX_SetTexTrans(float xT, float yT) {
+ tex_xT = xT;
+ tex_yT = yT;
+}
+
+void GX_SetCamPosZ(float f) {
+ cam.pos.z = f;
+}
+
/****************************************************************************
* Scaler Support Functions
****************************************************************************/
@@ -128,7 +144,7 @@ static void draw_square(Mtx v) {
Mtx mv;
guMtxIdentity(m);
- guMtxTransApply(m, m, 0, 0, -100);
+ guMtxTransApply(m, m, tex_xT, tex_yT, -100);
guMtxConcat(v, m, mv);
GX_LoadPosMtxImm(mv, GX_PNMTX0);
@@ -144,9 +160,9 @@ static void draw_square(Mtx v) {
* StartGX
****************************************************************************/
void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect) {
+ static bool inited = false;
Mtx p;
-
- GX_AbortFrame();
+ GXColor gxbackground = { 0, 0, 0, 0xff };
/*** Set new aspect ***/
square[0] = square[9] = -haspect;
@@ -156,9 +172,20 @@ void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect) {
/*** Allocate 32byte aligned texture memory ***/
texturesize = (width * height) * 2;
+
+ if (texturemem)
+ free(texturemem);
+
texturemem = (u8 *) memalign(32, texturesize);
+ memset(texturemem, 0, texturesize);
- GXColor gxbackground = { 0, 0, 0, 0xff };
+ /*** Setup for first call to scaler ***/
+ oldvwidth = oldvheight = -1;
+
+ if (inited)
+ return;
+
+ inited = true;
/*** Clear out FIFO area ***/
memset(gp_fifo, 0, DEFAULT_FIFO_SIZE);
@@ -184,12 +211,8 @@ void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect) {
guPerspective(p, 60, 1.33f, 10.0f, 1000.0f);
GX_LoadProjectionMtx(p, GX_PERSPECTIVE);
- memset(texturemem, 0, texturesize);
GX_Flush();
-
- /*** Setup for first call to scaler ***/
- vwidth = vheight = -1;
}
/****************************************************************************
diff --git a/backends/platform/wii/gx_supp.h b/backends/platform/wii/gx_supp.h
index 9393e93a26..108a94f0e7 100644
--- a/backends/platform/wii/gx_supp.h
+++ b/backends/platform/wii/gx_supp.h
@@ -1,6 +1,7 @@
/****************************************************************************
* Generic GX Scaler
* softdev 2007
+* dhewg 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,11 +24,17 @@
#ifndef _WII_GX_SUPP_H_
#define _WII_GX_SUPP_H_
+#include <gccore.h>
+
#ifdef __cplusplus
extern "C" {
#endif
+extern GXRModeObj *vmode;
+
void GX_InitVideo();
+void GX_SetTexTrans(float xT, float yT);
+void GX_SetCamPosZ(float f);
void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect);
void GX_Render(u16 width, u16 height, u8 *buffer, u16 pitch);
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
index 5753ecefe4..8bb1bff904 100644
--- a/backends/platform/wii/main.cpp
+++ b/backends/platform/wii/main.cpp
@@ -62,7 +62,9 @@ int main(int argc, char *argv[]) {
printf("startup\n");
SYS_SetResetCallback(reset_cb);
+#ifndef GAMECUBE
SYS_SetPowerCallback(power_cb);
+#endif
if (!fatInitDefault()) {
printf("fatInitDefault failed\n");
@@ -75,7 +77,7 @@ int main(int argc, char *argv[]) {
if (!strcmp(buf, "fat:/"))
chdir("/apps/scummvm");
- //fatEnableReadAhead(PI_DEFAULT, 32, 128);
+ fatEnableReadAhead(PI_DEFAULT, 32, 128);
}
g_system = new OSystem_Wii();
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 9e708345c5..505f93c820 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -19,8 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "osystem.h"
#include "backends/fs/wii/wii-fs-factory.h"
+#include "common/config-manager.h"
+
+#include "osystem.h"
#include <unistd.h>
@@ -51,7 +53,9 @@ OSystem_Wii::OSystem_Wii() :
_currentHeight(0),
_supportedGraphicsModes(NULL),
- _activeGraphicsMode(-1),
+ _activeGraphicsMode(0),
+
+ _fullscreen(false),
_mouseVisible(false),
_mouseX(0),
@@ -89,11 +93,17 @@ OSystem_Wii::~OSystem_Wii() {
void OSystem_Wii::initBackend() {
_startup_time = gettime();
+
+ char buf[MAXPATHLEN];
+ if (!getcwd(buf, MAXPATHLEN))
+ strcpy(buf, "/");
- _savefile = new DefaultSaveFileManager();
+ _savefile = new DefaultSaveFileManager(buf);
_mixer = new Audio::MixerImpl(this);
_timer = new DefaultTimerManager();
+ _fullscreen = ConfMan.getBool("fullscreen");
+
initGfx();
initSfx();
initEvents();
@@ -108,14 +118,28 @@ void OSystem_Wii::quit() {
}
bool OSystem_Wii::hasFeature(Feature f) {
- return f == kFeatureCursorHasPalette;
+ return (f == kFeatureFullscreenMode) ||
+ (f == kFeatureCursorHasPalette);
}
void OSystem_Wii::setFeatureState(Feature f, bool enable) {
+ switch (f) {
+ case kFeatureFullscreenMode:
+ _fullscreen = enable;
+ setGraphicsMode(_activeGraphicsMode);
+ break;
+ default:
+ break;
+ }
}
bool OSystem_Wii::getFeatureState(Feature f) {
- return false;
+ switch (f) {
+ case kFeatureFullscreenMode:
+ return _fullscreen;
+ default:
+ return false;
+ }
}
uint32 OSystem_Wii::getMillis() {
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 7fbc560b1a..94c0fa76b3 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -22,9 +22,9 @@
#ifndef _WII_OSYSTEM_H_
#define _WII_OSYSTEM_H_
-#include "common/system.h"
#include "base/main.h"
-
+#include "common/system.h"
+#include "common/fs.h"
#include "common/rect.h"
#include "common/events.h"
@@ -73,6 +73,8 @@ private:
OSystem::GraphicsMode *_supportedGraphicsModes;
s32 _activeGraphicsMode;
+ bool _fullscreen;
+
bool _mouseVisible;
s32 _mouseX, _mouseY;
u32 _mouseWidth, _mouseHeight;
@@ -110,7 +112,6 @@ public:
virtual bool getFeatureState(Feature f);
virtual const GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
- bool setGraphicsMode(const char *name);
virtual bool setGraphicsMode(int mode);
virtual int getGraphicsMode() const;
virtual void initSize(uint width, uint height);
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 1e54233c93..faad41d5f0 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -27,7 +27,12 @@
#define MAX_FPS 30
enum GraphicModeID {
- GM_DEFAULT
+ GM_DEFAULT = 0,
+ GM_OVERSCAN1,
+ GM_OVERSCAN2,
+ GM_OVERSCAN3,
+ GM_OVERSCAN4,
+ GM_OVERSCAN5
};
void OSystem_Wii::initGfx() {
@@ -42,6 +47,11 @@ void OSystem_Wii::initGfx() {
_overlayWidth = 640;
_overlayHeight = 480;
+#ifndef GAMECUBE
+ if (CONF_GetAspectRatio() && _fullscreen)
+ _overlayHeight = 360;
+#endif
+
_overlaySize = _overlayWidth * _overlayHeight * 2;
_overlayPixels = (OverlayColor *) memalign(32, _overlaySize);
@@ -51,17 +61,32 @@ void OSystem_Wii::initGfx() {
_cursorPalette = (u16 *) memalign(32, 256 * 2);
memset(_cursorPalette, 0, 256 * 2);
- _supportedGraphicsModes = new OSystem::GraphicsMode[2];
- _supportedGraphicsModes[0].name = strdup("gx");
- _supportedGraphicsModes[0].description = strdup("wii hardware scaler");
+ _supportedGraphicsModes = new OSystem::GraphicsMode[7];
+ _supportedGraphicsModes[0].name = strdup("standard");
+ _supportedGraphicsModes[0].description = strdup("standard");
_supportedGraphicsModes[0].id = GM_DEFAULT;
- _supportedGraphicsModes[1].name = 0;
- _supportedGraphicsModes[1].description = 0;
- _supportedGraphicsModes[1].id = 0;
-
- _texture = (u16 *) memalign(32, _overlaySize);
-
- GX_Start(_overlayWidth, _overlayHeight, 320, 240);
+ _supportedGraphicsModes[1].name = strdup("overscan1");
+ _supportedGraphicsModes[1].description = strdup("overscan 1");
+ _supportedGraphicsModes[1].id = GM_OVERSCAN1;
+ _supportedGraphicsModes[2].name = strdup("overscan2");
+ _supportedGraphicsModes[2].description = strdup("overscan 2");
+ _supportedGraphicsModes[2].id = GM_OVERSCAN2;
+ _supportedGraphicsModes[3].name = strdup("overscan3");
+ _supportedGraphicsModes[3].description = strdup("overscan 3");
+ _supportedGraphicsModes[3].id = GM_OVERSCAN3;
+ _supportedGraphicsModes[4].name = strdup("overscan4");
+ _supportedGraphicsModes[4].description = strdup("overscan 4");
+ _supportedGraphicsModes[4].id = GM_OVERSCAN4;
+ _supportedGraphicsModes[5].name = strdup("overscan5");
+ _supportedGraphicsModes[5].description = strdup("overscan 5");
+ _supportedGraphicsModes[5].id = GM_OVERSCAN5;
+ _supportedGraphicsModes[6].name = 0;
+ _supportedGraphicsModes[6].description = 0;
+ _supportedGraphicsModes[6].id = 0;
+
+ _texture = (u16 *) memalign(32, 640 * 480 * 2);
+
+ setGraphicsMode(_activeGraphicsMode);
}
void OSystem_Wii::deinitGfx() {
@@ -111,13 +136,24 @@ int OSystem_Wii::getDefaultGraphicsMode() const {
return GM_DEFAULT;
}
-bool OSystem_Wii::setGraphicsMode(const char *mode) {
- setGraphicsMode(GM_DEFAULT);
+bool OSystem_Wii::setGraphicsMode(int mode) {
+ s16 xar, yar;
- return true;
-}
+ printf("setGraphicsMode %d\n", mode);
+
+ xar = vmode->viWidth / 2;
+ yar = vmode->xfbHeight / 2;
+
+#ifndef GAMECUBE
+ if (CONF_GetAspectRatio() && !_fullscreen)
+ xar /= 1.33f;
+#endif
+
+ GX_SetCamPosZ(400 - mode * 10);
+ GX_Start(640, 480, xar, yar);
+
+ _activeGraphicsMode = mode;
-bool OSystem_Wii::setGraphicsMode(int mode) {
return true;
}
@@ -129,6 +165,8 @@ void OSystem_Wii::initSize(uint width, uint height) {
if (_gameWidth != width || _gameHeight != height) {
printf("initSize %u %u\n", width, height);
+ assert((width <= 640) && (height <= 480));
+
_gameWidth = width;
_gameHeight = height;
@@ -136,12 +174,15 @@ void OSystem_Wii::initSize(uint width, uint height) {
free(_gamePixels);
_gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight);
+ memset(_gamePixels, 0, _gameWidth * _gameHeight);
if (!_overlayVisible) {
_currentWidth = _gameWidth;
_currentHeight = _gameHeight;
updateEventScreenResolution();
}
+
+ setGraphicsMode(_activeGraphicsMode);
}
}
@@ -320,6 +361,8 @@ void OSystem_Wii::unlockScreen() {
}
void OSystem_Wii::setShakePos(int shakeOffset) {
+ GX_SetTexTrans(0, (float) -shakeOffset * ((float) vmode->efbHeight /
+ (float) _currentHeight));
}
void OSystem_Wii::showOverlay() {
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp
index 45310dba88..3626c4c10b 100644
--- a/backends/platform/wince/CEActionsPocket.cpp
+++ b/backends/platform/wince/CEActionsPocket.cpp
@@ -121,7 +121,7 @@ void CEActionsPocket::initInstanceGame() {
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
bool is_saga = (gameid == "saga");
- bool is_kyra = (gameid == "kyra1");
+ bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0);
bool is_samnmax = (gameid == "samnmax");
bool is_cine = (gameid == "cine");
bool is_touche = (gameid == "touche");
@@ -129,11 +129,13 @@ void CEActionsPocket::initInstanceGame() {
bool is_parallaction = (gameid == "parallaction");
bool is_lure = (gameid == "lure");
bool is_feeble = (gameid == "feeble");
+ bool is_drascula = (strncmp(gameid.c_str(), "drascula",8) == 0);
GUI_Actions::initInstanceGame();
// See if a right click mapping could be needed
- if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction)
+ if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob ||
+ is_samnmax || is_cine || is_touche || is_parallaction || is_drascula)
_right_click_needed = true;
// See if a "hide toolbar" mapping could be needed
@@ -153,7 +155,7 @@ void CEActionsPocket::initInstanceGame() {
} else if (is_sky) {
_action_enabled[POCKET_ACTION_SAVE] = true;
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5);
- } else if (is_cine) {
+ } else if (is_cine || is_drascula) {
_action_enabled[POCKET_ACTION_SAVE] = true;
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10
} else if (is_agi) {
@@ -171,7 +173,8 @@ void CEActionsPocket::initInstanceGame() {
// Skip
if (!is_cine && !is_parallaction)
_action_enabled[POCKET_ACTION_SKIP] = true;
- if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche || is_lure || is_feeble)
+ if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
+ is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula)
_key_action[POCKET_ACTION_SKIP].setKey(VK_ESCAPE);
else
_key_action[POCKET_ACTION_SKIP].setKey(KEY_ALL_SKIP);
@@ -212,7 +215,7 @@ CEActionsPocket::~CEActionsPocket() {
}
bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
- static bool keydialogrunning = false;
+ static bool keydialogrunning = false, quitdialog = false;
if (!pushed) {
switch(action) {
@@ -289,12 +292,14 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
_CESystem->move_cursor_right();
return true;
case POCKET_ACTION_QUIT:
- {
+ if (!quitdialog) {
+ quitdialog = true;
GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No");
if (alert.runModal() == GUI::kMessageOK)
_mainSystem->quit();
- return true;
+ quitdialog = false;
}
+ return true;
case POCKET_ACTION_BINDKEYS:
if (!keydialogrunning) {
keydialogrunning = true;
diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp
index 97d780d534..87f73f5a66 100644
--- a/backends/platform/wince/CEActionsSmartphone.cpp
+++ b/backends/platform/wince/CEActionsSmartphone.cpp
@@ -111,7 +111,7 @@ void CEActionsSmartphone::initInstanceGame() {
bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0);
bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0);
bool is_saga = (gameid == "saga");
- bool is_kyra = (gameid == "kyra1");
+ bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0);
bool is_samnmax = (gameid == "samnmax");
bool is_cine = (gameid == "cine");
bool is_touche = (gameid == "touche");
@@ -119,11 +119,13 @@ void CEActionsSmartphone::initInstanceGame() {
bool is_parallaction = (gameid == "parallaction");
bool is_lure = (gameid == "lure");
bool is_feeble = (gameid == "feeble");
+ bool is_drascula = (strncmp(gameid.c_str(), "drascula",8) == 0);
GUI_Actions::initInstanceGame();
// See if a right click mapping could be needed
- if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction)
+ if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob ||
+ is_samnmax || is_cine || is_touche || is_parallaction || is_drascula)
_right_click_needed = true;
// Initialize keys for different actions
@@ -136,7 +138,7 @@ void CEActionsSmartphone::initInstanceGame() {
} else if (is_sky) {
_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
_key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5);
- } else if (is_cine) {
+ } else if (is_cine || is_drascula) {
_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
_key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); //F10
} else if (is_agi) {
@@ -151,7 +153,8 @@ void CEActionsSmartphone::initInstanceGame() {
}
// Skip
_action_enabled[SMARTPHONE_ACTION_SKIP] = true;
- if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_saga || is_kyra || is_touche || is_lure || is_feeble)
+ if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob ||
+ is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula)
_key_action[SMARTPHONE_ACTION_SKIP].setKey(VK_ESCAPE);
else
_key_action[SMARTPHONE_ACTION_SKIP].setKey(KEY_ALL_SKIP);
@@ -176,7 +179,7 @@ CEActionsSmartphone::~CEActionsSmartphone() {
}
bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
- static bool keydialogrunning = false;
+ static bool keydialogrunning = false, quitdialog = false;
if (!pushed) {
switch (action) {
@@ -247,12 +250,14 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
_CESystem->smartphone_rotate_display();
return true;
case SMARTPHONE_ACTION_QUIT:
- {
+ if (!quitdialog) {
+ quitdialog = true;
GUI::MessageDialog alert(" Are you sure you want to quit ? ", "Yes", "No");
if (alert.runModal() == GUI::kMessageOK)
_mainSystem->quit();
- return true;
+ quitdialog = false;
}
+ return true;
}
return false;
diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp
index 92a21ab7ad..f31a77570f 100644
--- a/backends/platform/wince/CEkeys/EventsBuffer.cpp
+++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp
@@ -36,9 +36,8 @@ namespace CEKEYS {
key->setKey(key->keycode());
ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP);
- ev.key.keysym.mod = (SDLMod)key->flags();
+ ev.key.keysym.unicode = (SDLMod)key->flags(); // HACK: put the flags into the unused unicode field
ev.key.keysym.sym = (SDLKey)key->keycode();
- ev.key.keysym.unicode = key->keycode();
ev.key.keysym.mod = KMOD_RESERVED;
return (SDL_PushEvent(&ev) == 0);
}
diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile
index 176971067e..4400d50e3a 100644
--- a/backends/platform/wince/Makefile
+++ b/backends/platform/wince/Makefile
@@ -34,9 +34,11 @@ ENABLE_SWORD1 = STATIC_PLUGIN
ENABLE_SWORD2 = STATIC_PLUGIN
ENABLE_TOUCHE = STATIC_PLUGIN
ENABLE_PARALLACTION = STATIC_PLUGIN
+ENABLE_DRASCULA = STATIC_PLUGIN
#ENABLE_CRUISE = STATIC_PLUGIN
-#ENABLE_DRASCULA = STATIC_PLUGIN
#ENABLE_IGOR = STATIC_PLUGIN
+#ENABLE_M4 = STATIC_PLUGIN
+#ENABLE_MADE = STATIC_PLUGIN
########################################################################
## Pick which libraries you want to use here
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index c760b1f7df..f03f00bb9a 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -171,7 +171,7 @@ int _access(const char *path, int mode) {
MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname)/sizeof(TCHAR));
WIN32_FIND_DATA ffd;
- HANDLE h=FindFirstFile(fname, &ffd);
+ HANDLE h = FindFirstFile(fname, &ffd);
FindClose(h);
if (h == INVALID_HANDLE_VALUE)
@@ -179,9 +179,14 @@ int _access(const char *path, int mode) {
if (ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
// WORKAROUND: WinCE (or the emulator) sometimes returns bogus direcotry
- // hits for files that don't exist. Checking for the same fname twice
+ // hits for files that don't exist. TRIPLE checking for the same fname
// seems to weed out those false positives.
- HANDLE h=FindFirstFile(fname, &ffd);
+ // Exhibited in kyra engine.
+ HANDLE h = FindFirstFile(fname, &ffd);
+ FindClose(h);
+ if (h == INVALID_HANDLE_VALUE)
+ return -1; //Can't find file
+ h = FindFirstFile(fname, &ffd);
FindClose(h);
if (h == INVALID_HANDLE_VALUE)
return -1; //Can't find file
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 3f16b4fdd1..48f157f6ff 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -805,8 +805,16 @@ void OSystem_WINCE3::setupMixer() {
debug(1, "Sound opened OK, mixing at %d Hz", _sampleRate);
// Re-create mixer to match the output rate
+ int vol1 = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType);
+ int vol2 = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ int vol3 = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
+ int vol4 = _mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType);
delete(_mixer);
_mixer = new Audio::MixerImpl(this);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol1);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol2);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol3);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, vol4);
_mixer->setOutputRate(_sampleRate);
_mixer->setReady(true);
SDL_PauseAudio(0);
@@ -2254,15 +2262,18 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) {
_lastKeyPressed = 0;
event.type = Common::EVENT_PREDICTIVE_DIALOG;
return true;
- }
-
- event.type = Common::EVENT_KEYDOWN;
+ } event.type = Common::EVENT_KEYDOWN;
if (!_unfilteredkeys)
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
else
event.kbd.keycode = (Common::KeyCode)mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode, _unfilteredkeys);
event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode, _unfilteredkeys);
+ if (ev.key.keysym.mod == KMOD_RESERVED && ev.key.keysym.unicode == KMOD_SHIFT) {
+ event.kbd.ascii ^= 0x20;
+ event.kbd.flags = Common::KBD_SHIFT;
+ }
+
return true;
case SDL_KEYUP:
@@ -2290,6 +2301,11 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) {
event.kbd.keycode = (Common::KeyCode)mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode, _unfilteredkeys);
event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode, _unfilteredkeys);
+ if (ev.key.keysym.mod == KMOD_RESERVED && ev.key.keysym.unicode == KMOD_SHIFT) {
+ event.kbd.ascii ^= 0x20;
+ event.kbd.flags = Common::KBD_SHIFT;
+ }
+
return true;
case SDL_MOUSEMOTION: