diff -Nur instead-1.9.0/Rules.caanoo instead-1.9.0-canoo/Rules.caanoo
--- instead-1.9.0/Rules.caanoo	1970-01-01 03:00:00.000000000 +0300
+++ instead-1.9.0-canoo/Rules.caanoo	2013-03-26 12:00:24.000000000 +0400
@@ -0,0 +1,45 @@
+VERSION := 1.9.1
+
+PREFIX  = /home/peter/Devel/GPH_SDK/tools/gcc-4.2.4-glibc-2.7-eabi
+CC        = $(PREFIX)/bin/arm-gph-linux-gnueabi-gcc
+STRIP     = $(PREFIX)/bin/arm-gph-linux-gnueabi-strip
+
+CFLAGS     += -DARM_ARCH -DGP2X_BUILD
+CFLAGS     += -DWIZ_BUILD -DCAANOO
+CFLAGS     += -O3 -std=c99 -msoft-float -funsigned-char -fno-common -fno-builtin -Wl,--allow-multiple-definition
+CFLAGS     += -I../SDL-1.2.13/include `$(PREFIX)/arm-gph-linux-gnueabi/sys-root/usr/bin/sdl-config --cflags` -I$(PREFIX)/include
+
+DESTDIR=
+BIN=
+DATAPATH=.
+STEADPATH=$(DATAPATH)/stead
+THEMESPATH=$(DATAPATH)/themes
+GAMESPATH=$(DATAPATH)/games
+ICONPATH=$(DATAPATH)/icon
+LANGPATH=$(DATAPATH)/lang
+DOCPATH=
+MANPATH=
+SYSTEMSETUP=no
+
+ZLIB_CFLAGS=
+ZLIB_LFLAGS=-lz
+
+LUA_CFLAGS=-I../caanoo/lua/
+LUA_LFLAGS=../caanoo/lua/liblua.a
+
+SDL_CFLAGS=
+SDL_LFLAGS=-lSDL -lSDL_mixer -lSDL_image -lSDL_ttf -lm -ldl -lpthread -lz
+
+CFLAGS	+= -g -Wall -Dunix -D_USE_UNPACK -D_LOCAL_APPDATA -D_HAVE_ICONV -D_SDL_MOD_BUG
+
+INSTALLD=echo "Do not install standalone version!"
+INSTALLB=echo "Do not install standalone version!"
+INSTALL=echo "Do not install standalone version!"
+LN=echo "Do not install standalone version!"
+
+EXE=
+PLATFORM=unix.c
+RESOURCES=
+RM=rm
+AR=ar rc
+RANLIB=ranlib
diff -Nur instead-1.9.0/instead/Rules.caanoo instead-1.9.0-canoo/instead/Rules.caanoo
--- instead-1.9.0/instead/Rules.caanoo	1970-01-01 03:00:00.000000000 +0300
+++ instead-1.9.0-canoo/instead/Rules.caanoo	2013-03-26 12:00:24.000000000 +0400
@@ -0,0 +1,44 @@
+VERSION := 1.9.1
+
+PREFIX  = /home/peter/Devel/GPH_SDK/tools/gcc-4.2.4-glibc-2.7-eabi
+CC        = $(PREFIX)/bin/arm-gph-linux-gnueabi-gcc
+STRIP     = $(PREFIX)/bin/arm-gph-linux-gnueabi-strip
+
+CFLAGS     += -DARM_ARCH -DGP2X_BUILD
+CFLAGS     += -DWIZ_BUILD -DCAANOO
+CFLAGS     += -O3 -std=c99 -msoft-float -funsigned-char -fno-common -fno-builtin -Wl,--allow-multiple-definition
+CFLAGS     += -I../SDL-1.2.13/include `$(PREFIX)/arm-gph-linux-gnueabi/sys-root/usr/bin/sdl-config --cflags` -I$(PREFIX)/include
+DESTDIR=
+BIN=
+DATAPATH=.
+STEADPATH=$(DATAPATH)/stead
+THEMESPATH=$(DATAPATH)/themes
+GAMESPATH=$(DATAPATH)/games
+ICONPATH=$(DATAPATH)/icon
+LANGPATH=$(DATAPATH)/lang
+DOCPATH=
+MANPATH=
+SYSTEMSETUP=no
+
+ZLIB_CFLAGS=
+ZLIB_LFLAGS=-lz
+
+LUA_CFLAGS=-I../caanoo/lua/
+LUA_LFLAGS=../caanoo/lua/liblua.a
+
+SDL_CFLAGS=
+SDL_LFLAGS=-lSDL -lSDL_mixer -lSDL_image -lSDL_ttf -lm -ldl -lpthread -lz
+
+CFLAGS	+= -g -Wall -Dunix -D_USE_UNPACK -D_LOCAL_APPDATA # -D_SDL_MOD_BUG
+
+INSTALLD=echo "Do not install standalone version!"
+INSTALLB=echo "Do not install standalone version!"
+INSTALL=echo "Do not install standalone version!"
+LN=echo "Do not install standalone version!"
+
+EXE=
+PLATFORM=unix.c
+RESOURCES=
+RM=rm
+AR=ar rc
+RANLIB=ranlib
diff -Nur instead-1.9.0/src/sdl-instead/game.c instead-1.9.0-canoo/src/sdl-instead/game.c
--- instead-1.9.0/src/sdl-instead/game.c	2013-03-26 11:55:08.000000000 +0400
+++ instead-1.9.0-canoo/src/sdl-instead/game.c	2013-03-26 12:00:24.000000000 +0400
@@ -3332,7 +3332,7 @@
 				mouse_reset(1);
 				game_menu(menu_askquit);
 #endif
