diff options
Diffstat (limited to 'backends/wince')
-rw-r--r-- | backends/wince/CEActionsPocket.cpp | 16 | ||||
-rw-r--r-- | backends/wince/CEActionsSmartphone.cpp | 12 | ||||
-rw-r--r-- | backends/wince/CEDevice.cpp | 1 | ||||
-rw-r--r-- | backends/wince/CEException.cpp | 13 | ||||
-rw-r--r-- | backends/wince/CEKeysDialog.cpp | 6 | ||||
-rw-r--r-- | backends/wince/CEgui/Panel.cpp | 1 | ||||
-rw-r--r-- | backends/wince/CEgui/PanelItem.cpp | 3 | ||||
-rw-r--r-- | backends/wince/CEgui/PanelKeyboard.cpp | 7 | ||||
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.cpp | 8 | ||||
-rw-r--r-- | backends/wince/CEkeys/EventsBuffer.h | 2 | ||||
-rw-r--r-- | backends/wince/wince-sdl.cpp | 55 |
11 files changed, 81 insertions, 43 deletions
diff --git a/backends/wince/CEActionsPocket.cpp b/backends/wince/CEActionsPocket.cpp index 2f348208a7..339d37fd7b 100644 --- a/backends/wince/CEActionsPocket.cpp +++ b/backends/wince/CEActionsPocket.cpp @@ -116,7 +116,7 @@ void CEActionsPocket::initInstanceGame() { else if (is_queen) { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(282); // F1 key + _key_action[POCKET_ACTION_SAVE].setAscii(286); // F5 key for FOTAQ } else if (is_sky) { @@ -165,6 +165,12 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) { case POCKET_ACTION_RIGHTCLICK: _mainSystem->add_right_click(false); return true; + case POCKET_ACTION_PAUSE: + case POCKET_ACTION_SAVE: + case POCKET_ACTION_SKIP: + EventsBuffer::simulateKey(&_key_action[action], false); + return true; + } return false; } @@ -173,7 +179,7 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) { case POCKET_ACTION_PAUSE: case POCKET_ACTION_SAVE: case POCKET_ACTION_SKIP: - EventsBuffer::simulateKey(&_key_action[action]); + EventsBuffer::simulateKey(&_key_action[action], true); return true; case POCKET_ACTION_KEYBOARD: _mainSystem->swap_panel(); @@ -190,9 +196,9 @@ bool CEActionsPocket::perform(ActionType action, bool pushed) { case POCKET_ACTION_CURSOR: _mainSystem->swap_mouse_visibility(); return true; - case POCKET_ACTION_FREELOOK: - _mainSystem->swap_freeLook(); - return true; + case POCKET_ACTION_FREELOOK: + _mainSystem->swap_freeLook(); + return true; case POCKET_ACTION_ZOOM_UP: _mainSystem->swap_zoom_up(); return true; diff --git a/backends/wince/CEActionsSmartphone.cpp b/backends/wince/CEActionsSmartphone.cpp index 1a70945b06..4d7cb447a8 100644 --- a/backends/wince/CEActionsSmartphone.cpp +++ b/backends/wince/CEActionsSmartphone.cpp @@ -48,7 +48,7 @@ const String smartphoneActionNames[] = { #ifdef SIMU_SMARTPHONE const int ACTIONS_SMARTPHONE_DEFAULT[] = { 0x111, 0x112, 0x114, 0x113, 0x11a, 0x11b, VK_LWIN, VK_ESCAPE, VK_F8 }; #else -const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, VK_F10 }; +const int ACTIONS_SMARTPHONE_DEFAULT[] = { '4', '6', '8', '2', 0x11a, 0x11b, '0', VK_ESCAPE, '9' }; #endif void CEActionsSmartphone::init(GameDetector &detector) { @@ -119,7 +119,7 @@ void CEActionsSmartphone::initInstanceGame() { else if (is_queen) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(282); // F1 key + _key_action[SMARTPHONE_ACTION_SAVE].setAscii(286); // F1 key for FOTAQ } else if (is_sky) { @@ -137,7 +137,7 @@ void CEActionsSmartphone::initInstanceGame() { else _key_action[SMARTPHONE_ACTION_SKIP].setAscii(Scumm::KEY_ALL_SKIP); // Zone - _key_action[SMARTPHONE_ACTION_ZONE] = true; + _action_enabled[SMARTPHONE_ACTION_ZONE] = true; } @@ -153,6 +153,10 @@ bool CEActionsSmartphone::perform(ActionType action, bool pushed) { case SMARTPHONE_ACTION_LEFTCLICK: _mainSystem->add_left_click(false); return true; + case SMARTPHONE_ACTION_SAVE: + case SMARTPHONE_ACTION_SKIP: + EventsBuffer::simulateKey(&_key_action[action], false); + return true; } return false; } @@ -160,7 +164,7 @@ bool CEActionsSmartphone::perform(ActionType action, bool pushed) { switch (action) { case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: - EventsBuffer::simulateKey(&_key_action[action]); + EventsBuffer::simulateKey(&_key_action[action], true); return true; case SMARTPHONE_ACTION_RIGHTCLICK: _mainSystem->add_right_click(true); diff --git a/backends/wince/CEDevice.cpp b/backends/wince/CEDevice.cpp index 31cc8935c5..3f7121ddfd 100644 --- a/backends/wince/CEDevice.cpp +++ b/backends/wince/CEDevice.cpp @@ -171,3 +171,4 @@ Common::String CEDevice::getKeyName(unsigned int keyCode) { sprintf(key_name, "Key %.4x", keyCode); return key_name; } + diff --git a/backends/wince/CEException.cpp b/backends/wince/CEException.cpp index deab3fb9f4..1ef83342f8 100644 --- a/backends/wince/CEException.cpp +++ b/backends/wince/CEException.cpp @@ -43,6 +43,7 @@ void CEException::dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) { DWORD size; unsigned int i; +#ifdef ARM writeBreak(file); writeString(file, "Context dump"); sprintf(tempo, "R0=%.8x R1=%.8x R2=%.8x R3=%.8x R4=%.8x", context->R0, context->R1, @@ -77,13 +78,17 @@ void CEException::dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) { writeString(file, tempo); } } +#else + writeBreak(file); + writeString(file, "Context dump only available on ARM devices"); +#endif } void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) { char tempo[200]; char exceptionName[50]; unsigned int i; - +#if (_WIN32_WCE >= 300) writeBreak(file); switch(exceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION : @@ -122,6 +127,10 @@ void CEException::dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) } if (exceptionRecord->ExceptionRecord) dumpException(file, exceptionRecord->ExceptionRecord); +#else + writeBreak(file); + writeString(file, "Cannot get exception information on this CE version"); +#endif } bool CEException::writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers) { @@ -143,4 +152,4 @@ bool CEException::writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPoint CloseHandle(dumpFile); return true; -}
\ No newline at end of file +} diff --git a/backends/wince/CEKeysDialog.cpp b/backends/wince/CEKeysDialog.cpp index 946a06060f..a4575b4e02 100644 --- a/backends/wince/CEKeysDialog.cpp +++ b/backends/wince/CEKeysDialog.cpp @@ -56,7 +56,7 @@ CEKeysDialog::CEKeysDialog(const Common::String &title) // Get actions names Common::StringList l; - for (int i = 1; i < CEActions::Instance()->size(); i++) + for (int i = 0; i < CEActions::Instance()->size(); i++) l.push_back(CEActions::Instance()->actionName((ActionType)i)); _actionsList->setList(l); @@ -72,7 +72,7 @@ void CEKeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) if (_actionsList->getSelected() >= 0) { char selection[100]; - sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected() + 1))).c_str()); + sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)(_actionsList->getSelected()))).c_str()); _keyMapping->setLabel(selection); _keyMapping->draw(); } @@ -84,7 +84,7 @@ void CEKeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) else { char selection[100]; - _actionSelected = _actionsList->getSelected() + 1; + _actionSelected = _actionsList->getSelected(); sprintf(selection, "Associated key : %s", CEDevice::getKeyName(CEActions::Instance()->getMapping((ActionType)_actionSelected)).c_str()); _actionTitle->setLabel("Press the key to associate"); _keyMapping->setLabel(selection); diff --git a/backends/wince/CEgui/Panel.cpp b/backends/wince/CEgui/Panel.cpp index 2e7de809cf..5c236dee72 100644 --- a/backends/wince/CEgui/Panel.cpp +++ b/backends/wince/CEgui/Panel.cpp @@ -80,3 +80,4 @@ namespace CEGUI { _itemsMap.clear(); } } + diff --git a/backends/wince/CEgui/PanelItem.cpp b/backends/wince/CEgui/PanelItem.cpp index 55282a9589..6e901d5864 100644 --- a/backends/wince/CEgui/PanelItem.cpp +++ b/backends/wince/CEgui/PanelItem.cpp @@ -40,4 +40,5 @@ namespace CEGUI { void PanelItem::setPanel(Panel *panel) { _panel = panel; } -}
\ No newline at end of file +} + diff --git a/backends/wince/CEgui/PanelKeyboard.cpp b/backends/wince/CEgui/PanelKeyboard.cpp index 717afd69af..395785d5fc 100644 --- a/backends/wince/CEgui/PanelKeyboard.cpp +++ b/backends/wince/CEgui/PanelKeyboard.cpp @@ -72,10 +72,10 @@ namespace CEGUI { keyCode = 10; } - if (keyAscii != 0 && pushed) { + if (keyAscii != 0) { _key.setAscii(keyAscii); _key.setKeycode(tolower(keyAscii)); - return EventsBuffer::simulateKey(&_key); + return EventsBuffer::simulateKey(&_key, pushed); } else return false; @@ -83,4 +83,5 @@ namespace CEGUI { else return false; } -}
\ No newline at end of file +} + diff --git a/backends/wince/CEkeys/EventsBuffer.cpp b/backends/wince/CEkeys/EventsBuffer.cpp index 918da88e56..70da6cd435 100644 --- a/backends/wince/CEkeys/EventsBuffer.cpp +++ b/backends/wince/CEkeys/EventsBuffer.cpp @@ -24,7 +24,7 @@ namespace CEKEYS { - bool EventsBuffer::simulateKey(Key *key) { + bool EventsBuffer::simulateKey(Key *key, bool pushed) { SDL_Event ev = {0}; if (!key->keycode()) @@ -33,13 +33,11 @@ namespace CEKEYS { if (!key->ascii()) key->setAscii(key->keycode()); - ev.type = SDL_KEYDOWN; + ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); ev.key.keysym.mod = (SDLMod)key->flags(); ev.key.keysym.sym = (SDLKey)key->keycode(); ev.key.keysym.unicode = key->keycode(); - if (SDL_PushEvent(&ev)) - return false; - ev.type = SDL_KEYUP; + ev.key.keysym.mod = KMOD_RESERVED; return (SDL_PushEvent(&ev) == 0); } diff --git a/backends/wince/CEkeys/EventsBuffer.h b/backends/wince/CEkeys/EventsBuffer.h index b258a1c00b..938e8cc886 100644 --- a/backends/wince/CEkeys/EventsBuffer.h +++ b/backends/wince/CEkeys/EventsBuffer.h @@ -35,7 +35,7 @@ namespace CEKEYS { class EventsBuffer { public: - static bool simulateKey(Key *key); + static bool simulateKey(Key *key, bool pushed); static bool simulateMouseMove(int x, int y); static bool simulateMouseLeftClick(int x, int y, bool pushed); static bool simulateMouseRightClick(int x, int y, bool pushed); diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 34ef3678ea..977232a649 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -118,7 +118,7 @@ bool isSmartphone() { extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv); -void handleException(EXCEPTION_POINTERS *exceptionPointers) { +int handleException(EXCEPTION_POINTERS *exceptionPointers) { CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers); drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file"); fclose(stdout_file); @@ -126,6 +126,7 @@ void handleException(EXCEPTION_POINTERS *exceptionPointers) { CEDevice::end(); SDL_Quit(); exit(0); + return EXCEPTION_EXECUTE_HANDLER; } int SDL_main(int argc, char **argv) { @@ -228,6 +229,7 @@ OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), loadSmartphoneConfiguration(); } + } void OSystem_WINCE3::swap_panel_visibility() { @@ -345,8 +347,8 @@ void OSystem_WINCE3::initZones() { _currentZone = 0; for (i=0; i<TOTAL_ZONES; i++) { - _mouseXZone[i] = _zones[i].x + (_zones[i].width / 2); - _mouseYZone[i] = _zones[i].y + (_zones[i].height / 2); + _mouseXZone[i] = (_zones[i].x + (_zones[i].width / 2)) * _scaleFactorXm / _scaleFactorXd; + _mouseYZone[i] = (_zones[i].y + (_zones[i].height / 2)) * _scaleFactorYm / _scaleFactorYd; } } @@ -510,6 +512,14 @@ bool OSystem_WINCE3::checkOggHighSampleRate() { #endif void OSystem_WINCE3::get_sample_rate() { + // Force at least medium quality FM synthesis for FOTAQ + if (_gameDetector._targetName == "queen") { + if (!((ConfMan.hasKey("FM_high_quality") && ConfMan.getBool("FM_high_quality")) || + (ConfMan.hasKey("FM_medium_quality") && ConfMan.getBool("FM_medium_quality")))) { + ConfMan.set("FM_medium_quality", true); + ConfMan.flushToDisk(); + } + } // See if the output frequency is forced by the game if ((_gameDetector._game.features & Scumm::GF_DIGI_IMUSE) || _gameDetector._targetName == "queen" || @@ -814,6 +824,7 @@ bool OSystem_WINCE3::update_scalers() { _scaleFactorYd = 8; _scalerProc = SmartphoneLandscape; _modeFlags = 0; + initZones(); return true; } //#endif @@ -855,7 +866,7 @@ bool OSystem_WINCE3::setGraphicsMode(int mode) { _scaleFactorXm = -1; if (CEDevice::hasPocketPCResolution() && !CEDevice::hasWideResolution() && _orientationLandscape) - _mode = GFX_NORMAL; + _mode = GFX_NORMAL; else _mode = mode; @@ -1487,21 +1498,24 @@ bool OSystem_WINCE3::pollEvent(Event &event) { CEDevice::wakeUp(); - if (isSmartphone) + if (_isSmartphone) currentTime = GetTickCount(); while(SDL_PollEvent(&ev)) { switch(ev.type) { case SDL_KEYDOWN: - if (_isSmartphone) { - keyEvent = true; - _lastKeyPressed = ev.key.keysym.sym; - _keyRepeatTime = currentTime; - _keyRepeat = 0; - } + // KMOD_RESERVED is used if the key has been injected by an external buffer + if (ev.key.keysym.mod != KMOD_RESERVED) { + if (_isSmartphone) { + keyEvent = true; + _lastKeyPressed = ev.key.keysym.sym; + _keyRepeatTime = currentTime; + _keyRepeat = 0; + } - if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true)) - return true; + if (CEActions::Instance()->performMapped(ev.key.keysym.sym, true)) + return true; + } event.type = EVENT_KEYDOWN; event.kbd.keycode = ev.key.keysym.sym; @@ -1513,13 +1527,16 @@ bool OSystem_WINCE3::pollEvent(Event &event) { return true; case SDL_KEYUP: - if (_isSmartphone) { - keyEvent = true; - _lastKeyPressed = 0; - } + // KMOD_RESERVED is used if the key has been injected by an external buffer + if (ev.key.keysym.mod != KMOD_RESERVED) { + if (_isSmartphone) { + keyEvent = true; + _lastKeyPressed = 0; + } - if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false)) - return true; + if (CEActions::Instance()->performMapped(ev.key.keysym.sym, false)) + return true; + } event.type = EVENT_KEYUP; event.kbd.keycode = ev.key.keysym.sym; |