diff options
Diffstat (limited to 'backends/platform')
85 files changed, 1080 insertions, 1413 deletions
diff --git a/backends/platform/PalmOS/Src/base_event.cpp b/backends/platform/PalmOS/Src/base_event.cpp index d28fd913c0..a3913529b6 100644 --- a/backends/platform/PalmOS/Src/base_event.cpp +++ b/backends/platform/PalmOS/Src/base_event.cpp @@ -93,73 +93,137 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { sound_handler(); for(;;) { + // check for hardkey repeat for mouse emulation + keyCurrentState = KeyCurrentState(); + // if it was a key pressed, let the keyup event raise - if (_wasKey) { - // check for hardkey repeat for mouse emulation - keyCurrentState = KeyCurrentState(); - - if (!(keyCurrentState & _keyExtraMask)) { - _lastKeyRepeat = 0; - - } else if (getMillis() >= (_keyExtraRepeat + _keyExtraDelay)) { - _keyExtraRepeat = getMillis(); - - if (gVars->arrowKeys) { -/* if HARD_KEY(Up, chrUpArrow) - else if HARD_KEY(Down, chrDownArrow) - else if HARD_KEY(Left, chrLeftArrow) - else if HARD_KEY(Right, chrRightArrow) -*/ - } else { - // button released ? - if (_keyExtraPressed) { - if (_keyExtraPressed & _keyExtra.bitActionA) { - if (!(keyCurrentState & _keyExtra.bitActionA)) { - _keyExtraPressed &= ~_keyExtra.bitActionA; - - event.type = Common::EVENT_LBUTTONUP; - event.mouse.x = _mouseCurState.x; - event.mouse.y = _mouseCurState.y; - return true; - } - } - - if (_keyExtraPressed & _keyExtra.bitActionB) { - if (!(keyCurrentState & _keyExtra.bitActionB)) { - _keyExtraPressed &= ~_keyExtra.bitActionB; - - event.type = Common::EVENT_RBUTTONUP; - event.mouse.x = _mouseCurState.x; - event.mouse.y = _mouseCurState.y; - return true; - } - } + if (_keyExtraPressed) { + if (gVars->arrowKeys) { + if (_keyExtraPressed & _keyExtra.bitLeft) { + if (!(keyCurrentState & _keyExtra.bitLeft)) { + _keyExtraPressed &= ~_keyExtra.bitLeft; + + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_LEFT; + event.kbd.ascii = event.kbd.keycode; + event.kbd.flags = 0; + return true; + } + } + if (_keyExtraPressed & _keyExtra.bitRight) { + if (!(keyCurrentState & _keyExtra.bitRight)) { + _keyExtraPressed &= ~_keyExtra.bitRight; + + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_RIGHT; + event.kbd.ascii = event.kbd.keycode; + event.kbd.flags = 0; + return true; + } + } + if (_keyExtraPressed & _keyExtra.bitUp) { + if (!(keyCurrentState & _keyExtra.bitUp)) { + _keyExtraPressed &= ~_keyExtra.bitUp; + + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_UP; + event.kbd.ascii = event.kbd.keycode; + event.kbd.flags = 0; + return true; + } + } + if (_keyExtraPressed & _keyExtra.bitDown) { + if (!(keyCurrentState & _keyExtra.bitDown)) { + _keyExtraPressed &= ~_keyExtra.bitDown; + + event.type = Common::EVENT_KEYUP; + event.kbd.keycode = Common::KEYCODE_DOWN; + event.kbd.ascii = event.kbd.keycode; + event.kbd.flags = 0; + return true; } + } + } - Int8 sx = 0; - Int8 sy = 0; - - if (keyCurrentState & _keyExtra.bitUp) - sy = -1; - else if (keyCurrentState & _keyExtra.bitDown) - sy = +1; - - if (keyCurrentState & _keyExtra.bitLeft) - sx = -1; - else if (keyCurrentState & _keyExtra.bitRight) - sx = +1; - - if (sx || sy) { - simulate_mouse(event, sx, sy, &x, &y); - event.type = Common::EVENT_MOUSEMOVE; - event.mouse.x = x; - event.mouse.y = y; - warpMouse(x, y); + if (_keyExtraPressed & _keyExtra.bitActionA) { + if (!(keyCurrentState & _keyExtra.bitActionA)) { + _keyExtraPressed &= ~_keyExtra.bitActionA; - return true; - } + event.type = Common::EVENT_LBUTTONUP; + event.mouse.x = _mouseCurState.x; + event.mouse.y = _mouseCurState.y; + return true; + } + } + + if (_keyExtraPressed & _keyExtra.bitActionB) { + if (!(keyCurrentState & _keyExtra.bitActionB)) { + _keyExtraPressed &= ~_keyExtra.bitActionB; + + event.type = Common::EVENT_RBUTTONUP; + event.mouse.x = _mouseCurState.x; + event.mouse.y = _mouseCurState.y; + return true; } } + + // no more event till up is raised + return false; + } + + if (!(keyCurrentState & _keyExtraMask)) { + _lastKeyRepeat = 0; + + } else if (getMillis() >= (_keyExtraRepeat + _keyExtraDelay)) { + _keyExtraRepeat = getMillis(); + + if (gVars->arrowKeys) { + if (keyCurrentState & _keyExtra.bitLeft) { + _keyExtraPressed |= _keyExtra.bitLeft; + event.kbd.keycode = Common::KEYCODE_LEFT; + + } else if (keyCurrentState & _keyExtra.bitRight) { + _keyExtraPressed |= _keyExtra.bitRight; + event.kbd.keycode = Common::KEYCODE_RIGHT; + + } else if (keyCurrentState & _keyExtra.bitUp) { + _keyExtraPressed |= _keyExtra.bitUp; + event.kbd.keycode = Common::EVENT_KEYUP; + + } else if (keyCurrentState & _keyExtra.bitDown) { + _keyExtraPressed |= _keyExtra.bitDown; + event.kbd.keycode = Common::KEYCODE_DOWN; + } + + event.type = Common::EVENT_KEYDOWN; + event.kbd.ascii = event.kbd.keycode; + event.kbd.flags = 0; + return true; + + } else { + Int8 sx = 0; + Int8 sy = 0; + + if (keyCurrentState & _keyExtra.bitUp) + sy = -1; + else if (keyCurrentState & _keyExtra.bitDown) + sy = +1; + + if (keyCurrentState & _keyExtra.bitLeft) + sx = -1; + else if (keyCurrentState & _keyExtra.bitRight) + sx = +1; + + if (sx || sy) { + simulate_mouse(event, sx, sy, &x, &y); + event.type = Common::EVENT_MOUSEMOVE; + event.mouse.x = x; + event.mouse.y = y; + warpMouse(x, y); + + return true; + } + } } #if defined(COMPILE_OS5) && defined(PALMOS_ARM) @@ -174,13 +238,13 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // arrow keys case chrUpArrow: - k = 273; break; + k = Common::KEYCODE_UP; break; case chrDownArrow: - k = 274; break; - case chrLeftArrow: - k = 275; break; + k = Common::KEYCODE_DOWN; break; case chrRightArrow: - k = 276; break; + k = Common::KEYCODE_RIGHT; break; + case chrLeftArrow: + k = Common::KEYCODE_LEFT; break; } if (k) { @@ -197,16 +261,16 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // ESC key case vchrLaunch: event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = 27; - event.kbd.ascii = 27; + event.kbd.keycode = Common::KEYCODE_ESCAPE; + event.kbd.ascii = Common::ASCII_ESCAPE; event.kbd.flags = 0; return true; // F5 = menu case vchrMenu: event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = 319; - event.kbd.ascii = 319; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; event.kbd.flags = 0; return true; @@ -222,13 +286,13 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // arrow keys case chrUpArrow: - k = 273; break; + k = Common::KEYCODE_UP; break; case chrDownArrow: - k = 274; break; - case chrLeftArrow: - k = 275; break; + k = Common::KEYCODE_DOWN; break; case chrRightArrow: - k = 276; break; + k = Common::KEYCODE_RIGHT; break; + case chrLeftArrow: + k = Common::KEYCODE_LEFT; break; } if (k) { @@ -249,13 +313,11 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { ((ev.data.keyDown.chr == vchrAttnStateChanged) || (ev.data.keyDown.chr == vchrAttnUnsnooze))); - // graffiti strokes, auto-off, etc... if (!handled) if (SysHandleEvent(&ev)) continue; - switch(ev.eType) { case penMoveEvent: get_coordinates(&ev, x, y); @@ -349,8 +411,13 @@ bool OSystem_PalmBase::pollEvent(Common::Event &event) { // F1 -> F10 key if (key >= '0' && key <= '9' && mask == (Common::KBD_CTRL|Common::KBD_ALT)) { - key = (key == '0') ? 324 : (315 + key - '1'); - mask = 0; + key = (key - '0' + 10 - 1) % 10; // '0' -> 9, '1' -> 0, '2' -> 1, ... + _wasKey = true; + event.type = Common::EVENT_KEYDOWN; + event.kbd.keycode = Common::KEYCODE_F1 + key; + event.kbd.ascii = Common::ASCII_F1 + key; + event.kbd.flags = 0; + return true; #ifdef STDLIB_TRACE_MEMORY // print memory diff --git a/backends/platform/PalmOS/Src/be_os5.h b/backends/platform/PalmOS/Src/be_os5.h index fc5f9e667f..bb38c51ca6 100644 --- a/backends/platform/PalmOS/Src/be_os5.h +++ b/backends/platform/PalmOS/Src/be_os5.h @@ -110,6 +110,8 @@ private: typedef void (OSystem_PalmOS5::*RendererProc)(RectangleType &r, PointType &p); RendererProc _render; + Graphics::Surface _framebuffer; + OverlayColor *_overlayP; WinHandle _overlayH, _workScreenH; int16 *_workScreenP; @@ -131,8 +133,7 @@ private: void calc_scale(); void render_landscapeAny(RectangleType &r, PointType &p); - void render_landscape(RectangleType &r, PointType &p); - void render_portrait(RectangleType &r, PointType &p); + void render_landscape15x(RectangleType &r, PointType &p); void render_1x(RectangleType &r, PointType &p); WinHandle alloc_screen(Coord w, Coord h); virtual void draw_osd(UInt16 id, Int32 x, Int32 y, Boolean show, UInt8 color = 0); @@ -169,7 +170,8 @@ public: void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); void clearScreen(); - bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); void setCursorPalette(const byte *colors, uint start, uint num); void disableCursorPalette(bool disable); diff --git a/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp b/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp index 5f61c85cae..085fb2499a 100755 --- a/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp +++ b/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp @@ -28,7 +28,8 @@ #include "formUtil.h" #include "games.h" #include "start.h" -#include "common/util.h" + +#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0]))) static Char **items = NULL; Int16 selectedEngine = -1; diff --git a/backends/platform/PalmOS/Src/launcher/games.h b/backends/platform/PalmOS/Src/launcher/games.h index c277bec4cc..d807d6b64d 100644 --- a/backends/platform/PalmOS/Src/launcher/games.h +++ b/backends/platform/PalmOS/Src/launcher/games.h @@ -186,14 +186,14 @@ static const struct { { "cine", "Delphine Cinematique v1.0" }, { "queen", "Flight of the Amazon Queen" }, { "lure", "Lure of the Tempress" }, - { "gob", "Gobliiins, Bargon Attack and more ..." }, + { "gob", "Gobliiins, Bargon Attack and more" }, { "kyra", "Kyrandia" }, { "parallaction", "Parallaction" }, { "saga", "SAGA Engine" }, { "scumm", "Scumm Games" }, { "agi", "Sierra AGI" }, { "touche", "Touche: The Adventures of the Fifth Musketeer" }, - { "cruise", "Cruise for a Corpse" }, + { "cruise", "Beta -> Cruise for a Corpse" }, }; // protos diff --git a/backends/platform/PalmOS/Src/os5_gfx.cpp b/backends/platform/PalmOS/Src/os5_gfx.cpp index 247acf6f46..be5d28bc56 100644 --- a/backends/platform/PalmOS/Src/os5_gfx.cpp +++ b/backends/platform/PalmOS/Src/os5_gfx.cpp @@ -137,9 +137,13 @@ void OSystem_PalmOS5::hotswap_gfx_mode(int mode) { } if (_stretched) { - calc_scale(); OPTIONS_SET(kOptDisableOnScrDisp); - _render = &OSystem_PalmOS5::render_landscapeAny; + if (_screenHeight == 200 && _screenDest.h == 300) { + _render = &OSystem_PalmOS5::render_landscape15x; + } else { + _render = &OSystem_PalmOS5::render_landscapeAny; + calc_scale(); + } } else { OPTIONS_RST(kOptDisableOnScrDisp); _render = &OSystem_PalmOS5::render_1x; @@ -215,13 +219,18 @@ void OSystem_PalmOS5::copyRectToScreen(const byte *buf, int pitch, int x, int y, } } -bool OSystem_PalmOS5::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_PalmOS5::lockScreen() { + _framebuffer.pixels = _offScreenP; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - MemMove(surf->pixels, _offScreenP, _screenWidth * _screenHeight); - - return true; + return &_framebuffer; +} + +void OSystem_PalmOS5::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } void OSystem_PalmOS5::int_updateScreen() { diff --git a/backends/platform/PalmOS/Src/os5_renderer.cpp b/backends/platform/PalmOS/Src/os5_renderer.cpp index fdae35acd5..4580db4d53 100644 --- a/backends/platform/PalmOS/Src/os5_renderer.cpp +++ b/backends/platform/PalmOS/Src/os5_renderer.cpp @@ -76,3 +76,43 @@ void OSystem_PalmOS5::render_landscapeAny(RectangleType &r, PointType &p) { p.y = _screenOffset.y + o; RctSetRectangle(&r, 0, 0, _screenDest.w, _screenDest.h - o); } + +void OSystem_PalmOS5::render_landscape15x(RectangleType &r, PointType &p) { + Coord x, y, o = 0; + int16 *dst = _workScreenP; + + if (_overlayVisible) { + int16 *src = _overlayP; + + for (y = 0; y < 100; y++) { + // draw 2 lines + for (x = 0; x < 320; x++) { + *dst++ = *src++; + *dst++ = *src; + *dst++ = *src++; + } + // copy the second to the next line + MemMove(dst, dst - 480, 480 * 2); + dst += 480; + } + } else { + byte *src = _offScreenP; + o = _current_shake_pos; + + for (y = 0; y < 100; y++) { + // draw 2 lines + for (x = 0; x < 320; x++) { + *dst++ = _nativePal[*src++]; + *dst++ = _nativePal[*src]; + *dst++ = _nativePal[*src++]; + } + // copy the second to the next line + MemMove(dst, dst - 480, 480 * 2); + dst += 480; + } + } + + p.x = _screenOffset.x; + p.y = _screenOffset.y + o; + RctSetRectangle(&r, 0, 0, 480, 300 - o); +} diff --git a/backends/platform/PalmOS/Src/zodiac_event.cpp b/backends/platform/PalmOS/Src/zodiac_event.cpp index 4962ad2b72..84ecc27097 100644 --- a/backends/platform/PalmOS/Src/zodiac_event.cpp +++ b/backends/platform/PalmOS/Src/zodiac_event.cpp @@ -46,8 +46,8 @@ bool OSystem_PalmZodiac::check_event(Common::Event &event, EventPtr ev) { // F5 = menu case vchrThumbWheelBack: event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = 319; - event.kbd.ascii = 319; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; event.kbd.flags = 0; return true; diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index 01e86a561b..fa47ed21f5 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -81,8 +81,8 @@ class OSystem_Dreamcast : public OSystem { // The screen will not be updated to reflect the new bitmap void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); - // Copies the current screen contents to a new surface. - bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); // Clear the screen to black. void clearScreen(); @@ -213,6 +213,8 @@ class OSystem_Dreamcast : public OSystem { void *ovl_tx[NUM_BUFFERS]; unsigned short palette[256], cursor_palette[256]; + Graphics::Surface _framebuffer; + int temp_sound_buffer[RING_BUFFER_SAMPLES>>SOUND_BUFFER_SHIFT]; void checkSound(); diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index 73312cafed..da9f6e83ff 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -609,19 +609,24 @@ int OSystem_Dreamcast::getGraphicsMode() const return 0; } -bool OSystem_Dreamcast::grabRawScreen(Graphics::Surface *surf) +Graphics::Surface *OSystem_Dreamcast::lockScreen() { - if(!screen || !surf) - return false; + if (!screen) + return 0; - surf->create(_screen_w, _screen_h, 1); - unsigned char *src = screen, *dst = (unsigned char *)surf->pixels; - for(int h = _screen_h; h>0; --h) { - memcpy(dst, src, _screen_w); - src += SCREEN_W; - dst += _screen_w; - } - return true; + _framebuffer.pixels = screen; + _framebuffer.w = _screen_w; + _framebuffer.h = _screen_h; + _framebuffer.pitch = SCREEN_W; + _framebuffer.bytesPerPixel = 1; + + return &_framebuffer; +} + +void OSystem_Dreamcast::unlockScreen() +{ + // Force screen update + _screen_dirty = true; } void OSystem_Dreamcast::clearScreen() diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp index 7a5e5911d8..f3638a28db 100644 --- a/backends/platform/dc/input.cpp +++ b/backends/platform/dc/input.cpp @@ -48,7 +48,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, if(!(buttons & 4)) lmb++; if(!(buttons & 2)) rmb++; - if(!(buttons & 8)) newkey = 319; + if(!(buttons & 8)) newkey = Common::ASCII_F5; else if(!(buttons & 512)) newkey = ' '; else if(!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15]; @@ -69,7 +69,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, if(!(buttons & 4)) lmb++; if(!(buttons & 2)) rmb++; - if(!(buttons & 8)) newkey = 319; + if(!(buttons & 8)) newkey = Common::ASCII_F5; mouse_x += pad->cond.mouse.axis1; mouse_y += pad->cond.mouse.axis2; @@ -101,22 +101,22 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, "=¯`{ }+*½<>?" : "-^@[ ];:§,./")[key - 0x2d]; else if(key >= 0x3a && key <= 0x43) - newkey = key+(315-0x3a); + newkey = key+(Common::ASCII_F1-0x3a); else if(key >= 0x54 && key <= 0x57) newkey = "/*-+"[key-0x54]; else switch(key) { case 0x27: case 0x62: newkey = ((shift & 0x22)? '~' : '0'); break; case 0x28: case 0x58: - newkey = 13; break; + newkey = Common::KEYCODE_RETURN; break; case 0x29: - newkey = 27; break; + newkey = Common::KEYCODE_ESCAPE; break; case 0x2a: - newkey = 8; break; + newkey = Common::KEYCODE_BACKSPACE; break; case 0x2b: - newkey = 9; break; + newkey = Common::KEYCODE_TAB; break; case 0x2c: - newkey = ' '; break; + newkey = Common::KEYCODE_SPACE; break; case 0x4c: if((shift & 0x11) && (shift & 0x44)) exit(0); diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp index a4fec642fe..8262a39614 100644 --- a/backends/platform/dc/selector.cpp +++ b/backends/platform/dc/selector.cpp @@ -364,7 +364,7 @@ int gameMenu(Game *games, int num_games) event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags); setimask(mask); - if(event==-Common::EVENT_LBUTTONDOWN || event==13 || event==319) { + if(event==-Common::EVENT_LBUTTONDOWN || event==13 || event==Common::ASCII_F5) { int selected_game = top_game + selector_pos; for(int fade=0; fade<=256; fade+=4) { diff --git a/backends/platform/dc/softkbd.cpp b/backends/platform/dc/softkbd.cpp index e8436fc30a..58b492f6db 100644 --- a/backends/platform/dc/softkbd.cpp +++ b/backends/platform/dc/softkbd.cpp @@ -52,7 +52,7 @@ static const char key_names[] = static const short key_codes[] = { - 27, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + Common::KEYCODE_ESCAPE, Common::ASCII_F1, Common::ASCII_F2, Common::ASCII_F3, Common::ASCII_F4, Common::ASCII_F5, Common::ASCII_F6, Common::ASCII_F7, Common::ASCII_F8, Common::ASCII_F9, Common::ASCII_F10, K('1','!'), K('2','"'), K('3','#'), K('4','$'), K('5','%'), K('6','&'), K('7','\''), K('8','('), K('9',')'), K('0','~'), K('-','='), K('q','Q'), K('w','W'), K('e','E'), K('r','R'), K('t','T'), @@ -61,7 +61,7 @@ static const short key_codes[] = K('h','H'), K('j','J'), K('k','K'), K('l','L'), K(';','+'), K(':','*'), K('z','Z'), K('x','X'), K('c','C'), K('v','V'), K('b','B'), K('n','N'), K('m','M'), K(',','<'), K('.','>'), K('/','?'), K('\\','_'), - ~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', 8, 13 + ~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', Common::KEYCODE_BACKSPACE, Common::KEYCODE_RETURN }; SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os) diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile index f28abd2b77..cb41774064 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -333,8 +333,8 @@ endif #--------------------------------------------------------------------------------- %.nds: %.bin - @echo ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.9.0;DS Port" - ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.9.1;DS Port" + @echo ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.11.0svn;DS Port" + ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../../$(LOGO) "$(shell basename $@);ScummVM 0.11.0svn;DS Port" dsbuild $@ -l ../ndsloader.bin padbin 16 $(basename $@).ds.gba diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 153ecfab87..af5addac66 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -333,27 +333,25 @@ void initSprites() { void saveGameBackBuffer() { #ifdef DISABLE_SCUMM if (savedBuffer == NULL) savedBuffer = new u8[gameWidth * gameHeight]; - for (int r = 0; r < 200; r++) { + for (int r = 0; r < gameHeight; r++) { memcpy(savedBuffer + (r * gameWidth), ((u8 *) (get8BitBackBuffer())) + (r * 512), gameWidth); - } #endif } void restoreGameBackBuffer() { #ifdef DISABLE_SCUMM if (savedBuffer) { - for (int r = 0; r < 200; r++) { - memcpy(((u8 *) (BG_GFX_SUB)) + (r * 512), savedBuffer + (r * gameWidth), gameWidth); - memcpy(((u8 *) (get8BitBackBuffer())) + (r * 512), savedBuffer + (r * gameWidth), gameWidth); - } + for (int r = 0; r < gameHeight; r++) { + memcpy(((u8 *) (BG_GFX_SUB)) + (r * 512), savedBuffer + (r * gameWidth), gameWidth); + memcpy(((u8 *) (get8BitBackBuffer())) + (r * 512), savedBuffer + (r * gameWidth), gameWidth); + } + delete savedBuffer; savedBuffer = NULL; } -#endif - -#ifndef DISABLE_SCUMM - memset(get8BitBackBuffer(), 0, 512 * 256); - memset(BG_GFX_SUB, 0, 512 * 256); +#else + memset(get8BitBackBuffer(), 0, 512 * 256); + memset(BG_GFX_SUB, 0, 512 * 256); if (Scumm::g_scumm) { Scumm::g_scumm->markRectAsDirty(Scumm::kMainVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1); Scumm::g_scumm->markRectAsDirty(Scumm::kTextVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1); @@ -996,11 +994,10 @@ void setKeyboardEnable(bool en) { // Copy the sub screen VRAM from the top screen - they should always be // the same. u16* buffer = get8BitBackBuffer(); - - for (int r = 0; r < (512 * 256) >> 1; r++) { - BG_GFX_SUB[r] = buffer[r]; - } - + + for (int r = 0; r < (512 * 256) >> 1; r++) + BG_GFX_SUB[r] = buffer[r]; + SUB_DISPLAY_CR &= ~DISPLAY_BG1_ACTIVE; // Turn off keyboard layer SUB_DISPLAY_CR |= DISPLAY_BG3_ACTIVE; // Turn on game layer } else { @@ -1229,7 +1226,7 @@ void addEventsToQueue() { if (leftHandedSwap(getKeysChanged()) & KEY_UP) { event.type = getKeyEvent(leftHandedSwap(KEY_UP)); - event.kbd.keycode = SDLK_UP; + event.kbd.keycode = Common::KEYCODE_UP; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); @@ -1237,7 +1234,7 @@ void addEventsToQueue() { if (leftHandedSwap(getKeysChanged()) & KEY_DOWN) { event.type = getKeyEvent(leftHandedSwap(KEY_DOWN)); - event.kbd.keycode = SDLK_DOWN; + event.kbd.keycode = Common::KEYCODE_DOWN; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); @@ -1245,7 +1242,7 @@ void addEventsToQueue() { if (leftHandedSwap(getKeysDown()) & KEY_A) { event.type = getKeyEvent(leftHandedSwap(KEY_A)); - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; event.kbd.ascii = 0; event.kbd.flags = 0; system->addEvent(event); @@ -1256,8 +1253,8 @@ void addEventsToQueue() { if ((getKeysChanged() & KEY_START)) { event.type = getKeyEvent(KEY_START); - event.kbd.keycode = 319; // F5 - event.kbd.ascii = 319; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; event.kbd.flags = 0; system->addEvent(event); } @@ -2315,6 +2312,8 @@ int main(void) consolePrintf("-------------------------------\n"); consolePrintf("ScummVM DS\n"); consolePrintf("Ported by Neil Millstone\n"); + FIXME: Change this code to make use of base/internal_version.h + resp. uses gScummVMVersion from base/version.h consolePrintf("Version 0.10.0SVN "); #if defined(DS_BUILD_A) consolePrintf("build A\n"); @@ -2483,4 +2482,3 @@ int main(void) int main() { DS::main(); } - diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp index 58df3dc863..171d1e044c 100644 --- a/backends/platform/ds/arm9/source/dsoptions.cpp +++ b/backends/platform/ds/arm9/source/dsoptions.cpp @@ -158,8 +158,8 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint Common::Event event; event.type = Common::EVENT_KEYDOWN; - event.kbd.ascii = SDLK_DOWN; - event.kbd.keycode = SDLK_DOWN; + event.kbd.ascii = 0; + event.kbd.keycode = Common::KEYCODE_DOWN; OSystem_DS::instance()->addEvent(event); event.type = Common::EVENT_KEYUP; diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index 9ff2c5ba63..cad6ad6b78 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -173,8 +173,8 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int u16* src = (u16 *) buf; if (DS::getKeyboardEnable()) { - - for (int dy = y; dy < y + h; dy++) { + for (int dy = y; dy < y + h; dy++) + { u16* dest = bg + (dy << 8) + (x >> 1); DC_FlushRange(src, w << 1); @@ -185,7 +185,8 @@ void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } } else { - for (int dy = y; dy < y + h; dy++) { + for (int dy = y; dy < y + h; dy++) + { u16* dest1 = bg + (dy << 8) + (x >> 1); u16* dest2 = bgSub + (dy << 8) + (x >> 1); @@ -473,22 +474,36 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager() } } -bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) { - surf->create(DS::getGameWidth(), DS::getGameHeight(), 1); +Graphics::Surface *OSystem_DS::lockScreen() { + // For now, we create a full temporary screen surface, to which we copy the + // the screen content. Later unlockScreen will copy everything back. + // Not very nice nor efficient, but at least works, and is not worse + // than in the bad old times where we used grabRawScreen + copyRectToScreen. + + _framebuffer.create(DS::getGameWidth(), DS::getGameHeight(), 1); // Ensure we copy using 16 bit quantities due to limitation of VRAM addressing - // TODO: Change this to work with the software scalar (hint: video ram format is different) + + u16* image = (u16 *) DS::get8BitBackBuffer(); for (int y = 0; y < DS::getGameHeight(); y++) { - DC_FlushRange((image + (y * 512)), DS::getGameWidth()); + DC_FlushRange(image + (y << 8), DS::getGameWidth()); for (int x = 0; x < DS::getGameWidth() >> 1; x++) { - *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = *(image + y * 256 + x); + *(((u16 *) (_framebuffer.pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y << 8 + x]; } } - return true; + return &_framebuffer; +} + +void OSystem_DS::unlockScreen() { + // Copy temp framebuffer back to screen + copyRectToScreen((byte *)_framebuffer.pixels, _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h); + + // Free memory + _framebuffer.free(); } void OSystem_DS::setFocusRectangle(const Common::Rect& rect) { diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index b6d6f5b7bc..58b940af2c 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -53,6 +53,8 @@ public: DSAudioMixer* _mixer; DSTimerManager* _timer; + Graphics::Surface _framebuffer; + static OSystem_DS* _instance; typedef void (*SoundProc)(void *param, byte *buf, int len); @@ -127,7 +129,8 @@ public: void addEvent(Common::Event& e); bool isEventQueueEmpty() { return queuePos == 0; } - virtual bool grabRawScreen(Graphics::Surface* surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); virtual void setFocusRectangle(const Common::Rect& rect); @@ -159,4 +162,9 @@ void OSystem_DS::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) //consolePrintf("coltorgb\n"); } +namespace DS +{ +bool isCpuScalerEnabled(); +} + #endif diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp index 3f1d6f8064..8f7af668d8 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.cpp +++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp @@ -56,9 +56,9 @@ key_data keys[DS_NUM_KEYS] = { {35, 17, 0, '8'}, {36, 19, 0, '9'}, {27, 21, 0, '0'}, - {45, 23, 0, SDLK_MINUS}, - {50, 25, 0, SDLK_EQUALS}, - {52, 27, 0, SDLK_BACKSPACE}, + {45, 23, 0, Common::KEYCODE_MINUS}, + {50, 25, 0, Common::KEYCODE_EQUALS}, + {52, 27, 0, Common::KEYCODE_BACKSPACE}, // Top row {'Q'-'A' + 1, 4, 2, 'Q'}, @@ -71,8 +71,8 @@ key_data keys[DS_NUM_KEYS] = { {'I'-'A' + 1, 18, 2, 'I'}, {'O'-'A' + 1, 20, 2, 'O'}, {'P'-'A' + 1, 22, 2, 'P'}, - {43, 24, 2, SDLK_LEFTBRACKET}, - {44, 26, 2, SDLK_RIGHTBRACKET}, + {43, 24, 2, Common::KEYCODE_LEFTBRACKET}, + {44, 26, 2, Common::KEYCODE_RIGHTBRACKET}, // Middle row {55, 3, 4, DS_CAPSLOCK}, @@ -85,9 +85,9 @@ key_data keys[DS_NUM_KEYS] = { {'J'-'A' + 1, 17, 4, 'J'}, {'K'-'A' + 1, 19, 4, 'K'}, {'L'-'A' + 1, 21, 4, 'L'}, - {42, 23, 4, SDLK_SEMICOLON}, - {41, 25, 4, SDLK_QUOTE}, - {46, 27, 4, SDLK_RETURN}, + {42, 23, 4, Common::KEYCODE_SEMICOLON}, + {41, 25, 4, Common::KEYCODE_QUOTE}, + {46, 27, 4, Common::KEYCODE_RETURN}, // Bottom row {51, 4, 6, DS_SHIFT}, @@ -98,26 +98,26 @@ key_data keys[DS_NUM_KEYS] = { {'B'-'A' + 1, 14, 6, 'B'}, {'N'-'A' + 1, 16, 6, 'N'}, {'M'-'A' + 1, 18, 6, 'M'}, - {38, 20, 6, SDLK_COMMA}, - {39, 22, 6, SDLK_PERIOD}, - {40, 24, 6, SDLK_SLASH}, + {38, 20, 6, Common::KEYCODE_COMMA}, + {39, 22, 6, Common::KEYCODE_PERIOD}, + {40, 24, 6, Common::KEYCODE_SLASH}, // Space bar - {47, 9, 8, SDLK_SPACE}, - {48, 11, 8, SDLK_SPACE}, - {48, 13, 8, SDLK_SPACE}, - {48, 15, 8, SDLK_SPACE}, - {48, 17, 8, SDLK_SPACE}, - {49, 19, 8, SDLK_SPACE}, + {47, 9, 8, Common::KEYCODE_SPACE}, + {48, 11, 8, Common::KEYCODE_SPACE}, + {48, 13, 8, Common::KEYCODE_SPACE}, + {48, 15, 8, Common::KEYCODE_SPACE}, + {48, 17, 8, Common::KEYCODE_SPACE}, + {49, 19, 8, Common::KEYCODE_SPACE}, // Cursor arrows - {52, 27, 8, SDLK_LEFT}, - {54, 29, 8, SDLK_DOWN}, - {53, 31, 8, SDLK_RIGHT}, - {51, 29, 6, SDLK_UP}, + {52, 27, 8, Common::KEYCODE_LEFT}, + {54, 29, 8, Common::KEYCODE_DOWN}, + {53, 31, 8, Common::KEYCODE_RIGHT}, + {51, 29, 6, Common::KEYCODE_UP}, // Close button - {56, 30, 0, SDLK_UNKNOWN}, + {56, 30, 0, Common::KEYCODE_INVALID}, }; @@ -237,7 +237,7 @@ void addKeyboardEvents() { Common::Event event; // consolePrintf("Key: %d\n", r); - if ((keys[r].character == SDLK_UNKNOWN)) { + if ((keys[r].character == Common::KEYCODE_INVALID)) { // Close button DS::closed = true; } else if ((keys[r].character >= '0') && (keys[r].character <= '9')) { diff --git a/backends/platform/ds/arm9/source/touchkeyboard.h b/backends/platform/ds/arm9/source/touchkeyboard.h index 53fd25e12a..e8f5fda37e 100644 --- a/backends/platform/ds/arm9/source/touchkeyboard.h +++ b/backends/platform/ds/arm9/source/touchkeyboard.h @@ -25,75 +25,6 @@ namespace DS { -enum SDLKey { - SDLK_UNKNOWN = 0, SDLK_FIRST = 0, SDLK_BACKSPACE = 8, SDLK_TAB = 9, - SDLK_CLEAR = 12, SDLK_RETURN = 13, SDLK_PAUSE = 19, SDLK_ESCAPE = 27, - SDLK_SPACE = 32, SDLK_EXCLAIM = 33, SDLK_QUOTEDBL = 34, SDLK_HASH = 35, - SDLK_DOLLAR = 36, SDLK_AMPERSAND = 38, SDLK_QUOTE = 39, SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, SDLK_ASTERISK = 42, SDLK_PLUS = 43, SDLK_COMMA = 44, - SDLK_MINUS = 45, SDLK_PERIOD = 46, SDLK_SLASH = 47, SDLK_0 = 48, - SDLK_1 = 49, SDLK_2 = 50, SDLK_3 = 51, SDLK_4 = 52, - SDLK_5 = 53, SDLK_6 = 54, SDLK_7 = 55, SDLK_8 = 56, - SDLK_9 = 57, SDLK_COLON = 58, SDLK_SEMICOLON = 59, SDLK_LESS = 60, - SDLK_EQUALS = 61, SDLK_GREATER = 62, SDLK_QUESTION = 63, SDLK_AT = 64, - SDLK_LEFTBRACKET = 91, SDLK_BACKSLASH = 92, SDLK_RIGHTBRACKET = 93, SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, SDLK_BACKQUOTE = 96, SDLK_a = 97, SDLK_b = 98, - SDLK_c = 99, SDLK_d = 100, SDLK_e = 101, SDLK_f = 102, - SDLK_g = 103, SDLK_h = 104, SDLK_i = 105, SDLK_j = 106, - SDLK_k = 107, SDLK_l = 108, SDLK_m = 109, SDLK_n = 110, - SDLK_o = 111, SDLK_p = 112, SDLK_q = 113, SDLK_r = 114, - SDLK_s = 115, SDLK_t = 116, SDLK_u = 117, SDLK_v = 118, - SDLK_w = 119, SDLK_x = 120, SDLK_y = 121, SDLK_z = 122, - SDLK_DELETE = 127, SDLK_WORLD_0 = 160, SDLK_WORLD_1 = 161, SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, SDLK_WORLD_4 = 164, SDLK_WORLD_5 = 165, SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, SDLK_WORLD_8 = 168, SDLK_WORLD_9 = 169, SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, SDLK_WORLD_12 = 172, SDLK_WORLD_13 = 173, SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, SDLK_WORLD_16 = 176, SDLK_WORLD_17 = 177, SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, SDLK_WORLD_20 = 180, SDLK_WORLD_21 = 181, SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, SDLK_WORLD_24 = 184, SDLK_WORLD_25 = 185, SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, SDLK_WORLD_28 = 188, SDLK_WORLD_29 = 189, SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, SDLK_WORLD_32 = 192, SDLK_WORLD_33 = 193, SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, SDLK_WORLD_36 = 196, SDLK_WORLD_37 = 197, SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, SDLK_WORLD_40 = 200, SDLK_WORLD_41 = 201, SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, SDLK_WORLD_44 = 204, SDLK_WORLD_45 = 205, SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, SDLK_WORLD_48 = 208, SDLK_WORLD_49 = 209, SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, SDLK_WORLD_52 = 212, SDLK_WORLD_53 = 213, SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, SDLK_WORLD_56 = 216, SDLK_WORLD_57 = 217, SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, SDLK_WORLD_60 = 220, SDLK_WORLD_61 = 221, SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, SDLK_WORLD_64 = 224, SDLK_WORLD_65 = 225, SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, SDLK_WORLD_68 = 228, SDLK_WORLD_69 = 229, SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, SDLK_WORLD_72 = 232, SDLK_WORLD_73 = 233, SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, SDLK_WORLD_76 = 236, SDLK_WORLD_77 = 237, SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, SDLK_WORLD_80 = 240, SDLK_WORLD_81 = 241, SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, SDLK_WORLD_84 = 244, SDLK_WORLD_85 = 245, SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, SDLK_WORLD_88 = 248, SDLK_WORLD_89 = 249, SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, SDLK_WORLD_92 = 252, SDLK_WORLD_93 = 253, SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, SDLK_KP0 = 256, SDLK_KP1 = 257, SDLK_KP2 = 258, - SDLK_KP3 = 259, SDLK_KP4 = 260, SDLK_KP5 = 261, SDLK_KP6 = 262, - SDLK_KP7 = 263, SDLK_KP8 = 264, SDLK_KP9 = 265, SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, SDLK_KP_MULTIPLY = 268, SDLK_KP_MINUS = 269, SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, SDLK_KP_EQUALS = 272, SDLK_UP = 273, SDLK_DOWN = 274, - SDLK_RIGHT = 275, SDLK_LEFT = 276, SDLK_INSERT = 277, SDLK_HOME = 278, - SDLK_END = 279, SDLK_PAGEUP = 280, SDLK_PAGEDOWN = 281, SDLK_F1 = 282, - SDLK_F2 = 283, SDLK_F3 = 284, SDLK_F4 = 285, SDLK_F5 = 286, - SDLK_F6 = 287, SDLK_F7 = 288, SDLK_F8 = 289, SDLK_F9 = 290, - SDLK_F10 = 291, SDLK_F11 = 292, SDLK_F12 = 293, SDLK_F13 = 294, - SDLK_F14 = 295, SDLK_F15 = 296, SDLK_NUMLOCK = 300, SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, SDLK_RSHIFT = 303, SDLK_LSHIFT = 304, SDLK_RCTRL = 305, - SDLK_LCTRL = 306, SDLK_RALT = 307, SDLK_LALT = 308, SDLK_RMETA = 309, - SDLK_LMETA = 310, SDLK_LSUPER = 311, SDLK_RSUPER = 312, SDLK_MODE = 313, - SDLK_COMPOSE = 314, SDLK_HELP = 315, SDLK_PRINT = 316, SDLK_SYSREQ = 317, - SDLK_BREAK = 318, SDLK_MENU = 319, SDLK_POWER = 320, SDLK_EURO = 321, - SDLK_UNDO = 322, SDLK_LAST -}; - -enum SDLMod { - KMOD_NONE = 0x0000, KMOD_LSHIFT = 0x0001, KMOD_RSHIFT = 0x0002, KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, KMOD_LALT = 0x0100, KMOD_RALT = 0x0200, KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, KMOD_NUM = 0x1000, KMOD_CAPS = 0x2000, KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -}; - void drawKeyboard(int tileBase, int mapBase, u16* saveSpace); void restoreVRAM(int tileBase, int mapBase, u16* saveSpace); void addKeyboardEvents(); diff --git a/backends/platform/gp2x/build/bundle.sh b/backends/platform/gp2x/build/bundle.sh index b5e3161c9b..93ae45f0e3 100644 --- a/backends/platform/gp2x/build/bundle.sh +++ b/backends/platform/gp2x/build/bundle.sh @@ -23,6 +23,7 @@ cp ../../../../scummvm.gp2x ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../AUTHORS ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../README ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../COPYING ./scummvm-gp2x-`date '+%Y-%m-%d'`/ +cp ../../../../COPYRIGHT ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../NEWS ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../gui/themes/modern.ini ./scummvm-gp2x-`date '+%Y-%m-%d'`/ cp ../../../../gui/themes/modern.zip ./scummvm-gp2x-`date '+%Y-%m-%d'`/ diff --git a/backends/platform/gp2x/events.cpp b/backends/platform/gp2x/events.cpp index 80cdad924b..72b188afd2 100644 --- a/backends/platform/gp2x/events.cpp +++ b/backends/platform/gp2x/events.cpp @@ -65,7 +65,7 @@ static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { if (key >= SDLK_F1 && key <= SDLK_F9) { - return key - SDLK_F1 + 315; + return key - SDLK_F1 + Common::ASCII_F1; } else if (key >= SDLK_KP0 && key <= SDLK_KP9) { return key - SDLK_KP0 + '0'; } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) { @@ -468,10 +468,10 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { break; case GP2X_BUTTON_R: if (GP2X_BUTTON_STATE_L == TRUE) { - event.kbd.keycode = SDLK_0; + event.kbd.keycode = Common::KEYCODE_0; event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0); } else { - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); } break; @@ -479,28 +479,28 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { if (GP2X_BUTTON_STATE_L == TRUE) { event.type = Common::EVENT_QUIT; } else { - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); } break; case GP2X_BUTTON_A: - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_Y: if (GP2X_BUTTON_STATE_L == TRUE) { setZoomOnMouse(); } else { - event.kbd.keycode = SDLK_SPACE; + event.kbd.keycode = Common::KEYCODE_SPACE; event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); } break; case JOY_BUT_RETURN: - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0); break; case JOY_BUT_ZERO: - event.kbd.keycode = SDLK_0; + event.kbd.keycode = Common::KEYCODE_0; event.kbd.ascii = mapKey(SDLK_0, ev.key.keysym.mod, 0); break; @@ -514,7 +514,7 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { // displayMessageOnOSD("Left Trigger Pressed"); // break; // } else if ((ev.jbutton.button == GP2X_BUTTON_R) && (ev.jbutton.button != GP2X_BUTTON_L)) { - // event.kbd.keycode = SDLK_F5; + // event.kbd.keycode = Common::KEYCODE_F5; // event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); // break; // } else { @@ -525,7 +525,7 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { if (GP2X_BUTTON_STATE_L == TRUE) { displayMessageOnOSD("Setting CPU Speed at 230MHz"); GP2X_setCpuspeed(200); - //event.kbd.keycode = SDLK_PLUS; + //event.kbd.keycode = Common::KEYCODE_PLUS; //event.kbd.ascii = mapKey(SDLK_PLUS, ev.key.keysym.mod, 0); } else { GP2X_mixer_move_volume(1); @@ -536,7 +536,7 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { if (GP2X_BUTTON_STATE_L == TRUE) { displayMessageOnOSD("Setting CPU Speed at 60MHz"); GP2X_setCpuspeed(60); - //event.kbd.keycode = SDLK_MINUS; + //event.kbd.keycode = Common::KEYCODE_MINUS; //event.kbd.ascii = mapKey(SDLK_MINUS, ev.key.keysym.mod, 0); } else { GP2X_mixer_move_volume(0); @@ -564,26 +564,26 @@ bool OSystem_GP2X::pollEvent(Common::Event &event) { event.kbd.flags = 0; switch (ev.jbutton.button) { case GP2X_BUTTON_SELECT: - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_A: - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_Y: -// event.kbd.keycode = SDLK_SPACE; +// event.kbd.keycode = Common::KEYCODE_SPACE; // event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_START: - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; event.kbd.ascii = mapKey(SDLK_RETURN, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_L: GP2X_BUTTON_STATE_L = FALSE; break; case GP2X_BUTTON_R: - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); break; case GP2X_BUTTON_VOLUP: diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h index 4c91a00247..68f2fb997e 100644 --- a/backends/platform/gp2x/gp2x-common.h +++ b/backends/platform/gp2x/gp2x-common.h @@ -90,11 +90,8 @@ public: // The screen will not be updated to reflect the new bitmap void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); - // Copies the screen to a buffer - bool grabRawScreen(Graphics::Surface *surf); - - // Clear the screen - void clearScreen(); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); // Update the dirty areas of the screen void updateScreen(); diff --git a/backends/platform/gp2x/graphics.cpp b/backends/platform/gp2x/graphics.cpp index a482689e43..c3ed5c627c 100644 --- a/backends/platform/gp2x/graphics.cpp +++ b/backends/platform/gp2x/graphics.cpp @@ -687,22 +687,6 @@ void OSystem_GP2X::setZoomOnMouse() { } } -void OSystem_GP2X::clearScreen() { - assert (_transactionMode == kTransactionNone); - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - byte *dst = (byte *)_screen->pixels; - - // Clear the screen - memset(dst, 0, _screenWidth * _screenHeight); - - // Unlock the screen surface - SDL_UnlockSurface(_screen); -} - void OSystem_GP2X::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) { assert (_transactionMode == kTransactionNone); assert(src); @@ -772,15 +756,19 @@ void OSystem_GP2X::copyRectToScreen(const byte *src, int pitch, int x, int y, in SDL_UnlockSurface(_screen); } -// TIDY: DIRTY HACK: Try a REALLY simple version of grabRawScreen to -// debug why it will not work on the GP2X. -bool OSystem_GP2X::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_GP2X::lockScreen() { + _framebuffer.pixels = _screen->pixels; + _framebuffer.w = _screen->w; + _framebuffer.h = _screen->h; + _framebuffer.pitch = _screen->pitch; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - memcpy(surf->pixels, _screen->pixels, _screenWidth * _screenHeight); + return &_framebuffer; +} - return true; +void OSystem_GP2X::unlockScreen() { + // Force screen update + _forceFull = true; } void OSystem_GP2X::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) { diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp index ab2ac1616b..f6e0a10bbc 100644 --- a/backends/platform/gp32/gp32_osys.cpp +++ b/backends/platform/gp32/gp32_osys.cpp @@ -209,14 +209,18 @@ void OSystem_GP32::copyRectToScreen(const byte *src, int pitch, int x, int y, in } } -bool OSystem_GP32::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_GP32::lockScreen() { + _framebuffer.pixels = _gameScreen; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - - memcpy(surf->pixels, _gameScreen, _screenWidth * _screenHeight); + return &_framebuffer; +} - return true; +void OSystem_GP32::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } //TODO: Implement Dirty rect? @@ -524,8 +528,10 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYDOWN; if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; - else - event.kbd.keycode = event.kbd.ascii = 319; + else { + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { // SELECT = pause @@ -596,8 +602,10 @@ bool OSystem_GP32::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYUP; if (_overlayVisible) event.kbd.keycode = event.kbd.ascii = 13; - else - event.kbd.keycode = event.kbd.ascii = 319; + else { + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; + } return true; } if (ev.button == GPC_VK_SELECT) { diff --git a/backends/platform/gp32/gp32_osys.h b/backends/platform/gp32/gp32_osys.h index fa8a0903ad..94578e8e15 100644 --- a/backends/platform/gp32/gp32_osys.h +++ b/backends/platform/gp32/gp32_osys.h @@ -49,6 +49,8 @@ protected: uint16 *_tmpScreen, *_hwScreen; OverlayColor *_overlayBuffer; + Graphics::Surface _framebuffer; + int _overlayWidth, _overlayHeight; bool _overlayVisible; uint32 _shakePos; @@ -111,7 +113,8 @@ public: void grabOverlay(OverlayColor *buf, int pitch); void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); - bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); int16 getOverlayHeight(); int16 getOverlayWidth(); diff --git a/backends/platform/maemo/hildon.cpp b/backends/platform/maemo/hildon.cpp index cd23617685..d4f2aa122d 100644 --- a/backends/platform/maemo/hildon.cpp +++ b/backends/platform/maemo/hildon.cpp @@ -26,9 +26,10 @@ #include <hildon-widgets/hildon-app.h> #include <gtk/gtk.h> #include <libosso.h> +#include "base/internal_version.h" #define OSSO_APP_NAME "scummvm" -#define OSSO_APP_VERSION "0.9.0CVS" +#define OSSO_APP_VERSION SCUMMVM_VERSION #define OSSO_APP_SERVICE "org.scummvm."OSSO_APP_NAME #define OSSO_APP_OBJECT "/org/scummvm/"OSSO_APP_NAME #define OSSO_APP_IFACE "org.scummvm."OSSO_APP_NAME diff --git a/backends/platform/maemo/main.cpp b/backends/platform/maemo/main.cpp index 40b2efb626..73a5aff7bc 100644 --- a/backends/platform/maemo/main.cpp +++ b/backends/platform/maemo/main.cpp @@ -33,6 +33,7 @@ #include "backends/platform/maemo/maemo-sdl.h" #include "base/main.h" +#include "base/internal_version.h" #include <hildon-widgets/hildon-app.h> #include <gtk/gtk.h> #include <libosso.h> @@ -41,7 +42,7 @@ #include <sys/resource.h> #define OSSO_APP_NAME "scummvm" -#define OSSO_APP_VERSION "0.9.0CVS" +#define OSSO_APP_VERSION SCUMMVM_VERSION void set_doubling(unsigned char enable) { return; diff --git a/backends/platform/morphos/morphos.cpp b/backends/platform/morphos/morphos.cpp index 66525a7664..7375ecbe46 100644 --- a/backends/platform/morphos/morphos.cpp +++ b/backends/platform/morphos/morphos.cpp @@ -838,7 +838,7 @@ bool OSystem_MorphOS::pollEvent(Common::Event &event) /* * Function key */ - event.kbd.ascii = (ScummMsg->Code-RAWKEY_F1)+315; + event.kbd.ascii = (ScummMsg->Code-RAWKEY_F1)+Common::ASCII_F1; event.kbd.keycode = 0; } else if (ScummMsg->Code == RAWKEY_F11 || ScummMsg->Code == RAWKEY_F12) diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp index 963b3429f5..250ca0fb29 100644 --- a/backends/platform/null/null.cpp +++ b/backends/platform/null/null.cpp @@ -63,7 +63,8 @@ public: virtual void grabPalette(byte *colors, uint start, uint num); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void updateScreen(); - virtual bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); virtual void setShakePos(int shakeOffset); virtual void showOverlay(); @@ -189,8 +190,11 @@ void OSystem_NULL::copyRectToScreen(const byte *buf, int pitch, int x, int y, in void OSystem_NULL::updateScreen() { } -bool OSystem_NULL::grabRawScreen(Graphics::Surface *surf) { - return false; +Graphics::Surface *OSystem_NULL::lockScreen() { + return 0; +} + +void OSystem_NULL::unlockScreen() { } void OSystem_NULL::setShakePos(int shakeOffset) { diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index 4829027f15..1de3c5e8c8 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -364,13 +364,6 @@ void Gs2dScreen::copyScreenRect(const uint8 *buf, int pitch, int x, int y, int w } } -void Gs2dScreen::clearScreen(void) { - WaitSema(g_DmacSema); - memset(_screenBuf, 0, _width * _height); - _screenChanged = true; - SignalSema(g_DmacSema); -} - void Gs2dScreen::setPalette(const uint32 *pal, uint8 start, uint16 num) { assert(start + num <= 256); @@ -393,11 +386,20 @@ void Gs2dScreen::grabPalette(uint32 *pal, uint8 start, uint16 num) { } } -void Gs2dScreen::grabScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *Gs2dScreen::lockScreen() { WaitSema(g_DmacSema); - surf->create(_width, _height, 1); - memcpy(surf->pixels, _screenBuf, _width * _height); + + _framebuffer.pixels = _screen->pixels; + _framebuffer.w = _screen->w; + _framebuffer.h = _screen->h; + _framebuffer.pitch = _screen->pitch; + _framebuffer.bytesPerPixel = 1; + + return &_framebuffer; +} + +void Gs2dScreen::unlockScreen() { + _screenChanged = true; SignalSema(g_DmacSema); } diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 353e577980..471ec87789 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -56,13 +56,13 @@ public: void copyPrintfOverlay(const uint8* buf); void clearPrintfOverlay(void); - void clearScreen(void); void copyScreenRect(const uint8 *buf, int pitch, int x, int y, int w, int h); void setPalette(const uint32 *pal, uint8 start, uint16 num); void updateScreen(void); void grabPalette(uint32 *pal, uint8 start, uint16 num); - void grabScreen(Graphics::Surface *surf); + Graphics::Surface *lockScreen(); + void unlockScreen(); //- overlay routines void copyOverlayRect(const uint16 *buf, uint16 pitch, uint16 x, uint16 y, uint16 w, uint16 h); void grabOverlay(uint16 *buf, uint16 pitch); @@ -99,6 +99,8 @@ private: uint32 _mouseScaleX, _mouseScaleY; uint8 _mTraCol; + Graphics::Surface _framebuffer; + int _shakePos; bool _showMouse, _showOverlay, _screenChanged, _overlayChanged, _clutChanged; diff --git a/backends/platform/ps2/ps2input.cpp b/backends/platform/ps2/ps2input.cpp index a3f4a31e8f..a17d38b80d 100644 --- a/backends/platform/ps2/ps2input.cpp +++ b/backends/platform/ps2/ps2input.cpp @@ -31,7 +31,6 @@ #include "backends/platform/ps2/ps2input.h" #include "backends/platform/ps2/ps2pad.h" #include "backends/platform/ps2/systemps2.h" -#include "backends/platform/ps2/sdlkeys.h" #include "common/events.h" #include "common/system.h" @@ -96,15 +95,15 @@ void Ps2Input::warpTo(uint16 x, uint16 y) { #define PAD_CHECK_TIME 20 int Ps2Input::mapKey(int key, int mod) { // copied from sdl backend - if (key >= SDLK_F1 && key <= SDLK_F9) { - return key - SDLK_F1 + 315; - } else if (key >= SDLK_KP0 && key <= SDLK_KP9) { - return key - SDLK_KP0 + '0'; - } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) { + if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) { + return key - Common::KEYCODE_F1 + Common::ASCII_F1; + } else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) { + return key - Common::KEYCODE_KP0 + '0'; + } else if (key >= Common::KEYCODE_UP && key <= Common::KEYCODE_PAGEDOWN) { return key; } else if (key >= 'a' && key <= 'z' && mod & Common::KBD_SHIFT) { return key & ~0x20; - } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) { + } else if (key >= Common::KEYCODE_NUMLOCK && key <= Common::KEYCODE_EURO) { return 0; } return key; @@ -142,17 +141,17 @@ bool Ps2Input::pollEvent(Common::Event *event) { PS2KbdRawKey key; if (PS2KbdReadRaw(&key) == 1) { if (_usbToSdlk[key.key]) { - if ((_usbToSdlk[key.key] == SDLK_LSHIFT) || (_usbToSdlk[key.key] == SDLK_RSHIFT)) { + if ((_usbToSdlk[key.key] == Common::KEYCODE_LSHIFT) || (_usbToSdlk[key.key] == Common::KEYCODE_RSHIFT)) { if (key.state & 1) _keyFlags |= Common::KBD_SHIFT; else _keyFlags &= ~Common::KBD_SHIFT; - } else if ((_usbToSdlk[key.key] == SDLK_LCTRL) || (_usbToSdlk[key.key] == SDLK_RCTRL)) { + } else if ((_usbToSdlk[key.key] == Common::KEYCODE_LCTRL) || (_usbToSdlk[key.key] == Common::KEYCODE_RCTRL)) { if (key.state & 1) _keyFlags |= Common::KBD_CTRL; else _keyFlags &= ~Common::KBD_CTRL; - } else if ((_usbToSdlk[key.key] == SDLK_LALT) || (_usbToSdlk[key.key] == SDLK_RALT)) { + } else if ((_usbToSdlk[key.key] == Common::KEYCODE_LALT) || (_usbToSdlk[key.key] == Common::KEYCODE_RALT)) { if (key.state & 1) _keyFlags |= Common::KBD_ALT; else @@ -256,106 +255,106 @@ const int Ps2Input::_usbToSdlk[0x100] = { /* 01 */ 0, /* 02 */ 0, /* 03 */ 0, - /* 04 */ SDLK_a, - /* 05 */ SDLK_b, - /* 06 */ SDLK_c, - /* 07 */ SDLK_d, - /* 08 */ SDLK_e, - /* 09 */ SDLK_f, - /* 0A */ SDLK_g, - /* 0B */ SDLK_h, - /* 0C */ SDLK_i, - /* 0D */ SDLK_j, - /* 0E */ SDLK_k, - /* 0F */ SDLK_l, - /* 10 */ SDLK_m, - /* 11 */ SDLK_n, - /* 12 */ SDLK_o, - /* 13 */ SDLK_p, - /* 14 */ SDLK_q, - /* 15 */ SDLK_r, - /* 16 */ SDLK_s, - /* 17 */ SDLK_t, - /* 18 */ SDLK_u, - /* 19 */ SDLK_v, - /* 1A */ SDLK_w, - /* 1B */ SDLK_x, - /* 1C */ SDLK_y, - /* 1D */ SDLK_z, - /* 1E */ SDLK_1, - /* 1F */ SDLK_2, - /* 20 */ SDLK_3, - /* 21 */ SDLK_4, - /* 22 */ SDLK_5, - /* 23 */ SDLK_6, - /* 24 */ SDLK_7, - /* 25 */ SDLK_8, - /* 26 */ SDLK_9, - /* 27 */ SDLK_0, - /* 28 */ SDLK_RETURN, - /* 29 */ SDLK_ESCAPE, - /* 2A */ SDLK_BACKSPACE, - /* 2B */ SDLK_TAB, - /* 2C */ SDLK_SPACE, - /* 2D */ SDLK_MINUS, - /* 2E */ SDLK_EQUALS, - /* 2F */ SDLK_LEFTBRACKET, - /* 30 */ SDLK_RIGHTBRACKET, - /* 31 */ SDLK_BACKSLASH, - /* 32 */ SDLK_HASH, - /* 33 */ SDLK_SEMICOLON, - /* 34 */ SDLK_QUOTE, - /* 35 */ SDLK_BACKQUOTE, - /* 36 */ SDLK_COMMA, - /* 37 */ SDLK_PERIOD, - /* 38 */ SDLK_SLASH, - /* 39 */ SDLK_CAPSLOCK, - /* 3A */ SDLK_F1, - /* 3B */ SDLK_F2, - /* 3C */ SDLK_F3, - /* 3D */ SDLK_F4, - /* 3E */ SDLK_F5, - /* 3F */ SDLK_F6, - /* 40 */ SDLK_F7, - /* 41 */ SDLK_F8, - /* 42 */ SDLK_F9, - /* 43 */ SDLK_F10, - /* 44 */ SDLK_F11, - /* 45 */ SDLK_F12, - /* 46 */ SDLK_PRINT, - /* 47 */ SDLK_SCROLLOCK, - /* 48 */ SDLK_PAUSE, - /* 49 */ SDLK_INSERT, - /* 4A */ SDLK_HOME, - /* 4B */ SDLK_PAGEUP, - /* 4C */ SDLK_DELETE, - /* 4D */ SDLK_END, - /* 4E */ SDLK_PAGEDOWN, - /* 4F */ SDLK_RIGHT, - /* 50 */ SDLK_LEFT, - /* 51 */ SDLK_DOWN, - /* 52 */ SDLK_UP, - /* 53 */ SDLK_NUMLOCK, - /* 54 */ SDLK_KP_DIVIDE, - /* 55 */ SDLK_KP_MULTIPLY, - /* 56 */ SDLK_KP_MINUS, - /* 57 */ SDLK_KP_PLUS, - /* 58 */ SDLK_KP_ENTER, - /* 59 */ SDLK_KP1, - /* 5A */ SDLK_KP2, - /* 5B */ SDLK_KP3, - /* 5C */ SDLK_KP4, - /* 5D */ SDLK_KP5, - /* 5E */ SDLK_KP6, - /* 5F */ SDLK_KP7, - /* 60 */ SDLK_KP8, - /* 61 */ SDLK_KP9, - /* 62 */ SDLK_KP0, - /* 63 */ SDLK_KP_PERIOD, + /* 04 */ Common::KEYCODE_a, + /* 05 */ Common::KEYCODE_b, + /* 06 */ Common::KEYCODE_c, + /* 07 */ Common::KEYCODE_d, + /* 08 */ Common::KEYCODE_e, + /* 09 */ Common::KEYCODE_f, + /* 0A */ Common::KEYCODE_g, + /* 0B */ Common::KEYCODE_h, + /* 0C */ Common::KEYCODE_i, + /* 0D */ Common::KEYCODE_j, + /* 0E */ Common::KEYCODE_k, + /* 0F */ Common::KEYCODE_l, + /* 10 */ Common::KEYCODE_m, + /* 11 */ Common::KEYCODE_n, + /* 12 */ Common::KEYCODE_o, + /* 13 */ Common::KEYCODE_p, + /* 14 */ Common::KEYCODE_q, + /* 15 */ Common::KEYCODE_r, + /* 16 */ Common::KEYCODE_s, + /* 17 */ Common::KEYCODE_t, + /* 18 */ Common::KEYCODE_u, + /* 19 */ Common::KEYCODE_v, + /* 1A */ Common::KEYCODE_w, + /* 1B */ Common::KEYCODE_x, + /* 1C */ Common::KEYCODE_y, + /* 1D */ Common::KEYCODE_z, + /* 1E */ Common::KEYCODE_1, + /* 1F */ Common::KEYCODE_2, + /* 20 */ Common::KEYCODE_3, + /* 21 */ Common::KEYCODE_4, + /* 22 */ Common::KEYCODE_5, + /* 23 */ Common::KEYCODE_6, + /* 24 */ Common::KEYCODE_7, + /* 25 */ Common::KEYCODE_8, + /* 26 */ Common::KEYCODE_9, + /* 27 */ Common::KEYCODE_0, + /* 28 */ Common::KEYCODE_RETURN, + /* 29 */ Common::KEYCODE_ESCAPE, + /* 2A */ Common::KEYCODE_BACKSPACE, + /* 2B */ Common::KEYCODE_TAB, + /* 2C */ Common::KEYCODE_SPACE, + /* 2D */ Common::KEYCODE_MINUS, + /* 2E */ Common::KEYCODE_EQUALS, + /* 2F */ Common::KEYCODE_LEFTBRACKET, + /* 30 */ Common::KEYCODE_RIGHTBRACKET, + /* 31 */ Common::KEYCODE_BACKSLASH, + /* 32 */ Common::KEYCODE_HASH, + /* 33 */ Common::KEYCODE_SEMICOLON, + /* 34 */ Common::KEYCODE_QUOTE, + /* 35 */ Common::KEYCODE_BACKQUOTE, + /* 36 */ Common::KEYCODE_COMMA, + /* 37 */ Common::KEYCODE_PERIOD, + /* 38 */ Common::KEYCODE_SLASH, + /* 39 */ Common::KEYCODE_CAPSLOCK, + /* 3A */ Common::KEYCODE_F1, + /* 3B */ Common::KEYCODE_F2, + /* 3C */ Common::KEYCODE_F3, + /* 3D */ Common::KEYCODE_F4, + /* 3E */ Common::KEYCODE_F5, + /* 3F */ Common::KEYCODE_F6, + /* 40 */ Common::KEYCODE_F7, + /* 41 */ Common::KEYCODE_F8, + /* 42 */ Common::KEYCODE_F9, + /* 43 */ Common::KEYCODE_F10, + /* 44 */ Common::KEYCODE_F11, + /* 45 */ Common::KEYCODE_F12, + /* 46 */ Common::KEYCODE_PRINT, + /* 47 */ Common::KEYCODE_SCROLLOCK, + /* 48 */ Common::KEYCODE_PAUSE, + /* 49 */ Common::KEYCODE_INSERT, + /* 4A */ Common::KEYCODE_HOME, + /* 4B */ Common::KEYCODE_PAGEUP, + /* 4C */ Common::KEYCODE_DELETE, + /* 4D */ Common::KEYCODE_END, + /* 4E */ Common::KEYCODE_PAGEDOWN, + /* 4F */ Common::KEYCODE_RIGHT, + /* 50 */ Common::KEYCODE_LEFT, + /* 51 */ Common::KEYCODE_DOWN, + /* 52 */ Common::KEYCODE_UP, + /* 53 */ Common::KEYCODE_NUMLOCK, + /* 54 */ Common::KEYCODE_KP_DIVIDE, + /* 55 */ Common::KEYCODE_KP_MULTIPLY, + /* 56 */ Common::KEYCODE_KP_MINUS, + /* 57 */ Common::KEYCODE_KP_PLUS, + /* 58 */ Common::KEYCODE_KP_ENTER, + /* 59 */ Common::KEYCODE_KP1, + /* 5A */ Common::KEYCODE_KP2, + /* 5B */ Common::KEYCODE_KP3, + /* 5C */ Common::KEYCODE_KP4, + /* 5D */ Common::KEYCODE_KP5, + /* 5E */ Common::KEYCODE_KP6, + /* 5F */ Common::KEYCODE_KP7, + /* 60 */ Common::KEYCODE_KP8, + /* 61 */ Common::KEYCODE_KP9, + /* 62 */ Common::KEYCODE_KP0, + /* 63 */ Common::KEYCODE_KP_PERIOD, /* 64 */ 0, /* 65 */ 0, /* 66 */ 0, - /* 67 */ SDLK_KP_EQUALS, + /* 67 */ Common::KEYCODE_KP_EQUALS, /* 68 */ 0, /* 69 */ 0, /* 6A */ 0, @@ -476,13 +475,13 @@ const int Ps2Input::_usbToSdlk[0x100] = { /* DD */ 0, /* DE */ 0, /* DF */ 0, - /* E0 */ SDLK_LCTRL, - /* E1 */ SDLK_LSHIFT, - /* E2 */ SDLK_LALT, + /* E0 */ Common::KEYCODE_LCTRL, + /* E1 */ Common::KEYCODE_LSHIFT, + /* E2 */ Common::KEYCODE_LALT, /* E3 */ 0, - /* E4 */ SDLK_RCTRL, - /* E5 */ SDLK_RSHIFT, - /* E6 */ SDLK_RALT, + /* E4 */ Common::KEYCODE_RCTRL, + /* E5 */ Common::KEYCODE_RSHIFT, + /* E6 */ Common::KEYCODE_RALT, /* E7 */ 0, /* E8 */ 0, /* E9 */ 0, @@ -511,22 +510,22 @@ const int Ps2Input::_usbToSdlk[0x100] = { }; const int Ps2Input::_padCodes[16] = { - SDLK_1, // Select + Common::KEYCODE_1, // Select 0, // L3 0, // R3 - SDLK_F5, // Start + Common::KEYCODE_F5, // Start 0, // Up 0, // Right 0, // Down 0, // Left - SDLK_KP0, // L2 + Common::KEYCODE_KP0, // L2 0, // R2 - SDLK_n, // L1 - SDLK_y, // R1 - SDLK_ESCAPE, // Triangle + Common::KEYCODE_n, // L1 + Common::KEYCODE_y, // R1 + Common::KEYCODE_ESCAPE, // Triangle 0, // Circle => Right mouse button 0, // Cross => Left mouse button - SDLK_RETURN // Square + Common::KEYCODE_RETURN // Square }; const int Ps2Input::_padFlags[16] = { diff --git a/backends/platform/ps2/sdlkeys.h b/backends/platform/ps2/sdlkeys.h deleted file mode 100644 index b2f783cedd..0000000000 --- a/backends/platform/ps2/sdlkeys.h +++ /dev/null @@ -1,264 +0,0 @@ -/* copied from SDK_keysym.h */ - -#ifndef __SDLKEYS_H__ -#define __SDLKEYS_H__ - -enum SdlKeyCodes { - SDLK_UNKNOWN = 0, - SDLK_FIRST = 0, - SDLK_BACKSPACE = 8, - SDLK_TAB = 9, - SDLK_CLEAR = 12, - SDLK_RETURN = 13, - SDLK_PAUSE = 19, - SDLK_ESCAPE = 27, - SDLK_SPACE = 32, - SDLK_EXCLAIM = 33, - SDLK_QUOTEDBL = 34, - SDLK_HASH = 35, - SDLK_DOLLAR = 36, - SDLK_AMPERSAND = 38, - SDLK_QUOTE = 39, - SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, - SDLK_ASTERISK = 42, - SDLK_PLUS = 43, - SDLK_COMMA = 44, - SDLK_MINUS = 45, - SDLK_PERIOD = 46, - SDLK_SLASH = 47, - SDLK_0 = 48, - SDLK_1 = 49, - SDLK_2 = 50, - SDLK_3 = 51, - SDLK_4 = 52, - SDLK_5 = 53, - SDLK_6 = 54, - SDLK_7 = 55, - SDLK_8 = 56, - SDLK_9 = 57, - SDLK_COLON = 58, - SDLK_SEMICOLON = 59, - SDLK_LESS = 60, - SDLK_EQUALS = 61, - SDLK_GREATER = 62, - SDLK_QUESTION = 63, - SDLK_AT = 64, - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = 91, - SDLK_BACKSLASH = 92, - SDLK_RIGHTBRACKET = 93, - SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, - SDLK_BACKQUOTE = 96, - SDLK_a = 97, - SDLK_b = 98, - SDLK_c = 99, - SDLK_d = 100, - SDLK_e = 101, - SDLK_f = 102, - SDLK_g = 103, - SDLK_h = 104, - SDLK_i = 105, - SDLK_j = 106, - SDLK_k = 107, - SDLK_l = 108, - SDLK_m = 109, - SDLK_n = 110, - SDLK_o = 111, - SDLK_p = 112, - SDLK_q = 113, - SDLK_r = 114, - SDLK_s = 115, - SDLK_t = 116, - SDLK_u = 117, - SDLK_v = 118, - SDLK_w = 119, - SDLK_x = 120, - SDLK_y = 121, - SDLK_z = 122, - SDLK_DELETE = 127, - /* End of ASCII mapped keysyms */ - - /* International keyboard syms */ - SDLK_WORLD_0 = 160, /* 0xA0 */ - SDLK_WORLD_1 = 161, - SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, - SDLK_WORLD_4 = 164, - SDLK_WORLD_5 = 165, - SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, - SDLK_WORLD_8 = 168, - SDLK_WORLD_9 = 169, - SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, - SDLK_WORLD_12 = 172, - SDLK_WORLD_13 = 173, - SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, - SDLK_WORLD_16 = 176, - SDLK_WORLD_17 = 177, - SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, - SDLK_WORLD_20 = 180, - SDLK_WORLD_21 = 181, - SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, - SDLK_WORLD_24 = 184, - SDLK_WORLD_25 = 185, - SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, - SDLK_WORLD_28 = 188, - SDLK_WORLD_29 = 189, - SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, - SDLK_WORLD_32 = 192, - SDLK_WORLD_33 = 193, - SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, - SDLK_WORLD_36 = 196, - SDLK_WORLD_37 = 197, - SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, - SDLK_WORLD_40 = 200, - SDLK_WORLD_41 = 201, - SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, - SDLK_WORLD_44 = 204, - SDLK_WORLD_45 = 205, - SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, - SDLK_WORLD_48 = 208, - SDLK_WORLD_49 = 209, - SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, - SDLK_WORLD_52 = 212, - SDLK_WORLD_53 = 213, - SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, - SDLK_WORLD_56 = 216, - SDLK_WORLD_57 = 217, - SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, - SDLK_WORLD_60 = 220, - SDLK_WORLD_61 = 221, - SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, - SDLK_WORLD_64 = 224, - SDLK_WORLD_65 = 225, - SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, - SDLK_WORLD_68 = 228, - SDLK_WORLD_69 = 229, - SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, - SDLK_WORLD_72 = 232, - SDLK_WORLD_73 = 233, - SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, - SDLK_WORLD_76 = 236, - SDLK_WORLD_77 = 237, - SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, - SDLK_WORLD_80 = 240, - SDLK_WORLD_81 = 241, - SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, - SDLK_WORLD_84 = 244, - SDLK_WORLD_85 = 245, - SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, - SDLK_WORLD_88 = 248, - SDLK_WORLD_89 = 249, - SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, - SDLK_WORLD_92 = 252, - SDLK_WORLD_93 = 253, - SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, /* 0xFF */ - - /* Numeric keypad */ - SDLK_KP0 = 256, - SDLK_KP1 = 257, - SDLK_KP2 = 258, - SDLK_KP3 = 259, - SDLK_KP4 = 260, - SDLK_KP5 = 261, - SDLK_KP6 = 262, - SDLK_KP7 = 263, - SDLK_KP8 = 264, - SDLK_KP9 = 265, - SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, - SDLK_KP_MULTIPLY = 268, - SDLK_KP_MINUS = 269, - SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, - SDLK_KP_EQUALS = 272, - - /* Arrows + Home/End pad */ - SDLK_UP = 273, - SDLK_DOWN = 274, - SDLK_RIGHT = 275, - SDLK_LEFT = 276, - SDLK_INSERT = 277, - SDLK_HOME = 278, - SDLK_END = 279, - SDLK_PAGEUP = 280, - SDLK_PAGEDOWN = 281, - - /* Function keys */ - SDLK_F1 = 282, - SDLK_F2 = 283, - SDLK_F3 = 284, - SDLK_F4 = 285, - SDLK_F5 = 286, - SDLK_F6 = 287, - SDLK_F7 = 288, - SDLK_F8 = 289, - SDLK_F9 = 290, - SDLK_F10 = 291, - SDLK_F11 = 292, - SDLK_F12 = 293, - SDLK_F13 = 294, - SDLK_F14 = 295, - SDLK_F15 = 296, - - /* Key state modifier keys */ - SDLK_NUMLOCK = 300, - SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, - SDLK_RSHIFT = 303, - SDLK_LSHIFT = 304, - SDLK_RCTRL = 305, - SDLK_LCTRL = 306, - SDLK_RALT = 307, - SDLK_LALT = 308, - SDLK_RMETA = 309, - SDLK_LMETA = 310, - SDLK_LSUPER = 311, /* Left "Windows" key */ - SDLK_RSUPER = 312, /* Right "Windows" key */ - SDLK_MODE = 313, /* "Alt Gr" key */ - SDLK_COMPOSE = 314, /* Multi-key compose key */ - - /* Miscellaneous function keys */ - SDLK_HELP = 315, - SDLK_PRINT = 316, - SDLK_SYSREQ = 317, - SDLK_BREAK = 318, - SDLK_MENU = 319, - SDLK_POWER = 320, /* Power Macintosh power key */ - SDLK_EURO = 321, /* Some european keyboards */ - SDLK_UNDO = 322, /* Atari keyboard has Undo */ - - /* Add any other keys here */ - - SDLK_LAST -}; - -#endif - - diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index 80d5ab9c83..32290bddea 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -326,7 +326,7 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { } _screen->wantAnim(false); - _screen->clearScreen(); + clearScreen(); } OSystem_PS2::~OSystem_PS2(void) { @@ -510,9 +510,12 @@ void OSystem_PS2::copyRectToScreen(const byte *buf, int pitch, int x, int y, int _screen->copyScreenRect((const uint8*)buf, pitch, x, y, w, h); } -bool OSystem_PS2::grabRawScreen(Graphics::Surface *surf) { - _screen->grabScreen(surf); - return true; +Graphics::Surface *OSystem_PS2::lockScreen() { + return _screen->lockScreen(); +} + +void OSystem_PS2::unlockScreen() { + _screen->unlockScreen(); } void OSystem_PS2::updateScreen(void) { diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 4a3764666e..b5c84d3b95 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -56,7 +56,8 @@ public: virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); virtual void setShakePos(int shakeOffset); virtual void grabPalette(byte *colors, uint start, uint num); - virtual bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); virtual void updateScreen(); virtual void showOverlay(); diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index bee422d36f..20a50c1b47 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -209,13 +209,18 @@ void OSystem_PSP::copyRectToScreen(const byte *buf, int pitch, int x, int y, int } } -bool OSystem_PSP::grabRawScreen(Graphics::Surface *surf) { - assert(surf); +Graphics::Surface *OSystem_PSP::lockScreen() { + _framebuffer.pixels = _offscreen; + _framebuffer.w = _screenWidth; + _framebuffer.h = _screenHeight; + _framebuffer.pitch = _screenWidth; + _framebuffer.bytesPerPixel = 1; - surf->create(_screenWidth, _screenHeight, 1); - memcpy(surf->pixels, _offscreen, _screenWidth * _screenHeight); - - return true; + return &_framebuffer; +} + +void OSystem_PSP::unlockScreen() { + // The screen is always completely update anyway, so we don't have to force a full update here. } void OSystem_PSP::updateScreen() { @@ -442,19 +447,19 @@ bool OSystem_PSP::pollEvent(Common::Event &event) { event.kbd.flags = 0; if (buttonsChanged & PSP_CTRL_LTRIGGER) { - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = 27; } else if (buttonsChanged & PSP_CTRL_RTRIGGER) { - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; event.kbd.ascii = 13; } else if (buttonsChanged & PSP_CTRL_START) { - event.kbd.keycode = SDLK_F5; - event.kbd.ascii = 319; + event.kbd.keycode = Common::KEYCODE_F5; + event.kbd.ascii = Common::ASCII_F5; /* } else if (buttonsChanged & PSP_CTRL_SELECT) { - event.kbd.keycode = SDLK_0; + event.kbd.keycode = Common::KEYCODE_0; event.kbd.ascii = '0'; */ } else if (buttonsChanged & PSP_CTRL_SQUARE) { - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = '.'; } diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index b833f5e179..d5d3669a22 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -27,6 +27,7 @@ #include "common/scummsys.h" #include "common/system.h" #include "backends/intern.h" +#include "graphics/surface.h" #include <SDL.h> @@ -62,6 +63,7 @@ protected: bool _overlayVisible; uint32 _shakePos; + Graphics::Surface _framebuffer; bool _mouseVisible; int _mouseX, _mouseY; @@ -101,7 +103,8 @@ public: virtual int16 getHeight(); virtual void setPalette(const byte *colors, uint start, uint num); virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h); - virtual bool grabRawScreen(Graphics::Surface *surf); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); virtual void updateScreen(); virtual void setShakePos(int shakeOffset); diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp index 5175460007..a939229c84 100644 --- a/backends/platform/psp/osys_psp_gu.cpp +++ b/backends/platform/psp/osys_psp_gu.cpp @@ -59,11 +59,11 @@ unsigned char *keyboard_letters; unsigned char *keyboard_letters_shift; unsigned char kbd_ascii[] = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '[', ']', '\\', ';', '\'', ',', '.', '/', '`'}; -unsigned int kbd_code[] = {SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7, SDLK_8, SDLK_9, SDLK_0, SDLK_MINUS, SDLK_EQUALS, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET, - SDLK_BACKSLASH, SDLK_SEMICOLON, SDLK_QUOTE, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_BACKQUOTE}; +Common::KeyCode kbd_code[] = {Common::KEYCODE_1, Common::KEYCODE_2, Common::KEYCODE_3, Common::KEYCODE_4, Common::KEYCODE_5, Common::KEYCODE_6, Common::KEYCODE_7, Common::KEYCODE_8, Common::KEYCODE_9, Common::KEYCODE_0, Common::KEYCODE_MINUS, Common::KEYCODE_EQUALS, Common::KEYCODE_LEFTBRACKET, Common::KEYCODE_RIGHTBRACKET, + Common::KEYCODE_BACKSLASH, Common::KEYCODE_SEMICOLON, Common::KEYCODE_QUOTE, Common::KEYCODE_COMMA, Common::KEYCODE_PERIOD, Common::KEYCODE_SLASH, Common::KEYCODE_BACKQUOTE}; unsigned char kbd_ascii_cl[] = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '{', '}', '|', ':', '"', '<', '>', '?', '~'}; -unsigned int kbd_code_cl[] = {SDLK_EXCLAIM, SDLK_AT, SDLK_HASH, SDLK_DOLLAR, 37, SDLK_CARET, SDLK_AMPERSAND, SDLK_ASTERISK, SDLK_LEFTPAREN, SDLK_RIGHTPAREN, SDLK_UNDERSCORE, - SDLK_PLUS, 123, 125, 124, SDLK_COLON, SDLK_QUOTEDBL, SDLK_LESS, SDLK_GREATER, SDLK_QUESTION, 126}; +Common::KeyCode kbd_code_cl[] = {Common::KEYCODE_EXCLAIM, Common::KEYCODE_AT, Common::KEYCODE_HASH, Common::KEYCODE_DOLLAR, (Common::KeyCode)37, Common::KEYCODE_CARET, Common::KEYCODE_AMPERSAND, Common::KEYCODE_ASTERISK, Common::KEYCODE_LEFTPAREN, Common::KEYCODE_RIGHTPAREN, Common::KEYCODE_UNDERSCORE, + Common::KEYCODE_PLUS, (Common::KeyCode)123, (Common::KeyCode)125, (Common::KeyCode)124, Common::KEYCODE_COLON, Common::KEYCODE_QUOTEDBL, Common::KEYCODE_LESS, Common::KEYCODE_GREATER, Common::KEYCODE_QUESTION, (Common::KeyCode)126}; #define CAPS_LOCK (1 << 0) #define SYMBOLS (1 << 1) @@ -487,7 +487,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { if ( (buttonsChanged & PSP_CTRL_LEFT) && !(pad.Buttons & PSP_CTRL_LEFT)) { event.kbd.flags = 0; event.kbd.ascii = 0; - event.kbd.keycode = SDLK_LEFT; + event.kbd.keycode = Common::KEYCODE_LEFT; _prevButtons = pad.Buttons; return true; } @@ -495,7 +495,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { if ( (buttonsChanged & PSP_CTRL_RIGHT) && !(pad.Buttons & PSP_CTRL_RIGHT)) { event.kbd.flags = 0; event.kbd.ascii = 0; - event.kbd.keycode = SDLK_RIGHT; + event.kbd.keycode = Common::KEYCODE_RIGHT; _prevButtons = pad.Buttons; return true; } @@ -503,7 +503,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { if ( (buttonsChanged & PSP_CTRL_UP) && !(pad.Buttons & PSP_CTRL_UP)) { event.kbd.flags = 0; event.kbd.ascii = 0; - event.kbd.keycode = SDLK_UP; + event.kbd.keycode = Common::KEYCODE_UP; _prevButtons = pad.Buttons; return true; } @@ -511,7 +511,7 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { if ( (buttonsChanged & PSP_CTRL_DOWN) && !(pad.Buttons & PSP_CTRL_DOWN)) { event.kbd.flags = 0; event.kbd.ascii = 0; - event.kbd.keycode = SDLK_DOWN; + event.kbd.keycode = Common::KEYCODE_DOWN; _prevButtons = pad.Buttons; return true; } @@ -535,19 +535,19 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { switch(_keySelected) { case 27: event.kbd.ascii = ' '; - event.kbd.keycode = SDLK_SPACE; + event.kbd.keycode = Common::KEYCODE_SPACE; break; case 28: event.kbd.ascii = 127; - event.kbd.keycode = SDLK_DELETE; + event.kbd.keycode = Common::KEYCODE_DELETE; break; case 29: event.kbd.ascii = 8; - event.kbd.keycode = SDLK_BACKSPACE; + event.kbd.keycode = Common::KEYCODE_BACKSPACE; break; case 30: event.kbd.ascii = 13; - event.kbd.keycode = SDLK_RETURN; + event.kbd.keycode = Common::KEYCODE_RETURN; break; } } else { @@ -555,11 +555,11 @@ bool OSystem_PSP_GU::pollEvent(Common::Event &event) { case 0: event.kbd.flags = 0; event.kbd.ascii = 'a'+_keySelected-1; - event.kbd.keycode = SDLK_a + _keySelected-1; + event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); break; case CAPS_LOCK: event.kbd.ascii = 'A'+_keySelected-1; - event.kbd.keycode = SDLK_a + _keySelected-1; + event.kbd.keycode = (Common::KeyCode)(Common::KEYCODE_a + _keySelected-1); event.kbd.flags = Common::KBD_SHIFT; break; case SYMBOLS: diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp index bc7f0eecde..2b3c2c18fe 100644 --- a/backends/platform/sdl/events.cpp +++ b/backends/platform/sdl/events.cpp @@ -52,14 +52,14 @@ static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { if (key >= SDLK_F1 && key <= SDLK_F9) { - return key - SDLK_F1 + 315; + return key - SDLK_F1 + Common::ASCII_F1; } else if (key >= SDLK_KP0 && key <= SDLK_KP9) { return key - SDLK_KP0 + '0'; } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) { return key; } else if (unicode) { return unicode; - } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { + } else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) { return key & ~0x20; } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) { return 0; @@ -265,7 +265,7 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { return true; event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = ev.key.keysym.sym; + event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); return true; @@ -278,7 +278,7 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { return true; event.type = Common::EVENT_KEYUP; - event.kbd.keycode = ev.key.keysym.sym; + event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); @@ -337,19 +337,19 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYDOWN; switch (ev.jbutton.button) { case JOY_BUT_ESCAPE: - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); break; case JOY_BUT_PERIOD: - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); break; case JOY_BUT_SPACE: - event.kbd.keycode = SDLK_SPACE; + event.kbd.keycode = Common::KEYCODE_SPACE; event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); break; case JOY_BUT_F5: - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); break; } @@ -367,19 +367,19 @@ bool OSystem_SDL::pollEvent(Common::Event &event) { event.type = Common::EVENT_KEYUP; switch (ev.jbutton.button) { case JOY_BUT_ESCAPE: - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); break; case JOY_BUT_PERIOD: - event.kbd.keycode = SDLK_PERIOD; + event.kbd.keycode = Common::KEYCODE_PERIOD; event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0); break; case JOY_BUT_SPACE: - event.kbd.keycode = SDLK_SPACE; + event.kbd.keycode = Common::KEYCODE_SPACE; event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); break; case JOY_BUT_F5: - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); break; } @@ -455,21 +455,21 @@ bool OSystem_SDL::remapKey(SDL_Event &ev,Common::Event &event) { // Map menu key to f5 (scumm menu) if (ev.key.keysym.sym == 306) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); return true; } // Map action key to action if (ev.key.keysym.sym == 291) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_TAB; + event.kbd.keycode = Common::KEYCODE_TAB; event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); return true; } // Map OK key to skip cinematic if (ev.key.keysym.sym == 292) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_ESCAPE; + event.kbd.keycode = Common::KEYCODE_ESCAPE; event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0); return true; } @@ -485,7 +485,7 @@ bool OSystem_SDL::remapKey(SDL_Event &ev,Common::Event &event) { // Map menu key (f11) to f5 (scumm menu) if (ev.key.keysym.sym == SDLK_F11) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_F5; + event.kbd.keycode = Common::KEYCODE_F5; event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0); } // Nap center (space) to tab (default action ) @@ -493,13 +493,13 @@ bool OSystem_SDL::remapKey(SDL_Event &ev,Common::Event &event) { // else if (ev.key.keysym.sym == SDLK_SPACE) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_TAB; + event.kbd.keycode = Common::KEYCODE_TAB; event.kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0); } // Since we stole space (pause) above we'll rebind it to the tab key on the keyboard else if (ev.key.keysym.sym == SDLK_TAB) { event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = SDLK_SPACE; + event.kbd.keycode = Common::KEYCODE_SPACE; event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0); } else { // Let the events fall through if we didn't change them, this may not be the best way to diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 212eb43585..f93c806aa8 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -761,22 +761,6 @@ void OSystem_SDL::setAspectRatioCorrection(bool enable) { } } -void OSystem_SDL::clearScreen() { - assert (_transactionMode == kTransactionNone); - - // Try to lock the screen surface - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s", SDL_GetError()); - - byte *dst = (byte *)_screen->pixels; - - // Clear the screen - memset(dst, 0, _screenWidth * _screenHeight); - - // Unlock the screen surface - SDL_UnlockSurface(_screen); -} - void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) { assert (_transactionMode == kTransactionNone); assert(src); @@ -848,24 +832,44 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int SDL_UnlockSurface(_screen); } -bool OSystem_SDL::grabRawScreen(Graphics::Surface *surf) { - assert(_screen); - assert(surf); +Graphics::Surface *OSystem_SDL::lockScreen() { + assert (_transactionMode == kTransactionNone); - Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + // Lock the graphics mutex + lockMutex(_graphicsMutex); - surf->create(_screenWidth, _screenHeight, _screen->format->BytesPerPixel); + // paranoia check + assert(!_screenIsLocked); + _screenIsLocked = true; // Try to lock the screen surface if (SDL_LockSurface(_screen) == -1) error("SDL_LockSurface failed: %s", SDL_GetError()); - memcpy(surf->pixels, _screen->pixels, _screenWidth * _screenHeight * _screen->format->BytesPerPixel); + _framebuffer.pixels = _screen->pixels; + _framebuffer.w = _screen->w; + _framebuffer.h = _screen->h; + _framebuffer.pitch = _screen->pitch; + _framebuffer.bytesPerPixel = 1; + + return &_framebuffer; +} + +void OSystem_SDL::unlockScreen() { + assert (_transactionMode == kTransactionNone); + + // paranoia check + assert(_screenIsLocked); + _screenIsLocked = false; // Unlock the screen surface SDL_UnlockSurface(_screen); - return true; + // Trigger a full screen update + _forceFull = true; + + // Finally unlock the graphics mutex + unlockMutex(_graphicsMutex); } void OSystem_SDL::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) { @@ -1597,6 +1601,8 @@ void OSystem_SDL::displayMessageOnOSD(const char *msg) { assert (_transactionMode == kTransactionNone); assert(msg); + Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + uint i; // Lock the OSD surface for drawing diff --git a/backends/platform/sdl/sdl-common.h b/backends/platform/sdl/sdl-common.h index e66ca71e7f..4795b22a53 100644 --- a/backends/platform/sdl/sdl-common.h +++ b/backends/platform/sdl/sdl-common.h @@ -92,11 +92,8 @@ public: // The screen will not be updated to reflect the new bitmap virtual void copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h); // overloaded by CE backend (FIXME) - // Copies the screen to a buffer - bool grabRawScreen(Graphics::Surface *surf); - - // Clear the screen - void clearScreen(); + virtual Graphics::Surface *lockScreen(); + virtual void unlockScreen(); // Update the dirty areas of the screen void updateScreen(); @@ -218,6 +215,8 @@ protected: // unseen game screen SDL_Surface *_screen; + + // TODO: We could get rid of the following two vars and just use _screen instead int _screenWidth, _screenHeight; // temporary screen (for scalers) @@ -274,6 +273,9 @@ protected: int _mode; int _transactionMode; bool _fullscreen; + + bool _screenIsLocked; + Graphics::Surface _framebuffer; /** Current video mode flags (see DF_* constants) */ uint32 _modeFlags; diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 0fe16e0520..fe78bd4236 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -243,6 +243,7 @@ OSystem_SDL::OSystem_SDL() _savefile(0), _mixer(0), _timer(0), + _screenIsLocked(false), _graphicsMutex(0), _transactionMode(kTransactionNone) { // allocate palette storage diff --git a/backends/platform/symbian/README b/backends/platform/symbian/README index 3a4b6142ad..cbc6a12494 100644 --- a/backends/platform/symbian/README +++ b/backends/platform/symbian/README @@ -2,9 +2,9 @@ ScummVM - ScummVM ported to EPOC/SymbianOS Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - Copyright (C) 2005 ScummVM Team + Copyright (C) 2007 Lars 'AnotherGuest' Persson + Copyright (C) 2007 Jurgen 'SumthinWicked' Braam + Copyright (C) 2007 ScummVM Team $Id$ @@ -13,19 +13,35 @@ 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 are currently working together to finalize the transfer to CVS. - + Jurgen and Lars have successfully transfered all needed changes into CVS, with additional helpful tools for Symbian OS + + Release version: 0.10.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) + * 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 + + +Games supported +--------------- + The Symbian port of ScumVM supports all but Sword1 & 2 games. Some games might not run properly due to screenresolution or memory constraints. + -Nescessary components ---------------------- +Building ScummVM +--------------------- + + Nescessary components + --------------------- Building ScummVM yourself using the UIQ 2.1/Nokia S60 SDK/Nokia S80 SDK/Nokia S90 SDK framework is not an easy task! 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 2.1 SDK (To build for UIQ devices); + - UIQ 2.1 SDK (To build for UIQ2 devices); http://www.symbian.com/developer/sdks_uiq.asp - - Nokia S60 1st, 2nd edition (3rd edition has not been tested) SDK (To build for S60 devices) + - Nokia S60 1st, 2nd edition,3rd edition SDK (To build for S60 devices) - Nokia S80 SDK (To build for S80 devices) @@ -58,8 +74,8 @@ Nescessary components http://libmpeg2.sourceforge.net/ -Building ScummVM ------------------ + Compiling ScummVM + ----------------- ECompXL: this is a tool that will compress your executable with GZIP and glue it to a predefined loader app. The app will uncompress your application at runtime and run it without you even knowing it. A really interesting byproduct diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg index 8c001e2927..d15f549207 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v1.pkg @@ -39,6 +39,20 @@ "\epoc32\release\armi\urel\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif" "\epoc32\release\armi\urel\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc" +"..\..\..\..\dists\pred.dic"-"c:\system\apps\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\system\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\system\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\system\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\system\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\system\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" + ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL ""-"!:\system\apps\ScummVM\scummvm.stdout.txt",FILENULL diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg index b2eb086488..5e0c8bfdaa 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg @@ -6,7 +6,7 @@ ;&EN ; UID is the app's UID -#{"ScummVM S60v2"},(0x101f9b57),0,80,3 +#{"ScummVM S60v2"},(0x101f9b57),0,100,0 ; Platform type (0x101F6F88), 0, 0, 0, {"Series60ProductID"} @@ -16,6 +16,19 @@ "\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVM\ScummVM.exe" "\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif" "\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc" +"..\..\..\..\dists\pred.dic"-"c:\system\apps\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\system\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\system\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\system\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\system\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\system\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" ; 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 eebd4764f5..4ba5d43bcd 100644 --- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in +++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in @@ -62,12 +62,12 @@ SOURCE c24 ScummxLarge.bmp SOURCE 8 ScummxLargeMask.bmp END -EPOCSTACKSIZE 0x0000F000 +EPOCSTACKSIZE 80000 EPOCHEAPSIZE 2048000 32000000 ALWAYS_BUILD_AS_ARM MACRO S60 MACRO S60V3 -MACRO EPOC_AS_APP + //START_AUTO_MACROS_SLAVE// // empty base file, will be updated by Perl build scripts diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg index 73cbad17cd..12d5b37be2 100644 --- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg +++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg @@ -48,6 +48,20 @@ "\epoc32\data\Z\resource\APPS\scummvm.MIF"- "!:\resource\apps\scummvm.MIF" "\epoc32\data\z\private\10003a3f\apps\scummvm_reg.rsc"-"!:\private\10003a3f\import\apps\scummvm_reg.rsc" +"..\..\..\..\dists\pred.dic"-"c:\data\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\resource\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\resource\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\resource\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\resource\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\resource\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\resource\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"c:\shared\scummvm\kyra.dat" +"..\sky.cpt"-"c:\shared\scummvm\sky.cpt" + ; Config/log files: 'empty' will automagically be removed on uninstall ""-"c:\data\scummvm\scummvm.ini",FILENULL ""-"c:\data\scummvm\scummvm.stdout.txt",FILENULL diff --git a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg index 6daf9081c7..db94745b35 100644 --- a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg +++ b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg @@ -38,6 +38,19 @@ "\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVM\ScummVM.exe" "\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif" "\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc" +"..\..\..\..\dists\pred.dic"-"c:\system\apps\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\system\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\system\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\system\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\system\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\system\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" ; 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 09ed915e35..6752bc3813 100644 --- a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg +++ b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg @@ -38,6 +38,19 @@ "\epoc32\release\armi\urel\ScummVM.exe"-"!:\system\apps\ScummVM\ScummVM.exe" "\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif" "\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc" +"..\..\..\..\dists\pred.dic"-"c:\system\apps\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\system\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\system\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\system\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\system\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\system\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in index c3ebae01d7..3e9c408c96 100644 --- a/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in +++ b/backends/platform/symbian/UIQ2/ScummVM_UIQ2.mmp.in @@ -39,7 +39,6 @@ AIF ScummVm.Aif ..\res\ ScummVmAif.rss c16 ScummL.bmp ScummLM.bmp ScummS.bmp UID 0x100039ce 0x101f9b57 MACRO UIQ -MACRO EPOC_AS_APP //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg index f8aca7fd52..d55d70c823 100644 --- a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg +++ b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2.pkg @@ -37,6 +37,19 @@ "\epoc32\release\armi\urel\ScummVM.app"-"!:\system\apps\ScummVM\ScummVM.app" "\epoc32\data\z\system\apps\ScummVM\ScummVM.aif"-"!:\system\apps\ScummVM\ScummVM.aif" "\epoc32\data\z\system\apps\ScummVM\ScummVM.rsc"-"!:\system\apps\ScummVM\ScummVM.rsc" +"..\..\..\..\dists\pred.dic"-"c:\system\apps\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\system\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\system\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\system\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\system\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\system\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"!:\system\apps\ScummVM\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg index a07149b702..8783f25337 100644 --- a/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg +++ b/backends/platform/symbian/UIQ2/scummvm-CVS-SymbianUIQ2_SE.pkg @@ -6,7 +6,7 @@ ;&EN ; UID is the app's UID -#{"ScummVM SE"},(0x101f9b57),0,80,3 +#{"ScummVM SE"},(0x101f9b57),0,100,0 ; Platform type (0x101F617B), 2, 0, 0, {"UIQ20ProductID"} @@ -22,6 +22,10 @@ ""-"!:\system\apps\ScummVM\scummvm.stderr.txt",FILENULL ""-"!:\system\apps\ScummVM\sdl.ini",FILENULL +; Common datafiles needed for some games +"..\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" +"..\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" + ; This install layout will let you upgrade to newer versions wihout loss of scummvm.ini. ; It will remove the config file, std***.txt files & dirs on uninstall. diff --git a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in index 8620237b3a..e6ba0ea743 100644 --- a/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in +++ b/backends/platform/symbian/UIQ3/ScummVM_UIQ3.mmp.in @@ -46,7 +46,7 @@ TARGETPATH \Resource\Apps LANG SC END -EPOCSTACKSIZE 0x0000FFFF +EPOCSTACKSIZE 80000 EPOCHEAPSIZE 3000000 32000000 START BITMAP ScummVM.mbm @@ -66,7 +66,7 @@ UID 0x100039ce 0xA0000657 MACRO UIQ MACRO UIQ3 -MACRO EPOC_AS_APP + ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg index 1e529127f9..f92b013cd7 100644 --- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg +++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg @@ -46,6 +46,19 @@ "\epoc32\Data\Z\resource\apps\scummvm_loc.rsc"- "!:\resource\apps\scummvm_loc.rsc" "\epoc32\data\Z\resource\APPS\scummvm.MBM"- "!:\resource\apps\scummvm.MBM" "\epoc32\data\z\private\10003a3f\apps\scummvm_reg.rsc"-"!:\private\10003a3f\import\apps\scummvm_reg.rsc" +"..\..\..\..\dists\pred.dic"-"c:\shared\scummvm\pred.dic" + +; Scummvm Documentation +"..\..\..\..\COPYRIGHT"-"!:\resource\apps\scummvm\COPYRIGHT", FT, TC +"..\..\..\..\COPYING"-"!:\resource\apps\scummvm\COPYING", FT, TC +"..\README"-"!:\system\apps\scummvm\SYMBIAN_README", FT, TC +"..\..\..\..\AUTHORS"-"!:\resource\apps\scummvm\AUTHORS" +"..\..\..\..\README"-"!:\resource\apps\scummvm\README" +"..\..\..\..\NEWS"-"!:\resource\apps\scummvm\NEWS" + +; Common datafiles needed for some games +"..\kyra.dat"-"c:\shared\scummvm\kyra.dat" +"..\sky.cpt"-"c:\shared\scummvm\sky.cpt" ; Config/log files: 'empty' will automagically be removed on uninstall ""-"c:\shared\scummvm\scummvm.ini",FILENULL diff --git a/backends/platform/symbian/mmp/scummvm_agi.mmp.in b/backends/platform/symbian/mmp/scummvm_agi.mmp.in index f6b47c3458..66a743879a 100644 --- a/backends/platform/symbian/mmp/scummvm_agi.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_agi.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_agi.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_agos.mmp.in b/backends/platform/symbian/mmp/scummvm_agos.mmp.in index 05ec375b51..f3f265d273 100644 --- a/backends/platform/symbian/mmp/scummvm_agos.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_agos.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_agos.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in index a1f3f1b261..dd9eb0d4ea 100644 --- a/backends/platform/symbian/mmp/scummvm_base.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_base.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM // Note: the LIB:*.lib statements are used by AdaptAllMMPs.pl, so don't remove them! //START_AUTO_MACROS_MASTER// diff --git a/backends/platform/symbian/mmp/scummvm_cine.mmp.in b/backends/platform/symbian/mmp/scummvm_cine.mmp.in index d8dcd62718..18309f6f9d 100644 --- a/backends/platform/symbian/mmp/scummvm_cine.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_cine.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_CINE.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in index 05092777b0..43fc2cbf8a 100644 --- a/backends/platform/symbian/mmp/scummvm_cruise.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_cruise.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_cruise.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_gob.mmp.in b/backends/platform/symbian/mmp/scummvm_gob.mmp.in index 34c4f82bd1..247ff33011 100644 --- a/backends/platform/symbian/mmp/scummvm_gob.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_gob.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_gob.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in index 899384003f..257eb92420 100644 --- a/backends/platform/symbian/mmp/scummvm_kyra.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_kyra.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_kyra.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_lure.mmp.in b/backends/platform/symbian/mmp/scummvm_lure.mmp.in index 1a52efbc69..29afe56182 100644 --- a/backends/platform/symbian/mmp/scummvm_lure.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_lure.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_lure.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in index 4c1bd99614..ad8b885ee1 100644 --- a/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_parallaction.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_parallaction.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_queen.mmp.in b/backends/platform/symbian/mmp/scummvm_queen.mmp.in index b5a65b6cef..5b90efd1d1 100644 --- a/backends/platform/symbian/mmp/scummvm_queen.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_queen.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_queen.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_saga.mmp.in b/backends/platform/symbian/mmp/scummvm_saga.mmp.in index 4f6555a049..880c99fbb2 100644 --- a/backends/platform/symbian/mmp/scummvm_saga.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_saga.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_saga.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in index cdf454e663..16ae2e763a 100644 --- a/backends/platform/symbian/mmp/scummvm_scumm.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_scumm.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_scumm.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_sky.mmp.in b/backends/platform/symbian/mmp/scummvm_sky.mmp.in index 8748956564..e07b918efb 100644 --- a/backends/platform/symbian/mmp/scummvm_sky.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sky.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_sky.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in index 2bd6febc76..0bea7fdcb7 100644 --- a/backends/platform/symbian/mmp/scummvm_sword1.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sword1.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_sword1.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in index ddd299ce75..a7eaa4c4f5 100644 --- a/backends/platform/symbian/mmp/scummvm_sword2.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_sword2.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_sword2.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/mmp/scummvm_touche.mmp.in b/backends/platform/symbian/mmp/scummvm_touche.mmp.in index 787d9f33bf..84d9bd13fb 100644 --- a/backends/platform/symbian/mmp/scummvm_touche.mmp.in +++ b/backends/platform/symbian/mmp/scummvm_touche.mmp.in @@ -30,6 +30,7 @@ TARGET scummvm_touche.lib TARGETTYPE lib OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings +ALWAYS_BUILD_AS_ARM //START_AUTO_MACROS_SLAVE// diff --git a/backends/platform/symbian/src/SymbianActions.cpp b/backends/platform/symbian/src/SymbianActions.cpp index cb2652eac4..3809253032 100644 --- a/backends/platform/symbian/src/SymbianActions.cpp +++ b/backends/platform/symbian/src/SymbianActions.cpp @@ -47,7 +47,7 @@ const Common::String actionNames[] = { "Save", "Skip", "Zone", - "FT Cheat", + "Multi Function", "Swap character", "Skip text", "Pause", @@ -122,7 +122,7 @@ void SymbianActions::initInstanceMain(OSystem *mainSystem) { // Skip _action_enabled[ACTION_SKIP] = true; - _key_action[ACTION_SKIP].setAscii(SDLK_ESCAPE); + _key_action[ACTION_SKIP].setKey(SDLK_ESCAPE); } void SymbianActions::initInstanceGame() { @@ -138,7 +138,8 @@ void SymbianActions::initInstanceGame() { bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); bool is_agi = (gameid == "agi"); - + bool is_parallaction = (gameid == "parallaction"); + Actions::initInstanceGame(); // Initialize keys for different actions @@ -149,51 +150,58 @@ void SymbianActions::initInstanceGame() { _action_enabled[ACTION_SAVE] = true; if (is_queen) { - _key_action[ACTION_SAVE].setAscii(SDLK_F1); // F1 key for FOTAQ + _key_action[ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ } else if (is_sky) { - _key_action[ACTION_SAVE].setAscii(63); + _key_action[ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); } else if (is_cine) { - _key_action[ACTION_SAVE].setAscii(SDLK_F10); // F10 + _key_action[ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10 } else if (is_agi) { - _key_action[ACTION_SAVE].setAscii(SDLK_ESCAPE); + _key_action[ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE); + } else if (is_parallaction) { + _key_action[ACTION_SAVE].setKey('s', SDLK_s); } else { - _key_action[ACTION_SAVE].setAscii(SDLK_F5); // F5 key + _key_action[ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key } } // Enable fast mode _action_enabled[ACTION_FASTMODE] = true; - _key_action[ACTION_FASTMODE].setAscii('f'); - _key_action[ACTION_FASTMODE].setFlags(KMOD_CTRL); + _key_action[ACTION_FASTMODE].setKey('f', SDLK_f, KMOD_CTRL); // Swap character _action_enabled[ACTION_SWAPCHAR] = true; - _key_action[ACTION_SWAPCHAR].setAscii('b'); // b + _key_action[ACTION_SWAPCHAR].setKey('b'); // b // Zone _action_enabled[ACTION_ZONE] = true; - // FT Cheat - _action_enabled[ACTION_FT_CHEAT] = true; - _key_action[ACTION_FT_CHEAT].setAscii(86); // shift-V + // Multi function key + _action_enabled[ACTION_MULTI] = true; + if (is_agi) + _key_action[ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog + else if (is_gob) + _key_action[ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start + else if (gameid == "atlantis") + _key_action[ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch + else + _key_action[ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V // Enable debugger _action_enabled[ACTION_DEBUGGER] = true; - _key_action[ACTION_DEBUGGER].setAscii('d'); - _key_action[ACTION_DEBUGGER].setFlags(KMOD_CTRL); + _key_action[ACTION_DEBUGGER].setKey('d', SDLK_d, KMOD_CTRL); // Skip text if (!is_cine) _action_enabled[ACTION_SKIP_TEXT] = true; if (is_queen) { - _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_SPACE); + _key_action[ACTION_SKIP_TEXT].setKey(SDLK_SPACE); } else { - _key_action[ACTION_SKIP_TEXT].setAscii(SDLK_PERIOD); + _key_action[ACTION_SKIP_TEXT].setKey(SDLK_PERIOD); } // Pause - _key_action[ACTION_PAUSE].setAscii(' '); + _key_action[ACTION_PAUSE].setKey(' '); _action_enabled[ACTION_PAUSE] = true; // Quit diff --git a/backends/platform/symbian/src/SymbianActions.h b/backends/platform/symbian/src/SymbianActions.h index 0facde763c..cbd333e500 100644 --- a/backends/platform/symbian/src/SymbianActions.h +++ b/backends/platform/symbian/src/SymbianActions.h @@ -34,7 +34,7 @@ namespace GUI { -#define ACTION_VERSION 6 +#define ACTION_VERSION 7 enum actionType { ACTION_UP = 0, @@ -46,7 +46,7 @@ enum actionType { ACTION_SAVE, ACTION_SKIP, ACTION_ZONE, - ACTION_FT_CHEAT, + ACTION_MULTI, ACTION_SWAPCHAR, ACTION_SKIP_TEXT, ACTION_PAUSE, diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 737795182e..c992c97316 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -88,8 +88,10 @@ void OSystem_SDL_Symbian::setFeatureState(Feature f, bool enable) { else { } - - return; + break; + case kFeatureDisableKeyFiltering: + GUI::Actions::Instance()->beginMapping(enable); + break;; default: OSystem_SDL::setFeatureState(f, enable); } @@ -104,6 +106,7 @@ OSystem_SDL_Symbian::OSystem_SDL_Symbian() :_channels(0),_stereo_mix_buffer(0) { } void OSystem_SDL_Symbian::initBackend() { + ConfMan.set("extrapath", Symbian::GetExecutablePath()); ConfMan.setBool("FM_high_quality", false); #if !defined(S60) || defined(S60V3) // S60 has low quality as default ConfMan.setBool("FM_medium_quality", true); @@ -143,7 +146,7 @@ bool OSystem_SDL_Symbian::setGraphicsMode(const char * /*name*/) { return OSystem_SDL::setGraphicsMode(getDefaultGraphicsMode()); } -void OSystem_SDL_Symbian::quitWithErrorMsg(const char *msg) { +void OSystem_SDL_Symbian::quitWithErrorMsg(const char * /*aMsg*/) { CEikonEnv::Static()->AlertWin(_L("quitWithErrorMsg()")) ; @@ -345,16 +348,21 @@ bool OSystem_SDL_Symbian::remapKey(SDL_Event &ev, Common::Event &event) { } return true; - + case GUI::ACTION_MULTI: { + GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop); + // if key code is pause, then change event to interactive or just fall through + if(key.keycode() == SDLK_PAUSE) { + event.type = Common::EVENT_PREDICTIVE_DIALOG; + return true; + } + } case GUI::ACTION_SAVE: case GUI::ACTION_SKIP: - case GUI::ACTION_FT_CHEAT: case GUI::ACTION_SKIP_TEXT: case GUI::ACTION_PAUSE: case GUI::ACTION_SWAPCHAR: case GUI::ACTION_FASTMODE: - case GUI::ACTION_DEBUGGER: - { + case GUI::ACTION_DEBUGGER: { GUI::Key &key = GUI::Actions::Instance()->getKeyAction(loop); ev.key.keysym.sym = (SDLKey) key.ascii(); ev.key.keysym.scancode= key.keycode(); @@ -426,7 +434,7 @@ struct TSymbianFileEntry { FILE* symbian_fopen(const char* name, const char* mode) { TSymbianFileEntry* fileEntry = new TSymbianFileEntry; - + if (fileEntry != NULL) { TInt modeLen = strlen(mode); @@ -446,7 +454,9 @@ FILE* symbian_fopen(const char* name, const char* mode) { if ((modeLen > 1 && mode[1] == '+') || (modeLen > 2 && mode[2] == '+')) { fileMode = fileMode| EFileWrite; } - + + fileMode = fileMode| EFileShareAny; + switch(mode[0]) { case 'a': if (fileEntry->iFileHandle.Open(CEikonEnv::Static()->FsSession(), tempFileName, fileMode) != KErrNone) { @@ -471,7 +481,6 @@ FILE* symbian_fopen(const char* name, const char* mode) { break; } } - return (FILE*) fileEntry; } diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 2bb79850e3..efada68ad9 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -49,7 +49,7 @@ const String pocketActionNames[] = { "Free look", "Zoom up", "Zoom down", - "FT Cheat", + "Multi Function", "Bind Keys", "Cursor Up", "Cursor Down", @@ -99,7 +99,7 @@ GUI::Actions() _action_enabled[POCKET_ACTION_DOWN] = true; _action_enabled[POCKET_ACTION_LEFT] = true; _action_enabled[POCKET_ACTION_RIGHT] = true; - _action_mapping[POCKET_ACTION_LEFTCLICK] = SDLK_RETURN; + _action_mapping[POCKET_ACTION_LEFTCLICK] = SDLK_F1; _action_mapping[POCKET_ACTION_UP] = SDLK_UP; _action_mapping[POCKET_ACTION_DOWN] = SDLK_DOWN; _action_mapping[POCKET_ACTION_LEFT] = SDLK_LEFT; @@ -127,11 +127,12 @@ void CEActionsPocket::initInstanceGame() { bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); bool is_agi = (gameid == "agi"); + bool is_parallaction = (gameid == "parallaction"); 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) + if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction) _right_click_needed = true; // See if a "hide toolbar" mapping could be needed @@ -140,36 +141,39 @@ void CEActionsPocket::initInstanceGame() { // Initialize keys for different actions // Pause - _key_action[POCKET_ACTION_PAUSE].setAscii(VK_SPACE); + _key_action[POCKET_ACTION_PAUSE].setKey(VK_SPACE); _action_enabled[POCKET_ACTION_PAUSE] = true; // Save if (is_simon || is_sword2 || is_gob || is_kyra || is_touche) _action_enabled[POCKET_ACTION_SAVE] = false; else if (is_queen) { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(286); // F1 key for FOTAQ + _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ } else if (is_sky) { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(63); + _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); } else if (is_cine) { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(291); // F10 + _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); // F10 } else if (is_agi) { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(SDLK_ESCAPE); + _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE); + } else if (is_parallaction) { + _action_enabled[POCKET_ACTION_SAVE] = true; + _key_action[POCKET_ACTION_SAVE].setKey('s', SDLK_s); } else { _action_enabled[POCKET_ACTION_SAVE] = true; - _key_action[POCKET_ACTION_SAVE].setAscii(319); // F5 key + _key_action[POCKET_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key } // Quit _action_enabled[POCKET_ACTION_QUIT] = true; // Skip - if (!is_cine) + 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) - _key_action[POCKET_ACTION_SKIP].setAscii(VK_ESCAPE); + _key_action[POCKET_ACTION_SKIP].setKey(VK_ESCAPE); else - _key_action[POCKET_ACTION_SKIP].setAscii(KEY_ALL_SKIP); + _key_action[POCKET_ACTION_SKIP].setKey(KEY_ALL_SKIP); // Hide _action_enabled[POCKET_ACTION_HIDE] = true; // Keyboard @@ -188,9 +192,16 @@ void CEActionsPocket::initInstanceGame() { _action_enabled[POCKET_ACTION_ZOOM_UP] = true; _action_enabled[POCKET_ACTION_ZOOM_DOWN] = true; } - // FT Cheat - _action_enabled[POCKET_ACTION_FT_CHEAT] = true; - _key_action[POCKET_ACTION_FT_CHEAT].setAscii(86); // shift-V + // Multi function key + _action_enabled[POCKET_ACTION_MULTI] = true; + if (is_agi) + _key_action[POCKET_ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog + else if (is_gob) + _key_action[POCKET_ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start + else if (gameid == "atlantis") + _key_action[POCKET_ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch + else + _key_action[POCKET_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V // Key bind method _action_enabled[POCKET_ACTION_BINDKEYS] = true; } @@ -213,7 +224,7 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { case POCKET_ACTION_PAUSE: case POCKET_ACTION_SAVE: case POCKET_ACTION_SKIP: - case POCKET_ACTION_FT_CHEAT: + case POCKET_ACTION_MULTI: EventsBuffer::simulateKey(&_key_action[action], false); return true; @@ -225,7 +236,16 @@ bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) { case POCKET_ACTION_PAUSE: case POCKET_ACTION_SAVE: case POCKET_ACTION_SKIP: - case POCKET_ACTION_FT_CHEAT: + case POCKET_ACTION_MULTI: + if (action == POCKET_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setKey(SDLK_l); + else + _key_action[action].setKey(SDLK_s); + } EventsBuffer::simulateKey(&_key_action[action], true); return true; case POCKET_ACTION_KEYBOARD: diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h index 0f6430d443..9749ca60ef 100644 --- a/backends/platform/wince/CEActionsPocket.h +++ b/backends/platform/wince/CEActionsPocket.h @@ -48,7 +48,7 @@ enum pocketActionType { POCKET_ACTION_FREELOOK, POCKET_ACTION_ZOOM_UP, POCKET_ACTION_ZOOM_DOWN, - POCKET_ACTION_FT_CHEAT, + POCKET_ACTION_MULTI, POCKET_ACTION_BINDKEYS, POCKET_ACTION_UP, POCKET_ACTION_DOWN, diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 3d85ebc68e..227318d552 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -43,7 +43,7 @@ const String smartphoneActionNames[] = { "Save", "Skip", "Zone", - "FT Cheat", + "Multi Function", "Bind Keys", "Keyboard", "Rotate", @@ -117,11 +117,12 @@ void CEActionsSmartphone::initInstanceGame() { bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); bool is_agi = (gameid == "agi"); + bool is_parallaction = (gameid == "parallaction"); 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) + if (is_sword1 || is_sword2 || is_sky || is_queen || is_comi || is_gob || is_samnmax || is_cine || is_touche || is_parallaction) _right_click_needed = true; // Initialize keys for different actions @@ -130,31 +131,41 @@ void CEActionsSmartphone::initInstanceGame() { _action_enabled[SMARTPHONE_ACTION_SAVE] = false; else if (is_queen) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(286); // F1 key for FOTAQ + _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F1 key for FOTAQ } else if (is_sky) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(63); + _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); } else if (is_cine) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(291); //F10 + _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F10, SDLK_F10); //F10 } else if (is_agi) { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(SDLK_ESCAPE); + _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_ESCAPE, SDLK_ESCAPE); + } else if (is_parallaction) { + _action_enabled[SMARTPHONE_ACTION_SAVE] = true; + _key_action[SMARTPHONE_ACTION_SAVE].setKey('s', SDLK_s); } else { _action_enabled[SMARTPHONE_ACTION_SAVE] = true; - _key_action[SMARTPHONE_ACTION_SAVE].setAscii(319); // F5 key + _key_action[SMARTPHONE_ACTION_SAVE].setKey(Common::ASCII_F5, SDLK_F5); // F5 key } // 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) - _key_action[SMARTPHONE_ACTION_SKIP].setAscii(VK_ESCAPE); + _key_action[SMARTPHONE_ACTION_SKIP].setKey(VK_ESCAPE); else - _key_action[SMARTPHONE_ACTION_SKIP].setAscii(KEY_ALL_SKIP); + _key_action[SMARTPHONE_ACTION_SKIP].setKey(KEY_ALL_SKIP); // Zone _action_enabled[SMARTPHONE_ACTION_ZONE] = true; - // FT Cheat - _action_enabled[SMARTPHONE_ACTION_FT_CHEAT] = true; - _key_action[SMARTPHONE_ACTION_FT_CHEAT].setAscii(86); // shift-V + // Multi function key + _action_enabled[SMARTPHONE_ACTION_MULTI] = true; + if (is_agi) + _key_action[SMARTPHONE_ACTION_MULTI].setKey(SDLK_PAUSE); // agi: show predictive dialog + else if (is_gob) + _key_action[SMARTPHONE_ACTION_MULTI].setKey(Common::ASCII_F1, SDLK_F1); // bargon : F1 to start + else if (gameid == "atlantis") + _key_action[SMARTPHONE_ACTION_MULTI].setKey(0, SDLK_KP0); // fate of atlantis : Ins to sucker-punch + else + _key_action[SMARTPHONE_ACTION_MULTI].setKey('V', SDLK_v, KMOD_SHIFT); // FT cheat : shift-V // Bind keys _action_enabled[SMARTPHONE_ACTION_BINDKEYS] = true; } @@ -176,7 +187,7 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { return true; case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: - case SMARTPHONE_ACTION_FT_CHEAT: + case SMARTPHONE_ACTION_MULTI: EventsBuffer::simulateKey(&_key_action[action], false); return true; } @@ -186,7 +197,16 @@ bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) { switch (action) { case SMARTPHONE_ACTION_SAVE: case SMARTPHONE_ACTION_SKIP: - case SMARTPHONE_ACTION_FT_CHEAT: + case SMARTPHONE_ACTION_MULTI: + if (action == SMARTPHONE_ACTION_SAVE && ConfMan.get("gameid") == "parallaction") { + // FIXME: This is a temporary solution. The engine should handle its own menus. + // Note that the user can accomplish this via the virtual keyboard as well, this is just for convenience + GUI::MessageDialog alert("Do you want to load or save the game?", "Load", "Save"); + if (alert.runModal() == GUI::kMessageOK) + _key_action[action].setKey(SDLK_l); + else + _key_action[action].setKey(SDLK_s); + } EventsBuffer::simulateKey(&_key_action[action], true); return true; case SMARTPHONE_ACTION_RIGHTCLICK: diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h index 648d0ae4cf..590302ef26 100644 --- a/backends/platform/wince/CEActionsSmartphone.h +++ b/backends/platform/wince/CEActionsSmartphone.h @@ -45,7 +45,7 @@ enum smartphoneActionType { SMARTPHONE_ACTION_SAVE, SMARTPHONE_ACTION_SKIP, SMARTPHONE_ACTION_ZONE, - SMARTPHONE_ACTION_FT_CHEAT, + SMARTPHONE_ACTION_MULTI, SMARTPHONE_ACTION_BINDKEYS, SMARTPHONE_ACTION_KEYBOARD, SMARTPHONE_ACTION_ROTATE, diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp index a76360f590..855c601741 100644 --- a/backends/platform/wince/CEDevice.cpp +++ b/backends/platform/wince/CEDevice.cpp @@ -53,15 +53,13 @@ DWORD CEDevice::reg_access(TCHAR *key, TCHAR *val, DWORD data) { return data; cbdata = sizeof(DWORD); - if (RegQueryValueEx(regkey, val, NULL, NULL, (LPBYTE) &tmpval, &cbdata) != ERROR_SUCCESS) - { + if (RegQueryValueEx(regkey, val, NULL, NULL, (LPBYTE) &tmpval, &cbdata) != ERROR_SUCCESS) { RegCloseKey(regkey); return data; } cbdata = sizeof(DWORD); - if (RegSetValueEx(regkey, val, 0, REG_DWORD, (LPBYTE) &data, cbdata) != ERROR_SUCCESS) - { + if (RegSetValueEx(regkey, val, 0, REG_DWORD, (LPBYTE) &data, cbdata) != ERROR_SUCCESS) { RegCloseKey(regkey); return data; } @@ -78,8 +76,7 @@ void CEDevice::backlight_xchg() { REG_disp = reg_access(TEXT("ControlPanel\\Power"), TEXT("Display"), REG_disp); h = CreateEvent(NULL, FALSE, FALSE, TEXT("BackLightChangeEvent")); - if (h) - { + if (h) { SetEvent(h); CloseHandle(h); } diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp index 8a17a4c1c4..79b833f84b 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp @@ -35,6 +35,8 @@ namespace CEGUI { PanelKeyboard::PanelKeyboard(WORD reference) : Toolbar() { setBackground(reference); + _state = false; + _lastKey.setKey(0); } @@ -42,6 +44,7 @@ namespace CEGUI { } bool PanelKeyboard::action(int x, int y, bool pushed) { + Key key; if (checkInside(x, y)) { int keyAscii = 0; @@ -62,19 +65,35 @@ namespace CEGUI { keyAscii = VK_BACK; keyCode = keyAscii; } else { // Enter - keyAscii = 13; keyCode = 10; + keyAscii = 13; keyCode = 13; } } if (keyAscii != 0) { - _key.setAscii(keyAscii); - _key.setKeycode(tolower(keyCode)); - return EventsBuffer::simulateKey(&_key, pushed); + if (_state && pushed && keyCode != _lastKey.keycode()) // if cursor is still down and off the current key + return false; + else if (_state && !pushed && keyCode != _lastKey.keycode()) { // cursor is up but off the current key + keyAscii = _lastKey.ascii(); + keyCode = _lastKey.keycode(); + } + _state = pushed; + _lastKey.setKey(keyAscii, tolower(keyCode)); + + key.setKey(keyAscii, tolower(keyCode)); + return EventsBuffer::simulateKey(&key, pushed); } - else + else if (_state && !pushed) { // cursor is in some forbidden region and is up + _state = false; + key = _lastKey; + return EventsBuffer::simulateKey(&key, false); + } else return false; } - else + else if (_state && !pushed) { // cursor left the keyboard area and is up + _state = false; + key = _lastKey; + return EventsBuffer::simulateKey(&key, false); + } else return false; } } diff --git a/backends/platform/wince/CEgui/PanelKeyboard.h b/backends/platform/wince/CEgui/PanelKeyboard.h index fe586b3727..d0182ce5fe 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.h +++ b/backends/platform/wince/CEgui/PanelKeyboard.h @@ -44,7 +44,8 @@ namespace CEGUI { virtual ~PanelKeyboard(); virtual bool action(int x, int y, bool pushed); private: - Key _key; + bool _state; + Key _lastKey; }; } diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index c8b09f611a..19978c23dc 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -32,10 +32,9 @@ namespace CEKEYS { SDL_Event ev = {0}; if (!key->keycode()) - key->setKeycode(key->ascii()); - - if (!key->ascii()) - key->setAscii(key->keycode()); + key->setKey(key->ascii(), key->ascii()); + else if (!key->ascii()) + key->setKey(key->keycode()); ev.type = (pushed ? SDL_KEYDOWN : SDL_KEYUP); ev.key.keysym.mod = (SDLMod)key->flags(); diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index cc9e2951be..0d9556e967 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -3,9 +3,20 @@ # $URL$ # $Id$ +######################################################################## +## Set this to point to where the tools are installed on your system + wince_gcc_root = /cygdrive/e/wince-gcc-root -srcdir = ../../.. -VPATH = $(srcdir) + + +######################################################################## +## Do you want a debug build or not? + +#WINCE_DEBUG_BUILD = 1 + + +######################################################################## +## Disable whichever engines you want here #DISABLE_SCUMM = 1 #DISABLE_SKY = 1 @@ -20,10 +31,36 @@ DISABLE_LURE = 1 #DISABLE_SWORD1 = 1 #DISABLE_SWORD2 = 1 #DISABLE_TOUCHE = 1 -DISABLE_PARALLACTION = 1 +#DISABLE_PARALLACTION = 1 DISABLE_CRUISE = 1 + +######################################################################## +## Pick which libraries you want to use here + +USE_MAD = 1 +USE_MPEG2 = 1 +USE_TREMOR = 1 +#USE_TREMOLO = 1 +USE_FLAC = 1 +USE_ZLIB = 1 + + +######################################################################## +## You're probably not going to want to change these defines... + #DISABLE_HQ_SCALERS = 1 +USE_ARM_SOUND_ASM = 1 +USE_ARM_SMUSH = 1 + + +######################################################################## +## Hopefully you shouldn't need to change anything below here. ## +######################################################################## + + +srcdir = ../../.. +VPATH = $(srcdir) CXX = arm-wince-pe-g++ LD = arm-wince-pe-g++ @@ -38,9 +75,19 @@ ECHO = echo -n CAT = cat AS = arm-wince-pe-as -DEFINES := -D_WIN32_WCE=300 -DARM -D__ARM__ -D_ARM_ -DUNICODE -DSCUMM_NEED_ALIGNMENT -DFPM_DEFAULT -DUSE_MAD -DNONSTANDARD_PORT -DUSE_TREMOR -DUSE_VORBIS -DUSE_MPEG2 -DWIN32 -DUSE_ZLIB +######################################################################## +## Set up defines, includes, cflags etc + +DEFINES := -D_WIN32_WCE=300 -DARM -D__ARM__ -D_ARM_ -DUNICODE -DSCUMM_NEED_ALIGNMENT +DEFINES += -DFPM_DEFAULT + +DEFINES += -DNONSTANDARD_PORT +DEFINES += -DWIN32 DEFINES += -D__stdcall= -Dcdecl= -D__cdecl__= -D__cdecl= -Wno-multichar -#DEFINES += -DDEBUG -DUSE_WINDBG -g + +ifdef WINCE_DEBUG_BUILD +DEFINES += -DDEBUG -DUSE_WINDBG -g +endif INCLUDES := -I$(srcdir) -I. -I$(srcdir)/engines -Imissing/gcc -Ilibs/include -Ilibs/include/sdl -ICEgui -ICEkeys -I$(wince_gcc_root)/include @@ -49,7 +96,47 @@ CFLAGS := -O3 -march=armv4 -mtune=xscale CXXFLAGS := $(CFLAGS) LDFLAGS := -Llibs/lib -L$(wince_gcc_root)/lib -LIBS := -lSDL -lzlib -lmad -lmpeg2 -ltremorce --entry WinMainCRTStartup +LIBS := -lSDL + +ifdef USE_ZLIB +DEFINES += -DUSE_ZLIB +LIBS += -lzlib +endif + +ifdef USE_MAD +DEFINES += -DUSE_MAD +LIBS += -lmad +endif + +ifdef USE_MPEG2 +DEFINES += -DUSE_MPEG2 +LIBS += -lmpeg2 +endif + +ifdef USE_TREMOR +DEFINES += -DUSE_TREMOR -DUSE_VORBIS +LIBS += -ltremorce +endif + +ifdef USE_TREMOLO +DEFINES += -DUSE_TREMOR -DUSE_VORBIS +INCLUDES += -Ilibs/include/tremolo +LIBS += -llibTremolo +endif + +ifdef USE_FLAC +DEFINES += -DUSE_FLAC +LIBS += -lFLAC +endif + +ifdef USE_ARM_SMUSH +DEFINES += -DUSE_ARM_SMUSH +endif + +LIBS += --entry WinMainCRTStartup + +######################################################################## +# Targets follow here TARGET = scummvm.exe OBJS := @@ -71,7 +158,6 @@ include $(srcdir)/Makefile.common all: dist dist: $(TARGET) -# bzip2 -fvk $(TARGET) $(STRIP) $(TARGET) PocketSCUMM.o: diff --git a/backends/platform/wince/README-WinCE b/backends/platform/wince/README-WinCE deleted file mode 100644 index b1fc585e22..0000000000 --- a/backends/platform/wince/README-WinCE +++ /dev/null @@ -1,506 +0,0 @@ -ScummVM Windows CE FAQ -Last updated: 2006-06-20 -Release version: 0.9.0 ------------------------------------------------------------------------- - -This document is intended to give common answers to specific ScummVM -issues on Windows CE, in 3 sections - * "General questions" : browse this section to get started and see - general issues - * "Game specific questions" : lists some common game specific issues - * "Support and links" : how to get support if you're still puzzled - ------------------------------------------------------------------------- -General questions ------------------------------------------------------------------------- - -Which devices are supported ? ------------------------------ - -Official build --------------- - -The official build is based on the ARM architecture and should work with any -Pocket PC 2000, Pocket PC 2002, Pocket PC 2003, Pocket PC 2003 SE, Smartphone -2002, Smartphone 2003 or Windows Mobile based device. - -Support for old ARM architectures (Handheld PCs, Palm Size PCs) and other CPUs -(MIPS, SH3) is discontinued. Feel free to generate builds for these -architectures and contact me to include them on ScummVM website. - -Full support ------------- - -* ARM based Windows Mobile handhelds with QVGA resolution (240x320) slower - than 200 MHz (PocketPC platform) - -All AdLib first generation games should work properly on these devices. -Sam'n'Max will be a bit too slow to be played with music. -More recent games (The Dig, Curse of Monkey Island, Broken Sword series) -and all VGA games will probably be too slow to be enjoyable. - -* ARM based Windows Mobile handhelds with QVGA resolution (240x320) faster - than 200 MHz - -All games should work properly on these devices. -VGA games will be resized and the font gets hard to read in this case (be sure -to install the talkie version the game :p) - -* ARM based Windows Mobile handhelds with VGA resolution (640x480) - -All non VGA games should work properly on these devices. They can be resized -with different scalers (not all desktop scalers are supported due to Embedded -Visual C++ very personal interpretation of the C++ standard). -VGA games will be displayed in true VGA mode, which can takes a lot of memory -and slow down the game (especially during scrollings). It will get better in -the next releases or with faster devices. - -* Windows Mobile Smartphones (176x220 or 240x320) - -Early support is provided for all 320x200 games. -The font can get hard to read (you should prefer talkie games, or wear glasses) - -* Support for Windows Mobile 5 is experimental but should work. "Flipping" devices -such as the HTC Wizard or HTC Universal work only in portait (closed) mode for the -moment. - -Partial / Discontinued support ------------------------------- - -Support for the following devices is not complete, not working properly or -discontinued because the device is now obsolete. Feel free to contribute and -improve the port for your favorite device, or use the last release built with -the previous port architecture (0.5.1) which was less resource hungry and -supported more exotic devices. - -* "Paletted" devices (non "true color") - -These devices will be supported through the GDI layer which will slow down the -games a lot. You can try to disable the music/sound effects to get a better -game experience. - -* "Mono" devices - -I don't even think anything will be displayed on these devices :) you can try -and report your success ... - -* MIPS/SH3 devices with QVGA resolution (240x320), "true color" - -Some devices may be a bit too slow, especially if direct screen access (GAPI) -is not supported on these devices. - -* ARM/MIPS/SH3 devices with VGA resolution (640x480) (Palm Size PC / Handheld - PC platform) - -True VGA games will probably be too slow to run properly on these devices even -if they can support them ... - -* ARM/MIPS/SH3 devices with desktop resolution (800x600) (Handheld PC platform) - -No, there will never be ANY scaler supporting 800x600 resolution, because -320x200 games CANNOT be resized to a 800x600 by a simple operation. - -And the device will probably be too slow to perform any kind of graphic -transform anyway :) - -How do I install ScummVM for Windows CE ? ------------------------------------------ - -If the current release includes a .EXE installer, ScummVM for Windows CE -will be installed without hassle. -Otherwise, you'll unzip the release on your desktop computer, and copy -all files on your device. - -If you're using a Pocket PC 2000 operating system, be sure to have GAPI -installed - it's available on Microsoft website http://www.microsoft.com - -How do I install a game ? -------------------------- - -You'll at least need to copy all the data files from your game, in a -sub-directory of your game directory. - -You'll need to put the data files in a directory named after ScummVM game -name (see "Supported Game" section in ScummVM readme) for the games having -"generic" data files (.LFL files). Recent games can be put in any directory. - -You can compress the multimedia files (sound/video) as described in the -ScummVM readme. - -You can compress the audio tracks of Loom or Monkey Island 1 as described in -the ScummVM readme. If you are running these games on a slow device with Ogg -Vorbis compression, it's recommended to sample the files to 11 kHz (this sample -rate is not supported by other versions of ScummVM). - -If you need more details, you can check SirDave's mini-manual online available -at: http://forums.scummvm.org/viewtopic.php?t=936 -and at: http://www.pocketmatrix.com/forums/viewtopic.php?t=8606 - -How do I run a game ? ---------------------- - -If it's the first time you're running ScummVM for Windows CE, have installed or -removed games, you need to rescan your game directory. - * Select Scan, tap the root directory of your games, and tap "Yes" to begin - an automatic scan of the installed games. - -Usually all games are detected and you can start playing right away. If your -game is not detected check its directory name and your data files. - -To play a game, tap on its name then tap the "Play" button or double tap its -name. - -How do I play a game on a Pocket PC or Handheld PC device ? ------------------------------------------------------------ - -The stylus is your mouse cursor, and a tap is a left mouse button click. - -As the Pocket PC lacks some keys, a toolbar is displayed at the bottom of the -screen to make the most common functions just a tap away - * The disk icon opens ScummVM options menu to save your game, or change your - current game settings. - * The movie icon skips a non interactive sequence, the current dialog or - behaves like the ESC key on a regular keyboard - * The sound icon turns all sound effects and music off and on - * The key icon allow you to map a key action to a device button. - * The monkey icon switches between portrait, landscape and inverse landscape - mode. - -You can map additional actions on your device hardware buttons using the -"Options" / "Key" menu in the ScummVM options menu. To associate an action to -a key, tap the action, then the "Map" button and press the hardware key. -The following actions are available - * Pause : pause the game - * Save : open ScummVM option menu - * Quit : quit ScummVM (without saving, be careful when using it) - * Skip : skip a non interactive sequence, the current dialog or - behaves like the ESC key on a regular keyboard - * Hide : hide or display the toolbar - - YOU MUST HIDE THE TOOLBAR TO SCROLL THROUGH THE INVENTORY IN ZAK - - * Keyboard : hide or display the virtual keyboard - - YOU MUST DISPLAY THE KEYBOARD TO FIGHT IN INDIANA JONES 3 - - * Sound : turns all sound effects and music off and on - * Right click : acts as a right mouse button click - - YOU MUST MAP THIS ACTION TO PLAY THE FOLLOWING GAMES - - - SAM & MAX, BENEATH A STEEL SKY, CURSE OF MONKEY ISLAND - - * Cursor : hide or display the mouse cursor - * Free look : go in or out of free-look mode. In this mode, you can tap - the screen to look for interesting locations without walking. - * Zoom up : magnify the upper part of the screen for 640x480 games - rendered on a 320x240 device. - * Zoom down : magnify the lower part of the screen for 640x480 games - rendered on a 320x240 device. - * FT Cheat : win a Full Throttle action sequence - * Bind keys : map a key action to a device button - * Up,Down,Left: - Right, : emulate mouse/stylus behavior - Left Click : - -If you start a game when a Right click mapping is necessary, ScummVM will ask -you to map one of your hardware key to this action before playing. Just press -the key you want to map if you see this message. - -How do I hide the toolbar ? ----------------------------- - -A shortcut is available to hide the toolbar directly from the game screen from -release 0.8.0. Double tapping the stylus at the top of the screen will switch -between a visible toolbar panel, a virtual keyboard, and an invisible panel. -If any part of the screen is obscured by the toolbar (like the load/save game -dialogs) you can use the invisible panel mode to get to it. For 320x200 games -on QVGA Pocket PCs, when the panel is hidden the game screen is resized to -320x240 for better gaming experience. - -How do I play a game on a Microsoft Smartphone device ? -------------------------------------------------------- - -When playing on a Smartphone, the cursor and mouse buttons are emulated by -a set of default keys : - 4 Move up - 6 Move down - 8 Move left - 2 Move right - Hotkey 1 Left mouse button click - Hotkey 2 Right mouse button click - Return/Action Open the key mapping menu - -Note that this means that the input will be "inversed" on a 240x320 (Windows -Mobile 2005) Smartphone. You'll have to remap the keys. - -A few options are also emulated by a set of default keys : - - 0 Options menu - Back Skip - # Zone option - -The cursor will move faster if you keep the key down. You can tweak this -behaviour in the configuration file described below. - -The "Zone" key is a *very* valuable addition allowing you to jump quickly -between three screen zones : the game zone, the verbs zone and the inventory -zone. When you switch to a zone the cursor will be reset to its former location -in this zone. - -There are two more actions available for mapping: - - Keyboard: Shows hides a virtual keyboard which can be use whenever text - input is required in a game, or a dialog. - - Rotate : Flips the screen orientation between normal and inverse landscape. - -You can change the keys mapping during the game in the key mapping menu. - -Note that you'll need to push the Action button (center of the pad) to quit -a Simon game. - -How can I apply a ScummVM command line option (f.e. to change the language) ---------------------------------------------------------------------------- - -See the section regarding the configuration file (scummvm.ini) in ScummVM -README file - the same keywords apply. - -Some parameters are specific to this port : - -game specific section (f.e. [monkey2]) - performance options - -high_sample_rate bool Desktop quality (22 kHz) sound output if set. - 11 kHz otherwise. - The default is 11 kHz. - If you have a fast device, you can set this to - true to enjoy better sound effects and music. -FM_high_quality bool Desktop quality FM synthesis if set. Lower - quality otherwise. The default is low quality. - You can change this if you have a fast device. -sound_thread_priority int Set the priority of the sound thread - (given to SetThreadPriority API) -Smush_force_redraw int Force a Smush frame redraw every X missed - frames. Mainly used for Full Throttle action - sequences. Setting it lower gives more - priority to screen redraws. Setting it higher - gives more priority to stylus/keyboard input. - The default is 30. - -game specific section (f.e. [monkey2]) - game options - -landscape int 0: Portrait, 1: Landscape, 2: Inverse Landscape - -[scummvm] section - keys definition - -You usually do not wish to modify these values directly, as they are set -by the option dialog, and are only given here for reference. - -action_mapping_version int Mapping version linked to ScummVM version. -action_mapping string Hex codes describing the key associated to - each different action. - -[scummvm] section - mouse emulation tuning - -You can tweak these parameters to customize how the cursor is handled. - -repeatTrigger int Number of milliseconds a key must be held to - consider being repeated. - -repeatX int Number of key repeat events before changing - horizontal cursor behaviour. -stepX1 int Horizontal cursor offset value when the key is - not repeated. -stepX2 int Horizontal cursor offset value when the key is - repeated less than repeatX. -stepX3 int Horizontal cursor offset value when the key is - repeated more than repeatX. - - -repeatY int Number of key repeat events before changing - vertical cursor behaviour. -stepY1 int Vertical cursor offset value when the key is - not repeated. -stepY2 int Horizontal cursor offset value when the key is - repeated less than repeatY. -stepY3 int Vertical cursor offset value when the key is - repeated more than repeatY. - -Game xxx is too slow on my device ---------------------------------- - -Even if it shouldn't happen (this port is running almost correctly on a -80 / 120 MHz first generation SPV phone), you can try some things : - - * Disable sound in the engine (see the global README) - * Play with the priority of the sound thread (change the - sound_thread_priority value - the higher the lower priority) - -And don't forget to report your progress in the ScummVM forum ! - ------------------------------------------------------------------------- -Game specific questions ------------------------------------------------------------------------- - --------------------------- --- Beneath a Steel Sky -- --------------------------- - -Introduction movie is too slow or never ends ... -------------------------------------------------- - -Skip it :) - -How can I open the inventory in Beneath a Steel Sky ? ---------------------------------------------------- - -Tap the top of the screen. Check your stylus calibration if you still cannot -open it. - -How can I use an item in Beneath a Steel Sky ? ----------------------------------------------- - -You need to map the right click button (see the General Questions section). - ----------------------------- --- Curse of Monkey Island -- ----------------------------- - -How can I open the inventory in Curse of Monkey Island ? ------------------------------------------------------- - -You need to map the right click button (see the General Questions section). - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the music and voice files (VOXDISK.BUN, MUSDISK.BUN) -to lower these requirements. - -Sound synchronization is lost in Curse of Monkey Island videos --------------------------------------------------------------- - -This is a port bug which is very noticeable in VGA mode. It can probably be -fixed with a faster blitting routine or a faster device. - --------------------- --- Full Throttle -- --------------------- - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the voice file (MONSTER.SOU) and disable the -music to lower these requirements. - ----------------------------------------- --- Indiana Jones and the Last Crusade -- ----------------------------------------- - -How can I fight in Indiana Jones and the Last Crusade ? ------------------------------------------------------ - -You need to map the keyboard button (see the General Questions section). - ---------------- --- Sam & Max -- ---------------- - -How can I change the current action ? -------------------------------------- - -You need to map the right click button (see the General Questions section). - -How can I exit a mini game ? ----------------------------- - -Use the skip toolbar icon (see the General Questions section). - -------------------- --- Simon 1 and 2 -- --------------------- - -How can I save or quit in Simon ? --------------------------------- - -"Use" (use the use verb :p) the postcard. The ScummVM option dialog is disabled -in Simon games. - -On Smartphone, you'll need to push the Action button (center of the pad) to -quit the game. - -------------- --- The Dig -- -------------- - -I'm experiencing random crashes ... ------------------------------------- - -This game has high memory requirements, and may crash sometimes on low -memory devices. Continue your game with the latest automatically saved -game and everything should be fine. -You can consider removing the music and voice files (VOXDISK.BUN, MUSDISK.BUN) -to lower these requirements. - --------------------- --- Zak Mc Kracken -- --------------------- - -How can I scroll through my inventory items in Zak Mc Kracken ? -------------------------------------------------------------- - -You need to map the hide toolbar button (see the General Questions section) or -double tap at the top of the screen (from 0.8.0+) - --------------------- --- Broken Sword 2 -- --------------------- - -I've installed the movies pack but they are not playing -------------------------------------------------------- - -MPEG 2 playback takes too much memory in the current release, and may prevent -movies from playing in VGA mode. This may get better in the next releases. - ----------------- --- Gobliiins -- ----------------- - -Cursor is grabled after loading a game --------------------------------------- - -Due to a bug in 0.8.0, you'll have to tap the stylus somewhere on the game -screen between 2 letters when entering a code. Otherwise the cursor will get -garbled. - -This has not been retested for 0.8.1 but should be fixed. - ------------------------------------------------------------------------- -Support ------------------------------------------------------------------------- - -Help, I've read everything and ... ------------------------------------ - -Luckily, as there is a huge variety of Windows Mobile devices, a specific forum -is dedicated to this ScummVM port. You can ask your question on the WinCE -ScummVM forum available at http://forums.scummvm.org/viewforum.php?f=6 - -Some older questions and very nice tutorials are still available on the historic -PocketMatrix forum at http://www.pocketmatrix.com/forums/viewforum.php?f=20 -where the community is always glad to help and have dealt with all my bugs for more -than three years now :) - -I think I found a bug, ScummVM crashes in ... ---------------------------------------------- - -See the "Reporting Bugs" section in ScummVM readme. - -If you have a Pocket PC or Handheld PC, be sure to include its resolution (obtained -on the second dialog displayed on the "About" menu) in your bug report. - -If you cannot reproduce this bug on another ScummVM version, you can cross -post your bug report on ScummVM forums. - ------------------------------------------------------------------------- -Good Luck and Happy Adventuring! -The ScummVM team. -http://www.scummvm.org/ ------------------------------------------------------------------------- diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 8ef7412530..2d6e9a4302 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -314,9 +314,6 @@ void OSystem_WINCE3::initScreenInfos() { _isOzone = 0; SDL_Rect **r; r = SDL_ListModes(NULL, 0); - printf("listmodes: %dx%d\n", r[0]->w, r[0]->h); - //_platformScreenWidth = GetSystemMetrics(SM_CXSCREEN); - //_platformScreenHeight = GetSystemMetrics(SM_CYSCREEN); _platformScreenWidth = r[0]->w; _platformScreenHeight = r[0]->h; } @@ -330,7 +327,7 @@ bool OSystem_WINCE3::isOzone() { OSystem_WINCE3::OSystem_WINCE3() : OSystem_SDL(), _orientationLandscape(0), _newOrientation(0), _panelInitialized(false), - _panelVisible(true), _panelStateForced(false), _forceHideMouse(false), + _panelVisible(true), _panelStateForced(false), _forceHideMouse(false), _unfilteredkeys(false), _freeLook(false), _forcePanelInvisible(false), _toolbarHighDrawn(false), _zoomUp(false), _zoomDown(false), _scalersChanged(false), _monkeyKeyboard(false), _lastKeyPressed(0), _tapTime(0), _saveToolbarState(false), _saveActiveToolbar(NAME_MAIN_PANEL), _rbutton(false), _hasfocus(true), @@ -771,6 +768,7 @@ void OSystem_WINCE3::setFeatureState(Feature f, bool enable) { switch(f) { case kFeatureFullscreenMode: return; + case kFeatureVirtualKeyboard: if (_hasSmartphoneResolution) return; @@ -790,6 +788,12 @@ void OSystem_WINCE3::setFeatureState(Feature f, bool enable) { //_toolbarHandler.setVisible(_saveToolbarState); } return; + + case kFeatureDisableKeyFiltering: + if (_hasSmartphoneResolution) + _unfilteredkeys = enable; + return; + default: OSystem_SDL::setFeatureState(f, enable); } @@ -1583,6 +1587,17 @@ void OSystem_WINCE3::internUpdateScreen() { _forceFull = false; } +Graphics::Surface *OSystem_WINCE3::lockScreen() { + // FIXME: Fingolfing asks: Why is undrawMouse() needed here? + // Please document this. + undrawMouse(); + return OSystem_SDL::lockScreen(); +} + +void OSystem_WINCE3::unlockScreen() { + OSystem_SDL::unlockScreen(); +} + bool OSystem_WINCE3::saveScreenshot(const char *filename) { assert(_hwscreen != NULL); @@ -2067,18 +2082,30 @@ void OSystem_WINCE3::addDirtyRect(int x, int y, int w, int h, bool mouseRect) { OSystem_SDL::addDirtyRect(x, y, w, h, false); } -static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode) +static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) { if (GUI::Actions::Instance()->mappingActive()) return key; + if (unfilter) { + switch (key) { + case SDLK_ESCAPE: + return SDLK_BACKSPACE; + case SDLK_F8: + return SDLK_ASTERISK; + case SDLK_F9: + return SDLK_HASH; + } + return key; + } + if (key >= SDLK_KP0 && key <= SDLK_KP9) { return key - SDLK_KP0 + '0'; } else if (key >= SDLK_UP && key <= SDLK_PAGEDOWN) { return key; } else if (unicode) { return unicode; - } else if (key >= 'a' && key <= 'z' && mod & KMOD_SHIFT) { + } else if (key >= 'a' && key <= 'z' && (mod & KMOD_SHIFT)) { return key & ~0x20; } else if (key >= SDLK_NUMLOCK && key <= SDLK_EURO) { return 0; @@ -2113,9 +2140,9 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { while(SDL_PollEvent(&ev)) { switch(ev.type) { case SDL_KEYDOWN: - // KMOD_RESERVED is used if the key has been injected by an external buffer debug(1, "Key down %X %s", ev.key.keysym.sym, SDL_GetKeyName((SDLKey)ev.key.keysym.sym)); - if (ev.key.keysym.mod != KMOD_RESERVED) { + // KMOD_RESERVED is used if the key has been injected by an external buffer + if (ev.key.keysym.mod != KMOD_RESERVED && !_unfilteredkeys) { keyEvent = true; _lastKeyPressed = ev.key.keysym.sym; _keyRepeatTime = currentTime; @@ -2125,19 +2152,27 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { return true; } - event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = ev.key.keysym.sym; - event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - if (GUI_Actions::Instance()->mappingActive()) event.kbd.flags = 0xFF; + else if (ev.key.keysym.sym == SDLK_PAUSE) { + _lastKeyPressed = 0; + event.type = Common::EVENT_PREDICTIVE_DIALOG; + return true; + } + + 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); return true; case SDL_KEYUP: - // KMOD_RESERVED is used if the key has been injected by an external buffer debug(1, "Key up %X %s", ev.key.keysym.sym, SDL_GetKeyName((SDLKey)ev.key.keysym.sym)); - if (ev.key.keysym.mod != KMOD_RESERVED) { + // KMOD_RESERVED is used if the key has been injected by an external buffer + if (ev.key.keysym.mod != KMOD_RESERVED && !_unfilteredkeys) { keyEvent = true; _lastKeyPressed = 0; @@ -2145,12 +2180,19 @@ bool OSystem_WINCE3::pollEvent(Common::Event &event) { return true; } - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = ev.key.keysym.sym; - event.kbd.ascii = mapKeyCE(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); - if (GUI_Actions::Instance()->mappingActive()) event.kbd.flags = 0xFF; + else if (ev.key.keysym.sym == SDLK_PAUSE) { + _lastKeyPressed = 0; + return false; // chew up the show agi dialog key up event + } + + event.type = Common::EVENT_KEYUP; + 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); return true; diff --git a/backends/platform/wince/wince-sdl.h b/backends/platform/wince/wince-sdl.h index 0e8e5e53ba..e74c438807 100644 --- a/backends/platform/wince/wince-sdl.h +++ b/backends/platform/wince/wince-sdl.h @@ -97,6 +97,8 @@ public: void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); void showOverlay(); void hideOverlay(); + Graphics::Surface *lockScreen(); + void unlockScreen(); // GUI and action stuff void swap_panel_visibility(); @@ -189,6 +191,7 @@ private: bool _panelInitialized; // only initialize the toolbar once bool _monkeyKeyboard; // forced keyboard for Monkey Island copy protection + bool _unfilteredkeys; // discard key mapping temporarily (agi pred. dialog) static bool _soundMaster; // turn off sound after all calculations // static since needed by the SDL callback int _orientationLandscape; // current orientation |