-			} else if ((alt_pressed | control_pressed) && (!is_key(&ev, "q") || !is_key(&ev, "f4"))) {
+			} else if (!is_key(&ev, "quit") || ((alt_pressed | control_pressed) && (!is_key(&ev, "q") || !is_key(&ev, "f4")))) {
 				break;
 			} else if (alt_pressed &&
 				(!is_key(&ev, "enter") || !is_key(&ev, "return"))) {
diff -Nur instead-1.9.0/src/sdl-instead/graphics.c instead-1.9.0-canoo/src/sdl-instead/graphics.c
--- instead-1.9.0/src/sdl-instead/graphics.c	2013-03-26 11:55:08.000000000 +0400
+++ instead-1.9.0-canoo/src/sdl-instead/graphics.c	2013-03-26 12:05:44.000000000 +0400
@@ -1649,15 +1649,22 @@
 #else
 int gfx_set_mode(int w, int h, int fs)
 {
+	int maxbpp = 32;
 	int hw = (software_sw)?0:SDL_HWSURFACE;
 	SDL_Surface *scr;
 	if (gfx_width == w && gfx_height == h && gfx_fs == fs)
 		return 0; /* already done */
+#ifdef CAANOO
+	maxbpp = 16;
+#endif
 	vid_modes = NULL;
 	gfx_fs = fs;
 	gfx_width = w;
 	gfx_height = h;
 	SDL_ShowCursor(SDL_DISABLE);
+#ifdef CAANOO
+ 	screen = SDL_SetVideoMode(gfx_width, gfx_height, maxbpp, ((gfx_fs)?SDL_HWSURFACE:0) | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+#else
 #ifdef S60
 	scr = SDL_SetVideoMode(gfx_width, gfx_height, 0, SDL_ANYFORMAT | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
 #else
@@ -1668,15 +1675,15 @@
 	scr = SDL_SetVideoMode(gfx_width, gfx_height, 16, SDL_DOUBLEBUF | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
   #else
    #ifdef __APPLE__	
-	scr = SDL_SetVideoMode(gfx_width, gfx_height, (fs)?32:0, SDL_SWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+	scr = SDL_SetVideoMode(gfx_width, gfx_height, (fs)?maxbpp:0, SDL_SWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
 	if (scr == NULL) /* ok, fallback to anyformat */
 		scr = SDL_SetVideoMode(gfx_width, gfx_height, 0, SDL_ANYFORMAT | SDL_SWSURFACE | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
    #else
     #ifndef _WIN32_WCE
 	#if SDL_VERSION_ATLEAST(1,3,0)
-	scr = SDL_SetVideoMode(gfx_width, gfx_height, 32, SDL_DOUBLEBUF | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+	scr = SDL_SetVideoMode(gfx_width, gfx_height, maxbpp, SDL_DOUBLEBUF | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
 	#else
-	scr = SDL_SetVideoMode(gfx_width, gfx_height, (fs)?32:0, SDL_DOUBLEBUF | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
+	scr = SDL_SetVideoMode(gfx_width, gfx_height, (fs)?maxbpp:0, SDL_DOUBLEBUF | hw | ( ( fs ) ? SDL_FULLSCREEN : 0 ) );
 	#endif
 	if (scr == NULL) /* ok, fallback to anyformat */
     #endif
@@ -1685,6 +1692,7 @@
   #endif
  #endif
 #endif
+#endif
 	screen = GFX_IMG(scr);
 	if (scr == NULL || screen == NULL) {
 		fprintf(stderr, "Unable to set %dx%d video: %s\n", w, h, SDL_GetError());
@@ -4746,7 +4754,7 @@
 
 int gfx_init(void)
 {
-	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) {
+	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK) < 0) {
 		fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
 		return -1;
 	}
diff -Nur instead-1.9.0/src/sdl-instead/input.c instead-1.9.0-canoo/src/sdl-instead/input.c
--- instead-1.9.0/src/sdl-instead/input.c	2013-03-26 11:55:08.000000000 +0400
+++ instead-1.9.0-canoo/src/sdl-instead/input.c	2013-03-26 12:10:26.000000000 +0400
@@ -30,6 +30,41 @@
 }
 #endif
 
+#ifdef CAANOO
+static const char *joy_map(int button)
+{
+	switch(button) {
+	case 2:
+		return "left";
+	case 6:
+		return "right";
+	case 0:
+		return "up";
+	case 4:
+		return "down";
+	case 15:
+		return "space"; //y
+	case 14:
+		return "tab"; //x
+	case 12:
+		return "escape"; // a
+	case 18:
+	case 13:
+		return "return"; // b
+	case 8:
+		return "quit";
+	case 10:
+		return "page up";
+	case 11:
+		return "page down";
+	case 9:
+	case 20:
+		return "f1";
+	}
+	return "";
+}
+#endif
+
 int minimized(void)
 {
 	if (nopause_sw)
@@ -74,6 +109,10 @@
 	SDL_EnableKeyRepeat(500, 30);
 #endif
 	m_focus = !!(SDL_GetAppState() & SDL_APPMOUSEFOCUS);
+	if(SDL_NumJoysticks() > 0) {
+		SDL_JoystickOpen(0);
+		SDL_JoystickEventState(SDL_ENABLE);
+	}
 	return 0;
 }
 
@@ -188,6 +227,20 @@
 	case SDL_QUIT:
 		game_running = 0;
 		return -1;
+#ifdef CAANOO
+	case SDL_JOYBUTTONDOWN:
+		inp->type = KEY_DOWN;
+		inp->code = event.jbutton.button;
+		strncpy(inp->sym, joy_map(event.jbutton.button), sizeof(inp->sym));
+		inp->sym[sizeof(inp->sym) - 1] = 0;
+		break;
+	case SDL_JOYBUTTONUP:
+		inp->type = KEY_UP;
+		inp->code = event.jbutton.button;
+		strncpy(inp->sym, joy_map(event.jbutton.button), sizeof(inp->sym));
+		inp->sym[sizeof(inp->sym) - 1] = 0;
+		break;
+#endif
 	case SDL_KEYDOWN:	//A key has been pressed
 		inp->type = KEY_DOWN; 
 		inp->code = event.key.keysym.scancode;
diff -Nur instead-1.9.0/src/sdl-instead/sound.c instead-1.9.0-canoo/src/sdl-instead/sound.c
--- instead-1.9.0/src/sdl-instead/sound.c	2013-03-13 19:39:07.000000000 +0400
+++ instead-1.9.0-canoo/src/sdl-instead/sound.c	2013-03-26 12:00:24.000000000 +0400
@@ -1,8 +1,9 @@
+#include <SDL.h>
+#include <SDL_mixer.h>
+
 #include "externals.h"
 #include "internals.h"
 
-#include <SDL.h>
-#include <SDL_mixer.h>
 #include "sdl_idf.h"
 
 #ifdef S60
