summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/SOURCES.app_build6
-rw-r--r--apps/plugins/SUBDIRS2
-rw-r--r--apps/plugins/SUBDIRS.app_build10
-rw-r--r--apps/plugins/battery_bench.c3
-rw-r--r--apps/plugins/blackjack.c16
-rw-r--r--apps/plugins/bounce.c3
-rw-r--r--apps/plugins/brickmania.c3
-rw-r--r--apps/plugins/calculator.c11
-rw-r--r--apps/plugins/calendar.c10
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.h10
-rw-r--r--apps/plugins/chessclock.c10
-rw-r--r--apps/plugins/chip8.c12
-rw-r--r--apps/plugins/chopper.c3
-rw-r--r--apps/plugins/clix.c3
-rw-r--r--apps/plugins/cube.c10
-rw-r--r--apps/plugins/doom/i_video.c11
-rw-r--r--apps/plugins/fft/fft.c9
-rw-r--r--apps/plugins/fireworks.c3
-rw-r--r--apps/plugins/flipit.c12
-rw-r--r--apps/plugins/fractals/fractal.h12
-rw-r--r--apps/plugins/goban/goban.h10
-rw-r--r--apps/plugins/imageviewer/imageviewer_button.h12
-rw-r--r--apps/plugins/invadrox.c3
-rw-r--r--apps/plugins/jewels.c3
-rw-r--r--apps/plugins/lamp.c3
-rw-r--r--apps/plugins/lib/pluginlib_actions.c6
-rw-r--r--apps/plugins/lib/simple_viewer.c1
-rw-r--r--apps/plugins/logo.c3
-rw-r--r--apps/plugins/lua/strcspn.c1
-rw-r--r--apps/plugins/lua/strpbrk.c1
-rw-r--r--apps/plugins/matrix.c3
-rw-r--r--apps/plugins/midi/midiplay.c8
-rw-r--r--apps/plugins/minesweeper.c10
-rw-r--r--apps/plugins/mosaique.c3
-rw-r--r--apps/plugins/mp3_encoder.c3
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c8
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c9
-rw-r--r--apps/plugins/oscilloscope.c11
-rw-r--r--apps/plugins/pacbox/pacbox.h11
-rw-r--r--apps/plugins/pdbox/pdbox.h19
-rw-r--r--apps/plugins/pegbox.c18
-rw-r--r--apps/plugins/pong.c8
-rw-r--r--apps/plugins/reversi/reversi-gui.h9
-rw-r--r--apps/plugins/rockblox.c12
-rw-r--r--apps/plugins/rockblox1d.c3
-rw-r--r--apps/plugins/rockboy/rockboy.c12
-rw-r--r--apps/plugins/rockboy/rockmacros.h2
-rw-r--r--apps/plugins/rockpaint.c11
-rw-r--r--apps/plugins/sliding_puzzle.c6
-rw-r--r--apps/plugins/snake.c3
-rw-r--r--apps/plugins/snake2.c3
-rw-r--r--apps/plugins/snow.c3
-rw-r--r--apps/plugins/sokoban.c15
-rw-r--r--apps/plugins/solitaire.c18
-rw-r--r--apps/plugins/spacerocks.c9
-rw-r--r--apps/plugins/star.c17
-rw-r--r--apps/plugins/starfield.c3
-rw-r--r--apps/plugins/stats.c3
-rw-r--r--apps/plugins/stopwatch.c8
-rw-r--r--apps/plugins/sudoku/sudoku.h10
-rw-r--r--apps/plugins/superdom.c3
-rw-r--r--apps/plugins/test_codec.c2
-rw-r--r--apps/plugins/test_fps.c2
-rw-r--r--apps/plugins/test_gfx.c6
-rw-r--r--apps/plugins/text_viewer/tv_button.h10
-rw-r--r--apps/plugins/vu_meter.c11
-rw-r--r--apps/plugins/wormlet.c3
-rw-r--r--apps/plugins/xobox.c9
-rw-r--r--apps/plugins/zxbox/keymaps.h12
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c9
70 files changed, 492 insertions, 35 deletions
diff --git a/apps/plugins/SOURCES.app_build b/apps/plugins/SOURCES.app_build
index ddac2b9ba8..e374062536 100644
--- a/apps/plugins/SOURCES.app_build
+++ b/apps/plugins/SOURCES.app_build
@@ -1,3 +1,7 @@
+#ifndef HAVE_TOUCHSCREEN
+/* In devices running RockBox as an application, but having a keypad */
+#include "SOURCES"
+#else
/* plugins common to all models */
credits.c
properties.c
@@ -39,3 +43,5 @@ test_sampr.c
#endif
test_viewports.c
#endif /* HAVE_TEST_PLUGINS */
+
+#endif /* HAVE_TOUCHSCREEN */
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index c497c49b14..d2feb721d4 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -73,7 +73,7 @@ mikmod
#if defined(IRIVER_H300_SERIES) || defined(IRIVER_H100_SERIES) || \
(CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_E200_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
- (CONFIG_KEYPAD == IPOD_1G2G_PAD)
+ (CONFIG_KEYPAD == IPOD_1G2G_PAD || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
/* PDBox is confirmed to run on these player models. */
pdbox
#endif
diff --git a/apps/plugins/SUBDIRS.app_build b/apps/plugins/SUBDIRS.app_build
index dbf4382b62..23b840fd87 100644
--- a/apps/plugins/SUBDIRS.app_build
+++ b/apps/plugins/SUBDIRS.app_build
@@ -1,4 +1,11 @@
-/* For all targets with a bitmap display */
+#ifndef HAVE_TOUCHSCREEN
+/* This is for devices having a keypad, running RockBox as an application */
+#include "SUBDIRS"
+
+#else
+/* For all targets with a bitmap display and a touchscreen
+ * In fact, most of the plugins aren't supposed to be used on a touch(mouse) device
+ */
#ifdef HAVE_LCD_BITMAP
#ifdef HAVE_TAGCACHE
@@ -15,3 +22,4 @@ mikmod
#endif
#endif /* CONFIG_CODEC == SWCODEC */
+#endif /* HAVE_TOUCHSCREEN */ \ No newline at end of file
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index a16302e8b0..be509cffcb 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -125,7 +125,8 @@
#define BATTERY_ON_TXT "SELECT - start"
#define BATTERY_OFF_TXT "POWER"
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD \
+ || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define BATTERY_ON BUTTON_SELECT
#define BATTERY_OFF BUTTON_BACK
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index 0c35306cfc..ab4da37b0a 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -466,6 +466,22 @@ enum {
#define BJACK_RIGHT BUTTON_RIGHT
#define BJACK_LEFT BUTTON_LEFT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define BJACK_SELECT_NAME "SELECT"
+#define BJACK_STAY_NAME "MENU"
+#define BJACK_QUIT_NAME "BACK"
+#define BJACK_DOUBLE_NAME "USER"
+#define BJACK_SELECT BUTTON_SELECT
+#define BJACK_QUIT BUTTON_BACK
+#define BJACK_MAX (BUTTON_LEFT|BUTTON_UP)
+#define BJACK_MIN (BUTTON_RIGHT|BUTTON_DOWN)
+#define BJACK_STAY BUTTON_MENU
+#define BJACK_DOUBLEDOWN BUTTON_USER
+#define BJACK_UP BUTTON_UP
+#define BJACK_DOWN BUTTON_DOWN
+#define BJACK_RIGHT BUTTON_RIGHT
+#define BJACK_LEFT BUTTON_LEFT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 6880e269e2..5bd81b7fed 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -127,7 +127,8 @@
#define BOUNCE_QUIT BUTTON_POWER
#define BOUNCE_MODE BUTTON_PLAY
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
+ || (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define BOUNCE_LEFT BUTTON_LEFT
#define BOUNCE_RIGHT BUTTON_RIGHT
#define BOUNCE_UP BUTTON_UP
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index c362ffe702..dd3903eb26 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -158,7 +158,8 @@ CONFIG_KEYPAD == SANSA_CONNECT_PAD
#define UP BUTTON_SCROLL_UP
#define DOWN BUTTON_SCROLL_DOWN
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD \
+ || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define QUIT BUTTON_BACK
#define LEFT BUTTON_LEFT
#define RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 8288f34c28..77c7a5588d 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -431,6 +431,17 @@ F3: equal to "="
#define CALCULATOR_CALC BUTTON_NEXT
#define CALCULATOR_CLEAR BUTTON_PREV
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+
+#define CALCULATOR_LEFT BUTTON_LEFT
+#define CALCULATOR_RIGHT BUTTON_RIGHT
+#define CALCULATOR_UP BUTTON_UP
+#define CALCULATOR_DOWN BUTTON_DOWN
+#define CALCULATOR_QUIT BUTTON_BACK
+#define CALCULATOR_INPUT BUTTON_SELECT
+#define CALCULATOR_CALC BUTTON_MENU
+#define CALCULATOR_CLEAR BUTTON_USER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index d8d8f1ad12..d498b97ffb 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -308,6 +308,16 @@
#define CALENDAR_NEXT_MONTH BUTTON_NEXT
#define CALENDAR_PREV_MONTH BUTTON_PREV
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define CALENDAR_QUIT BUTTON_BACK
+#define CALENDAR_SELECT BUTTON_SELECT
+#define CALENDAR_NEXT_WEEK BUTTON_DOWN
+#define CALENDAR_PREV_WEEK BUTTON_UP
+#define CALENDAR_NEXT_DAY BUTTON_RIGHT
+#define CALENDAR_PREV_DAY BUTTON_LEFT
+#define CALENDAR_NEXT_MONTH BUTTON_POWER
+#define CALENDAR_PREV_MONTH BUTTON_USER
+
#else
#error "No keypad setting."
#endif
diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h
index 1627426cef..765e52ec8c 100644
--- a/apps/plugins/chessbox/chessbox_pgn.h
+++ b/apps/plugins/chessbox/chessbox_pgn.h
@@ -422,6 +422,16 @@
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_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_USER
+#define CB_LEVEL BUTTON_BACK
+#define CB_MENU BUTTON_MENU
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index dca5c4040e..94f069d0a0 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -326,6 +326,16 @@
#define CHC_SETTINGS_OK BUTTON_SELECT
#define CHC_SETTINGS_CANCEL BUTTON_LEFT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define CHC_QUIT BUTTON_BACK
+#define CHC_STARTSTOP BUTTON_SELECT
+#define CHC_RESET BUTTON_USER
+#define CHC_MENU BUTTON_MENU
+#define CHC_SETTINGS_INC BUTTON_UP
+#define CHC_SETTINGS_DEC BUTTON_DOWN
+#define CHC_SETTINGS_OK BUTTON_SELECT
+#define CHC_SETTINGS_CANCEL BUTTON_BACK
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index 97d8351fe9..470a8e4c89 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1193,6 +1193,18 @@ CONFIG_KEYPAD == MROBE500_PAD
#define CHIP8_KEY8 BUTTON_VOL_DOWN
#define CHIP8_KEY9 BUTTON_VOL_UP
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define CHIP8_OFF (BUTTON_BACK|BUTTON_REPEAT)
+#define CHIP8_KEY1 BUTTON_MENU
+#define CHIP8_KEY2 BUTTON_UP
+#define CHIP8_KEY3 BUTTON_DOWN
+#define CHIP8_KEY4 BUTTON_LEFT
+#define CHIP8_KEY5 BUTTON_SELECT
+#define CHIP8_KEY6 BUTTON_RIGHT
+#define CHIP8_KEY7 BUTTON_BACK
+#define CHIP8_KEY8 BUTTON_POWER
+#define CHIP8_KEY9 BUTTON_USER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index 71ea8f835f..d819da421b 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -97,7 +97,8 @@ Still To do:
#define ACTION2 BUTTON_MENU
#define ACTIONTEXT "UP"
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD \
+ || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define QUIT BUTTON_BACK
#define ACTION BUTTON_SELECT
#define ACTION2 BUTTON_MENU
diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c
index 378e9813e6..06fe0d84e0 100644
--- a/apps/plugins/clix.c
+++ b/apps/plugins/clix.c
@@ -83,7 +83,8 @@
#define CLIX_BUTTON_UP BUTTON_UP
#define CLIX_BUTTON_DOWN BUTTON_DOWN
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define CLIX_BUTTON_QUIT BUTTON_BACK
#define CLIX_BUTTON_LEFT BUTTON_LEFT
#define CLIX_BUTTON_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 7e97eaf569..cecb10e1f2 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -329,6 +329,16 @@
#define CUBE_PAUSE BUTTON_DOWN
#define CUBE_HIGHSPEED BUTTON_LEFT
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define CUBE_QUIT BUTTON_BACK
+#define CUBE_NEXT BUTTON_RIGHT
+#define CUBE_PREV BUTTON_LEFT
+#define CUBE_INC BUTTON_UP
+#define CUBE_DEC BUTTON_DOWN
+#define CUBE_MODE BUTTON_MENU
+#define CUBE_PAUSE BUTTON_USER
+#define CUBE_HIGHSPEED BUTTON_SELECT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index d12799cac4..9009acc67f 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -424,6 +424,17 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_ENTER BUTTON_NEXT
#define DOOMBUTTON_WEAPON BUTTON_PREV
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_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_MENU
+#define DOOMBUTTON_ESC BUTTON_BACK
+#define DOOMBUTTON_ENTER BUTTON_POWER
+#define DOOMBUTTON_WEAPON BUTTON_USER
+
#else
#error Keymap not defined!
#endif
diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c
index 89205503e7..b2ef8d8e33 100644
--- a/apps/plugins/fft/fft.c
+++ b/apps/plugins/fft/fft.c
@@ -257,6 +257,15 @@ GREY_INFO_STRUCT
# define FFT_FREQ_SCALE BUTTON_DOWN
# define FFT_QUIT BUTTON_POWER
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+# define FFT_PREV_GRAPH BUTTON_LEFT
+# define FFT_NEXT_GRAPH BUTTON_RIGHT
+# define FFT_ORIENTATION BUTTON_USER
+# define FFT_WINDOW BUTTON_MENU
+# define FFT_AMP_SCALE BUTTON_SELECT
+# define FFT_FREQ_SCALE BUTTON_DOWN
+# define FFT_QUIT BUTTON_BACK
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index e3a391035a..52b11b7079 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -63,7 +63,8 @@
#elif (CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
- (CONFIG_KEYPAD == MROBE100_PAD)
+ (CONFIG_KEYPAD == MROBE100_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define BTN_MENU BUTTON_MENU
#define BTN_FIRE BUTTON_SELECT
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index ffc691c720..da5a9e8c6b 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -380,6 +380,18 @@
#define FLIPIT_STEP_BY_STEP BUTTON_NEXT
#define FLIPIT_TOGGLE BUTTON_SELECT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+
+#define FLIPIT_LEFT BUTTON_LEFT
+#define FLIPIT_RIGHT BUTTON_RIGHT
+#define FLIPIT_UP BUTTON_UP
+#define FLIPIT_DOWN BUTTON_DOWN
+#define FLIPIT_QUIT BUTTON_BACK
+#define FLIPIT_SHUFFLE BUTTON_MENU
+#define FLIPIT_SOLVE BUTTON_USER
+#define FLIPIT_STEP_BY_STEP BUTTON_POWER
+#define FLIPIT_TOGGLE BUTTON_SELECT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h
index 76f3229399..0d1aff3078 100644
--- a/apps/plugins/fractals/fractal.h
+++ b/apps/plugins/fractals/fractal.h
@@ -378,6 +378,18 @@
#define FRACTAL_PRECISION_DEC BUTTON_VOL_DOWN
#define FRACTAL_RESET BUTTON_PREV
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define FRACTAL_QUIT BUTTON_BACK
+#define FRACTAL_UP BUTTON_UP
+#define FRACTAL_DOWN BUTTON_DOWN
+#define FRACTAL_LEFT BUTTON_LEFT
+#define FRACTAL_RIGHT BUTTON_RIGHT
+#define FRACTAL_ZOOM_IN (BUTTON_MENU|BUTTON_REL)
+#define FRACTAL_ZOOM_OUT (BUTTON_USER|BUTTON_REL)
+#define FRACTAL_PRECISION_INC (BUTTON_MENU|BUTTON_REPEAT)
+#define FRACTAL_PRECISION_DEC (BUTTON_USER|BUTTON_REPEAT)
+#define FRACTAL_RESET BUTTON_POWER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/goban/goban.h b/apps/plugins/goban/goban.h
index d03bc82474..20940d74f0 100644
--- a/apps/plugins/goban/goban.h
+++ b/apps/plugins/goban/goban.h
@@ -364,6 +364,16 @@
#define GBN_BUTTON_PLAY BUTTON_SELECT
#define GBN_BUTTON_MENU BUTTON_POWER
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define GBN_BUTTON_UP BUTTON_UP
+#define GBN_BUTTON_DOWN BUTTON_DOWN
+#define GBN_BUTTON_LEFT BUTTON_LEFT
+#define GBN_BUTTON_RIGHT BUTTON_RIGHT
+#define GBN_BUTTON_RETREAT BUTTON_BACK
+#define GBN_BUTTON_ADVANCE BUTTON_USER
+#define GBN_BUTTON_PLAY BUTTON_SELECT
+#define GBN_BUTTON_MENU BUTTON_MENU
+
#else
#error Unsupported keypad
#endif
diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h
index 9f345d83f3..10d239922e 100644
--- a/apps/plugins/imageviewer/imageviewer_button.h
+++ b/apps/plugins/imageviewer/imageviewer_button.h
@@ -379,6 +379,18 @@
#define IMGVIEW_MENU BUTTON_POWER
#define IMGVIEW_SLIDE_SHOW BUTTON_NEXT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define IMGVIEW_ZOOM_IN BUTTON_POWER
+#define IMGVIEW_ZOOM_OUT BUTTON_USER
+#define IMGVIEW_UP BUTTON_UP
+#define IMGVIEW_DOWN BUTTON_DOWN
+#define IMGVIEW_LEFT BUTTON_LEFT
+#define IMGVIEW_RIGHT BUTTON_RIGHT
+#define IMGVIEW_NEXT BUTTON_SELECT
+#define IMGVIEW_PREVIOUS 0xFFFFFFA //not used
+#define IMGVIEW_MENU BUTTON_MENU
+#define IMGVIEW_QUIT BUTTON_BACK
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 96e04a976f..c52208d3c6 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -122,7 +122,8 @@
#define RIGHT BUTTON_RIGHT
#define FIRE BUTTON_SELECT
-#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_PAD \
+ || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define QUIT BUTTON_POWER
#define LEFT BUTTON_LEFT
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 4d5a5b6ce9..7d80a536dd 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -172,7 +172,8 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#define HK_SELECT "PLAY"
#define HK_CANCEL "POWER"
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define JEWELS_UP BUTTON_UP
#define JEWELS_DOWN BUTTON_DOWN
#define JEWELS_LEFT BUTTON_LEFT
diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c
index d9ad70b946..583e2753fa 100644
--- a/apps/plugins/lamp.c
+++ b/apps/plugins/lamp.c
@@ -57,7 +57,8 @@
# define LAMP_UP BUTTON_UP
# define LAMP_DOWN BUTTON_DOWN
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
# define LAMP_LEFT BUTTON_LEFT
# define LAMP_RIGHT BUTTON_RIGHT
# define LAMP_UP BUTTON_UP
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index 0a2f12da50..44a2cd8c03 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -116,7 +116,8 @@ const struct button_mapping pla_main_ctx[] =
|| (CONFIG_KEYPAD == SANSA_FUZE_PAD) \
|| (CONFIG_KEYPAD == SAMSUNG_YH_PAD) \
|| (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) \
- || (CONFIG_KEYPAD == SANSA_CONNECT_PAD))
+ || (CONFIG_KEYPAD == SANSA_CONNECT_PAD) \
+ || (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD))
{ PLA_UP, BUTTON_UP, BUTTON_NONE },
{ PLA_DOWN, BUTTON_DOWN, BUTTON_NONE },
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE },
@@ -278,7 +279,8 @@ const struct button_mapping pla_main_ctx[] =
{PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
{PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
{PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
+ || (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
{PLA_CANCEL, BUTTON_BACK, BUTTON_NONE},
{PLA_EXIT, BUTTON_MENU, BUTTON_NONE},
{PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
diff --git a/apps/plugins/lib/simple_viewer.c b/apps/plugins/lib/simple_viewer.c
index 16cbcb35de..06cc9c1a71 100644
--- a/apps/plugins/lib/simple_viewer.c
+++ b/apps/plugins/lib/simple_viewer.c
@@ -25,6 +25,7 @@
#include "simple_viewer.h"
#include <ctype.h>
+
struct view_info {
#ifdef HAVE_LCD_BITMAP
struct font* pf;
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index d651c2f634..be163f566e 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -123,7 +123,8 @@ const unsigned char rockbox16x7[] = {
#elif CONFIG_KEYPAD == MROBE500_PAD
#define LP_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define LP_QUIT BUTTON_BACK
#define LP_DEC_X BUTTON_LEFT
#define LP_INC_X BUTTON_RIGHT
diff --git a/apps/plugins/lua/strcspn.c b/apps/plugins/lua/strcspn.c
index 7af6f693eb..0a19eaebf2 100644
--- a/apps/plugins/lua/strcspn.c
+++ b/apps/plugins/lua/strcspn.c
@@ -1,5 +1,6 @@
#include "rocklibc.h"
+#undef strcspn
size_t strcspn(const char *s, const char *reject)
{
size_t l=0;
diff --git a/apps/plugins/lua/strpbrk.c b/apps/plugins/lua/strpbrk.c
index f416f391ae..1e0491f779 100644
--- a/apps/plugins/lua/strpbrk.c
+++ b/apps/plugins/lua/strpbrk.c
@@ -1,5 +1,6 @@
#include "rocklibc.h"
+#undef strpbrk
char *strpbrk(const char *s, const char *accept) {
register int i,l=strlen(accept);
for (; *s; s++)
diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c
index 1a1008073c..10b8ce578d 100644
--- a/apps/plugins/matrix.c
+++ b/apps/plugins/matrix.c
@@ -101,7 +101,8 @@
#define MATRIX_SLEEP_LESS BUTTON_DOWN
#define MATRIX_PAUSE BUTTON_SELECT
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define MATRIX_EXIT BUTTON_BACK
#define MATRIX_SLEEP_MORE BUTTON_UP
#define MATRIX_SLEEP_LESS BUTTON_DOWN
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c
index 1b5d18465b..ace7290a12 100644
--- a/apps/plugins/midi/midiplay.c
+++ b/apps/plugins/midi/midiplay.c
@@ -233,6 +233,14 @@
#define BTN_DOWN BUTTON_DOWN
#define BTN_PLAY BUTTON_SELECT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define BTN_QUIT BUTTON_BACK
+#define BTN_RIGHT BUTTON_RIGHT
+#define BTN_LEFT BUTTON_LEFT
+#define BTN_UP BUTTON_UP
+#define BTN_DOWN BUTTON_DOWN
+#define BTN_PLAY BUTTON_USER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c
index ad67b1dd67..e0da928b02 100644
--- a/apps/plugins/minesweeper.c
+++ b/apps/plugins/minesweeper.c
@@ -311,6 +311,16 @@ CONFIG_KEYPAD == MROBE500_PAD
# define MINESWP_DISCOVER BUTTON_SELECT
# define MINESWP_INFO BUTTON_PREV
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+# define MINESWP_LEFT BUTTON_LEFT
+# define MINESWP_RIGHT BUTTON_RIGHT
+# define MINESWP_UP BUTTON_UP
+# define MINESWP_DOWN BUTTON_DOWN
+# define MINESWP_QUIT BUTTON_BACK
+# define MINESWP_TOGGLE BUTTON_USER
+# define MINESWP_DISCOVER BUTTON_SELECT
+# define MINESWP_INFO BUTTON_MENU
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index ec41c8c02b..87e664e102 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -113,7 +113,8 @@
#elif CONFIG_KEYPAD == MROBE500_PAD
#define MOSAIQUE_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define MOSAIQUE_QUIT BUTTON_BACK
#define MOSAIQUE_SPEED BUTTON_SELECT
#define MOSAIQUE_RESTART BUTTON_MENU
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index a70e316f06..567ec5dbc8 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -2394,7 +2394,8 @@ static void get_mp3_filename(const char *wav_name)
#define MP3ENC_DONE BUTTON_POWER
#define MP3ENC_SELECT BUTTON_SELECT
-#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define MP3ENC_PREV BUTTON_UP
#define MP3ENC_NEXT BUTTON_DOWN
#define MP3ENC_DONE BUTTON_POWER
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index 90b547893e..e9b1c01680 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -248,6 +248,14 @@ struct mpeg_settings settings;
#define MPEG_START_TIME_DOWN BUTTON_DOWN
#define MPEG_START_TIME_EXIT BUTTON_POWER
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define MPEG_START_TIME_SELECT BUTTON_SELECT
+#define MPEG_START_TIME_LEFT BUTTON_LEFT
+#define MPEG_START_TIME_RIGHT BUTTON_RIGHT
+#define MPEG_START_TIME_UP BUTTON_UP
+#define MPEG_START_TIME_DOWN BUTTON_DOWN
+#define MPEG_START_TIME_EXIT BUTTON_BACK
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index e3d9865e12..f73e5f2090 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -362,6 +362,15 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#define MPEG_RW BUTTON_LEFT
#define MPEG_FF BUTTON_RIGHT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define MPEG_MENU BUTTON_MENU
+#define MPEG_PAUSE BUTTON_SELECT
+#define MPEG_STOP BUTTON_POWER
+#define MPEG_VOLDOWN BUTTON_DOWN
+#define MPEG_VOLUP BUTTON_UP
+#define MPEG_RW BUTTON_LEFT
+#define MPEG_FF BUTTON_RIGHT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 4469a92e12..0b1687da5c 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -342,6 +342,17 @@
#define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP
#define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define OSCILLOSCOPE_QUIT BUTTON_BACK
+#define OSCILLOSCOPE_DRAWMODE BUTTON_USER
+#define OSCILLOSCOPE_ADVMODE BUTTON_MENU
+#define OSCILLOSCOPE_ORIENTATION BUTTON_POWER
+#define OSCILLOSCOPE_PAUSE BUTTON_SELECT
+#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT
+#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT
+#define OSCILLOSCOPE_VOL_UP BUTTON_UP
+#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
index 3c906ac0aa..0183b0c3f6 100644
--- a/apps/plugins/pacbox/pacbox.h
+++ b/apps/plugins/pacbox/pacbox.h
@@ -265,6 +265,17 @@
#define PACMAN_COIN BUTTON_VOL_DOWN
#define PACMAN_MENU BUTTON_POWER
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_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_USER
+#define PACMAN_MENU BUTTON_MENU
+
#else
#error Keymap not defined!
diff --git a/apps/plugins/pdbox/pdbox.h b/apps/plugins/pdbox/pdbox.h
index 56ad568a3b..b53e15f94e 100644
--- a/apps/plugins/pdbox/pdbox.h
+++ b/apps/plugins/pdbox/pdbox.h
@@ -89,7 +89,9 @@ float rb_atan(float);
float rb_atan2(float, float);
float rb_sinh(float);
float rb_tan(float);
-#ifndef SIMULATOR
+//#ifndef SIMULATOR
+/*FIXME: is it a correct replacement??? */
+#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
typedef struct
{
int quot;
@@ -163,9 +165,12 @@ void pd_init(void);
#define atoi rb->atoi
#define write rb->write
+#undef strncat
#define strncat rb_strncat
-#ifndef SIMULATOR
+//#ifndef SIMULATOR
+/*FIXME: is it a correct replacement??? */
+#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
#define floor rb_floor
#define atof rb_atof
#define atol rb_atol
@@ -186,6 +191,7 @@ void pd_init(void);
#endif
#define ftoan rb_ftoan
+#undef strtok_r
#define strtok_r rb->strtok_r
#define strstr rb->strcasestr
@@ -282,6 +288,15 @@ enum pd_key_id
#define PDPOD_WHEELLEFT (BUTTON_SCROLL_BACK)
#define PDPOD_WHEELRIGHT (BUTTON_SCROLL_FWD)
#define PDPOD_ACTION (BUTTON_SELECT)
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+ #define PDPOD_QUIT BUTTON_BACK
+ #define PDPOD_PLAY BUTTON_USER
+ #define PDPOD_PREVIOUS BUTTON_LEFT
+ #define PDPOD_NEXT BUTTON_RIGHT
+ #define PDPOD_MENU BUTTON_MENU
+ #define PDPOD_WHEELLEFT BUTTON_UP
+ #define PDPOD_WHEELRIGHT BUTTON_DOWN
+ #define PDPOD_ACTION BUTTON_SELECT
#else
#warning "No keys defined for this architecture!"
#endif
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c
index 3eb6008f76..479f7c5ec2 100644
--- a/apps/plugins/pegbox.c
+++ b/apps/plugins/pegbox.c
@@ -510,6 +510,24 @@ CONFIG_KEYPAD == MROBE500_PAD
#define LVL_DOWN_TEXT "PREV"
#define SELECT_TEXT "SELECT"
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define PEGBOX_SELECT BUTTON_SELECT
+#define PEGBOX_QUIT BUTTON_BACK
+#define PEGBOX_RESTART BUTTON_MENU
+#define PEGBOX_LVL_UP BUTTON_USER
+#define PEGBOX_LVL_DOWN BUTTON_POWER
+#define PEGBOX_UP BUTTON_UP
+#define PEGBOX_DOWN BUTTON_DOWN
+#define PEGBOX_RIGHT BUTTON_RIGHT
+#define PEGBOX_LEFT BUTTON_LEFT
+
+#define SAVE_TEXT "PLAYPAUSE"
+#define QUIT_TEXT "POWER"
+#define RESTART_TEXT "BACK"
+#define LVL_UP_TEXT "Vol+"
+#define LVL_DOWN_TEXT "Vol-"
+#define SELECT_TEXT "SELECT"
+
#else
#error Unsupported keymap!
#endif
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index d3875f39e4..430b688f1f 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -244,6 +244,14 @@ CONFIG_KEYPAD == MROBE500_PAD
#define PONG_RIGHT_UP BUTTON_UP
#define PONG_RIGHT_DOWN BUTTON_RIGHT
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define PONG_QUIT BUTTON_BACK
+#define PONG_PAUSE BUTTON_SELECT
+#define PONG_LEFT_UP BUTTON_UP
+#define PONG_LEFT_DOWN BUTTON_DOWN
+#define PONG_RIGHT_UP BUTTON_MENU
+#define PONG_RIGHT_DOWN BUTTON_POWER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h
index a36efe51cb..c0d6183c2f 100644
--- a/apps/plugins/reversi/reversi-gui.h
+++ b/apps/plugins/reversi/reversi-gui.h
@@ -252,6 +252,15 @@
#define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAYPAUSE
#define REVERSI_BUTTON_MENU BUTTON_BACK
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define REVERSI_BUTTON_QUIT BUTTON_BACK
+#define REVERSI_BUTTON_UP BUTTON_UP
+#define REVERSI_BUTTON_DOWN BUTTON_DOWN
+#define REVERSI_BUTTON_LEFT BUTTON_LEFT
+#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
+#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
+#define REVERSI_BUTTON_MENU BUTTON_MENU
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 674b14ed83..c23c6b11cb 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -379,6 +379,18 @@
#define ROCKBLOX_DROP BUTTON_SELECT
#define ROCKBLOX_RESTART BUTTON_VOL_DOWN
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+
+#define ROCKBLOX_OFF BUTTON_BACK
+#define ROCKBLOX_ROTATE_CCW BUTTON_POWER
+#define ROCKBLOX_ROTATE_CW BUTTON_MENU
+#define ROCKBLOX_ROTATE BUTTON_UP
+#define ROCKBLOX_DOWN BUTTON_DOWN
+#define ROCKBLOX_LEFT BUTTON_LEFT
+#define ROCKBLOX_RIGHT BUTTON_RIGHT
+#define ROCKBLOX_DROP BUTTON_SELECT
+#define ROCKBLOX_RESTART BUTTON_USER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/rockblox1d.c b/apps/plugins/rockblox1d.c
index 49219c2eba..5b6e812abf 100644
--- a/apps/plugins/rockblox1d.c
+++ b/apps/plugins/rockblox1d.c
@@ -69,7 +69,8 @@
#define ONEDROCKBLOX_DOWN BUTTON_PLAY
#define ONEDROCKBLOX_QUIT BUTTON_POWER
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define ONEDROCKBLOX_DOWN BUTTON_SELECT
#define ONEDROCKBLOX_QUIT BUTTON_BACK
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index 37f0566b21..bc73abee92 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -342,6 +342,18 @@ static void setoptions (void)
options.SELECT = BUTTON_NEXT;
options.MENU = BUTTON_SELECT;
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+ options.UP = BUTTON_UP;
+ options.DOWN = BUTTON_DOWN;
+ options.LEFT = BUTTON_LEFT;
+ options.RIGHT = BUTTON_RIGHT;
+
+ options.A = BUTTON_SELECT;
+ options.B = BUTTON_BACK;
+ options.START = BUTTON_POWER;
+ options.SELECT = BUTTON_USER;
+ options.MENU = BUTTON_MENU;
+
#else
#error No Keymap Defined!
#endif
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h
index 724a0fb96d..87e570b55a 100644
--- a/apps/plugins/rockboy/rockmacros.h
+++ b/apps/plugins/rockboy/rockmacros.h
@@ -23,8 +23,6 @@
#include "plugin.h"
-#include "autoconf.h"
-
#define malloc(a) my_malloc(a)
void *my_malloc(size_t size);
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 7f16bf2763..eeca916d1d 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -243,6 +243,17 @@
#define ROCKPAINT_LEFT BUTTON_LEFT
#define ROCKPAINT_RIGHT BUTTON_RIGHT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define ROCKPAINT_QUIT BUTTON_BACK
+#define ROCKPAINT_DRAW BUTTON_SELECT
+#define ROCKPAINT_MENU BUTTON_MENU
+#define ROCKPAINT_TOOLBAR BUTTON_USER
+#define ROCKPAINT_TOOLBAR2 ( BUTTON_USER | BUTTON_REPEAT )
+#define ROCKPAINT_UP BUTTON_UP
+#define ROCKPAINT_DOWN BUTTON_DOWN
+#define ROCKPAINT_LEFT BUTTON_LEFT
+#define ROCKPAINT_RIGHT BUTTON_RIGHT
+
#else
#error "Please define keys for this keypad"
#endif
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index 653099a547..a176f75c91 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -136,7 +136,8 @@
#define PUZZLE_SHUFFLE BUTTON_REW
#define PUZZLE_PICTURE BUTTON_PLAY
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define PUZZLE_QUIT BUTTON_BACK
#define PUZZLE_LEFT BUTTON_LEFT
#define PUZZLE_RIGHT BUTTON_RIGHT
@@ -784,7 +785,8 @@ enum plugin_status plugin_start(
rb->lcd_putsxy(0, 18, "[OFF] to stop");
rb->lcd_putsxy(0, 28, "[REW] shuffle");
rb->lcd_putsxy(0, 38, "[PLAY] change pic");
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
rb->lcd_putsxy(0, 18, "[BACK] to stop");
rb->lcd_putsxy(0, 28, "[SELECT] shuffle");
rb->lcd_putsxy(0, 38, "[MENU] change pic");
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index 09e72a5fff..a20376742f 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -130,7 +130,8 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left;
#define SNAKE_DOWN BUTTON_SCROLL_DOWN
#define SNAKE_PLAYPAUSE BUTTON_PLAY
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define SNAKE_QUIT BUTTON_BACK
#define SNAKE_LEFT BUTTON_LEFT
#define SNAKE_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index 0e7b499271..bd0257d2be 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -238,7 +238,8 @@ Head and Tail are stored
#define SNAKE2_PLAYPAUSE BUTTON_FF
#define SNAKE2_PLAYPAUSE_TEXT "FF"
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define SNAKE2_LEFT BUTTON_LEFT
#define SNAKE2_RIGHT BUTTON_RIGHT
#define SNAKE2_UP BUTTON_UP
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index 8a2de39707..6371a697da 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -67,7 +67,8 @@
#define SNOW_QUIT (BUTTON_HOME|BUTTON_REPEAT)
#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
-(CONFIG_KEYPAD == CREATIVEZVM_PAD)
+(CONFIG_KEYPAD == CREATIVEZVM_PAD) || \
+(CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define SNOW_QUIT BUTTON_BACK
#elif (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index ddc95290da..942b101d4c 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -526,6 +526,21 @@
#define BUTTON_SAVE (BUTTON_SELECT|BUTTON_REPEAT)
#define BUTTON_SAVE_NAME "SELECT LONG"
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define SOKOBAN_LEFT BUTTON_LEFT
+#define SOKOBAN_RIGHT BUTTON_RIGHT
+#define SOKOBAN_UP BUTTON_UP
+#define SOKOBAN_DOWN BUTTON_DOWN
+#define SOKOBAN_MENU BUTTON_MENU
+#define SOKOBAN_UNDO BUTTON_BACK
+#define SOKOBAN_REDO BUTTON_USER
+//#define SOKOBAN_LEVEL_DOWN (BUTTON_POWER|BUTTON_REL)
+//#define SOKOBAN_LEVEL_REPEAT (BUTTON_CENTER|BUTTON_REPEAT)
+//#define SOKOBAN_LEVEL_UP (BUTTON_MENU|BUTTON_REPEAT)
+#define SOKOBAN_PAUSE BUTTON_SELECT
+#define BUTTON_SAVE BUTTON_SELECT
+#define BUTTON_SAVE_NAME "SELECT"
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 91ef346221..a1e8b7694b 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -544,6 +544,24 @@ CONFIG_KEYPAD == MROBE500_PAD
# define HK_CUR2STACK "NEXT"
# define HK_REM2STACK "PREV"
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+# define SOL_QUIT BUTTON_BACK
+# 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_REL)
+# define SOL_DRAW BUTTON_MENU
+# define SOL_REM2CUR (BUTTON_USER | BUTTON_REPEAT)
+# define SOL_CUR2STACK (BUTTON_SELECT | BUTTON_REPEAT)
+# define SOL_REM2STACK BUTTON_POWER
+# define HK_MOVE "Select"
+# define HK_DRAW "Menu"
+# define HK_REM2CUR "Long User"
+# define HK_CUR2STACK "Long Select.."
+# define HK_REM2STACK "Power"
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 0c03a3183b..946d97d075 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -278,6 +278,15 @@
#define AST_RIGHT BUTTON_RIGHT
#define AST_FIRE BUTTON_SELECT
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define AST_PAUSE BUTTON_MENU
+#define AST_QUIT BUTTON_BACK
+#define AST_THRUST BUTTON_UP
+#define AST_HYPERSPACE BUTTON_DOWN
+#define AST_LEFT BUTTON_LEFT
+#define AST_RIGHT BUTTON_RIGHT
+#define AST_FIRE BUTTON_SELECT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 620cddf77e..cf04e02edc 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -480,6 +480,23 @@
#define STAR_LEVEL_DOWN_NAME "Vol-"
#define STAR_LEVEL_REPEAT_NAME "PREV LONG"
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+
+#define STAR_QUIT BUTTON_BACK
+#define STAR_LEFT BUTTON_LEFT
+#define STAR_RIGHT BUTTON_RIGHT
+#define STAR_UP BUTTON_UP
+#define STAR_DOWN BUTTON_DOWN
+#define STAR_TOGGLE_CONTROL BUTTON_SELECT
+#define STAR_LEVEL_UP BUTTON_MENU
+#define STAR_LEVEL_DOWN BUTTON_POWER
+#define STAR_LEVEL_REPEAT BUTTON_USER
+#define STAR_TOGGLE_CONTROL_NAME "Select"
+#define STAR_QUIT_NAME "Back"
+#define STAR_LEVEL_UP_NAME "Menu"
+#define STAR_LEVEL_DOWN_NAME "Power"
+#define STAR_LEVEL_REPEAT_NAME "User"
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index e3b5634978..c996da9234 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -78,7 +78,8 @@
#define STARFIELD_DECREASE_NB_STARS BUTTON_LEFT
#define STARFIELD_TOGGLE_COLOR BUTTON_SELECT
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define STARFIELD_QUIT BUTTON_BACK
#define STARFIELD_INCREASE_ZMOVE BUTTON_UP
#define STARFIELD_DECREASE_ZMOVE BUTTON_DOWN
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index c5ff31e2bd..da231b772c 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -72,7 +72,8 @@ static bool cancel;
#define STATS_STOP BUTTON_POWER
#define STATS_STOP_REMOTE BUTTON_RC_DOWN
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define STATS_STOP BUTTON_BACK
#elif CONFIG_KEYPAD == MROBE100_PAD
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index 94785dc352..fd33bb7c03 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -263,6 +263,14 @@
#define STOPWATCH_SCROLL_UP BUTTON_UP
#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define STOPWATCH_QUIT BUTTON_BACK
+#define STOPWATCH_START_STOP BUTTON_SELECT
+#define STOPWATCH_RESET_TIMER BUTTON_MENU
+#define STOPWATCH_LAP_TIMER BUTTON_USER
+#define STOPWATCH_SCROLL_UP BUTTON_UP
+#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 456e4fd9ee..07147185ae 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -329,6 +329,16 @@
#define SUDOKU_BUTTON_MENU BUTTON_SELECT
#define SUDOKU_BUTTON_POSSIBLE BUTTON_VOL_DOWN
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define SUDOKU_BUTTON_QUIT BUTTON_BACK
+#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_MENU BUTTON_MENU
+#define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT
+#define SUDOKU_BUTTON_POSSIBLE BUTTON_USER
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index b4e25afdb1..135a6ae445 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -120,7 +120,8 @@ char buf[255];
#define SUPERDOM_RIGHT BUTTON_RIGHT
#define SUPERDOM_CANCEL (BUTTON_HOME|BUTTON_REPEAT)
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define SUPERDOM_OK BUTTON_SELECT
#define SUPERDOM_UP BUTTON_UP
#define SUPERDOM_DOWN BUTTON_DOWN
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 6e1b3b6f9e..849b40de42 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -39,6 +39,8 @@
#define TESTCODEC_EXITBUTTON (BUTTON_REC | BUTTON_REPEAT)
#elif CONFIG_KEYPAD == RK27XX_GENERIC_PAD
#define TESTCODEC_EXITBUTTON (BUTTON_M | BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define TESTCODEC_EXITBUTTON BUTTON_BACK
#elif defined(HAVE_TOUCHSCREEN)
#define TESTCODEC_EXITBUTTON BUTTON_TOPLEFT
#else
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c
index da4684f60a..4514aa61bb 100644
--- a/apps/plugins/test_fps.c
+++ b/apps/plugins/test_fps.c
@@ -37,6 +37,8 @@
#define FPS_QUIT (BUTTON_REC|BUTTON_REPEAT)
#elif CONFIG_KEYPAD == RK27XX_GENERIC_PAD
#define FPS_QUIT (BUTTON_M|BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define FPS_QUIT BUTTON_BACK
#elif defined(BUTTON_OFF)
#define FPS_QUIT BUTTON_OFF
#else
diff --git a/apps/plugins/test_gfx.c b/apps/plugins/test_gfx.c
index cde77c55fe..4081e64d13 100644
--- a/apps/plugins/test_gfx.c
+++ b/apps/plugins/test_gfx.c
@@ -402,7 +402,7 @@ static void time_text(void) /* tests mono_bitmap performance */
/* plugin entry point */
enum plugin_status plugin_start(const void* parameter)
{
-#ifndef SIMULATOR
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
int cpu_freq;
#endif
@@ -447,7 +447,7 @@ enum plugin_status plugin_start(const void* parameter)
6*4*DURATION/HZ);
init_rand_table();
-#ifndef SIMULATOR
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
#endif
@@ -458,7 +458,7 @@ enum plugin_status plugin_start(const void* parameter)
time_fillrect();
time_text();
-#ifndef SIMULATOR
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
if (*rb->cpu_frequency != cpu_freq)
rb->fdprintf(log_fd, "\nCPU: %s\n", "clock changed!");
else
diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h
index 697076e643..fe16b5f8ce 100644
--- a/apps/plugins/text_viewer/tv_button.h
+++ b/apps/plugins/text_viewer/tv_button.h
@@ -436,6 +436,16 @@
#define TV_LINE_DOWN BUTTON_SCROLL_FWD
#define TV_BOOKMARK (BUTTON_DOWN|BUTTON_SELECT)
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+#define TV_QUIT BUTTON_BACK
+#define TV_SCROLL_UP BUTTON_UP
+#define TV_SCROLL_DOWN BUTTON_DOWN
+#define TV_SCREEN_LEFT BUTTON_LEFT
+#define TV_SCREEN_RIGHT BUTTON_RIGHT
+#define TV_MENU BUTTON_MENU
+#define TV_AUTOSCROLL BUTTON_USER
+#define TV_BOOKMARK BUTTON_SELECT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index cf66070c6b..7ca7b43726 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -338,6 +338,17 @@
#define LABEL_MENU "PREV"
#define LABEL_VOLUME "VOL+/VOL-"
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+#define VUMETER_QUIT BUTTON_BACK
+#define VUMETER_HELP BUTTON_USER
+#define VUMETER_MENU BUTTON_MENU
+#define VUMETER_UP BUTTON_UP
+#define VUMETER_DOWN BUTTON_DOWN
+#define LABEL_HELP "User"
+#define LABEL_QUIT "Back"
+#define LABEL_MENU "Menu"
+#define LABEL_VOLUME "Up/Down"
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 016c4ad31b..f1834aade5 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -180,7 +180,8 @@ static long max_cycle;
#define BTN_QUIT BUTTON_POWER
#define BTN_STOPRESET BUTTON_REW
-#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
+#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) || \
+ (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
#define BTN_DIR_UP BUTTON_UP
#define BTN_DIR_DOWN BUTTON_DOWN
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 8de0c8fe16..30fd5fde13 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -277,6 +277,15 @@ CONFIG_KEYPAD == MROBE500_PAD
#define DOWN BUTTON_DOWN
#define PAUSE BUTTON_SELECT
+#elif (CONFIG_KEYPAD == SAMSUNG_YPR0_PAD)
+
+#define QUIT BUTTON_BACK
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define UP BUTTON_UP
+#define DOWN BUTTON_DOWN
+#define PAUSE BUTTON_SELECT
+
#else
#error No keymap defined!
#endif
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index 4e5d73a343..317e67cd9f 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -28,7 +28,8 @@
#define ZX_SELECT BUTTON_SELECT
#define ZX_MENU BUTTON_MENU
-#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
+#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
+ CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
#define ZX_UP BUTTON_UP
#define ZX_DOWN BUTTON_DOWN
@@ -226,6 +227,15 @@
#define ZX_LEFT BUTTON_LEFT
#define ZX_RIGHT BUTTON_RIGHT
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+
+#define ZX_MENU BUTTON_MENU
+#define ZX_UP BUTTON_UP
+#define ZX_DOWN BUTTON_DOWN
+#define ZX_SELECT BUTTON_CENTER
+#define ZX_LEFT BUTTON_LEFT
+#define ZX_RIGHT BUTTON_RIGHT
+
#else
#error Keymap not defined!
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index fc5ed41169..e8b5219de3 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -225,6 +225,15 @@
#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
+#define KBD_SELECT BUTTON_CENTER
+#define KBD_ABORT BUTTON_BACK
+#define KBD_LEFT BUTTON_LEFT
+#define KBD_RIGHT BUTTON_RIGHT
+#define KBD_UP BUTTON_UP
+#define KBD_DOWN BUTTON_DOWN
+
+#elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
+
#define KBD_SELECT BUTTON_SELECT
#define KBD_ABORT BUTTON_BACK
#define KBD_LEFT BUTTON_LEFT