diff -Naur scummvm-0.8.1.orig/backends/sdl/events.cpp scummvm-0.8.1/backends/sdl/events.cpp
--- scummvm-0.8.1.orig/backends/sdl/events.cpp	2006-01-18 18:07:25.000000000 +0000
+++ scummvm-0.8.1/backends/sdl/events.cpp	2006-02-05 10:58:21.000000000 +0000
@@ -192,9 +192,8 @@
 		case SDL_KEYDOWN:{
 			b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
 
-			// Alt-Return and Alt-Enter toggle full screen mode
-			if (b == KBD_ALT && (ev.key.keysym.sym == SDLK_RETURN
-			                  || ev.key.keysym.sym == SDLK_KP_ENTER)) {
+			// Return and Enter toggle full screen mode
+			if (ev.key.keysym.sym == SDLK_F6) {
 				setFullscreenMode(!_fullscreen);
 #ifdef USE_OSD
 				if (_fullscreen)
diff -Naur scummvm-0.8.1.orig/base/main.cpp scummvm-0.8.1/base/main.cpp
--- scummvm-0.8.1.orig/base/main.cpp	2006-01-27 23:39:39.000000000 +0000
+++ scummvm-0.8.1/base/main.cpp	2006-02-05 10:58:21.000000000 +0000
@@ -166,6 +166,8 @@
 
 #if defined(UNIX)
 #include <signal.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 
 #ifndef SCUMM_NEED_ALIGNMENT
 static void handle_errors(int sig_num) {
@@ -335,6 +337,9 @@
 	do_memory_test();
 #endif
 
+  // Maemo task navigator priority inheritance fix
+  setpriority(PRIO_PROCESS, 0, 0);
+
 // Code copied from SDL_main
 #if (defined(WIN32) && defined(NO_CONSOLE)) || defined(__SYMBIAN32__)
 // Symbian does not like any output to the console through any *print* function
diff -Naur scummvm-0.8.1.orig/configure scummvm-0.8.1/configure
--- scummvm-0.8.1.orig/configure	2005-10-29 01:01:16.000000000 +0000
+++ scummvm-0.8.1/configure	2006-02-05 10:58:21.000000000 +0000
@@ -294,8 +294,8 @@
   --disable-he             exclude HE70+ games in SCUMM engine
   --disable-simon          don't build the simon engine
   --disable-sky            don't build the Beneath a Steel Sky engine
-  --disable-sword1         don't build the Broken Sword 1 engine
-  --disable-sword2         don't build the Broken Sword 2 engine
+  --disable-sword1         don't build the Broken Sword I engine
+  --disable-sword2         don't build the Broken Sword II engine
   --disable-queen          don't build the Flight of the Amazon Queen engine
   --disable-saga           don't build the SAGA engine
   --disable-gob            don't build the Gobli*ns engine
@@ -544,7 +544,7 @@
 
 echocheck "compiler version"
 
-cxx_name=`( $cc -v ) 2>&1 | tail -n 1 | cut -d ' ' -f 1`
+cxx_name=`( $cc -v ) 2>&1 | tail -1 | cut -d ' ' -f 1`
 cxx_version=`( $CXX -dumpversion ) 2>&1`
 if test "$?" -gt 0; then
 	cxx_version="not found"
@@ -690,16 +690,6 @@
 			type_2_byte='short'
 			type_4_byte='int'
 			;;
-		arm-linux)
-			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
-			DEFINES="$DEFINES -DUNIX"
-			#not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
-			_def_endianness='#define SCUMM_LITTLE_ENDIAN'
-			_def_align='#define SCUMM_NEED_ALIGNMENT'
-			type_1_byte='char'
-			type_2_byte='short'
-			type_4_byte='int'
-			;;
 		ppc-amigaos)
 			echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
 			_def_endianness='#define SCUMM_BIG_ENDIAN'
@@ -1194,7 +1184,7 @@
 	echo "    Beneath a Steel Sky"
 fi
 if test "$_build_sword1" = yes ; then
-	echo_n "    Broken Sword 1"
+	echo_n "    Broken Sword I"
 	if test "$_mpeg2" = yes ; then
 		echo " (w/ mpeg2 cutscenes)"
 	else
@@ -1202,7 +1192,7 @@
 	fi
 fi
 if test "$_build_sword2" = yes ; then
-	echo_n "    Broken Sword 2"
+	echo_n "    Broken Sword II"
 	if test "$_mpeg2" = yes ; then
 		echo " (w/ mpeg2 cutscenes)"
 	else
diff -Naur scummvm-0.8.1.orig/debian/changelog scummvm-0.8.1/debian/changelog
--- scummvm-0.8.1.orig/debian/changelog	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/changelog	2006-02-05 14:34:40.000000000 +0000
@@ -0,0 +1,5 @@
+scummvm (0.8.1) unstable; urgency=low
+
+  * Initial release
+
+ -- Frantisek Dufka <dufkaf@seznam.cz>  Sun, 5 Feb 2006 11:23:50 +0100
diff -Naur scummvm-0.8.1.orig/debian/compat scummvm-0.8.1/debian/compat
--- scummvm-0.8.1.orig/debian/compat	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/compat	2006-02-05 10:58:53.000000000 +0000
@@ -0,0 +1 @@
+4
diff -Naur scummvm-0.8.1.orig/debian/control scummvm-0.8.1/debian/control
--- scummvm-0.8.1.orig/debian/control	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/control	2006-02-05 10:58:52.000000000 +0000
@@ -0,0 +1,13 @@
+Source: scummvm
+Section: games
+Priority: optional
+Maintainer: Frantisek Dufka <dufkaf@seznam.cz>
+Build-Depends: debhelper (>> 4.0.0), libsdl1.2-dev
+Standards-Version: 3.6.1.1
+
+Package: scummvm
+Architecture: any
+Depends: maemo
+Description: free implementation of LucasArts' S.C.U.M.M interpreter
+ ScummVM is a virtual machine for classic graphical adventure games.
+ This package does not contain any actual games.
diff -Naur scummvm-0.8.1.orig/debian/copyright scummvm-0.8.1/debian/copyright
--- scummvm-0.8.1.orig/debian/copyright	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/copyright	2006-02-05 10:58:53.000000000 +0000
@@ -0,0 +1,19 @@
+ScummVM was debianized by Bastien Nocera <hadess@hadess.net> the 5th Apr 2002.
+It was adopted by Tore Anderson <tore@linpro.no> the 4th Oct 2002.
+Packaged for the Maemo platform by Tomas Junnoen <tomas@fs-security.com> Oct 2005
+
+It was downloaded from <http://www.scummvm.org/>.
+
+Upstream Authors: see AUTHORS file of the ScummVM source distribution.
+
+Copyright:
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'.
+
+This copyright also applies to the Debian-related build scripts.
diff -Naur scummvm-0.8.1.orig/debian/files scummvm-0.8.1/debian/files
--- scummvm-0.8.1.orig/debian/files	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/files	2006-02-05 20:29:53.000000000 +0000
@@ -0,0 +1 @@
+scummvm_0.8.1_arm.deb games optional
diff -Naur scummvm-0.8.1.orig/debian/rules scummvm-0.8.1/debian/rules
--- scummvm-0.8.1.orig/debian/rules	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/rules	2006-02-05 20:27:08.000000000 +0000
@@ -0,0 +1,44 @@
+#!/usr/bin/make -f
+
+build: scummvm
+
+scummvm:
+	dh_testdir
+	./configure --disable-debug --disable-mt32emu  --disable-hq-scalers --enable-kyra
+#--disable-scumm-7-8
+	$(MAKE)
+
+clean:
+	dh_testdir
+	dh_testroot
+	-$(MAKE) distclean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean
+	dh_installdirs
+	install -m0755 scummvm debian/scummvm/usr/games/scummvm.bin
+	install -m0755 scummvm.wrapper debian/scummvm/usr/games/scummvm
+	install -m0644 scummvm.xpm debian/scummvm/usr/share/icons
+	install -m0644 scummvm.desktop debian/scummvm/usr/share/applications
+
+binary: binary-arch
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs NEWS
+	dh_link
+	dh_strip
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary-indep:
+
+.PHONY: build clean binary install binary-arch binary-indep
diff -Naur scummvm-0.8.1.orig/debian/scummvm.dirs scummvm-0.8.1/debian/scummvm.dirs
--- scummvm-0.8.1.orig/debian/scummvm.dirs	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/scummvm.dirs	2006-02-05 10:58:53.000000000 +0000
@@ -0,0 +1,3 @@
+usr/games
+usr/share/icons
+usr/share/applications
diff -Naur scummvm-0.8.1.orig/debian/scummvm.links scummvm-0.8.1/debian/scummvm.links
--- scummvm-0.8.1.orig/debian/scummvm.links	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/scummvm.links	2006-02-05 10:58:52.000000000 +0000
@@ -0,0 +1 @@
+/var/lib/install/usr/share/applications/scummvm.desktop /etc/others-menu/extra_applications/scummvm.desktop
diff -Naur scummvm-0.8.1.orig/debian/scummvm.substvars scummvm-0.8.1/debian/scummvm.substvars
--- scummvm-0.8.1.orig/debian/scummvm.substvars	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/debian/scummvm.substvars	2006-02-05 20:29:52.000000000 +0000
@@ -0,0 +1 @@
+shlibs:Depends=libc6 (>= 2.3.2.ds1-4), libgcc1 (>= 1:3.3.3-1), libsdl1.2, libstdc++5 (>= 1:3.3.3-1), zlib1g (>= 1:1.2.1)
diff -Naur scummvm-0.8.1.orig/gob/util.cpp scummvm-0.8.1/gob/util.cpp
--- scummvm-0.8.1.orig/gob/util.cpp	2006-01-18 18:07:27.000000000 +0000
+++ scummvm-0.8.1/gob/util.cpp	2006-02-05 16:52:06.000000000 +0000
@@ -150,9 +150,16 @@
 			_mouseButtons &= ~2;
 			break;
 		case OSystem::EVENT_KEYDOWN:
-			addKeyToBuffer(event.kbd.keycode);
+			if (event.kbd.keycode==285){
+				_mouseButtons |= 2;
+			} else
+				addKeyToBuffer(event.kbd.keycode);
 			break;
 		case OSystem::EVENT_KEYUP:
+			if (event.kbd.keycode==285){
+				_mouseButtons &= ~2;
+			}
+
 			break;
 		case OSystem::EVENT_QUIT:
 			g_system->quit();
diff -Naur scummvm-0.8.1.orig/queen/input.cpp scummvm-0.8.1/queen/input.cpp
--- scummvm-0.8.1.orig/queen/input.cpp	2006-01-18 18:07:29.000000000 +0000
+++ scummvm-0.8.1/queen/input.cpp	2006-02-05 11:07:20.000000000 +0000
@@ -181,7 +181,7 @@
 		}
 		break;
 	case KEY_F1: // use Journal
-	case KEY_F5:
+	case KEY_F4:
 		if (_cutawayRunning) {
 			if (_canQuit) {
 				_keyVerb = VERB_USE_JOURNAL;
diff -Naur scummvm-0.8.1.orig/queen/input.h scummvm-0.8.1/queen/input.h
--- scummvm-0.8.1.orig/queen/input.h	2006-01-18 18:07:29.000000000 +0000
+++ scummvm-0.8.1/queen/input.h	2006-02-05 11:07:03.000000000 +0000
@@ -109,7 +109,7 @@
 
 		KEY_F1 = 282,
 		KEY_F11 = KEY_F1 + 10,
-		KEY_F5 = KEY_F1 + 4,
+		KEY_F4 = KEY_F1 + 3,
 		KEY_F12
 	};
 
diff -Naur scummvm-0.8.1.orig/scumm/dialogs.cpp scummvm-0.8.1/scumm/dialogs.cpp
--- scummvm-0.8.1.orig/scumm/dialogs.cpp	2006-01-25 14:48:39.000000000 +0000
+++ scummvm-0.8.1/scumm/dialogs.cpp	2006-02-05 10:58:21.000000000 +0000
@@ -879,7 +879,8 @@
 }
 
 void PauseDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
-	if (ascii == ' ')  // Close pause dialog if space key is pressed
+	if (ascii == ' ' ||
+	    keycode == 273)  // Close pause dialog if space or up key is pressed
 		close();
 	else
 		ScummDialog::handleKeyDown(ascii, keycode, modifiers);
@@ -947,10 +948,12 @@
 }
 
 void ValueDisplayDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
