summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/bitmaps/native/SOURCES8
-rw-r--r--apps/bitmaps/native/rockboxlogo.240x74x16.bmpbin0 -> 53334 bytes
-rw-r--r--apps/bookmark.h5
-rw-r--r--apps/eq_menu.c9
-rw-r--r--apps/gui/gwps.h23
-rw-r--r--apps/gui/list.h4
-rw-r--r--apps/gui/select.h8
-rw-r--r--apps/gui/yesno.h3
-rw-r--r--apps/menu.h10
-rw-r--r--apps/plugins/battery_test.c2
-rw-r--r--apps/plugins/bitmaps/native/SOURCES2
-rw-r--r--apps/plugins/bounce.c6
-rw-r--r--apps/plugins/brickmania.c12
-rw-r--r--apps/plugins/calculator.c10
-rw-r--r--apps/plugins/chessclock.c10
-rw-r--r--apps/plugins/chip8.c8
-rw-r--r--apps/plugins/cube.c13
-rw-r--r--apps/plugins/databox/databox.c3
-rw-r--r--apps/plugins/demystify.c6
-rw-r--r--apps/plugins/dict.c2
-rw-r--r--apps/plugins/flipit.c11
-rw-r--r--apps/plugins/jewels.c12
-rw-r--r--apps/plugins/jpeg.c12
-rw-r--r--apps/plugins/logo.c6
-rw-r--r--apps/plugins/mandelbrot.c13
-rw-r--r--apps/plugins/minesweeper.c9
-rw-r--r--apps/plugins/mosaique.c5
-rw-r--r--apps/plugins/mp3_encoder.c6
-rw-r--r--apps/plugins/plasma.c6
-rw-r--r--apps/plugins/pong.c7
-rw-r--r--apps/plugins/rockblox.c6
-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.c9
-rw-r--r--apps/plugins/solitaire.c24
-rw-r--r--apps/plugins/star.c12
-rw-r--r--apps/plugins/starfield.c6
-rw-r--r--apps/plugins/stats.c2
-rw-r--r--apps/plugins/stopwatch.c7
-rw-r--r--apps/plugins/sudoku.c8
-rw-r--r--apps/plugins/viewer.c11
-rw-r--r--apps/recorder/keyboard.c14
-rw-r--r--apps/settings.h9
-rw-r--r--apps/tree.h17
-rw-r--r--firmware/app.lds4
-rw-r--r--firmware/boot.lds6
-rw-r--r--firmware/drivers/ata.c40
-rw-r--r--firmware/drivers/power.c8
-rw-r--r--firmware/export/button.h14
-rw-r--r--firmware/export/config-gigabeat.h94
-rw-r--r--firmware/export/config.h11
-rw-r--r--firmware/export/cpu.h3
-rwxr-xr-xtools/configure26
-rw-r--r--uisimulator/sdl/UI-gigabeatf.bmpbin0 -> 1050742 bytes
-rw-r--r--uisimulator/sdl/button.c8
-rw-r--r--uisimulator/sdl/uisdl.h10
58 files changed, 599 insertions, 8 deletions
diff --git a/apps/bitmaps/native/SOURCES b/apps/bitmaps/native/SOURCES
index c83bad5ebd..5ee09c5303 100644
--- a/apps/bitmaps/native/SOURCES
+++ b/apps/bitmaps/native/SOURCES
@@ -11,10 +11,12 @@ rockboxlogo.160x53x2.bmp
rockboxlogo.160x50x16.bmp
#elif (LCD_WIDTH == 176) && (LCD_DEPTH == 16)
rockboxlogo.176x54x16.bmp
-#elif (LCD_WIDTH == 320) && (LCD_DEPTH == 16)
-rockboxlogo.320x98x16.bmp
-#elif (LCD_WIDTH >= 220) && (LCD_DEPTH == 16)
+#elif (LCD_WIDTH == 220) && (LCD_DEPTH == 16)
rockboxlogo.220x68x16.bmp
+#elif (LCD_WIDTH == 240) && (LCD_DEPTH == 16)
+rockboxlogo.240x74x16.bmp
+#elif (LCD_WIDTH >= 320) && (LCD_DEPTH == 16)
+rockboxlogo.320x98x16.bmp
#endif
#endif /* HAVE_LCD_BITMAP */
diff --git a/apps/bitmaps/native/rockboxlogo.240x74x16.bmp b/apps/bitmaps/native/rockboxlogo.240x74x16.bmp
new file mode 100644
index 0000000000..fd335b2fb8
--- /dev/null
+++ b/apps/bitmaps/native/rockboxlogo.240x74x16.bmp
Binary files differ
diff --git a/apps/bookmark.h b/apps/bookmark.h
index 2d1dc3e27f..8e8f6b684a 100644
--- a/apps/bookmark.h
+++ b/apps/bookmark.h
@@ -48,6 +48,11 @@
#define BOOKMARK_DELETE BUTTON_REC | BUTTON_REPEAT
#define BOOKMARK_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define BOOKMARK_SELECT BUTTON_MENU
+#define BOOKMARK_DELETE BUTTON_POWER
+#define BOOKMARK_DOWN BUTTON_A
+
#else /* player, recorder, gmini */
#define BOOKMARK_SELECT BUTTON_PLAY
#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_PLAY)
diff --git a/apps/eq_menu.c b/apps/eq_menu.c
index 0e754dd979..f6c8dba0df 100644
--- a/apps/eq_menu.c
+++ b/apps/eq_menu.c
@@ -85,6 +85,15 @@
#define EQ_BTN_CHANGE_MODE BUTTON_SELECT
#define EQ_BTN_EXIT BUTTON_PLAY
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+
+#define EQ_BTN_DECREMENT BUTTON_LEFT
+#define EQ_BTN_INCREMENT BUTTON_RIGHT
+#define EQ_BTN_NEXT_BAND BUTTON_DOWN
+#define EQ_BTN_PREV_BAND BUTTON_UP
+#define EQ_BTN_CHANGE_MODE BUTTON_SELECT
+#define EQ_BTN_EXIT BUTTON_A
+
#endif
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index dc6841b881..3277037bfa 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -233,6 +233,29 @@
#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+
+#define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL)
+#define WPS_NEXT_PRE BUTTON_RIGHT
+#define WPS_PREV (BUTTON_LEFT | BUTTON_REL)
+#define WPS_PREV_PRE BUTTON_LEFT
+#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
+#define WPS_REW (BUTTON_LEFT | BUTTON_REPEAT)
+#define WPS_INCVOL BUTTON_UP
+#define WPS_DECVOL BUTTON_DOWN
+#define WPS_PAUSE (BUTTON_POWER | BUTTON_REL)
+#define WPS_PAUSE_PRE BUTTON_POWER
+#define WPS_MENU (BUTTON_MENU | BUTTON_REL)
+#define WPS_MENU_PRE BUTTON_MENU
+#define WPS_BROWSE (BUTTON_SELECT | BUTTON_REL)
+#define WPS_BROWSE_PRE BUTTON_SELECT
+#define WPS_EXIT BUTTON_A
+#define WPS_ID3 (BUTTON_MENU | BUTTON_POWER)
+#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
+#define WPS_QUICK (BUTTON_MENU | BUTTON_REPEAT)
+#define WPS_NEXT_DIR (BUTTON_RIGHT | BUTTON_POWER)
+#define WPS_PREV_DIR (BUTTON_LEFT | BUTTON_POWER)
+
#endif
/* constants used in line_type and as refresh_mode for wps_refresh */
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 23a0fc37b8..e72e00c5d1 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -93,6 +93,10 @@
#define LIST_NEXT BUTTON_DOWN
#define LIST_PREV BUTTON_UP
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define LIST_NEXT BUTTON_DOWN
+#define LIST_PREV BUTTON_UP
+
#endif
/*
diff --git a/apps/gui/select.h b/apps/gui/select.h
index ff552950d7..5acf0f8c96 100644
--- a/apps/gui/select.h
+++ b/apps/gui/select.h
@@ -93,6 +93,14 @@
#define SELECT_CANCEL BUTTON_PLAY
#define SELECT_CANCEL2 BUTTON_POWER
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define SELECT_INC BUTTON_UP
+#define SELECT_DEC BUTTON_DOWN
+#define SELECT_OK BUTTON_MENU
+#define SELECT_OK2 BUTTON_LEFT
+#define SELECT_CANCEL BUTTON_A
+#define SELECT_CANCEL2 BUTTON_POWER
+
#endif
struct gui_select
diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h
index c6519bc00e..5fcd1a62e3 100644
--- a/apps/gui/yesno.h
+++ b/apps/gui/yesno.h
@@ -32,6 +32,9 @@
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define YESNO_OK BUTTON_RIGHT
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define YESNO_OK BUTTON_RIGHT
+
#endif
enum yesno_res
{
diff --git a/apps/menu.h b/apps/menu.h
index 31e8730831..77cb603b96 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -95,6 +95,16 @@
#define MENU_EXIT_MENU BUTTON_REC
#define MENU_ENTER BUTTON_RIGHT
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+
+#define MENU_EXIT BUTTON_LEFT
+#define MENU_EXIT2 BUTTON_A
+#define MENU_EXIT_MENU BUTTON_MENU
+#define MENU_ENTER BUTTON_RIGHT
+#define MENU_ENTER2 BUTTON_SELECT
+#define MENU_NEXT BUTTON_DOWN
+#define MENU_PREV BUTTON_UP
+
#endif
struct menu_item {
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c
index 31a2ac582c..6c9988eb53 100644
--- a/apps/plugins/battery_test.c
+++ b/apps/plugins/battery_test.c
@@ -47,6 +47,8 @@ PLUGIN_HEADER
#define BATTERY_TEST_QUIT BUTTON_MENU
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define BATTERY_TEST_QUIT BUTTON_POWER
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define BATTERY_TEST_QUIT BUTTON_A
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 11f6bd3d11..71b2ebb5f2 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -15,6 +15,8 @@ bejeweled_jewels.160x128x16.bmp
bejeweled_jewels.160x128x16.bmp
#elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176)
bejeweled_jewels.220x176x16.bmp
+#elif (LCD_WIDTH == 240) && (LCD_HEIGHT == 320)
+bejeweled_jewels.220x176x16.bmp
#elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
bejeweled_jewels.320x240x16.bmp
#endif
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index cad0379b50..6c48e802d4 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -64,6 +64,12 @@ PLUGIN_HEADER
#define BOUNCE_QUIT BUTTON_POWER
#define BOUNCE_MODE BUTTON_PLAY
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define BOUNCE_UP BUTTON_UP
+#define BOUNCE_DOWN BUTTON_DOWN
+#define BOUNCE_QUIT BUTTON_A
+#define BOUNCE_MODE BUTTON_POWER
+
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 10f230ea66..899f022717 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -75,6 +75,18 @@ PLUGIN_HEADER
#define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD)
#define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK)
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+
+#define QUIT BUTTON_A
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define SELECT BUTTON_SELECT
+#define UP BUTTON_UP
+#define DOWN BUTTON_DOWN
+
+#define SCROLL_FWD(x) (0)
+#define SCROLL_BACK(x) (0)
+
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */
#define QUIT BUTTON_POWER
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index fb31d3d516..6bde1b0a09 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -153,6 +153,16 @@ PLUGIN_HEADER
#define CALCULATOR_CALC BUTTON_PLAY
#define CALCULATOR_CLEAR BUTTON_REC
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+
+#define CALCULATOR_UP BUTTON_UP
+#define CALCULATOR_DOWN BUTTON_DOWN
+#define CALCULATOR_QUIT BUTTON_A
+#define CALCULATOR_INPUT_CALC_PRE BUTTON_MENU
+#define CALCULATOR_INPUT (BUTTON_MENU | BUTTON_REL)
+#define CALCULATOR_CALC BUTTON_SELECT
+#define CALCULATOR_CLEAR BUTTON_POWER
+
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index 84979ab401..edfd421255 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -96,6 +96,16 @@ PLUGIN_HEADER
#define CHC_SETTINGS_OK BUTTON_SELECT
#define CHC_SETTINGS_CANCEL BUTTON_REC
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define CHC_QUIT BUTTON_A
+#define CHC_STARTSTOP BUTTON_SELECT
+#define CHC_RESET BUTTON_POWER
+#define CHC_MENU BUTTON_MENU
+#define CHC_SETTINGS_INC BUTTON_RIGHT
+#define CHC_SETTINGS_DEC BUTTON_LEFT
+#define CHC_SETTINGS_OK BUTTON_MENU
+#define CHC_SETTINGS_CANCEL BUTTON_A
+
#endif
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index 1be48823ed..29816bfa13 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -992,6 +992,14 @@ STATIC void chip8 (void)
#define CHIP8_KEY6 BUTTON_RIGHT
#define CHIP8_KEY8 BUTTON_DOWN
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define CHIP8_OFF BUTTON_A
+#define CHIP8_KEY2 BUTTON_UP
+#define CHIP8_KEY4 BUTTON_LEFT
+#define CHIP8_KEY5 BUTTON_MENU
+#define CHIP8_KEY6 BUTTON_RIGHT
+#define CHIP8_KEY8 BUTTON_DOWN
+
#endif
static byte chip8_virtual_keys[16];
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 63dcce4c33..71da39885e 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -120,6 +120,19 @@ PLUGIN_HEADER
#define CUBE_PAUSE (BUTTON_PLAY | BUTTON_REL)
#define CUBE_HIGHSPEED (BUTTON_REC | BUTTON_REL)
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define CUBE_QUIT BUTTON_A
+#define CUBE_X_INC BUTTON_LEFT
+#define CUBE_X_DEC BUTTON_RIGHT
+#define CUBE_Y_INC BUTTON_UP
+#define CUBE_Y_DEC BUTTON_DOWN
+#define CUBE_Z_INC (BUTTON_POWER | BUTTON_UP)
+#define CUBE_Z_DEC (BUTTON_POWER | BUTTON_DOWN)
+#define CUBE_MODE BUTTON_MENU
+#define CUBE_PAUSE_PRE BUTTON_SELECT
+#define CUBE_PAUSE (BUTTON_SELECT | BUTTON_REL)
+#define CUBE_HIGHSPEED (BUTTON_POWER | BUTTON_REL)
+
#endif
#ifdef HAVE_LCD_BITMAP
diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c
index d7e6f28ccb..0ec14d5d2f 100644
--- a/apps/plugins/databox/databox.c
+++ b/apps/plugins/databox/databox.c
@@ -43,6 +43,9 @@ PLUGIN_HEADER
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define DBX_SELECT BUTTON_SELECT
#define DBX_STOP BUTTON_PLAY
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define DBX_SELECT BUTTON_SELECT
+#define DBX_STOP BUTTON_A
#endif
#define MAX_TOKENS 70
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index da7cd6eb96..36f7b924d3 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -38,6 +38,12 @@ PLUGIN_HEADER
#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
#define DEMYSTIFY_INCREASE_SPEED BUTTON_UP
#define DEMYSTIFY_DECREASE_SPEED BUTTON_DOWN
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define DEMYSTIFY_QUIT BUTTON_A
+#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT
+#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT
+#define DEMYSTIFY_INCREASE_SPEED BUTTON_UP
+#define DEMYSTIFY_DECREASE_SPEED BUTTON_DOWN
#else
#define DEMYSTIFY_QUIT BUTTON_OFF
#define DEMYSTIFY_ADD_POLYGON BUTTON_UP
diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c
index cb68f4cce2..62bb9a73a4 100644
--- a/apps/plugins/dict.c
+++ b/apps/plugins/dict.c
@@ -110,6 +110,8 @@ long reverse (long N) {
#define LP_QUIT BUTTON_PLAY
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define LP_QUIT BUTTON_POWER
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define LP_QUIT BUTTON_A
#else
#define LP_QUIT BUTTON_OFF
#endif
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 4b7ef42376..a4c9cea9db 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -74,6 +74,17 @@ PLUGIN_HEADER
#define FLIPIT_TOGGLE_PRE BUTTON_SELECT
#define FLIPIT_TOGGLE (BUTTON_SELECT | BUTTON_REL)
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+
+#define FLIPIT_UP BUTTON_UP
+#define FLIPIT_DOWN BUTTON_DOWN
+#define FLIPIT_QUIT BUTTON_A
+#define FLIPIT_SHUFFLE (BUTTON_POWER | BUTTON_LEFT)
+#define FLIPIT_SOLVE (BUTTON_POWER | BUTTON_RIGHT)
+#define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_UP)
+#define FLIPIT_TOGGLE_PRE BUTTON_MENU
+#define FLIPIT_TOGGLE (BUTTON_MENU | BUTTON_REL)
+
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 9e4ab66cbf..666827668f 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -76,6 +76,16 @@ PLUGIN_HEADER
#define BEJEWELED_SELECT BUTTON_SELECT
#define BEJEWELED_CANCEL BUTTON_PLAY
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define BEJEWELED_UP BUTTON_UP
+#define BEJEWELED_DOWN BUTTON_DOWN
+#define BEJEWELED_LEFT BUTTON_LEFT
+#define BEJEWELED_RIGHT BUTTON_RIGHT
+#define BEJEWELED_QUIT BUTTON_A
+#define BEJEWELED_START BUTTON_POWER
+#define BEJEWELED_SELECT BUTTON_SELECT
+#define BEJEWELED_RESUME BUTTON_MENU
+
#else
#error BEJEWELED: Unsupported keypad
#endif
@@ -88,7 +98,7 @@ PLUGIN_HEADER
#define NUM_SCORES 10
/* use 22x22 tiles (H300, iPod Color) */
-#elif (LCD_HEIGHT == 176) && (LCD_WIDTH == 220)
+#elif ((LCD_HEIGHT == 176) && (LCD_WIDTH == 220)) || ((LCD_HEIGHT == 320) && (LCD_WIDTH == 240))
#define TILE_WIDTH 22
#define TILE_HEIGHT 22
#define YOFS 0
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index ecd42b6234..ce27d7da3f 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -97,6 +97,18 @@ PLUGIN_HEADER
#define JPEG_NEXT BUTTON_PLAY
#define JPEG_PREVIOUS BUTTON_REC
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define JPEG_ZOOM_IN_PRE BUTTON_MENU
+#define JPEG_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
+#define JPEG_ZOOM_OUT (BUTTON_MENU | BUTTON_REPEAT)
+#define JPEG_UP BUTTON_UP
+#define JPEG_DOWN BUTTON_DOWN
+#define JPEG_LEFT BUTTON_LEFT
+#define JPEG_RIGHT BUTTON_RIGHT
+#define JPEG_QUIT BUTTON_A
+#define JPEG_NEXT (BUTTON_POWER | BUTTON_RIGHT)
+#define JPEG_PREVIOUS (BUTTON_POWER | BUTTON_LEFT)
+
#endif
/* different graphics libraries */
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index 1a16e5d2a3..982460ea8f 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -201,6 +201,12 @@ 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 == GIGABEAT_PAD
+#define LP_QUIT BUTTON_A
+#define LP_DEC_X BUTTON_LEFT
+#define LP_INC_X BUTTON_RIGHT
+#define LP_DEC_Y BUTTON_DOWN
+#define LP_INC_Y BUTTON_UP
#else
#define LP_QUIT BUTTON_OFF
#define LP_DEC_X BUTTON_LEFT
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index 4054ef35d9..3017bb4dac 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -90,6 +90,19 @@ PLUGIN_HEADER
#define MANDELBROT_MAXITER_INC (BUTTON_PLAY | BUTTON_RIGHT)
#define MANDELBROT_MAXITER_DEC (BUTTON_PLAY | BUTTON_LEFT)
#define MANDELBROT_RESET BUTTON_REC
+
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define MANDELBROT_QUIT BUTTON_A
+#define MANDELBROT_UP BUTTON_UP
+#define MANDELBROT_DOWN BUTTON_DOWN
+#define MANDELBROT_LEFT BUTTON_LEFT
+#define MANDELBROT_RIGHT BUTTON_RIGHT
+#define MANDELBROT_ZOOM_IN_PRE BUTTON_MENU
+#define MANDELBROT_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
+#define MANDELBROT_ZOOM_OUT (BUTTON_MENU | BUTTON_REPEAT)
+#define MANDELBROT_MAXITER_INC (BUTTON_POWER | BUTTON_RIGHT)
+#define MANDELBROT_MAXITER_DEC (BUTTON_POWER | BUTTON_LEFT)
+#define MANDELBROT_RESET BUTTON_SELECT
#endif
#if LCD_DEPTH < 8
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c
index 149bf92ed6..fd4507f4e3 100644
--- a/apps/plugins/minesweeper.c
+++ b/apps/plugins/minesweeper.c
@@ -89,6 +89,15 @@ PLUGIN_HEADER
#define MINESWP_DISCOVER BUTTON_SELECT
#define MINESWP_INFO (BUTTON_REC | BUTTON_PLAY)
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define MINESWP_UP BUTTON_UP
+#define MINESWP_DOWN BUTTON_DOWN
+#define MINESWP_QUIT BUTTON_A
+#define MINESWP_START BUTTON_SELECT
+#define MINESWP_TOGGLE BUTTON_SELECT
+#define MINESWP_DISCOVER BUTTON_POWER
+#define MINESWP_INFO BUTTON_MENU
+
#endif
/* here is a global api struct pointer. while not strictly necessary,
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index 12f35e40c8..b68667cc24 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -68,6 +68,11 @@ PLUGIN_HEADER
#define MOSAIQUE_SPEED BUTTON_SELECT
#define MOSAIQUE_RESTART BUTTON_PLAY
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define MOSAIQUE_QUIT BUTTON_A
+#define MOSAIQUE_SPEED BUTTON_MENU
+#define MOSAIQUE_RESTART BUTTON_SELECT
+
#endif
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index d1a967b1a3..cd9a314de3 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -1890,6 +1890,12 @@ char *get_mp3_filename(char *wav_name)
#define MP3ENC_NEXT BUTTON_DOWN
#define MP3ENC_DONE BUTTON_POWER
#define MP3ENC_SELECT BUTTON_SELECT
+#define MP3ENC_SELECT BUTTON_MENU
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define MP3ENC_PREV BUTTON_UP
+#define MP3ENC_NEXT BUTTON_DOWN
+#define MP3ENC_DONE BUTTON_A
+#define MP3ENC_SELECT BUTTON_SELECT
#endif
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c
index 83aef91890..ca589d77b6 100644
--- a/apps/plugins/plasma.c
+++ b/apps/plugins/plasma.c
@@ -55,6 +55,10 @@ static int plasma_frequency;
#define PLASMA_QUIT BUTTON_MENU
#define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_FWD
#define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_BACK
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define PLASMA_QUIT BUTTON_A
+#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
+#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define PLASMA_QUIT BUTTON_REC
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
@@ -72,6 +76,8 @@ static int plasma_frequency;
#define PLASMA_REGEN_COLORS BUTTON_SELECT
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
#define PLASMA_REGEN_COLORS BUTTON_SELECT
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define PLASMA_REGEN_COLORS BUTTON_SELECT
#endif
#endif
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index b725c9305a..a348ae7545 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -72,6 +72,13 @@ PLUGIN_HEADER
#define PONG_RIGHT_UP BUTTON_REC
#define PONG_RIGHT_DOWN BUTTON_PLAY
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define PONG_QUIT BUTTON_A
+#define PONG_LEFT_UP BUTTON_UP
+#define PONG_LEFT_DOWN BUTTON_DOWN
+#define PONG_RIGHT_UP BUTTON_POWER
+#define PONG_RIGHT_DOWN BUTTON_MENU
+
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 0c976369cf..6b26b3bd6a 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -36,6 +36,12 @@ PLUGIN_HEADER
#define ROCKBLOX_DOWN BUTTON_DOWN
#define ROCKBLOX_LEFT BUTTON_LEFT
#define ROCKBLOX_RIGHT BUTTON_RIGHT
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define ROCKBLOX_OFF BUTTON_A
+#define ROCKBLOX_UP BUTTON_UP
+#define ROCKBLOX_DOWN BUTTON_DOWN
+#define ROCKBLOX_LEFT BUTTON_LEFT
+#define ROCKBLOX_RIGHT BUTTON_RIGHT
#else
#define ROCKBLOX_OFF BUTTON_OFF
#define ROCKBLOX_UP BUTTON_UP
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index 2e4a221930..c1c2bef362 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -59,6 +59,13 @@ PLUGIN_HEADER
#define PUZZLE_SHUFFLE BUTTON_REC
#define PUZZLE_PICTURE BUTTON_PLAY
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define PUZZLE_QUIT BUTTON_A
+#define PUZZLE_UP BUTTON_UP
+#define PUZZLE_DOWN BUTTON_DOWN
+#define PUZZLE_SHUFFLE BUTTON_SELECT
+#define PUZZLE_PICTURE BUTTON_POWER
+
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index 04a4f3e0e2..272e0017c0 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -67,6 +67,12 @@ PLUGIN_HEADER
#define SNAKE_DOWN BUTTON_DOWN
#define SNAKE_PLAYPAUSE BUTTON_PLAY
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define SNAKE_QUIT BUTTON_A
+#define SNAKE_UP BUTTON_UP
+#define SNAKE_DOWN BUTTON_DOWN
+#define SNAKE_PLAYPAUSE BUTTON_SELECT
+
#else
#error "lacks keymapping"
#endif
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index 23b60734df..8407654110 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -113,6 +113,18 @@ PLUGIN_HEADER
#define SNAKE2_SELECT_TYPE BUTTON_RIGHT
#define SNAKE2_PLAYPAUSE BUTTON_SELECT
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define SNAKE2_UP BUTTON_UP
+#define SNAKE2_DOWN BUTTON_DOWN
+#define SNAKE2_QUIT BUTTON_A
+#define SNAKE2_LEVEL_UP BUTTON_UP
+#define SNAKE2_LEVEL_UP2 BUTTON_RIGHT
+#define SNAKE2_LEVEL_DOWN BUTTON_DOWN
+#define SNAKE2_LEVEL_DOWN2 BUTTON_LEFT
+#define SNAKE2_SELECT_MAZE BUTTON_POWER
+#define SNAKE2_SELECT_TYPE BUTTON_MENU
+#define SNAKE2_PLAYPAUSE BUTTON_SELECT
+
#else
#error "lacks keymapping"
#endif
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index c1487a8009..9001eabeef 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -42,6 +42,8 @@ PLUGIN_HEADER
#define SNOW_QUIT BUTTON_PLAY
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define SNOW_QUIT BUTTON_POWER
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define SNOW_QUIT BUTTON_A
#else
#define SNOW_QUIT BUTTON_OFF
#endif
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 73b014f457..501253b130 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -86,6 +86,15 @@ PLUGIN_HEADER
#define SOKOBAN_LEVEL_DOWN (BUTTON_PLAY | BUTTON_DOWN)
#define SOKOBAN_LEVEL_REPEAT BUTTON_REC
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define SOKOBAN_UP BUTTON_UP
+#define SOKOBAN_DOWN BUTTON_DOWN
+#define SOKOBAN_QUIT BUTTON_A
+#define SOKOBAN_UNDO BUTTON_MENU
+#define SOKOBAN_LEVEL_UP (BUTTON_POWER | BUTTON_UP)
+#define SOKOBAN_LEVEL_DOWN (BUTTON_POWER | BUTTON_DOWN)
+#define SOKOBAN_LEVEL_REPEAT BUTTON_SELECT
+
#endif
#ifdef HAVE_LCD_COLOR
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index cf6c6cb965..26629665d9 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -136,7 +136,22 @@ static struct plugin_api* rb;
#define SOL_REM2STACK (BUTTON_REC | BUTTON_DOWN)
#define SOL_MENU_RUN BUTTON_SELECT
#define SOL_MENU_INFO BUTTON_PLAY
-
+
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define SOL_QUIT BUTTON_A
+#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_LEFT | BUTTON_POWER)
+#define SOL_CUR2STACK (BUTTON_SELECT | BUTTON_REPEAT)
+#define SOL_REM2STACK (BUTTON_RIGHT | BUTTON_POWER)
+#define SOL_MENU_RUN BUTTON_SELECT
+#define SOL_MENU_RUN2 BUTTON_RIGHT
+#define SOL_MENU_INFO BUTTON_MENU
#endif
/* common help definitions */
@@ -181,6 +196,13 @@ static struct plugin_api* rb;
#define HELP_SOL_REM2CUR "REC+LEFT: Put the card on top of the remains' stack on top of the cursor."
#define HELP_SOL_CUR2STACK "REC+UP..: Put the card under the cursor on one of the 4 final stacks."
#define HELP_SOL_REM2STACK "REC+DOWN: Put the card on top of the remains' stack on one of the 4 final stacks."
+
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define HELP_SOL_MOVE "SELECT: Select cards, Move cards, reveal hidden cards ..."
+#define HELP_SOL_DRAW "MENU: Un-select a card if it was selected. Else, draw 3 new cards out of the remains' stack."
+#define HELP_SOL_REM2CUR "POWER+LEFT: Put the card on top of the remains' stack on top of the cursor."
+#define HELP_SOL_CUR2STACK "SELECT..: Put the card under the cursor on one of the 4 final stacks."
+#define HELP_SOL_REM2STACK "POWER+RIGHT: Put the card on top of the remains' stack on one of the 4 final stacks."
#endif
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index a6d30eefec..097f62cf9e 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -122,6 +122,18 @@ PLUGIN_HEADER
#define STAR_LEVEL_REPEAT (BUTTON_PLAY | BUTTON_RIGHT)
#define STAR_MENU_RUN BUTTON_REC
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+
+#define STAR_QUIT BUTTON_A
+#define STAR_UP BUTTON_UP
+#define STAR_DOWN BUTTON_DOWN
+#define STAR_TOGGLE_CONTROL_PRE BUTTON_MENU
+#define STAR_TOGGLE_CONTROL (BUTTON_MENU | BUTTON_REL)
+#define STAR_LEVEL_UP (BUTTON_POWER | BUTTON_UP)
+#define STAR_LEVEL_DOWN (BUTTON_POWER | BUTTON_DOWN)
+#define STAR_LEVEL_REPEAT (BUTTON_POWER | BUTTON_RIGHT)
+#define STAR_MENU_RUN BUTTON_RIGHT
+
#endif
/* function returns because of USB? */
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index f72c1ce5a9..7535caf032 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -38,6 +38,12 @@ 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 == GIGABEAT_PAD)
+#define STARFIELD_QUIT BUTTON_A
+#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 718b3ec928..12c11a9190 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -36,6 +36,8 @@ static int fontwidth, fontheight;
#define STATS_STOP BUTTON_PLAY
#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
#define STATS_STOP BUTTON_POWER
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define STATS_STOP BUTTON_A
#else
#define STATS_STOP BUTTON_OFF
#endif
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index c5b22404ed..905b9d9e50 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -84,6 +84,13 @@ PLUGIN_HEADER
#define STOPWATCH_LAP_TIMER BUTTON_SELECT
#define STOPWATCH_SCROLL_UP BUTTON_UP
#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define STOPWATCH_QUIT BUTTON_A
+#define STOPWATCH_START_STOP BUTTON_SELECT
+#define STOPWATCH_RESET_TIMER BUTTON_POWER
+#define STOPWATCH_LAP_TIMER BUTTON_MENU
+#define STOPWATCH_SCROLL_UP BUTTON_UP
+#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
#endif
static struct plugin_api* rb;
diff --git a/apps/plugins/sudoku.c b/apps/plugins/sudoku.c
index 7894877e23..5cdf686778 100644
--- a/apps/plugins/sudoku.c
+++ b/apps/plugins/sudoku.c
@@ -111,6 +111,14 @@ PLUGIN_HEADER
#define SUDOKU_BUTTON_MENU BUTTON_PLAY
#define SUDOKU_BUTTON_POSSIBLE BUTTON_REC
+#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
+#define SUDOKU_BUTTON_QUIT BUTTON_A
+#define SUDOKU_BUTTON_UP BUTTON_UP
+#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
+#define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT
+#define SUDOKU_BUTTON_MENU BUTTON_MENU
+#define SUDOKU_BUTTON_POSSIBLE BUTTON_POWER
+
#elif
#error SUDOKU: Unsupported keypad
#endif
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 8e72229c5a..238c4e0fb2 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -152,6 +152,17 @@ PLUGIN_HEADER
#define VIEWER_MODE_LINE (BUTTON_PLAY | BUTTON_REPEAT)
#define VIEWER_MODE_WIDTH BUTTON_SELECT
+/* iAudio X5 keys */
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define VIEWER_QUIT BUTTON_A
+#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_MODE_WRAP (BUTTON_POWER | BUTTON_REL)
+#define VIEWER_MODE_LINE (BUTTON_POWER | BUTTON_REPEAT)
+#define VIEWER_MODE_WIDTH BUTTON_MENU
+
#endif
enum {
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index d45717c6dd..d1756ace2c 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -156,6 +156,20 @@
#define KBD_UP BUTTON_UP
#define KBD_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+
+/* TODO: Check keyboard mappings */
+
+#define KBD_MODES /* Gigabeat uses 2 modes, picker and line edit */
+#define KBD_SELECT (BUTTON_MENU | BUTTON_REL) /* backspace in line edit */
+#define KBD_SELECT_PRE BUTTON_MENU
+#define KBD_DONE BUTTON_POWER
+#define KBD_ABORT BUTTON_A
+#define KBD_LEFT BUTTON_LEFT
+#define KBD_RIGHT BUTTON_RIGHT
+#define KBD_UP BUTTON_UP
+#define KBD_DOWN BUTTON_DOWN
+
#endif
#if KEYBOARD_PAGES == 1
diff --git a/apps/settings.h b/apps/settings.h
index c7f70c3a19..753f067234 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -119,6 +119,15 @@
#define SETTINGS_NEXT BUTTON_RIGHT
#define SETTINGS_ACCEPT BUTTON_PLAY
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+#define SETTINGS_INC BUTTON_UP
+#define SETTINGS_DEC BUTTON_DOWN
+#define SETTINGS_OK BUTTON_MENU
+#define SETTINGS_CANCEL BUTTON_A
+#define SETTINGS_PREV BUTTON_LEFT
+#define SETTINGS_NEXT BUTTON_RIGHT
+#define SETTINGS_ACCEPT BUTTON_SELECT
+
#endif
/* data structures */
diff --git a/apps/tree.h b/apps/tree.h
index 92a2fcf770..9b4888c46a 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -155,6 +155,23 @@
#define TREE_WPS_PRE BUTTON_REC
#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#define TREE_POWER_BTN (BUTTON_PLAY | BUTTON_REPEAT)
+
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+
+#define TREE_NEXT BUTTON_DOWN
+#define TREE_PREV BUTTON_UP
+#define TREE_EXIT BUTTON_LEFT
+#define TREE_ABORT BUTTON_A
+#define TREE_ENTER BUTTON_RIGHT
+#define TREE_RUN (BUTTON_SELECT | BUTTON_REL)
+#define TREE_RUN_PRE BUTTON_SELECT
+#define TREE_MENU (BUTTON_MENU | BUTTON_REL)
+#define TREE_MENU_PRE BUTTON_MENU
+#define TREE_WPS (BUTTON_POWER | BUTTON_REL)
+#define TREE_WPS_PRE BUTTON_POWER
+#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
+#define TREE_POWER_BTN BUTTON_POWER
+
#endif
struct entry {
diff --git a/firmware/app.lds b/firmware/app.lds
index 74cca5a96a..5309311ee1 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -130,6 +130,10 @@ _pluginbuf = 0;
#define DRAMORIG 0xc00000 + STUBOFFSET
#define IRAMORIG 0x400000
#define IRAMSIZE 0x8000
+#elif CONFIG_CPU==S3C2440
+#define DRAMORIG 0x30000000 + STUBOFFSET
+#define IRAMORIG 0x40000000
+#define IRAMSIZE 4K
#else
#define DRAMORIG 0x09000000 + STUBOFFSET
#define IRAMORIG 0x0f000000
diff --git a/firmware/boot.lds b/firmware/boot.lds
index 779b7b3b85..0b49917edd 100644
--- a/firmware/boot.lds
+++ b/firmware/boot.lds
@@ -38,6 +38,12 @@ INPUT(crt0.o)
#define IRAMSIZE 0x18000
#define FLASHORIG 0x001f0000
#define FLASHSIZE 2M
+#elif CONFIG_CPU == S3C2440
+#define DRAMORIG 0x30000000
+#define IRAMORIG 0x40000000
+#define IRAMSIZE 4K
+#define FLASHORIG 0x0000000
+#define FLASHSIZE 1M
#elif CONFIG_CPU == PP5002
#define DRAMORIG 0x28000000
#define IRAMORIG 0x40000000
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index e4600e171a..8b3e54da44 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -246,6 +246,43 @@ int ide_read_register(int reg) {
return ide_reg_temp;
}
+#elif defined(TOSHIBA_GIGABEAT_F)
+
+/* don't use sh7034 assembler routines */
+#define PREFER_C_READING
+#define PREFER_C_WRITING
+
+#define ATA_IOBASE 0x20000000
+#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
+#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x02)))
+#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
+#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x06)))
+#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
+#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
+#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x12)))
+#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
+#define ATA_CONTROL (*((volatile unsigned char*)(0x21000000 + 0x1c)))
+
+#define STATUS_BSY 0x80
+#define STATUS_RDY 0x40
+#define STATUS_DF 0x20
+#define STATUS_DRQ 0x08
+#define STATUS_ERR 0x01
+#define ERROR_ABRT 0x04
+
+#define WRITE_PATTERN1 0xa5
+#define WRITE_PATTERN2 0x5a
+#define WRITE_PATTERN3 0xaa
+#define WRITE_PATTERN4 0x55
+
+#define READ_PATTERN1 0xa5
+#define READ_PATTERN2 0x5a
+#define READ_PATTERN3 0xaa
+#define READ_PATTERN4 0x55
+
+#define SET_REG(reg,val) reg = (val)
+#define SET_16BITREG(reg,val) reg = (val)
+
#endif
#define ATA_FEATURE ATA_ERROR
@@ -1429,6 +1466,9 @@ int ata_init(void)
#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
bool coldstart = false;
/* TODO: Implement coldstart variable */
+#elif defined(TOSHIBA_GIGABEAT_F)
+ /* TODO */
+ bool coldstart = true;
#else
bool coldstart = (PACR2 & 0x4000) != 0;
#endif
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index d7750a33b2..b62121298d 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -122,6 +122,8 @@ bool charger_inserted(void)
/* FM or V2, can also charge from the USB port */
return (adc_read(ADC_CHARGE_REGULATOR) < 0x1FF) ||
(adc_read(ADC_USB_POWER) < 0x1FF);
+#elif defined(TOSHIBA_GIGABEAT_F)
+ return false;
#else
/* Player */
return (PADR & 1) == 0;
@@ -189,6 +191,8 @@ void ide_power_enable(bool on)
P1 &= ~0x08;
#elif CONFIG_CPU == PNX0101
/* no ide controller */
+#elif defined(TOSHIBA_GIGABEAT_F)
+ /* Gigabeat TODO */
#else /* SH1 based archos */
bool touched = false;
#ifdef NEEDS_ATA_POWER_ON
@@ -241,6 +245,8 @@ bool ide_powered(void)
return true;
#elif defined(GMINI_ARCH)
return (P1 & 0x08?true:false);
+#elif defined(TOSHIBA_GIGABEAT_F)
+ return false;
#else /* SH1 based archos */
#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF)
#ifdef ATA_POWER_PLAYERSTYLE
@@ -283,6 +289,8 @@ void power_off(void)
#elif defined(GMINI_ARCH)
P1 &= ~1;
P1CON &= ~1;
+#elif defined(TOSHIBA_GIGABEAT_F)
+ /* FIXME: Can we turn the device off, or only enter sleep mode? */
#else
#ifdef HAVE_POWEROFF_ON_PBDR
and_b(~0x10, &PBDRL);
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 484698e492..3ae1d37d52 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -197,6 +197,20 @@ bool button_hold(void);
#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00400000)
+#elif CONFIG_KEYPAD == GIGABEAT_PAD
+
+/* TODO: These codes should relate to the hardware */
+
+#define BUTTON_POWER 0x0001
+#define BUTTON_MENU 0x0002
+#define BUTTON_VOL_UP 0x0008
+#define BUTTON_VOL_DOWN 0x0010
+#define BUTTON_A 0x0020
+#define BUTTON_UP 0x0100
+#define BUTTON_DOWN 0x0200
+#define BUTTON_SELECT 0x0400
+
+
#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */
#endif /* _BUTTON_H_ */
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
new file mode 100644
index 0000000000..db99bf5d57
--- /dev/null
+++ b/firmware/export/config-gigabeat.h
@@ -0,0 +1,94 @@
+/*
+ * This config file is for toshiba Gigabeat F
+ */
+#define TOSHIBA_GIGABEAT_F 1
+
+/* For Rolo and boot loader */
+#define MODEL_NUMBER 1
+
+/* define this if you have a bitmap LCD display */
+#define HAVE_LCD_BITMAP 1
+
+/* define this if you have a colour LCD */
+#define HAVE_LCD_COLOR 1
+
+/* LCD dimensions */
+#define LCD_WIDTH 240
+#define LCD_HEIGHT 320
+#define LCD_DEPTH 16 /* 65k colours */
+#define LCD_PIXELFORMAT RGB565 /* rgb565 */
+
+
+#define CONFIG_KEYPAD GIGABEAT_PAD
+
+/* Define this if you do software codec */
+#define CONFIG_CODEC SWCODEC
+
+/* define this if you have a real-time clock */
+//#define CONFIG_RTC RTC_PCF50606
+
+/* Define this for LCD backlight available */
+#define CONFIG_BACKLIGHT BL_GIGABEAT /* port controlled PWM */
+
+/* Define this if you have a software controlled poweroff */
+#define HAVE_SW_POWEROFF
+
+/* The number of bytes reserved for loadable codecs */
+#define CODEC_SIZE 0x80000
+
+/* The number of bytes reserved for loadable plugins */
+#define PLUGIN_BUFFER_SIZE 0x80000
+
+/* Define this if you have the WM8975 audio codec */
+#define HAVE_WM8751
+
+#ifndef SIMULATOR
+
+/* Define this if you have a Motorola SCF5249 */
+#define CONFIG_CPU S3C2440
+
+/* Define this if you want to use coldfire's i2c interface */
+#define CONFIG_I2C I2C_S3C2440
+
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_LIPOL1300
+
+#define BATTERY_SCALE_FACTOR 23437 /* FIX: this value is picked at random */
+
+/* Define this if the platform can charge batteries */
+#define HAVE_CHARGING 1
+
+/* define this if the hardware can be powered off while charging */
+#define HAVE_POWEROFF_WHILE_CHARGING
+
+/* The size of the flash ROM */
+#define FLASH_SIZE 0x400000
+
+/* Define this to the CPU frequency */
+#define CPU_FREQ 16934400
+
+/* Define this if you have ATA power-off control */
+#define HAVE_ATA_POWER_OFF
+
+/* Virtual LED (icon) */
+#define CONFIG_LED LED_VIRTUAL
+
+#define CONFIG_LCD LCD_GIGABEAT
+
+/* Offset ( in the firmware file's header ) to the file CRC */
+#define FIRMWARE_OFFSET_FILE_CRC 0
+
+/* Offset ( in the firmware file's header ) to the real data */
+#define FIRMWARE_OFFSET_FILE_DATA 8
+
+#define USB_IRIVERSTYLE
+
+/* Define this if you have adjustable CPU frequency */
+#define HAVE_ADJUSTABLE_CPU_FREQ
+
+#define BOOTFILE_EXT "gigabeat"
+#define BOOTFILE "rockbox." BOOTFILE_EXT
+
+#define HAVE_BACKLIGHT_BRIGHTNESS
+
+#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 0e673cb988..1557accde5 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -42,6 +42,7 @@
#define PP5002 5002
#define PP5020 5020
#define PNX0101 101
+#define S3C2440 2440
/* CONFIG_KEYPAD */
#define PLAYER_PAD 0
@@ -54,6 +55,7 @@
#define IPOD_4G_PAD 7
#define IPOD_3G_PAD 8
#define IRIVER_IFP7XX_PAD 9
+#define GIGABEAT_PAD 10
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@@ -80,6 +82,7 @@
#define LCD_IPODVIDEO 8 /* as used by iPod Video */
#define LCD_IPOD2BPP 9 /* as used by all greyscale iPods */
#define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */
+#define LCD_GIGABEAT 11
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@@ -99,6 +102,7 @@
#define BL_IRIVER_H300 8 /* IRiver PWM */
#define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */
#define BL_IPODMINI 10 /* Apple iPod Mini */
+#define BL_GIGABEAT 11 /* Toshiba Gigabeat */
/* CONFIG_I2C */
#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
@@ -108,6 +112,7 @@
#define I2C_PP5002 4 /* PP5002 style */
#define I2C_PP5020 5 /* PP5020 style */
#define I2C_PNX0101 6 /* PNX0101 style */
+#define I2C_S3C2440 7
/* CONFIG_LED */
#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
@@ -120,6 +125,7 @@
#define RTC_M41ST84W 1 /* Archos Recorder */
#define RTC_PCF50605 2 /* iPod 3G and 4G*/
#define RTC_PCF50606 3 /* iriver H300 */
+#define RTC_S3C2440 4
/* else HW controlled LED (iRiver H1x0) */
@@ -160,6 +166,8 @@
#include "config-ipod4g.h"
#elif defined(IRIVER_IFP7XX)
#include "config-ifp7xx.h"
+#elif defined(GIGABEAT_F)
+#include "config-gigabeat.h"
#elif defined(IPOD_MINI)
#include "config-ipodmini.h"
#else
@@ -185,7 +193,8 @@
#endif
/* define for all cpus from ARM family */
-#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101)
+#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440)
+
#define CPU_ARM
#endif
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h
index d0b953ef6f..4c33ac96f4 100644
--- a/firmware/export/cpu.h
+++ b/firmware/export/cpu.h
@@ -39,3 +39,6 @@
#if CONFIG_CPU == PNX0101
#include "pnx0101.h"
#endif
+#if CONFIG_CPU == S3C2440
+#include "s3c2440.h"
+#endif
diff --git a/tools/configure b/tools/configure
index 8a345f8c7c..f131ea8b7b 100755
--- a/tools/configure
+++ b/tools/configure
@@ -212,6 +212,13 @@ arm7tdmicc () {
endian="little"
}
+arm9tdmicc () {
+ prefixtools arm-elf-
+ GCCOPTS="$CCOPTS -mcpu=arm9tdmi -ffunction-sections -mlong-calls"
+ GCCOPTIMIZE="-fomit-frame-pointer"
+ endian="little"
+}
+
whichaddr () {
case $archos in
gmini120|gminisp)
@@ -457,6 +464,7 @@ toolsdir='\$(ROOTDIR)/tools'
echo "17 - iPod 4G (Grayscale)"
echo "18 - iPod Mini (1G/2G)"
echo "19 - iriver iFP-790"
+ echo "20 - Toshiba Gigabeat F"
target_id=`input`;
@@ -467,6 +475,7 @@ toolsdir='\$(ROOTDIR)/tools'
archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb codepages"
iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb codepages"
iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb codepages"
+ gigabeatbitmaptools="$toolset bmp2rb codepages"
ipodbitmaptools="$toolset scramble ipod_fw bmp2rb codepages"
ifpbitmaptools="$toolset bmp2rb codepages"
@@ -837,6 +846,23 @@ toolsdir='\$(ROOTDIR)/tools'
toolset=$ifpbitmaptools
;;
+ 20)
+ archos="gigabeatf"
+ target="-DGIGABEAT_F"
+ memory=32 # always
+ arm9tdmicc
+ tool="cp"
+ bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
+ output="rockbox.gigabeat"
+ appextra="recorder:gui"
+ archosrom=""
+ flash=""
+ plugins="yes"
+ codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
+ toolset=$gigabeatbitmaptools
+ ;;
+
*)
echo "Please select an actual target platform!"
exit
diff --git a/uisimulator/sdl/UI-gigabeatf.bmp b/uisimulator/sdl/UI-gigabeatf.bmp
new file mode 100644
index 0000000000..3f4104407c
--- /dev/null
+++ b/uisimulator/sdl/UI-gigabeatf.bmp
Binary files differ
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 72224315a2..9571beac5e 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -86,14 +86,18 @@ void button_event(int key, bool pressed)
new_btn = BUTTON_ON;
#elif defined(BUTTON_SELECT) && defined(BUTTON_PLAY)
new_btn = BUTTON_PLAY;
+#elif defined BUTTON_POWER
+ new_btn = BUTTON_POWER;
#endif
break;
+ case SDLK_KP_ENTER:
#ifdef BUTTON_OFF
- case SDLK_RETURN:
new_btn = BUTTON_OFF;
- break;
+#elif defined BUTTON_A
+ new_btn = BUTTON_A;
#endif
+ break;
#ifdef BUTTON_F1
case SDLK_KP_DIVIDE:
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index 800a7f8ab6..70b8e18bd1 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -180,6 +180,16 @@
#define UI_REMOTE_BGCOLORLIGHT 250, 180, 130 // bkgnd of remote lcd (bklight)
#define UI_REMOTE_BGCOLOR 90, 145, 90 // bkgnd of remote lcd (no bklight)
+
+#elif defined(GIGABEAT_F)
+#define UI_TITLE "Toshiba Gigabeat"
+#define UI_WIDTH 401 // width of GUI window
+#define UI_HEIGHT 655 // height of GUI window
+/* high-colour */
+#define UI_LCD_POSX 48 // x position of lcd
+#define UI_LCD_POSY 60 // y position of lcd
+#define UI_LCD_WIDTH 240
+#define UI_LCD_HEIGHT 320
#endif
extern SDL_Surface *gui_surface;