summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/SOURCES2
-rw-r--r--apps/keymaps/keymap-e200.c252
-rw-r--r--apps/plugins/SOURCES14
-rw-r--r--apps/plugins/battery_bench.c4
-rw-r--r--apps/plugins/bounce.c6
-rw-r--r--apps/plugins/brickmania.c9
-rwxr-xr-xapps/plugins/bubbles.c10
-rw-r--r--apps/plugins/calculator.c9
-rw-r--r--apps/plugins/chessbox/chessbox.c11
-rw-r--r--apps/plugins/chessclock.c10
-rw-r--r--apps/plugins/chip8.c8
-rw-r--r--apps/plugins/clock.c20
-rw-r--r--apps/plugins/cube.c14
-rw-r--r--apps/plugins/databox/databox.c3
-rw-r--r--apps/plugins/demystify.c6
-rw-r--r--apps/plugins/dice.c9
-rw-r--r--apps/plugins/dict.c2
-rw-r--r--apps/plugins/disktidy.c9
-rw-r--r--apps/plugins/doom/i_video.c15
-rw-r--r--apps/plugins/fire.c7
-rw-r--r--apps/plugins/flipit.c10
-rw-r--r--apps/plugins/jewels.c8
-rw-r--r--apps/plugins/jpeg.c12
-rw-r--r--apps/plugins/logo.c8
-rw-r--r--apps/plugins/mandelbrot.c12
-rw-r--r--apps/plugins/metronome.c9
-rw-r--r--apps/plugins/midiplay.c7
-rw-r--r--apps/plugins/minesweeper.c13
-rw-r--r--apps/plugins/mosaique.c5
-rw-r--r--apps/plugins/mp3_encoder.c5
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c5
-rw-r--r--apps/plugins/oscilloscope.c11
-rw-r--r--apps/plugins/pacbox/pacbox.h11
-rw-r--r--apps/plugins/plasma.c8
-rw-r--r--apps/plugins/pong.c8
-rw-r--r--apps/plugins/random_folder_advance_config.c2
-rw-r--r--apps/plugins/rockblox.c11
-rw-r--r--apps/plugins/rockpaint.c11
-rw-r--r--apps/plugins/sliding_puzzle.c7
-rw-r--r--apps/plugins/snake.c6
-rw-r--r--apps/plugins/snake2.c12
-rw-r--r--apps/plugins/snow.c2
-rw-r--r--apps/plugins/sokoban.c10
-rw-r--r--apps/plugins/solitaire.c21
-rwxr-xr-xapps/plugins/spacerocks.c13
-rw-r--r--apps/plugins/star.c13
-rw-r--r--apps/plugins/starfield.c7
-rw-r--r--apps/plugins/stats.c3
-rw-r--r--apps/plugins/stopwatch.c7
-rw-r--r--apps/plugins/sudoku/SOURCES2
-rw-r--r--apps/plugins/sudoku/sudoku.c3
-rw-r--r--apps/plugins/sudoku/sudoku.h10
-rw-r--r--apps/plugins/viewer.c10
-rw-r--r--apps/plugins/vu_meter.c11
-rw-r--r--apps/plugins/wormlet.c15
-rw-r--r--apps/plugins/xobox.c11
-rw-r--r--apps/plugins/zxbox/keymaps.h8
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c11
-rw-r--r--docs/CREDITS1
-rw-r--r--firmware/SOURCES2
-rw-r--r--uisimulator/sdl/UI-e200.bmpbin0 -> 522133 bytes
-rw-r--r--uisimulator/sdl/button.c12
-rw-r--r--uisimulator/sdl/uisdl.h10
63 files changed, 772 insertions, 11 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 570ec6e24a..e1d8e7bbdd 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -107,4 +107,6 @@ keymaps/keymap-gigabeat.c
keymaps/keymap-h10.c
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
keymaps/keymap-ifp7xx.c
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+keymaps/keymap-e200.c
#endif
diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c
new file mode 100644
index 0000000000..1c90e46592
--- /dev/null
+++ b/apps/keymaps/keymap-e200.c
@@ -0,0 +1,252 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) Barry Wardell 2006
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/* Button Code Definitions for iriver H10 target */
+
+#include "config.h"
+#include "action.h"
+#include "button.h"
+#include "settings.h"
+
+/* {Action Code, Button code, Prereq button code } */
+
+/*
+ * The format of the list is as follows
+ * { Action Code, Button code, Prereq button code }
+ * if there's no need to check the previous button's value, use BUTTON_NONE
+ * Insert LAST_ITEM_IN_LIST at the end of each mapping
+ */
+const struct button_mapping button_context_standard[] = {
+ { ACTION_STD_PREV, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_STD_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+
+ /* TODO: this is a bit of a hack so that we can exit some debug screens
+ * (audio, tagcache, dircache, hwinfo, stack, ports). They don't like it
+ * when ACTION_STD_CANCEL has anything other than BUTTON_NONE for prereq.
+ */
+ { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+}; /* button_context_standard */
+
+const struct button_mapping button_context_wps[] = {
+ { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_WPS_STOP, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
+ { ACTION_WPS_SKIPPREV, BUTTON_UP|BUTTON_REL, BUTTON_UP},
+ { ACTION_WPS_SEEKBACK, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_UP|BUTTON_REL, BUTTON_UP|BUTTON_REPEAT },
+ { ACTION_WPS_SKIPNEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+ { ACTION_WPS_SEEKFWD, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN|BUTTON_REPEAT },
+
+ { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_POWER|BUTTON_DOWN, BUTTON_POWER },
+ { ACTION_WPS_ABSETA_PREVDIR, BUTTON_POWER|BUTTON_UP, BUTTON_POWER },
+ { ACTION_WPSAB_RESET, BUTTON_POWER|BUTTON_SELECT, BUTTON_POWER },
+
+ { ACTION_WPS_VOLDOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLDOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_WPS_BROWSE, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_WPS_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_WPS_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_WPS_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_LEFT, BUTTON_SELECT },
+ { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST
+}; /* button_context_wps */
+
+const struct button_mapping button_context_settings[] = {
+ { ACTION_SETTINGS_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT,BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT,BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_settings */
+
+const struct button_mapping button_context_list[] = {
+ { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_list */
+
+const struct button_mapping button_context_tree[] = {
+ { ACTION_TREE_WPS, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_TREE_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
+}; /* button_context_tree */
+
+const struct button_mapping button_context_listtree_scroll_without_combo[] = {
+ { ACTION_TREE_ROOT_INIT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_TREE_PGLEFT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
+}; /* button_context_listtree_scroll_without_combo */
+
+const struct button_mapping button_context_listtree_scroll_with_combo[] = {
+ { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
+ { ACTION_TREE_PGLEFT, BUTTON_UP|BUTTON_SELECT, BUTTON_SELECT },
+ { ACTION_TREE_PGLEFT, BUTTON_UP|BUTTON_REL, BUTTON_UP|BUTTON_SELECT },
+ { ACTION_TREE_PGLEFT, BUTTON_UP|BUTTON_SELECT, BUTTON_UP|BUTTON_REL },
+ { ACTION_TREE_ROOT_INIT, BUTTON_UP|BUTTON_SELECT|BUTTON_REPEAT, BUTTON_UP|BUTTON_SELECT },
+ { ACTION_TREE_PGLEFT, BUTTON_UP|BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_DOWN|BUTTON_SELECT, BUTTON_SELECT },
+ { ACTION_TREE_PGRIGHT, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN|BUTTON_SELECT },
+ { ACTION_TREE_PGRIGHT, BUTTON_DOWN|BUTTON_SELECT, BUTTON_DOWN|BUTTON_REL },
+ { ACTION_TREE_PGRIGHT, BUTTON_DOWN|BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
+}; /* button_context_listtree_scroll_with_combo */
+
+const struct button_mapping button_context_yesno[] = {
+ { ACTION_YESNO_ACCEPT, BUTTON_RIGHT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_settings_yesno */
+
+const struct button_mapping button_context_quickscreen[] = {
+ { ACTION_QS_DOWNINV, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_QS_DOWNINV, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_UP, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_quickscreen */
+
+const struct button_mapping button_context_settings_right_is_inc[] = {
+ { ACTION_SETTINGS_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_settings_right_is_inc */
+
+const struct button_mapping button_context_pitchscreen[] = {
+ { ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_PS_INC_BIG, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_DEC_SMALL, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_PS_DEC_BIG, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFT, BUTTON_UP, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFTOFF, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_PS_EXIT, BUTTON_LEFT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_pitchscreen */
+
+const struct button_mapping button_context_keyboard[] = {
+ { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_UP|BUTTON_REL, BUTTON_UP },
+ { ACTION_KBD_DONE, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_KBD_ABORT, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+}; /* button_context_keyboard */
+
+const struct button_mapping button_context_bmark[] = {
+ { ACTION_BMS_DELETE, BUTTON_UP, BUTTON_NONE },
+ { ACTION_BMS_SELECT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_BMS_EXIT, BUTTON_LEFT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_bmark */
+
+/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
+const struct button_mapping* get_context_mapping(int context)
+{
+ switch (context)
+ {
+ case CONTEXT_STD:
+ case CONTEXT_MAINMENU:
+ return button_context_standard;
+
+ case CONTEXT_WPS:
+ return button_context_wps;
+
+ case CONTEXT_LIST:
+ return button_context_list;
+ case CONTEXT_TREE:
+ if (global_settings.hold_lr_for_scroll_in_list)
+ return button_context_listtree_scroll_without_combo;
+ else
+ return button_context_listtree_scroll_with_combo;
+ case CONTEXT_CUSTOM|CONTEXT_TREE:
+ return button_context_tree;
+
+ case CONTEXT_SETTINGS:
+ return button_context_settings;
+ case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
+ case CONTEXT_SETTINGS_COLOURCHOOSER:
+ case CONTEXT_SETTINGS_EQ:
+ case CONTEXT_SETTINGS_TIME:
+ return button_context_settings_right_is_inc;
+
+ case CONTEXT_YESNOSCREEN:
+ return button_context_yesno;
+ case CONTEXT_BOOKMARKSCREEN:
+ return button_context_bmark;
+ case CONTEXT_QUICKSCREEN:
+ return button_context_quickscreen;
+ case CONTEXT_PITCHSCREEN:
+ return button_context_pitchscreen;
+ case CONTEXT_KEYBOARD:
+ return button_context_keyboard;
+
+ default:
+ return button_context_standard;
+ }
+ return button_context_standard;
+}
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index dbad16ae2d..edc8f9f9c2 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -10,7 +10,7 @@ logo.c
metronome.c
mosaique.c
random_folder_advance_config.c
-#if (LCD_WIDTH != 240) && ((LCD_WIDTH != 128) || (LCD_HEIGHT != 64))
+#if (LCD_WIDTH != 240) && ((LCD_WIDTH != 128) || (LCD_HEIGHT != 64)) && !defined(SANSA_E200)
rockblox.c
#endif
rockbox_flash.c
@@ -41,16 +41,20 @@ mandelbrot.c
plasma.c
bounce.c
+#ifndef SANSA_E200
bubbles.c
+#endif
-#if LCD_WIDTH != 128
+#if LCD_WIDTH != 128 && !defined(SANSA_E200)
/* These need adjusting for the iRiver if'p screen */
brickmania.c
#endif
calculator.c
chip8.c
demystify.c
+#ifndef SANSA_E200
jewels.c
+#endif
minesweeper.c
oscilloscope.c
pong.c
@@ -65,7 +69,7 @@ starfield.c
video.c
#endif
vu_meter.c
-#ifndef IRIVER_H10_5GB
+#if !defined(IRIVER_H10_5GB) && !defined(SANSA_E200)
wormlet.c
#endif
@@ -87,9 +91,9 @@ rockboy.c
#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)
xobox.c
#endif
-
+#if !defined(SANSA_E200)
spacerocks.c
-
+#endif
#if LCD_DEPTH >= 16
rockpaint.c
#endif
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 3c56f84309..75d5cbcabd 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -77,6 +77,10 @@ PLUGIN_HEADER
#define BATTERY_ON BUTTON_SELECT
#define BATTERY_OFF BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define BATTERY_ON BUTTON_SELECT
+#define BATTERY_OFF BUTTON_POWER
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define BATTERY_ON BUTTON_PLAY
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 151a61b07b..002c913d77 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -73,6 +73,12 @@ PLUGIN_HEADER
#define BOUNCE_QUIT BUTTON_A
#define BOUNCE_MODE BUTTON_POWER
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define BOUNCE_UP BUTTON_SCROLL_UP
+#define BOUNCE_DOWN BUTTON_SCROLL_DOWN
+#define BOUNCE_QUIT BUTTON_POWER
+#define BOUNCE_MODE BUTTON_SELECT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define BOUNCE_UP BUTTON_SCROLL_UP
#define BOUNCE_DOWN BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 106a0f9bf6..1b6de1c180 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -102,6 +102,15 @@ PLUGIN_HEADER
#define SCROLL_FWD(x) (0)
#define SCROLL_BACK(x) (0)
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
+#define QUIT BUTTON_POWER
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define SELECT BUTTON_SELECT
+#define UP BUTTON_SCROLL_UP
+#define DOWN BUTTON_SCROLL_DOWN
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD /* grayscale at the moment */
#define QUIT BUTTON_POWER
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index ae06c1e2a4..2afbaba011 100755
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -116,6 +116,16 @@ PLUGIN_HEADER
#define BUBBLES_SELECT BUTTON_UP
#define BUBBLES_RESUME BUTTON_DOWN
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define BUBBLES_LEFT BUTTON_LEFT
+#define BUBBLES_RIGHT BUTTON_RIGHT
+#define BUBBLES_UP BUTTON_SCROLL_UP
+#define BUBBLES_DOWN BUTTON_SCROLL_DOWN
+#define BUBBLES_QUIT BUTTON_POWER
+#define BUBBLES_START BUTTON_PLAY
+#define BUBBLES_SELECT BUTTON_SELECT
+#define BUBBLES_RESUME BUTTON_DOWN
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define BUBBLES_LEFT BUTTON_LEFT
#define BUBBLES_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 99404765bb..608af85938 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -166,6 +166,15 @@ PLUGIN_HEADER
#define CALCULATOR_CALC BUTTON_SELECT
#define CALCULATOR_CLEAR BUTTON_POWER
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define CALCULATOR_UP BUTTON_UP
+#define CALCULATOR_DOWN BUTTON_DOWN
+#define CALCULATOR_QUIT BUTTON_POWER
+#define CALCULATOR_INPUT_CALC_PRE BUTTON_SELECT
+#define CALCULATOR_INPUT (BUTTON_SELECT|BUTTON_REL)
+#define CALCULATOR_CALC BUTTON_SELECT
+#define CALCULATOR_CLEAR BUTTON_REC
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define CALCULATOR_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index aea89817e6..fdab570bc2 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -130,6 +130,17 @@ PLUGIN_HEADER
#define CB_RESTART (BUTTON_REW | BUTTON_PLAY)
#define CB_QUIT BUTTON_POWER
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define CB_SELECT BUTTON_SELECT
+#define CB_UP BUTTON_UP
+#define CB_DOWN BUTTON_DOWN
+#define CB_LEFT BUTTON_LEFT
+#define CB_RIGHT BUTTON_RIGHT
+#define CB_PLAY (BUTTON_SELECT | BUTTON_RIGHT)
+#define CB_LEVEL BUTTON_REC
+#define CB_RESTART (BUTTON_SELECT | BUTTON_REPEAT)
+#define CB_QUIT BUTTON_POWER
+
#else
#error CHESSBOX: Unsupported keypad
#endif
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index 2e2ad4cb7e..c0da728446 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -107,6 +107,16 @@ PLUGIN_HEADER
#define CHC_SETTINGS_OK BUTTON_MENU
#define CHC_SETTINGS_CANCEL BUTTON_A
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define CHC_QUIT BUTTON_POWER
+#define CHC_STARTSTOP BUTTON_SELECT
+#define CHC_RESET BUTTON_DOWN
+#define CHC_MENU BUTTON_UP
+#define CHC_SETTINGS_INC BUTTON_RIGHT
+#define CHC_SETTINGS_DEC BUTTON_LEFT
+#define CHC_SETTINGS_OK BUTTON_SELECT
+#define CHC_SETTINGS_CANCEL BUTTON_POWER
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define CHC_QUIT BUTTON_POWER
#define CHC_STARTSTOP BUTTON_PLAY
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index 09dcad5fd0..6c6c9f44b6 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1003,6 +1003,14 @@ STATIC void chip8 (void)
#define CHIP8_KEY6 BUTTON_RIGHT
#define CHIP8_KEY8 BUTTON_DOWN
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define CHIP8_OFF BUTTON_POWER
+#define CHIP8_KEY2 BUTTON_SCROLL_UP
+#define CHIP8_KEY4 BUTTON_LEFT
+#define CHIP8_KEY5 BUTTON_SELECT
+#define CHIP8_KEY6 BUTTON_RIGHT
+#define CHIP8_KEY8 BUTTON_SCROLL_DOWN
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define CHIP8_OFF BUTTON_POWER
#define CHIP8_KEY2 BUTTON_SCROLL_UP
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c
index ff07e44e0c..2bf6a59da3 100644
--- a/apps/plugins/clock.c
+++ b/apps/plugins/clock.c
@@ -182,6 +182,26 @@ PLUGIN_HEADER
#define MENU_BUTTON_TEXT "SELECT"
#define COUNTER_BUTTON_TEXT "PLAY"
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+
+#define COUNTER_TOGGLE_BUTTON BUTTON_UP
+#define COUNTER_RESET_BUTTON BUTTON_DOWN
+#define MENU_BUTTON BUTTON_SELECT
+#define EXIT_BUTTON BUTTON_POWER
+#define MOVE_UP_BUTTON BUTTON_SCROLL_UP
+#define MOVE_DOWN_BUTTON BUTTON_SCROLL_DOWN
+#define CHANGE_UP_BUTTON BUTTON_RIGHT
+#define CHANGE_DOWN_BUTTON BUTTON_LEFT
+
+#define YESTEXT "Select"
+#define NAVI_BUTTON_TEXT_LEFT "LEFT"
+#define NAVI_BUTTON_TEXT_RIGHT "RIGHT"
+#define EXIT_BUTTON_TEXT "POWER"
+#define MENU_BUTTON_TEXT "PLAY"
+#define COUNTER_BUTTON_TEXT "PLAY"
+
+
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define COUNTER_TOGGLE_BUTTON (BUTTON_PLAY|BUTTON_REL)
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 38b0233b86..1dd981bb56 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -135,6 +135,20 @@ PLUGIN_HEADER
#define CUBE_PAUSE (BUTTON_SELECT | BUTTON_REL)
#define CUBE_HIGHSPEED (BUTTON_POWER | BUTTON_REL)
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define CUBE_QUIT BUTTON_POWER
+#define CUBE_X_INC BUTTON_LEFT
+#define CUBE_X_DEC BUTTON_RIGHT
+#define CUBE_Y_INC BUTTON_SCROLL_UP
+#define CUBE_Y_DEC BUTTON_SCROLL_DOWN
+#define CUBE_Z_INC BUTTON_UP
+#define CUBE_Z_DEC BUTTON_DOWN
+#define CUBE_MODE_PRE BUTTON_SELECT
+#define CUBE_MODE (BUTTON_SELECT|BUTTON_REPEAT)
+#define CUBE_PAUSE_PRE BUTTON_SELECT
+#define CUBE_PAUSE (BUTTON_SELECT|BUTTON_REL)
+#define CUBE_HIGHSPEED BUTTON_REC
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define CUBE_QUIT BUTTON_POWER
#define CUBE_X_INC BUTTON_LEFT
diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c
index 194ad66b51..25836a7f07 100644
--- a/apps/plugins/databox/databox.c
+++ b/apps/plugins/databox/databox.c
@@ -50,6 +50,9 @@ PLUGIN_HEADER
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define DBX_SELECT BUTTON_REW
#define DBX_STOP BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define DBX_SELECT BUTTON_SELECT
+#define DBX_STOP BUTTON_POWER
#endif
#define MAX_TOKENS 70
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index da3edeeb1b..55897441f9 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -33,6 +33,12 @@ PLUGIN_HEADER
#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_FWD
#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_BACK
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define DEMYSTIFY_QUIT BUTTON_POWER
+#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
+#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
+#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_UP
+#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_DOWN
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define DEMYSTIFY_QUIT BUTTON_POWER
#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 8351498aad..99c88f431d 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -125,6 +125,15 @@ use stop to exit
#define DICE_BUTTON_ON BUTTON_POWER
#define DICE_BUTTON_OFF BUTTON_A
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define DICE_BUTTON_UP BUTTON_SCROLL_UP
+#define DICE_BUTTON_DOWN BUTTON_SCROLL_DOWN
+#define DICE_BUTTON_LEFT BUTTON_LEFT
+#define DICE_BUTTON_RIGHT BUTTON_RIGHT
+#define DICE_BUTTON_SELECT BUTTON_SELECT
+#define DICE_BUTTON_ON BUTTON_UP
+#define DICE_BUTTON_OFF BUTTON_POWER
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define DICE_BUTTON_UP BUTTON_SCROLL_UP
#define DICE_BUTTON_DOWN BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c
index 31c1b6363e..1a0cbaab5b 100644
--- a/apps/plugins/dict.c
+++ b/apps/plugins/dict.c
@@ -113,6 +113,8 @@ long reverse (long N) {
#define LP_QUIT BUTTON_POWER
#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define LP_QUIT BUTTON_A
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define LP_QUIT BUTTON_POWER
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define LP_QUIT BUTTON_POWER
#else
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index e8d6385cbe..7af75f545b 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -83,6 +83,12 @@ enum tidy_system
#define TIDY_LEFT BUTTON_LEFT
#define TIDY_RIGHT BUTTON_RIGHT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define TIDY_DO BUTTON_SELECT
+#define TIDY_STOP BUTTON_POWER
+#define TIDY_LEFT BUTTON_LEFT
+#define TIDY_RIGHT BUTTON_RIGHT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define TIDY_DO BUTTON_PLAY
#define TIDY_STOP BUTTON_POWER
@@ -383,6 +389,9 @@ void tidy_lcd_menu(enum tidy_system system)
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
rb->lcd_puts(0, 0, "[Play] to clean up");
rb->lcd_puts(0, 1, "[Power] to exit/abort");
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+ rb->lcd_puts(0, 0, "[Select] to clean up");
+ rb->lcd_puts(0, 1, "[Power] to exit/abort");
#else
#error DISKTIDY: Unsupported model
#endif
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index 1fd56a335f..0e9d20f8cf 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -16,7 +16,10 @@
* GNU General Public License for more details.
*
* $Log$
- * Revision 1.24 2006/09/05 00:23:06 barrywardell
+ * Revision 1.25 2006/10/26 13:38:04 barrywardell
+ * Allow the Sansa e200 UI simulator to be built. Thanks to Andre Smith for the nice image of the Sansa. Lots more to be done including testing and tweaking the keymaps and modifying the plugins for the Sansa's 176x220 LCD.
+ *
+ * Revision 1.24 2006-09-05 00:23:06 barrywardell
* Fix not being able to exit Doom on the H10.
*
* Revision 1.23 2006-08-10 18:34:43 amiconn
@@ -171,6 +174,16 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_ESC BUTTON_POWER
#define DOOMBUTTON_ENTER BUTTON_REW
#define DOOMBUTTON_WEAPON BUTTON_FF
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define DOOMBUTTON_UP BUTTON_UP
+#define DOOMBUTTON_DOWN BUTTON_DOWN
+#define DOOMBUTTON_LEFT BUTTON_LEFT
+#define DOOMBUTTON_RIGHT BUTTON_RIGHT
+#define DOOMBUTTON_SHOOT BUTTON_SELECT
+#define DOOMBUTTON_OPEN BUTTON_REC
+#define DOOMBUTTON_ESC BUTTON_POWER
+#define DOOMBUTTON_ENTER BUTTON_SCROLL_UP
+#define DOOMBUTTON_WEAPON BUTTON_SCROLL_DOWN
#else
#define DOOMBUTTON_UP BUTTON_UP
#define DOOMBUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index d161f577f5..df46eb918e 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -87,6 +87,13 @@ static unsigned char draw_buffer[8*LCD_WIDTH];
#define FIRE_INCREASE_MULT BUTTON_UP
#define FIRE_DECREASE_MULT BUTTON_DOWN
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define FIRE_QUIT BUTTON_POWER
+#define FIRE_SWITCH_FLAMES_TYPE BUTTON_LEFT
+#define FIRE_SWITCH_FLAMES_MOVING BUTTON_RIGHT
+#define FIRE_INCREASE_MULT BUTTON_UP
+#define FIRE_DECREASE_MULT BUTTON_DOWN
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define FIRE_QUIT BUTTON_POWER
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_LEFT
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 5e793a665f..0712e32563 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -97,6 +97,16 @@ PLUGIN_HEADER
#define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_UP)
#define FLIPIT_TOGGLE BUTTON_MENU
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
+#define FLIPIT_UP BUTTON_UP
+#define FLIPIT_DOWN BUTTON_DOWN
+#define FLIPIT_QUIT BUTTON_POWER
+#define FLIPIT_SHUFFLE (BUTTON_REC | BUTTON_LEFT)
+#define FLIPIT_SOLVE (BUTTON_REC | BUTTON_RIGHT)
+#define FLIPIT_STEP_BY_STEP (BUTTON_REC | BUTTON_SELECT)
+#define FLIPIT_TOGGLE BUTTON_SELECT
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define FLIPIT_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 11a33a4395..90544202a6 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -86,6 +86,14 @@ PLUGIN_HEADER
#define JEWELS_SELECT BUTTON_SELECT
#define JEWELS_CANCEL BUTTON_A
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define JEWELS_UP BUTTON_UP
+#define JEWELS_DOWN BUTTON_DOWN
+#define JEWELS_LEFT BUTTON_LEFT
+#define JEWELS_RIGHT BUTTON_RIGHT
+#define JEWELS_SELECT BUTTON_SELECT
+#define JEWELS_CANCEL BUTTON_POWER
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define JEWELS_UP BUTTON_SCROLL_UP
#define JEWELS_DOWN BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 716599aec1..12574237b3 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -111,6 +111,18 @@ PLUGIN_HEADER
#define JPEG_NEXT (BUTTON_POWER | BUTTON_RIGHT)
#define JPEG_PREVIOUS (BUTTON_POWER | BUTTON_LEFT)
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define JPEG_ZOOM_PRE BUTTON_SELECT
+#define JPEG_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
+#define JPEG_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
+#define JPEG_UP BUTTON_UP
+#define JPEG_DOWN BUTTON_DOWN
+#define JPEG_LEFT BUTTON_LEFT
+#define JPEG_RIGHT BUTTON_RIGHT
+#define JPEG_MENU BUTTON_REC
+#define JPEG_NEXT BUTTON_SCROLL_DOWN
+#define JPEG_PREVIOUS BUTTON_SCROLL_UP
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define JPEG_ZOOM_PRE BUTTON_PLAY
#define JPEG_ZOOM_IN (BUTTON_PLAY | BUTTON_REL)
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index 34696073dd..251c6cb259 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -208,6 +208,14 @@ const unsigned char rockbox16x7[] = {
#define LP_INC_X BUTTON_RIGHT
#define LP_DEC_Y BUTTON_DOWN
#define LP_INC_Y BUTTON_UP
+
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define LP_QUIT BUTTON_POWER
+#define LP_DEC_X BUTTON_LEFT
+#define LP_INC_X BUTTON_RIGHT
+#define LP_DEC_Y BUTTON_DOWN
+#define LP_INC_Y BUTTON_UP
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define LP_QUIT BUTTON_POWER
#define LP_DEC_X BUTTON_LEFT
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index ba0235b406..4c7c4bbc9b 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -107,6 +107,18 @@ PLUGIN_HEADER
#define MANDELBROT_MAXITER_DEC (BUTTON_POWER | BUTTON_LEFT)
#define MANDELBROT_RESET BUTTON_SELECT
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define MANDELBROT_QUIT BUTTON_POWER
+#define MANDELBROT_UP BUTTON_UP
+#define MANDELBROT_DOWN BUTTON_DOWN
+#define MANDELBROT_LEFT BUTTON_LEFT
+#define MANDELBROT_RIGHT BUTTON_RIGHT
+#define MANDELBROT_ZOOM_IN BUTTON_SCROLL_DOWN
+#define MANDELBROT_ZOOM_OUT BUTTON_SCROLL_UP
+#define MANDELBROT_MAXITER_INC (BUTTON_SELECT | BUTTON_RIGHT)
+#define MANDELBROT_MAXITER_DEC (BUTTON_SELECT | BUTTON_LEFT)
+#define MANDELBROT_RESET BUTTON_REC
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define MANDELBROT_QUIT BUTTON_POWER
#define MANDELBROT_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index 5e83fca119..19150bad60 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -94,6 +94,15 @@ PLUGIN_HEADER
#define METRONOME_R_VOL_DOWN BUTTON_RC_VOL_DOWN
#define METRONOME_R_TAP BUTTON_RC_BITRATE
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define METRONOME_QUIT BUTTON_POWER
+#define METRONOME_PLAYPAUSE BUTTON_UP
+#define METRONOME_VOL_UP BUTTON_SCROLL_UP
+#define METRONOME_VOL_DOWN BUTTON_SCROLL_DOWN
+#define METRONOME_TAP BUTTON_SELECT
+#define METRONOME_MSG_START "press play"
+#define METRONOME_MSG_STOP "press pause"
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define METRONOME_QUIT BUTTON_POWER
#define METRONOME_PLAYPAUSE BUTTON_PLAY
diff --git a/apps/plugins/midiplay.c b/apps/plugins/midiplay.c
index e0b89cf860..585c7eec25 100644
--- a/apps/plugins/midiplay.c
+++ b/apps/plugins/midiplay.c
@@ -54,6 +54,13 @@ PLUGIN_HEADER
#define BTN_UP BUTTON_VOL_UP
#define BTN_DOWN BUTTON_VOL_DOWN
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define BTN_QUIT BUTTON_POWER
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+
+
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define BTN_QUIT BUTTON_POWER
#define BTN_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c
index fb59865ee4..fe24e44a77 100644
--- a/apps/plugins/minesweeper.c
+++ b/apps/plugins/minesweeper.c
@@ -105,6 +105,17 @@ enum minesweeper_status {
# define MINESWP_RIGHT (BUTTON_SELECT | BUTTON_RIGHT)
# define MINESWP_LEFT (BUTTON_SELECT | BUTTON_LEFT)
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+# define MINESWP_UP BUTTON_UP
+# define MINESWP_DOWN BUTTON_DOWN
+# define MINESWP_QUIT BUTTON_POWER
+# define MINESWP_START BUTTON_SELECT
+# define MINESWP_TOGGLE BUTTON_REC
+# define MINESWP_DISCOVER BUTTON_SELECT
+# define MINESWP_INFO (BUTTON_REC|BUTTON_REPEAT)
+# define MINESWP_RIGHT (BUTTON_SELECT | BUTTON_RIGHT)
+# define MINESWP_LEFT (BUTTON_SELECT | BUTTON_LEFT)
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
# define MINESWP_UP BUTTON_SCROLL_UP
# define MINESWP_DOWN BUTTON_SCROLL_DOWN
@@ -424,6 +435,8 @@ enum minesweeper_status menu( void )
"REC to start"
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
"FF to start"
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+ "SELECT to start"
#else
""
# warning Please define help string for this keypad.
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index b951fdc8b3..b5f8594c4f 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -85,6 +85,11 @@ PLUGIN_HEADER
#define MOSAIQUE_SPEED BUTTON_MENU
#define MOSAIQUE_RESTART BUTTON_SELECT
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define MOSAIQUE_QUIT BUTTON_POWER
+#define MOSAIQUE_SPEED BUTTON_DOWN
+#define MOSAIQUE_RESTART BUTTON_SELECT
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define MOSAIQUE_QUIT BUTTON_POWER
#define MOSAIQUE_SPEED BUTTON_FF
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index d1eef7b23b..6d66111d16 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -2348,6 +2348,11 @@ void get_mp3_filename(char *wav_name)
#define MP3ENC_NEXT BUTTON_DOWN
#define MP3ENC_DONE BUTTON_A
#define MP3ENC_SELECT BUTTON_SELECT
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define MP3ENC_PREV BUTTON_UP
+#define MP3ENC_NEXT BUTTON_DOWN
+#define MP3ENC_DONE BUTTON_POWER
+#define MP3ENC_SELECT BUTTON_SELECT
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define MP3ENC_PREV BUTTON_SCROLL_UP
#define MP3ENC_NEXT BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 67569a7e1c..3e9dd48b40 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -71,6 +71,11 @@ static int total_offset = 0;
#define MPEG_STOP BUTTON_POWER
#define MPEG_PAUSE BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define MPEG_MENU BUTTON_SELECT
+#define MPEG_STOP BUTTON_POWER
+#define MPEG_PAUSE BUTTON_UP
+
#else
#error MPEGPLAYER: Unsupported keypad
#endif
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 7f212bf690..7df43e7271 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -85,6 +85,17 @@ PLUGIN_HEADER
#define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP
#define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define OSCILLOSCOPE_QUIT BUTTON_POWER
+#define OSCILLOSCOPE_DRAWMODE BUTTON_SELECT
+#define OSCILLOSCOPE_ADVMODE BUTTON_DOWN
+#define OSCILLOSCOPE_ORIENTATION BUTTON_UP
+#define OSCILLOSCOPE_PAUSE BUTTON_REC
+#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT
+#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT
+#define OSCILLOSCOPE_VOL_UP BUTTON_SCROLL_UP
+#define OSCILLOSCOPE_VOL_DOWN BUTTON_SCROLL_DOWN
+
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define OSCILLOSCOPE_QUIT BUTTON_POWER
#define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_SELECT
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
index f6816082ef..863f9b246b 100644
--- a/apps/plugins/pacbox/pacbox.h
+++ b/apps/plugins/pacbox/pacbox.h
@@ -87,6 +87,17 @@
#define PACMAN_COIN BUTTON_REC
#define PACMAN_MENU BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
+#define PACMAN_UP BUTTON_UP
+#define PACMAN_DOWN BUTTON_DOWN
+#define PACMAN_LEFT BUTTON_LEFT
+#define PACMAN_RIGHT BUTTON_RIGHT
+#define PACMAN_1UP BUTTON_SELECT
+#define PACMAN_2UP BUTTON_POWER
+#define PACMAN_COIN BUTTON_REC
+#define PACMAN_MENU (BUTTON_SELECT|BUTTON_REPEAT)
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#if defined(IRIVER_H10_5GB)
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c
index 77c489f2ae..c48235ecf8 100644
--- a/apps/plugins/plasma.c
+++ b/apps/plugins/plasma.c
@@ -59,6 +59,12 @@ static int plasma_frequency;
#define PLASMA_QUIT BUTTON_A
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
+
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define PLASMA_QUIT BUTTON_POWER
+#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
+#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
+
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define PLASMA_QUIT BUTTON_POWER
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
@@ -81,6 +87,8 @@ static int plasma_frequency;
#define PLASMA_REGEN_COLORS BUTTON_PLAY
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define PLASMA_REGEN_COLORS BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define PLASMA_REGEN_COLORS BUTTON_SELECT
#elif CONFIG_KEYPAD == IPOD_4G_PAD
#define PLASMA_REGEN_COLORS BUTTON_SELECT
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index ef7f2f672e..5da61f5947 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -91,6 +91,14 @@ PLUGIN_HEADER
#define PONG_RIGHT_UP BUTTON_POWER
#define PONG_RIGHT_DOWN BUTTON_MENU
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define PONG_QUIT BUTTON_POWER
+#define PONG_PAUSE BUTTON_SELECT
+#define PONG_LEFT_UP BUTTON_LEFT
+#define PONG_LEFT_DOWN BUTTON_DOWN
+#define PONG_RIGHT_UP BUTTON_UP
+#define PONG_RIGHT_DOWN BUTTON_RIGHT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define PONG_QUIT BUTTON_POWER
#define PONG_LEFT_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index adf115c909..7d055c4172 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -50,6 +50,8 @@ struct file_format *list = NULL;
#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#endif
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index a3f5b16d52..a9fd89db16 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -96,6 +96,17 @@ PLUGIN_HEADER
#define ROCKBLOX_DROP BUTTON_REC
#define ROCKBLOX_RESTART BUTTON_PLAY
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
+#define ROCKBLOX_OFF BUTTON_POWER
+#define ROCKBLOX_ROTATE_RIGHT BUTTON_SCROLL_UP
+#define ROCKBLOX_ROTATE_LEFT BUTTON_SCROLL_DOWN
+#define ROCKBLOX_DOWN BUTTON_DOWN
+#define ROCKBLOX_LEFT BUTTON_LEFT
+#define ROCKBLOX_RIGHT BUTTON_RIGHT
+#define ROCKBLOX_DROP BUTTON_SELECT
+#define ROCKBLOX_RESTART BUTTON_REC
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define ROCKBLOX_OFF BUTTON_POWER
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 73927ed83d..8fd75755d6 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -81,6 +81,17 @@ PLUGIN_HEADER
#define ROCKPAINT_LEFT BUTTON_LEFT
#define ROCKPAINT_RIGHT BUTTON_RIGHT
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define ROCKPAINT_QUIT BUTTON_POWER
+#define ROCKPAINT_DRAW BUTTON_SELECT
+#define ROCKPAINT_MENU ( BUTTON_SELECT | BUTTON_POWER )
+#define ROCKPAINT_TOOLBAR BUTTON_REC
+#define ROCKPAINT_TOOLBAR2 ( BUTTON_REC | BUTTON_LEFT )
+#define ROCKPAINT_UP BUTTON_UP
+#define ROCKPAINT_DOWN BUTTON_DOWN
+#define ROCKPAINT_LEFT BUTTON_LEFT
+#define ROCKPAINT_RIGHT BUTTON_RIGHT
+
#elif ( CONFIG_KEYPAD == IRIVER_H10_PAD )
#define ROCKPAINT_QUIT BUTTON_POWER
#define ROCKPAINT_DRAW BUTTON_FF
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index d9ddba1332..2fe226c9db 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -69,6 +69,13 @@ PLUGIN_HEADER
#define PUZZLE_SHUFFLE BUTTON_SELECT
#define PUZZLE_PICTURE BUTTON_POWER
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define PUZZLE_QUIT BUTTON_POWER
+#define PUZZLE_UP BUTTON_UP
+#define PUZZLE_DOWN BUTTON_DOWN
+#define PUZZLE_SHUFFLE BUTTON_REC
+#define PUZZLE_PICTURE BUTTON_SELECT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define PUZZLE_QUIT BUTTON_POWER
#define PUZZLE_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index b1e9e10a55..6b27c04d6e 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -76,6 +76,12 @@ PLUGIN_HEADER
#define SNAKE_DOWN BUTTON_DOWN
#define SNAKE_PLAYPAUSE BUTTON_SELECT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define SNAKE_QUIT BUTTON_POWER
+#define SNAKE_UP BUTTON_UP
+#define SNAKE_DOWN BUTTON_DOWN
+#define SNAKE_PLAYPAUSE BUTTON_SELECT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define SNAKE_QUIT BUTTON_POWER
#define SNAKE_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index 30660c0f89..c2357967f5 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -219,6 +219,18 @@ PLUGIN_HEADER
#define SNAKE2_PLAYPAUSE BUTTON_SELECT
#define SNAKE2_PLAYPAUSE_TEXT "Select"
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define SNAKE2_UP BUTTON_UP
+#define SNAKE2_DOWN BUTTON_DOWN
+#define SNAKE2_QUIT BUTTON_POWER
+#define SNAKE2_LEVEL_UP BUTTON_UP
+#define SNAKE2_LEVEL_DOWN BUTTON_DOWN
+#define SNAKE2_MAZE_NEXT BUTTON_RIGHT
+#define SNAKE2_MAZE_LAST BUTTON_LEFT
+#define SNAKE2_SELECT_TYPE BUTTON_REC
+#define SNAKE2_PLAYPAUSE BUTTON_SELECT
+#define SNAKE2_PLAYPAUSE_TEXT "Select"
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define SNAKE2_UP BUTTON_SCROLL_UP
#define SNAKE2_DOWN BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index 8f907a7ec6..9e8f4f582f 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -45,6 +45,8 @@ PLUGIN_HEADER
#define SNOW_QUIT BUTTON_POWER
#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define SNOW_QUIT BUTTON_A
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define SNOW_QUIT BUTTON_POWER
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define SNOW_QUIT BUTTON_POWER
#else
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 06788d4806..fbbbf3ea06 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -102,6 +102,16 @@ extern const fb_data sokoban_tiles[];
#define SOKOBAN_LEVEL_DOWN (BUTTON_POWER | BUTTON_DOWN)
#define SOKOBAN_LEVEL_REPEAT BUTTON_SELECT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define SOKOBAN_UP BUTTON_UP
+#define SOKOBAN_DOWN BUTTON_DOWN
+#define SOKOBAN_QUIT BUTTON_POWER
+#define SOKOBAN_UNDO_PRE BUTTON_SELECT
+#define SOKOBAN_UNDO (BUTTON_SELECT | BUTTON_UP)
+#define SOKOBAN_LEVEL_UP (BUTTON_SELECT | BUTTON_RIGHT)
+#define SOKOBAN_LEVEL_DOWN (BUTTON_SELECT | BUTTON_LEFT)
+#define SOKOBAN_LEVEL_REPEAT BUTTON_REC
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define SOKOBAN_UP BUTTON_SCROLL_UP
#define SOKOBAN_DOWN BUTTON_SCROLL_DOWN
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index d369e89a0a..d72cea9a96 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -175,6 +175,27 @@ static struct plugin_api* rb;
# define HK_CUR2STACK "SELECT.."
# define HK_REM2STACK "POWER+RIGHT"
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+# define SOL_QUIT BUTTON_POWER
+# define SOL_UP BUTTON_UP
+# define SOL_DOWN BUTTON_DOWN
+# define SOL_LEFT BUTTON_LEFT
+# define SOL_RIGHT BUTTON_RIGHT
+# define SOL_MOVE_PRE BUTTON_SELECT
+# define SOL_MOVE (BUTTON_SELECT | BUTTON_UP)
+# define SOL_DRAW_PRE BUTTON_UP
+# define SOL_DRAW (BUTTON_UP | BUTTON_LEFT)
+# define SOL_REM2CUR_PRE BUTTON_UP
+# define SOL_REM2CUR (BUTTON_UP | BUTTON_RIGHT)
+# define SOL_CUR2STACK_PRE BUTTON_SELECT
+# define SOL_CUR2STACK (BUTTON_SELECT | BUTTON_RIGHT)
+# define SOL_REM2STACK BUTTON_REC
+# define HK_MOVE "SELECT"
+# define HK_DRAW "PLAY"
+# define HK_REM2CUR "PLAY.."
+# define HK_CUR2STACK "SELECT.."
+# define HK_REM2STACK "REC"
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
# define SOL_QUIT BUTTON_POWER
# define SOL_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index aeac49b92f..1406643395 100755
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -106,6 +106,19 @@ static struct plugin_api* rb; /* global api struct pointer */
#define AST_FIRE BUTTON_SELECT
#define AST_FIRE_REP BUTTON_SELECT | BUTTON_REPEAT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define AST_PAUSE BUTTON_SELECT
+#define AST_QUIT BUTTON_POWER
+#define AST_THRUST_REP BUTTON_UP | BUTTON_RIGHT
+#define AST_THRUST BUTTON_UP
+#define AST_HYPERSPACE BUTTON_DOWN
+#define AST_LEFT BUTTON_LEFT
+#define AST_LEFT_REP BUTTON_LEFT | BUTTON_RIGHT
+#define AST_RIGHT BUTTON_RIGHT
+#define AST_RIGHT_REP (BUTTON_RIGHT | BUTTON_RIGHT)
+#define AST_FIRE BUTTON_SELECT
+#define AST_FIRE_REP BUTTON_SELECT | BUTTON_RIGHT
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define AST_PAUSE BUTTON_PLAY
#define AST_QUIT BUTTON_POWER
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index d46063efdd..2bf2902bc6 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -135,6 +135,19 @@ PLUGIN_HEADER
#define STAR_LEVEL_REPEAT (BUTTON_POWER | BUTTON_RIGHT)
#define STAR_MENU_RUN BUTTON_RIGHT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+
+#define STAR_QUIT BUTTON_POWER
+#define STAR_UP BUTTON_UP
+#define STAR_DOWN BUTTON_DOWN
+#define STAR_TOGGLE_CONTROL_PRE BUTTON_SELECT
+#define STAR_TOGGLE_CONTROL (BUTTON_SELECT | BUTTON_REL)
+#define STAR_LEVEL_UP BUTTON_SCROLL_UP
+#define STAR_LEVEL_DOWN BUTTON_SCROLL_DOWN
+#define STAR_LEVEL_REPEAT (BUTTON_SELECT | BUTTON_RIGHT)
+#define STAR_MENU_RUN BUTTON_REC
+
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define STAR_QUIT BUTTON_POWER
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index ef3fd688e8..0d87ea7fff 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -51,6 +51,13 @@ static struct plugin_api* rb; /* global api struct pointer */
#define STARFIELD_DECREASE_ZMOVE BUTTON_DOWN
#define STARFIELD_INCREASE_NB_STARS BUTTON_RIGHT
#define STARFIELD_DECREASE_NB_STARS BUTTON_LEFT
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define STARFIELD_QUIT BUTTON_POWER
+#define STARFIELD_INCREASE_ZMOVE BUTTON_UP
+#define STARFIELD_DECREASE_ZMOVE BUTTON_DOWN
+#define STARFIELD_INCREASE_NB_STARS BUTTON_RIGHT
+#define STARFIELD_DECREASE_NB_STARS BUTTON_LEFT
+
#else
#define STARFIELD_QUIT BUTTON_OFF
#define STARFIELD_INCREASE_ZMOVE BUTTON_UP
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 20d17c75b2..0a1f2e48f9 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -54,6 +54,9 @@ static int fontwidth, fontheight;
#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define STATS_STOP BUTTON_A
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define STATS_STOP BUTTON_POWER
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define STATS_STOP BUTTON_POWER
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index 849ff687ce..f1e7355e65 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -95,6 +95,13 @@ PLUGIN_HEADER
#define STOPWATCH_LAP_TIMER BUTTON_MENU
#define STOPWATCH_SCROLL_UP BUTTON_UP
#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define STOPWATCH_QUIT BUTTON_POWER
+#define STOPWATCH_START_STOP BUTTON_LEFT
+#define STOPWATCH_RESET_TIMER BUTTON_REC
+#define STOPWATCH_LAP_TIMER BUTTON_SELECT
+#define STOPWATCH_SCROLL_UP BUTTON_UP
+#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define STOPWATCH_QUIT BUTTON_POWER
#define STOPWATCH_START_STOP BUTTON_PLAY
diff --git a/apps/plugins/sudoku/SOURCES b/apps/plugins/sudoku/SOURCES
index 7cce555c93..8b344bdfeb 100644
--- a/apps/plugins/sudoku/SOURCES
+++ b/apps/plugins/sudoku/SOURCES
@@ -1,3 +1,5 @@
+#if !defined(SANSA_E200)
sudoku.c
generator.c
templates.c
+#endif
diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c
index 98d11b7962..e1e99bf444 100644
--- a/apps/plugins/sudoku/sudoku.c
+++ b/apps/plugins/sudoku/sudoku.c
@@ -129,7 +129,8 @@ static const char default_game[9][9] =
#define CELL_WIDTH 12
#define CELL_HEIGHT 12
-#elif (LCD_HEIGHT==176) && (LCD_WIDTH==220)
+#elif ((LCD_HEIGHT==176) && (LCD_WIDTH==220)) || \
+ ((LCD_HEIGHT==220) && (LCD_WIDTH==176))
/* Iriver h300, iPod Color/Photo - 220x176, 9 cells @ 16x16 with 14 border lines */
/* Internal dimensions of a cell */
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 761be3a988..fefaf9f57d 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -100,6 +100,16 @@
#define SUDOKU_BUTTON_MENU BUTTON_PLAY
#define SUDOKU_BUTTON_POSSIBLE BUTTON_FF
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define SUDOKU_BUTTON_QUIT BUTTON_POWER
+#define SUDOKU_BUTTON_UP BUTTON_UP
+#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
+#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
+#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
+#define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT
+#define SUDOKU_BUTTON_MENU (BUTTON_SELECT|BUTTON_REPEAT)
+#define SUDOKU_BUTTON_POSSIBLE BUTTON_REC
+
#elif
#error SUDOKU: Unsupported keypad
#endif
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 9024825104..af73257508 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -157,6 +157,16 @@ PLUGIN_HEADER
#define VIEWER_MENU BUTTON_MENU
#define VIEWER_AUTOSCROLL BUTTON_A
+/* Sansa E200 keys */
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define VIEWER_QUIT BUTTON_POWER
+#define VIEWER_PAGE_UP BUTTON_UP
+#define VIEWER_PAGE_DOWN BUTTON_DOWN
+#define VIEWER_SCREEN_LEFT BUTTON_LEFT
+#define VIEWER_SCREEN_RIGHT BUTTON_RIGHT
+#define VIEWER_MENU BUTTON_SELECT
+#define VIEWER_AUTOSCROLL BUTTON_SCROLL_UP
+
/* iriver H10 keys */
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define VIEWER_QUIT BUTTON_POWER
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 559aafabc1..2ee708efed 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -83,6 +83,17 @@ PLUGIN_HEADER
#define VUMETER_UP BUTTON_UP
#define VUMETER_DOWN BUTTON_DOWN
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+#define VUMETER_QUIT BUTTON_POWER
+#define VUMETER_HELP BUTTON_REC
+#define VUMETER_MENU BUTTON_SELECT
+#define VUMETER_MENU_EXIT BUTTON_SELECT
+#define VUMETER_MENU_EXIT2 BUTTON_POWER
+#define VUMETER_LEFT BUTTON_LEFT
+#define VUMETER_RIGHT BUTTON_RIGHT
+#define VUMETER_UP BUTTON_UP
+#define VUMETER_DOWN BUTTON_DOWN
+
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define VUMETER_QUIT BUTTON_POWER
#define VUMETER_HELP BUTTON_PLAY
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 279fcfcb61..f108b4d518 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -127,6 +127,21 @@ PLUGIN_HEADER
#define PLAYERS_TEXT "Up/Down"
#define WORMS_TEXT "Left/Right"
+
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+
+#define BTN_DIR_UP BUTTON_UP
+#define BTN_DIR_DOWN BUTTON_DOWN
+#define BTN_DIR_LEFT BUTTON_LEFT
+#define BTN_DIR_RIGHT BUTTON_RIGHT
+#define BTN_STARTPAUSE BUTTON_SELECT
+#define BTN_QUIT BUTTON_POWER
+#define BTN_STOPRESET BUTTON_REC
+
+#define PLAYERS_TEXT "Up/Down"
+#define WORMS_TEXT "Left/Right"
+
+
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define BTN_DIR_UP BUTTON_SCROLL_UP
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 4c56a8cf19..abfd2a53b4 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -66,6 +66,17 @@ PLUGIN_HEADER
#define DOWN BUTTON_DOWN
#define PAUSE BUTTON_MENU
+#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
+
+#define QUIT BUTTON_POWER
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define SELECT BUTTON_SELECT
+#define UP BUTTON_UP
+#define DOWN BUTTON_DOWN
+#define PAUSE BUTTON_REC
+
+
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define QUIT BUTTON_POWER
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index f3f23295c5..54218dbf51 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -77,6 +77,14 @@
#define ZX_UP BUTTON_SCROLL_UP
#define ZX_DOWN BUTTON_SCROLL_DOWN
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+#define ZX_SELECT BUTTON_SELECT
+#define ZX_MENU BUTTON_POWER
+#define ZX_LEFT BUTTON_LEFT
+#define ZX_RIGHT BUTTON_RIGHT
+#define ZX_UP BUTTON_UP
+#define ZX_DOWN BUTTON_DOWN
+
#endif
#endif
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index 685d9ce6bb..ea4abae618 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -99,6 +99,17 @@
#define KBD_UP BUTTON_SCROLL_UP
#define KBD_DOWN BUTTON_SCROLL_DOWN
+#elif CONFIG_KEYPAD == SANSA_E200_PAD
+
+/* TODO: Check keyboard mappings */
+
+#define KBD_SELECT BUTTON_SELECT
+#define KBD_ABORT BUTTON_POWER
+#define KBD_LEFT BUTTON_LEFT
+#define KBD_RIGHT BUTTON_RIGHT
+#define KBD_UP BUTTON_UP
+#define KBD_DOWN BUTTON_DOWN
+
#endif
diff --git a/docs/CREDITS b/docs/CREDITS
index abac76db52..3dbf6f79f0 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -245,3 +245,4 @@ Jared Stafford
Martin Hensel
St├ęphane Doyen
Austin Appel
+Andre Smith
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 171cd6db12..e64fbebc7e 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -227,11 +227,13 @@ drivers/m5636.c
#endif
#ifdef SANSA_E200
+#ifndef SIMULATOR
target/arm/sandisk/sansa-e200/ata-e200.c
target/arm/sandisk/sansa-e200/lcd-e200.c
target/arm/sandisk/sansa-e200/adc-e200.c
target/arm/wmcodec-pp.c
#endif
+#endif
#ifdef IAUDIO_X5
target/coldfire/iaudio/x5/power-x5.c
diff --git a/uisimulator/sdl/UI-e200.bmp b/uisimulator/sdl/UI-e200.bmp
new file mode 100644
index 0000000000..ee9c6b5242
--- /dev/null
+++ b/uisimulator/sdl/UI-e200.bmp
Binary files differ
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 22cfda1119..4408dde3e9 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -467,17 +467,17 @@ void button_event(int key, bool pressed)
break;
case SDLK_KP8:
case SDLK_UP:
- new_btn = BUTTON_UP;
+ new_btn = BUTTON_SCROLL_UP;
break;
case SDLK_KP2:
case SDLK_DOWN:
- new_btn = BUTTON_DOWN;
+ new_btn = BUTTON_SCROLL_DOWN;
break;
case SDLK_KP9:
- new_btn = BUTTON_SCROLL_UP;
+ new_btn = BUTTON_UP;
break;
case SDLK_KP3:
- new_btn = BUTTON_SCROLL_DOWN;
+ new_btn = BUTTON_DOWN;
break;
case SDLK_KP1:
new_btn = BUTTON_POWER;
@@ -485,6 +485,10 @@ void button_event(int key, bool pressed)
case SDLK_KP7:
new_btn = BUTTON_REC;
break;
+ case SDLK_KP5:
+ case SDLK_SPACE:
+ new_btn = BUTTON_SELECT;
+ break;
#endif /* CONFIG_KEYPAD */
case SDLK_KP0:
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index 9b844c3945..a8e05008af 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -231,6 +231,16 @@
#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#elif defined(SANSA_E200)
+#define UI_TITLE "Sansa e200"
+#define UI_WIDTH 260 /* width of GUI window */
+#define UI_HEIGHT 502 /* height of GUI window */
+/* high-colour */
+#define UI_LCD_POSX 42 /* x position of lcd */
+#define UI_LCD_POSY 37 /* y position of lcd (74 for real aspect) */
+#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
+#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+
#elif defined(IRIVER_IFP7XX)
#define UI_TITLE "iriver iFP7xx"
#define UI_WIDTH 425 /* width of GUI window */