-	if (ascii == _incKey || ascii == _decKey) {
-		if (ascii == _incKey && _value < _max)
+	// Adjust value on +, -, left or right keypress
+	if (ascii == _incKey || ascii == _decKey ||
+	    keycode == 275 || keycode == 276) {
+		if ((ascii == _incKey || keycode == 275) && _value < _max)
 			_value++;
-		else if (ascii == _decKey && _value > _min)
+		else if ((ascii == _decKey || keycode == 276) && _value > _min)
 			_value--;
 
 		setResult(_value);
diff -Naur scummvm-0.8.1.orig/scumm/input.cpp scummvm-0.8.1/scumm/input.cpp
--- scummvm-0.8.1.orig/scumm/input.cpp	2006-01-18 18:07:32.000000000 +0000
+++ scummvm-0.8.1/scumm/input.cpp	2006-02-05 10:58:21.000000000 +0000
@@ -97,6 +97,36 @@
 				_keyPressed = event.kbd.ascii;	// Normal key press, pass on to the game.
 			}
 
+			// Maemo platform keybindings
+			if (_keyPressed == 318) // Map F4 (menu) to F5 (access main menu)
+				_keyPressed = 319;
+			if (_keyPressed == 13) // Map Select (return) to Tab (right mouse button)
+				_keyPressed = 9;
+			if (_keyPressed == 321) // Map F7 (zoom in) to 1 (to bypass Monkey2 copy protection)
+				_keyPressed = 49;	// 1
+			if (_keyPressed == 322) // Map F8 (zoom out) to toggle fast mode
+				_fastMode ^= 1;
+			if (event.kbd.ascii == 273) // Map Up to space (pause game)
+				_keyPressed = 32;
+			if (event.kbd.ascii == 274) // Map Down to . (skip one line of dialog)
+				_keyPressed = 46;
+
+			// Map Right to increase talk speed
+			// Map Left to decrease talk speed
+			if (event.kbd.ascii == 275 ||
+			    event.kbd.ascii == 276) {
+				if (event.kbd.ascii == 275 && _defaultTalkDelay < 9)
+					_defaultTalkDelay++;
+				if (event.kbd.ascii == 276 && _defaultTalkDelay > 0)
+					_defaultTalkDelay--;
+
+				ValueDisplayDialog dlg("Talk speed: ", 0, 9, _defaultTalkDelay, '+', '-');
+				_defaultTalkDelay = runDialog(dlg);
+				
+				if (VAR_CHARINC != 0xFF)
+					VAR(VAR_CHARINC) = _defaultTalkDelay;
+			}			
+
 			if (_heversion >= 80) {
 				// Keyboard is controlled via variable
 				int _keyState = 0;
@@ -353,11 +383,12 @@
 		return;
 	}
 
-	if (VAR_RESTART_KEY != 0xFF && _lastKeyHit == VAR(VAR_RESTART_KEY) ||
-	   (((_version <= 2) || (_platform == Common::kPlatformFMTowns && _version == 3)) && _lastKeyHit == 8)) {
-		confirmRestartDialog();
-		return;
-	}
+	// Disable restart dialog as we are using that key for zoomout/fast mode
+// 	if (VAR_RESTART_KEY != 0xFF && _lastKeyHit == VAR(VAR_RESTART_KEY) ||
+// 	   (((_version <= 2) || (_platform == Common::kPlatformFMTowns && _version == 3)) && _lastKeyHit == 8)) {
+// 		confirmRestartDialog();
+// 		return;
+// 	}
 
 	if ((VAR_PAUSE_KEY != 0xFF && _lastKeyHit == VAR(VAR_PAUSE_KEY)) ||
 		(VAR_PAUSE_KEY == 0xFF && _lastKeyHit == ' ')) {
diff -Naur scummvm-0.8.1.orig/scummvm.desktop scummvm-0.8.1/scummvm.desktop
--- scummvm-0.8.1.orig/scummvm.desktop	2005-10-29 01:01:16.000000000 +0000
+++ scummvm-0.8.1/scummvm.desktop	2006-02-05 11:08:09.000000000 +0000
@@ -1,12 +1,11 @@
 [Desktop Entry]
 Encoding=UTF-8
-Name=ScummVM
-Name[pl]=ScummVM
-Comment=Interpreter for several adventure games
-Comment[pl]=Interpreter graficznych gier przygodowych
-Exec=scummvm
-Icon=scummvm.xpm
-Terminal=false
+Version=1.0
 Type=Application
-Categories=Application;Game;AdventureGame;
-StartupNotify=false
+Name=ScummVM
+Exec=/var/lib/install/usr/games/scummvm
+Icon=scummvm
+X-Icon-path=/var/lib/install/usr/share/icons
+X-Window-Icon=scummvm
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff -Naur scummvm-0.8.1.orig/scummvm.wrapper scummvm-0.8.1/scummvm.wrapper
--- scummvm-0.8.1.orig/scummvm.wrapper	1970-01-01 00:00:00.000000000 +0000
+++ scummvm-0.8.1/scummvm.wrapper	2006-02-05 11:07:58.000000000 +0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+# wrapper for proper WM_CLASS name in SDL apps (needed for icon in taskbar)
+BASEDIR=`dirname $0`
+BASENAME=`basename $0`
+export SDL_VIDEO_X11_WMCLASS=${BASENAME}
+exec ${BASEDIR}/${BASENAME}.bin
diff -Naur scummvm-0.8.1.orig/sky/sky.cpp scummvm-0.8.1/sky/sky.cpp
--- scummvm-0.8.1.orig/sky/sky.cpp	2006-01-26 14:16:33.000000000 +0000
+++ scummvm-0.8.1/sky/sky.cpp	2006-02-05 11:04:43.000000000 +0000
@@ -479,7 +479,16 @@
 					_keyPressed = event.kbd.keycode;
 				else
 					_keyPressed = (byte)event.kbd.ascii;
-				break;
+				// Maemo platform keybindings
+				if (_keyPressed == 62) // Map F4 (menu) to F5 (access main menu)
+					_keyPressed = 63;
+				if (_keyPressed == 13) // Map Select=Enter to right mouse button
+					_skyMouse->buttonPressed(1);
+				if (_keyPressed == 66) // Map F8 (zoom out) to toggle fast mode
+					_fastMode ^= 1;
+				if (_keyPressed == 18) // Map Down to . (skip one line of dialog)
+					_keyPressed = 46;
+ 				break;
 			case OSystem::EVENT_MOUSEMOVE:
 				if (!(_systemVars.systemFlags & SF_MOUSE_LOCKED)) {
 					_mouseX = event.mouse.x;
