[Scummvm-devel] ScummVM port for Palm WebOS

Klaus Reimer k at ailis.de
Wed Feb 24 01:13:58 CET 2010


Hello,

Fingolfin contacted the Precentral community today because of the Palm
WebOS port of ScummVM
(http://forums.precentral.net/webos-apps-software/223524-scummvm-2.html#post2241681).
I'm here to clarify this situation a little bit.

There are actual two ports (Maybe there are more, I only know these
two). One is made by the WebOS Internals Team and is quite old. This is
just a Makefile to compile ScummVM as it is. No modifications are done
and as far as I know even no effort was done to package the port into
something which can be distributed.

The other port was done by me a few days ago and can be found here:
http://www.precentral.net/homebrew-apps/scummvm.

This is also not really a "port" because WebOS is based on Linux and SDL
so ScummVM can be compiled without any changes. But I did some minor
changes anyway and I apologize that I haven't found the time yet to
create a clean GPL-compliant patch for this. Maybe this isn't even
needed because the changes are most likely pretty ugly and could be
better integrated directly into ScummVM in a clean way. Let me describe
these few changes:

1. WebOS applications have no concept for letting an application to
"quit". Apps are closed by gestures which means the apps are always
closed by the operating system and not by the application itself. This
means that all Quit buttons in ScummVM are not needed and it also means
that using these Quit buttons can crash the phone. Don't know why but I
think this is a Palm issue and not a bug in ScummVM. I tried to get rid
of the Quit buttons by removing them from the theme but ScummVM doesn't
like that. So I simply removed the buttons in the code. My suggestion is
adding a WEBOS define which ignores the code for quit buttons (and the
quit action mapped to the escape key in the main menu) when this define
is set. Or adding a special CAN_QUIT define which handles.

2. WebOS devices have a gesture area below the touchscreen. This area
sends three different keycodes. The "Back" gesture sends the standard
escape key code. So this key does not need any special mapping. The
"Forward" gesture sends the keycode ev.key.keysym.sym == 229. In my
"port" I mapped this keycode to opening the game menu. The third gesture
is simply tapping the gesture area which generates key code 231. This is
somewhat problematic, because these gestures collide. So when I do a
forward gesture then a keydown event for 231 is sent, then a keydown for
229, then a keyup for 229 and then a keyup for 231. This has some
strange side-effects: When I open the menu with the forward gesture and
then tap "Resume" then the menu closes and opens again immediately. And
if I tap "Load" or "Save" and select a savegame slot then the input
field is filled with question marks. Looks like one of the two keys (229
or 231) is stuck. I worked around the problem with some code I don't
really understand. Maybe you can sort this out, here it goes (Placed in
backends/platform/sdl/events.cpp#OSystem_SDL::remapKey):

#ifdef WEBOS
        // Ignore a tap in the gesture area. This is needed because
        // otherwise this keydown event is stuck when performing a
        // forward gesture
        if (ev.key.keysym.sym == 231) {
                event.type = Common::EVENT_KEYUP;
                return true;
        }

        // On WebOS map the forward gesture to F5 (scumm menu)
        else if (ev.key.keysym.sym == 229) {
                event.type = Common::EVENT_KEYDOWN;
                event.kbd.keycode = Common::KEYCODE_F5;
                event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
                return true;
        }
#endif

3. I'd like to ship ScummVM with a custom theme which is optimized for
small touchscreens. With larger controls and without a mouse cursor in
the ScummVM menus. To let the user switch back to the scummmodern theme
if wanted I'd like to give this theme a different name like scummwebos
or something like that and I'd like to define this theme as the default
theme. Unfortunately the default theme name is currently hardcoded in
ScummVM. Maybe it makes sense to add a configure parameter to set a
custom default theme name? For now I simply changed the hardcoded theme
name in the code.

That's all. Nothing more was changed.

Current situation of my ScummVM WebOS package: The package is currently
just available from the Precentral repository which is an inofficial
"homebrew" community for WebOS devices. The package is there as some
sort of public alpha to gather feedback if it works on the Palm Pre (and
up to now it seems to work fine everywhere).

So, that's it for now from me. How do you like this to continue? If you
plan to create an official ScummVM release for the WebOS platform by
yourself and you want me to stop my work on my inofficial package then
please tell me. If I can help in any way to get an official ScummVM
package for WebOS on the road then let me know.

-- 
Bye, K <http://www.ailis.de/~k/>
[A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
(Finger k at ailis.de to get public key)




More information about the Scummvm-devel mailing list