aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wince
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/wince')
-rw-r--r--backends/platform/wince/CEActionsPocket.cpp16
-rw-r--r--backends/platform/wince/CEActionsSmartphone.cpp17
-rw-r--r--backends/platform/wince/CEScaler.cpp13
-rw-r--r--backends/platform/wince/CEgui/SDL_ImageResource.cpp2
-rw-r--r--backends/platform/wince/Makefile11
-rw-r--r--backends/platform/wince/README-WinCE.txt64
-rw-r--r--backends/platform/wince/missing/missing.cpp2
-rw-r--r--backends/platform/wince/module.mk21
-rw-r--r--backends/platform/wince/wince-sdl.cpp58
-rw-r--r--backends/platform/wince/wince.mk5
10 files changed, 147 insertions, 62 deletions
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp
index 1f6eeb3770..45dbad12cc 100644
--- a/backends/platform/wince/CEActionsPocket.cpp
+++ b/backends/platform/wince/CEActionsPocket.cpp
@@ -133,12 +133,14 @@ void CEActionsPocket::initInstanceGame() {
bool is_tucker = (gameid == "tucker");
bool is_groovie = (gameid == "groovie");
bool is_tinsel = (gameid == "tinsel");
+ bool is_cruise = (gameid == "cruise");
+ bool is_made = (gameid == "made");
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_tinsel ||
- is_samnmax || is_cine || is_touche || is_parallaction || is_drascula)
+ is_samnmax || is_cine || is_touche || is_parallaction || is_drascula || is_cruise)
_right_click_needed = true;
// See if a "hide toolbar" mapping could be needed
@@ -158,10 +160,10 @@ 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 || is_drascula) {
+ } else if (is_cine || is_drascula || is_cruise) {
_action_enabled[POCKET_ACTION_SAVE] = true;
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10
- } else if (is_agi) {
+ } else if (is_agi || is_made) {
_action_enabled[POCKET_ACTION_SAVE] = true;
_key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE);
} else if (is_parallaction) {
@@ -177,7 +179,7 @@ void CEActionsPocket::initInstanceGame() {
// Quit
_action_enabled[POCKET_ACTION_QUIT] = true;
// Skip
- if (!is_cine && !is_parallaction && !is_groovie)
+ if (!is_cine && !is_parallaction && !is_groovie && !is_cruise && !is_made)
_action_enabled[POCKET_ACTION_SKIP] = true;
if (is_simon || is_sky || is_sword2 || is_queen || is_sword1 || is_gob || is_tinsel ||
is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker)
@@ -214,6 +216,12 @@ void CEActionsPocket::initInstanceGame() {
_key_action[POCKET_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V
// Key bind method
_action_enabled[POCKET_ACTION_BINDKEYS] = true;
+ // Disable double-tap right-click for convenience
+ if (is_tinsel || is_cruise)
+ if (!ConfMan.hasKey("no_doubletap_rightclick")) {
+ ConfMan.setBool("no_doubletap_rightclick", true);
+ ConfMan.flushToDisk();
+ }
}
diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp
index 99f73bf37d..47733ae317 100644
--- a/backends/platform/wince/CEActionsSmartphone.cpp
+++ b/backends/platform/wince/CEActionsSmartphone.cpp
@@ -123,12 +123,14 @@ void CEActionsSmartphone::initInstanceGame() {
bool is_tucker = (gameid == "tucker");
bool is_groovie = (gameid == "groovie");
bool is_tinsel = (gameid == "tinsel");
+ bool is_cruise = (gameid == "cruise");
+ bool is_made = (gameid == "made");
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_tinsel ||
- is_samnmax || is_cine || is_touche || is_parallaction || is_drascula)
+ is_samnmax || is_cine || is_touche || is_parallaction || is_drascula || is_cruise)
_right_click_needed = true;
// Initialize keys for different actions
@@ -141,10 +143,10 @@ 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 || is_drascula) {
+ } else if (is_cine || is_drascula || is_cruise) {
_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
_key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); //F10
- } else if (is_agi) {
+ } else if (is_agi || is_made) {
_action_enabled[SMARTPHONE_ACTION_SAVE] = true;
_key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE);
} else if (is_parallaction) {
@@ -160,7 +162,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_tinsel ||
- is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker || is_groovie)
+ is_saga || is_kyra || is_touche || is_lure || is_feeble || is_drascula || is_tucker ||
+ is_groovie || is_cruise || is_made)
_key_action[SMARTPHONE_ACTION_SKIP].setKey(VK_ESCAPE);
else
_key_action[SMARTPHONE_ACTION_SKIP].setKey(KEY_ALL_SKIP);
@@ -178,6 +181,12 @@ void CEActionsSmartphone::initInstanceGame() {
_key_action[SMARTPHONE_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V
// Bind keys
_action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true;
+ // Disable double-tap right-click for convenience
+ if (is_tinsel || is_cruise)
+ if (!ConfMan.hasKey("no_doubletap_rightclick")) {
+ ConfMan.setBool("no_doubletap_rightclick", true);
+ ConfMan.flushToDisk();
+ }
}
diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp
index bfdb74319d..d26db3190f 100644
--- a/backends/platform/wince/CEScaler.cpp
+++ b/backends/platform/wince/CEScaler.cpp
@@ -53,15 +53,6 @@ void PocketPCPortraitTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPt
}
MAKE_WRAPPER(PocketPCPortrait)
-void PocketPCRawPortrait(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
-
- while (height--) {
- memcpy(dstPtr, srcPtr, width*sizeof(uint16_t));
- srcPtr += srcPitch;
- dstPtr += dstPitch;
- }
-}
-
// Our version of an aspect scaler. Main difference is the out-of-place
// operation, omitting a straight blit step the sdl backend does. Also,
// tests show unaligned access errors with the stock aspect scaler.
@@ -234,8 +225,8 @@ void SmartphoneLandscape(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, ui
SmartphoneLandscapeARM(srcPtr, srcPitch, dstPtr, dstPitch, width, height, redbluegreenMasks[maskUsed]);
#else
if (gBitFormat == 565)
- SmartphoneLandscape<565>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
+ SmartphoneLandscapeTemplate<565>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
else
- SmartphoneLandscape<555>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
+ SmartphoneLandscapeTemplate<555>(srcPtr, srcPitch, dstPtr, dstPitch, width, height);
#endif
}
diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
index e1a9d911de..ce6ebd6382 100644
--- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp
+++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
@@ -60,7 +60,7 @@ namespace CEGUI {
_surface = SDL_LoadBMP_RW(surfaceData, 1);
return _surface;
- };
+ }
SDL_Surface* SDL_ImageResource::get() {
return _surface;
diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile
index 1846029469..acade8ac9a 100644
--- a/backends/platform/wince/Makefile
+++ b/backends/platform/wince/Makefile
@@ -39,12 +39,12 @@ ENABLE_PARALLACTION = STATIC_PLUGIN
ENABLE_DRASCULA = STATIC_PLUGIN
ENABLE_GROOVIE = STATIC_PLUGIN
ENABLE_TUCKER = STATIC_PLUGIN
+ENABLE_TINSEL = STATIC_PLUGIN
+ENABLE_CRUISE = STATIC_PLUGIN
+ENABLE_MADE = STATIC_PLUGIN
#ENABLE_SCI = STATIC_PLUGIN
-#ENABLE_TINSEL = STATIC_PLUGIN
-#ENABLE_CRUISE = STATIC_PLUGIN
#ENABLE_IGOR = STATIC_PLUGIN
#ENABLE_M4 = STATIC_PLUGIN
-#ENABLE_MADE = STATIC_PLUGIN
########################################################################
## Pick which libraries you want to use here
@@ -76,6 +76,7 @@ USE_ARM_SOUND_ASM = 1
USE_ARM_SMUSH_ASM = 1
USE_ARM_GFX_ASM = 1
USE_ARM_COSTUME_ASM = 1
+USE_ARM_SCALER_ASM = 1
########################################################################
## Hopefully you shouldn't need to change anything below here. ##
@@ -167,6 +168,10 @@ ifdef USE_ARM_COSTUME_ASM
DEFINES += -DUSE_ARM_COSTUME_ASM
endif
+ifdef USE_ARM_SCALER_ASM
+DEFINES += -DUSE_ARM_SCALER_ASM
+endif
+
########################################################################
# Targets follow here
diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt
index 6a289766a2..5b3215e34e 100644
--- a/backends/platform/wince/README-WinCE.txt
+++ b/backends/platform/wince/README-WinCE.txt
@@ -6,26 +6,19 @@ Release version: 0.13.0
New in this version
-------------------
-0.13.0:
-Important: Two builds for ScummVM CE
+1.0.0rc1:
+This version features optimized ARM assembly versions for the Smartphone,
+Normal2x and Normal2xAspect scalers, courtesy of Robin Watts. There should
+be a speed improvement when using these scalers.
-For this release, two binaries (executables) are provided. The first,
-with file name scummvm1.exe, includes support for the following engines:
- - scumm, sword1, sword2, queen, sky, lure, agi, touche
-while the second, with file name scummvm2.exe:
- - gob, cine, saga, kyra, agos, parallaction, drascula, groovie, tucker
-The user must make sure to execute the correct file for a game. All
-previously detected games will be shown in the launcher. Trying to launch
-a gob engine game with scummvm1.exe will not work.
-Detection also works as implied: scummvm1.exe will detect only the games
-for which it has support; the same holds for scummvm2.exe.
-This change has been done so users with less free memory can play more
-memory hungry games.
-
-Also noted are problems with flac support. Your mileage may vary. Please
-consider using ogg or mp3 for those games (smaller sizes are better for
-handheld devices too!)
+Also new is the aspect 2x upscaling mode, which is auto detected and used
+when the scaler is set to (normal) 2x mode and the panel is hidden. Hence,
+a 320x200 game running on a VGA or higher resolution device will be
+aspect scaled to fill the 640x480 screen.
+Be aware that Discworld 2 tries to allocate a big chunk of memory (10 MB)
+and this will fail on many devices (file under the not enough memory
+category).
------------------------------------------------------------------------
@@ -590,6 +583,20 @@ By default, the double tap to right click action is disabled in this game
as this interferes with the game's controls. This setting can be overridden
(see 'no_doubletap_rightclick' parameter above).
+-----------------
+-- Discworld 2 --
+-----------------
+
+Crashes at startup of this game are usually due to the high memory
+requirements of this game.
+
+-------------------------
+-- Cruise for a Corpse --
+-------------------------
+
+As with Discworld, the double-tap-to-right-click action interferes and will
+be disabled by default.
+
------------------------------------------------------------------------
Support
@@ -637,6 +644,27 @@ http://www.scummvm.org/
Old news follow ...
------------------------------------------------------------------------
+0.13.0:
+Important: Two builds for ScummVM CE
+
+For this release, two binaries (executables) are provided. The first,
+with file name scummvm1.exe, includes support for the following engines:
+ - scumm, sword1, sword2, queen, sky, lure, agi, touche
+while the second, with file name scummvm2.exe:
+ - gob, cine, saga, kyra, agos, parallaction, drascula, groovie, tucker
+The user must make sure to execute the correct file for a game. All
+previously detected games will be shown in the launcher. Trying to launch
+a gob engine game with scummvm1.exe will not work.
+Detection also works as implied: scummvm1.exe will detect only the games
+for which it has support; the same holds for scummvm2.exe.
+This change has been done so users with less free memory can play more
+memory hungry games.
+
+Also noted are problems with flac support. Your mileage may vary. Please
+consider using ogg or mp3 for those games (smaller sizes are better for
+handheld devices too!)
+
+
0.12.0:
- Improved SMUSH support (deprecated 'Smush_force_redraw' option)
No skipped frames in Full Throttle action sequences. The 'Smush_force_redraw'
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index f63ad72298..ac93e8f714 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -135,7 +135,7 @@ EXT_C char *getcwd(char *buffer, int maxlen) {
#endif
EXT_C void GetCurrentDirectory(int len, char *buf) {
getcwd(buf,len);
-};
+}
/*
Windows CE fopen has non-standard behavior -- not
diff --git a/backends/platform/wince/module.mk b/backends/platform/wince/module.mk
new file mode 100644
index 0000000000..5fefe08d79
--- /dev/null
+++ b/backends/platform/wince/module.mk
@@ -0,0 +1,21 @@
+MODULE := backends/platform/wince
+
+MODULE_OBJS := \
+ CEActionsPocket.o CEDevice.o CEScaler.o \
+ CEActionsSmartphone.o CELauncherDialog.o wince-sdl.o \
+ CEgui/GUIElement.o CEgui/Panel.o CEgui/SDL_ImageResource.o \
+ CEgui/ItemAction.o CEgui/PanelItem.o CEgui/Toolbar.o \
+ CEgui/ItemSwitch.o CEgui/PanelKeyboard.o CEgui/ToolbarHandler.o \
+ CEkeys/EventsBuffer.o \
+ ../../../gui/Actions.o ../../../gui/Key.o ../../../gui/KeysDialog.o \
+ ../sdl/sdl.o ../sdl/graphics.o ../sdl/events.o ../sdl/hardwarekeys.o \
+ missing/missing.o \
+ PocketSCUMM.o \
+ ARMscaler.o \
+ smartLandScale.o
+
+MODULE_DIRS += \
+ backends/platform/wince/
+
+# We don't use the rules.mk here on purpose
+OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) $(OBJS)
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 8b2e0848f8..5d75b76805 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -403,9 +403,8 @@ static Uint32 timer_handler_wrapper(Uint32 interval) {
void OSystem_WINCE3::initBackend()
{
// Instantiate our own sound mixer
- // mixer init is postponed until a game engine is selected.
- if (_mixer == 0)
- _mixer = new Audio::MixerImpl(this);
+ // mixer init is rerun when a game engine is selected.
+ setupMixer();
// Create the timer. CE SDL does not support multiple timers (SDL_AddTimer).
// We work around this by using the SetTimer function, since we only use
@@ -792,11 +791,15 @@ void OSystem_WINCE3::setupMixer() {
SDL_AudioSpec desired;
int thread_priority;
+ compute_sample_rate();
if (_sampleRate == 0)
warning("setSoundCallback called with 0 _sampleRate. Audio will not work.");
+ else if (_mixer && _mixer->getOutputRate() == _sampleRate) {
+ debug(1, "Skipping sound mixer re-init: samplerate is good");
+ return;
+ }
memset(&desired, 0, sizeof(desired));
-
desired.freq = _sampleRate;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
@@ -913,7 +916,6 @@ void OSystem_WINCE3::engineInit() {
//update_game_settings();
// finalize mixer init
- compute_sample_rate();
setupMixer();
}
@@ -1080,13 +1082,6 @@ void OSystem_WINCE3::update_game_settings() {
if (ConfMan.hasKey("no_doubletap_rightclick"))
_noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick");
- else if (gameid == "tinsel") {
- _noDoubleTapRMB = true;
- ConfMan.setBool("no_doubletap_rightclick", true);
- ConfMan.flushToDisk();
- }
-
- compute_sample_rate();
}
void OSystem_WINCE3::initSize(uint w, uint h) {
@@ -1147,13 +1142,13 @@ void OSystem_WINCE3::setGraphicsModeIntern() {
}
bool OSystem_WINCE3::update_scalers() {
- if (_videoMode.mode != GFX_NORMAL)
- return false;
-
_videoMode.aspectRatioCorrection = false;
if (CEDevice::hasPocketPCResolution()) {
- if ( (!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth))
+ if (_videoMode.mode != GFX_NORMAL)
+ return false;
+
+ if ((!_orientationLandscape && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth))
|| CEDevice::hasSquareQVGAResolution() ) {
if (getScreenWidth() != 320) {
_scaleFactorXm = 3;
@@ -1204,9 +1199,32 @@ bool OSystem_WINCE3::update_scalers() {
}
return true;
- }
+ } else if (CEDevice::hasWideResolution()) {
+#ifdef USE_ARM_SCALER_ASM
+ if ( _videoMode.mode == GFX_DOUBLESIZE && (_videoMode.screenWidth == 320 || !_videoMode.screenWidth) ) {
+ if ( !_panelVisible && !_overlayVisible && _canBeAspectScaled ) {
+ _scaleFactorXm = 2;
+ _scaleFactorXd = 1;
+ _scaleFactorYm = 12;
+ _scaleFactorYd = 5;
+ _scalerProc = Normal2xAspect;
+ _modeFlags = 0;
+ _videoMode.aspectRatioCorrection = true;
+ } else if ( (_panelVisible || _overlayVisible) && _canBeAspectScaled ) {
+ _scaleFactorXm = 2;
+ _scaleFactorXd = 1;
+ _scaleFactorYm = 2;
+ _scaleFactorYd = 1;
+ _scalerProc = Normal2x;
+ _modeFlags = 0;
+ }
+ return true;
+ }
+#endif
+ } else if (CEDevice::hasSmartphoneResolution()) {
+ if (_videoMode.mode != GFX_NORMAL)
+ return false;
- if (CEDevice::hasSmartphoneResolution()) {
if (_videoMode.screenWidth > 320)
error("Game resolution not supported on Smartphone");
#ifdef ARM
@@ -1373,8 +1391,8 @@ bool OSystem_WINCE3::loadGFXMode() {
displayWidth = _videoMode.screenWidth * _scaleFactorXm / _scaleFactorXd;
displayHeight = _videoMode.screenHeight * _scaleFactorYm / _scaleFactorYd;
} else {
- displayWidth = _videoMode.screenWidth;
- displayHeight = _videoMode.screenHeight;
+ displayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+ displayHeight = _videoMode.screenHeight* _videoMode.scaleFactor;
}
switch (_orientationLandscape) {
diff --git a/backends/platform/wince/wince.mk b/backends/platform/wince/wince.mk
new file mode 100644
index 0000000000..5551b27289
--- /dev/null
+++ b/backends/platform/wince/wince.mk
@@ -0,0 +1,5 @@
+all: PocketSCUMM.o
+
+PocketSCUMM.o: $(srcdir)/backends/platform/wince/PocketSCUMM.rc
+ mkdir -p backends/platform/wince
+ $(WINDRES) -I$(srcdir)/backends/platform/wince $(srcdir)/backends/platform/wince/PocketSCUMM.rc backends/platform/wince/PocketSCUMM.o