Start of work on a port to the Archos 'AV300' (AV320/340/380) - a working UI simulator (but with a dummy background image for now) and the beginnings of the target-specific firmare code. Port is temporarily using a 2bpp LCD buffer format - the AV300 has a 320x240 colour (YCbCr-based) LCD which will need a new framebuffer format and drawing routines, but the LCD is also capable of various paletted bitmap modes, one of which has an identical framebuffer format to the greyscale ipods. Buttons (and hence the button mappings) are identical to the Archos Recorder, with the exception that the PLAY button on the Recorder is replaced by pressing the joystick on the AV300 (which I call BUTTON_SELECT). The initial port will begin by being strictly HWCODEC, but will evolve to be a hybrid SWCODEC/HWCODEC platform - it has a MAS3587F but also a main CPU (54MHz arm7tdmi plus DSP) capable of software decoding of at least some formats.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12008 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/SOURCES b/apps/SOURCES
index c9587cf..2070732 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -113,4 +113,6 @@
keymaps/keymap-ifp7xx.c
#elif CONFIG_KEYPAD == SANSA_E200_PAD
keymaps/keymap-e200.c
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+keymaps/keymap-av300.c
#endif
diff --git a/apps/bitmaps/native/SOURCES b/apps/bitmaps/native/SOURCES
index 027f33e..ba642ab 100644
--- a/apps/bitmaps/native/SOURCES
+++ b/apps/bitmaps/native/SOURCES
@@ -9,6 +9,8 @@
rockboxlogo.138x46x2.bmp
#elif (LCD_WIDTH == 160) && (LCD_DEPTH == 2)
rockboxlogo.160x53x2.bmp
+#elif (LCD_WIDTH == 320) && (LCD_DEPTH == 2)
+rockboxlogo.160x53x2.bmp
#elif (LCD_WIDTH == 160) && (LCD_DEPTH == 16)
rockboxlogo.160x50x16.bmp
#elif (LCD_WIDTH == 176) && (LCD_DEPTH == 16)
diff --git a/apps/keymaps/keymap-av300.c b/apps/keymaps/keymap-av300.c
new file mode 100644
index 0000000..22e1fcc
--- /dev/null
+++ b/apps/keymaps/keymap-av300.c
@@ -0,0 +1,261 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2006 Antoine Cellerier <dionoea @t videolan d.t org>
+ *
+ * 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 archos AV300 target
+ *
+ * \TODO handle F3
+ */
+
+#include "config.h"
+#include "action.h"
+#include "button.h"
+#include "settings.h"
+
+/* CONTEXT_CUSTOM's used in this file...
+
+CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions)
+
+
+*/
+
+static const struct button_mapping button_context_standard[] = {
+ { 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_STD_OK, BUTTON_ON, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+
+ { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_STD_MENU, BUTTON_F1, BUTTON_NONE },
+ { ACTION_STD_QUICKSCREEN, BUTTON_F2, BUTTON_NONE },
+ { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
+ { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_F3, BUTTON_F3, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+};
+
+static const struct button_mapping button_context_wps[] = {
+ { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+ { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
+ { ACTION_WPS_STOP, BUTTON_OFF|BUTTON_REL, BUTTON_OFF },
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_WPS_MENU, BUTTON_F1|BUTTON_REL, BUTTON_F1 },
+ { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
+ { ACTION_WPS_QUICKSCREEN, BUTTON_F2, BUTTON_NONE },
+ { ACTION_WPS_BROWSE, BUTTON_ON|BUTTON_REL, BUTTON_ON },
+ { ACTION_WPS_ID3SCREEN, BUTTON_F1|BUTTON_ON, BUTTON_NONE },
+ { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_UP, BUTTON_ON },
+ { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_DOWN, BUTTON_ON },
+ { ACTION_STD_KEYLOCK, BUTTON_F1|BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_F3, BUTTON_F3, BUTTON_NONE },
+ { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_WPS_ABSETA_PREVDIR, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_WPSAB_RESET, BUTTON_ON|BUTTON_OFF, BUTTON_ON },
+
+
+ LAST_ITEM_IN_LIST
+};
+
+static const struct button_mapping button_context_settings[] = {
+ { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT, BUTTON_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 },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+};
+
+static const struct button_mapping button_context_tree[] = {
+ { ACTION_TREE_WPS, BUTTON_ON|BUTTON_REL, BUTTON_ON },
+ { ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
+ { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
+ { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP, BUTTON_ON },
+ { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_ON|BUTTON_UP },
+ { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN, BUTTON_ON },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_ON|BUTTON_DOWN },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_listtree */
+
+static const struct button_mapping button_context_tree_scroll_lr[] = {
+ { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
+ { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1),
+};
+
+static const struct button_mapping button_context_yesno[] = {
+ { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+};
+static const struct button_mapping button_context_quickscreen[] = {
+ { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE },
+ { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_SELECT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_quickscreen */
+
+static const struct button_mapping button_context_pitchscreen[] = {
+ { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
+ { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_TOGGLE_MODE, BUTTON_F1, BUTTON_NONE },
+ { ACTION_PS_RESET, BUTTON_ON, BUTTON_NONE },
+ { ACTION_PS_EXIT, BUTTON_OFF, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_pitchcreen */
+
+static const struct button_mapping button_context_recscreen[] = {
+ { ACTION_REC_PAUSE, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_REC_F2, BUTTON_F2, BUTTON_NONE },
+ { ACTION_REC_F3, BUTTON_F3, BUTTON_NONE },
+ { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_SETTINGS_INC, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_recscreen */
+
+static 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_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_KBD_PAGE_FLIP, BUTTON_F1, BUTTON_NONE },
+ { ACTION_KBD_DONE, BUTTON_F2, BUTTON_NONE },
+ { ACTION_KBD_ABORT, BUTTON_OFF, BUTTON_NONE },
+ { ACTION_KBD_BACKSPACE, BUTTON_F3, BUTTON_NONE },
+ { ACTION_KBD_BACKSPACE, BUTTON_F3|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
+ { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
+ { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ LAST_ITEM_IN_LIST
+}; /* button_context_keyboard */
+
+static const struct button_mapping button_context_bmark[] = {
+ { ACTION_BMS_DELETE, BUTTON_SELECT|BUTTON_ON, BUTTON_SELECT },
+ { ACTION_BMS_DELETE, BUTTON_SELECT|BUTTON_ON, BUTTON_ON },
+ { ACTION_BMS_EXIT, BUTTON_OFF, BUTTON_NONE },
+ { ACTION_BMS_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+
+}; /* button_context_settings_bmark */
+
+static const struct button_mapping button_context_radio[] = {
+ { ACTION_FM_MENU, BUTTON_F1, BUTTON_NONE },
+ { ACTION_FM_PRESET, BUTTON_F2, BUTTON_NONE },
+ { ACTION_FM_RECORD, BUTTON_F3, BUTTON_NONE },
+ { ACTION_FM_FREEZE, BUTTON_SELECT, BUTTON_NONE },
+ { ACTION_FM_STOP, BUTTON_OFF, BUTTON_NONE },
+ { ACTION_FM_MODE, BUTTON_ON | BUTTON_REPEAT, BUTTON_ON },
+ { ACTION_FM_EXIT, BUTTON_ON | BUTTON_REL, BUTTON_ON },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
+
+};
+
+const struct button_mapping* get_context_mapping( int context )
+{
+ switch( context )
+ {
+ case CONTEXT_WPS:
+ return button_context_wps;
+ case CONTEXT_SETTINGS_TIME:
+ case CONTEXT_SETTINGS:
+ return button_context_settings;
+
+ case CONTEXT_YESNOSCREEN:
+ return button_context_yesno;
+
+ case CONTEXT_PITCHSCREEN:
+ return button_context_pitchscreen;
+ case CONTEXT_BOOKMARKSCREEN:
+ return button_context_bmark;
+ case CONTEXT_TREE:
+ if (global_settings.hold_lr_for_scroll_in_list)
+ return button_context_tree_scroll_lr;
+ /* else fall through to CUSTOM|1 */
+ case CONTEXT_CUSTOM|1:
+ return button_context_tree;
+
+ case CONTEXT_QUICKSCREEN:
+ return button_context_quickscreen;
+
+ case CONTEXT_RECSCREEN:
+ return button_context_recscreen;
+ case CONTEXT_KEYBOARD:
+ return button_context_keyboard;
+ case CONTEXT_FM:
+ return button_context_radio;
+
+ case CONTEXT_STD:
+ case CONTEXT_LIST:
+ case CONTEXT_MAINMENU:
+ default:
+ return button_context_standard;
+ }
+}
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index c285a9e..686c467 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -29,7 +29,8 @@
#endif
/* For all the color targets apart from the Gigabeat */
-#if (defined(HAVE_LCD_COLOR) && !defined(TOSHIBA_GIGABEAT_F)) || (LCD_DEPTH == 2)
+#if (defined(HAVE_LCD_COLOR) && !defined(TOSHIBA_GIGABEAT_F)) || \
+ (LCD_DEPTH == 2) && !defined(ARCHOS_AV300)
doom
#endif
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 53a8b22..568597c 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -243,6 +243,11 @@
sudoku_start.220x176x16.bmp
sudoku_normal.220x176x16.bmp
sudoku_inverse.220x176x16.bmp
+#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH == 2)
+/* Temporary bitmaps for Archos AV300 */
+sudoku_start.320x240x16.bmp
+sudoku_normal.320x240x16.bmp
+sudoku_inverse.320x240x16.bmp
#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH == 16)
sudoku_start.320x240x16.bmp
sudoku_normal.320x240x16.bmp
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 2fd2c28..4079424 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -35,6 +35,12 @@
#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL)
#define BOUNCE_MODE (BUTTON_ON | BUTTON_REL)
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define BOUNCE_UP BUTTON_UP
+#define BOUNCE_DOWN BUTTON_DOWN
+#define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL)
+#define BOUNCE_MODE (BUTTON_ON | BUTTON_REL)
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define BOUNCE_UP BUTTON_UP
#define BOUNCE_DOWN BUTTON_DOWN
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 5bcecce..12ad2c0 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -64,6 +64,19 @@
#define SCROLL_FWD(x) (0)
#define SCROLL_BACK(x) (0)
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+
+#define QUIT BUTTON_OFF
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define SELECT BUTTON_SELECT
+#define UP BUTTON_UP
+#define DOWN BUTTON_DOWN
+
+/* Only iPod have scroll events */
+#define SCROLL_FWD(x) (0)
+#define SCROLL_BACK(x) (0)
+
#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD)
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 608af85..eb1e613 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -116,6 +116,15 @@
#define CALCULATOR_OPERATORS BUTTON_F2
#define CALCULATOR_CLEAR BUTTON_F1
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define CALCULATOR_UP BUTTON_UP
+#define CALCULATOR_DOWN BUTTON_DOWN
+#define CALCULATOR_QUIT BUTTON_OFF
+#define CALCULATOR_INPUT BUTTON_SELECT
+#define CALCULATOR_CALC BUTTON_F3
+#define CALCULATOR_OPERATORS BUTTON_F2
+#define CALCULATOR_CLEAR BUTTON_F1
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define CALCULATOR_UP BUTTON_UP
#define CALCULATOR_DOWN BUTTON_DOWN
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 3a69fc9..c6a79e4 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -96,6 +96,17 @@
#define CB_RESTART BUTTON_F3
#define CB_QUIT BUTTON_OFF
+#elif CONFIG_KEYPAD == ARCHOS_AV300_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_ON
+#define CB_LEVEL BUTTON_F1
+#define CB_RESTART BUTTON_F3
+#define CB_QUIT BUTTON_OFF
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define CB_SELECT_PRE BUTTON_MENU
#define CB_SELECT (BUTTON_MENU|BUTTON_REL)
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index c0da728..5269e45 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -32,6 +32,17 @@
#define CHC_SETTINGS_OK2 BUTTON_LEFT
#define CHC_SETTINGS_CANCEL BUTTON_OFF
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define CHC_QUIT BUTTON_OFF
+#define CHC_STARTSTOP BUTTON_SELECT
+#define CHC_RESET BUTTON_LEFT
+#define CHC_MENU BUTTON_F1
+#define CHC_SETTINGS_INC BUTTON_UP
+#define CHC_SETTINGS_DEC BUTTON_DOWN
+#define CHC_SETTINGS_OK BUTTON_SELECT
+#define CHC_SETTINGS_OK2 BUTTON_LEFT
+#define CHC_SETTINGS_CANCEL BUTTON_OFF
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define CHC_QUIT BUTTON_OFF
#define CHC_STARTSTOP BUTTON_RIGHT
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index 6c6c9f4..44cc58c 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -959,6 +959,18 @@
#define CHIP8_KEY8 BUTTON_DOWN
#define CHIP8_KEY9 BUTTON_ON
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD /* only 9 out of 16 chip8 buttons */
+#define CHIP8_OFF BUTTON_OFF
+#define CHIP8_KEY1 BUTTON_F1
+#define CHIP8_KEY2 BUTTON_UP
+#define CHIP8_KEY3 BUTTON_F3
+#define CHIP8_KEY4 BUTTON_LEFT
+#define CHIP8_KEY5 BUTTON_SELECT
+#define CHIP8_KEY6 BUTTON_RIGHT
+#define CHIP8_KEY7 BUTTON_F2
+#define CHIP8_KEY8 BUTTON_DOWN
+#define CHIP8_KEY9 BUTTON_ON
+
#elif CONFIG_KEYPAD == ONDIO_PAD /* even more limited */
#define CHIP8_OFF BUTTON_OFF
#define CHIP8_KEY2 BUTTON_UP
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c
index 569b201..28cd223 100644
--- a/apps/plugins/clock.c
+++ b/apps/plugins/clock.c
@@ -134,6 +134,25 @@
#define MENU_BUTTON_TEXT "PLAY"
#define COUNTER_BUTTON_TEXT "ON"
+#elif (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
+
+#define COUNTER_TOGGLE_BUTTON (BUTTON_ON|BUTTON_REL)
+#define COUNTER_RESET_BUTTON (BUTTON_ON|BUTTON_REPEAT)
+#define MENU_BUTTON BUTTON_SELECT
+#define ALT_MENU_BUTTON BUTTON_F1
+#define EXIT_BUTTON BUTTON_OFF
+#define MOVE_UP_BUTTON BUTTON_UP
+#define MOVE_DOWN_BUTTON BUTTON_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 "OFF"
+#define MENU_BUTTON_TEXT "SELECT"
+#define COUNTER_BUTTON_TEXT "ON"
+
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD)
#define COUNTER_TOGGLE_BUTTON (BUTTON_PLAY|BUTTON_REL)
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 00c9a3b..57f1015 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -41,6 +41,18 @@
#define CUBE_PAUSE BUTTON_PLAY
#define CUBE_HIGHSPEED BUTTON_ON
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define CUBE_QUIT BUTTON_OFF
+#define CUBE_X_INC BUTTON_RIGHT
+#define CUBE_X_DEC BUTTON_LEFT
+#define CUBE_Y_INC BUTTON_UP
+#define CUBE_Y_DEC BUTTON_DOWN
+#define CUBE_Z_INC BUTTON_F2
+#define CUBE_Z_DEC BUTTON_F1
+#define CUBE_MODE BUTTON_F3
+#define CUBE_PAUSE BUTTON_SELECT
+#define CUBE_HIGHSPEED BUTTON_ON
+
#elif CONFIG_KEYPAD == PLAYER_PAD
#define CUBE_QUIT BUTTON_STOP
#define CUBE_X_INC BUTTON_RIGHT
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c
index 99c88f4..8638cb8 100644
--- a/apps/plugins/dice.c
+++ b/apps/plugins/dice.c
@@ -69,6 +69,15 @@
#define DICE_BUTTON_ON BUTTON_ON
#define DICE_BUTTON_SELECT BUTTON_PLAY
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define DICE_BUTTON_UP BUTTON_UP
+#define DICE_BUTTON_DOWN BUTTON_DOWN
+#define DICE_BUTTON_LEFT BUTTON_LEFT
+#define DICE_BUTTON_RIGHT BUTTON_RIGHT
+#define DICE_BUTTON_OFF BUTTON_OFF
+#define DICE_BUTTON_ON BUTTON_ON
+#define DICE_BUTTON_SELECT BUTTON_SELECT
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define DICE_BUTTON_UP BUTTON_UP
#define DICE_BUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 7af75f5..88cc39d 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -45,6 +45,12 @@
#define TIDY_LEFT BUTTON_LEFT
#define TIDY_RIGHT BUTTON_RIGHT
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define TIDY_DO BUTTON_ON
+#define TIDY_STOP BUTTON_OFF
+#define TIDY_LEFT BUTTON_LEFT
+#define TIDY_RIGHT BUTTON_RIGHT
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define TIDY_DO BUTTON_MENU
#define TIDY_STOP BUTTON_OFF
@@ -369,6 +375,9 @@
#if CONFIG_KEYPAD == RECORDER_PAD
rb->lcd_puts(0, 0, "[On] to clean up");
rb->lcd_puts(0, 1, "[Off] to exit/abort");
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ rb->lcd_puts(0, 0, "[On] to clean up");
+ rb->lcd_puts(0, 1, "[Off] to exit/abort");
#elif CONFIG_KEYPAD == ONDIO_PAD
rb->lcd_puts(0, 0, "[Menu] to clean up");
rb->lcd_puts(0, 1, "[Off] to exit/abort");
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index d03afa2..2e762cb 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -59,6 +59,13 @@
#define FIRE_INCREASE_MULT BUTTON_UP
#define FIRE_DECREASE_MULT BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define FIRE_QUIT BUTTON_OFF
+#define FIRE_SWITCH_FLAMES_TYPE BUTTON_ON
+#define FIRE_SWITCH_FLAMES_MOVING BUTTON_SELECT
+#define FIRE_INCREASE_MULT BUTTON_UP
+#define FIRE_DECREASE_MULT BUTTON_DOWN
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define FIRE_QUIT BUTTON_OFF
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_MENU
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index 5a46327..8b8ee33 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -39,6 +39,9 @@
#elif (CONFIG_KEYPAD == RECORDER_PAD)
#define BTN_MENU BUTTON_OFF
#define BTN_FIRE BUTTON_PLAY
+#elif (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
+#define BTN_MENU BUTTON_OFF
+#define BTN_FIRE BUTTON_SELECT
#elif (CONFIG_KEYPAD == ONDIO_PAD)
#define BTN_MENU BUTTON_MENU
#define BTN_FIRE BUTTON_UP
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 0dd2fa5..bdf15b7 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -30,6 +30,15 @@
#define FLIPIT_STEP_BY_STEP BUTTON_F3
#define FLIPIT_TOGGLE BUTTON_PLAY
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define FLIPIT_UP BUTTON_UP
+#define FLIPIT_DOWN BUTTON_DOWN
+#define FLIPIT_QUIT BUTTON_OFF
+#define FLIPIT_SHUFFLE BUTTON_F1
+#define FLIPIT_SOLVE BUTTON_F2
+#define FLIPIT_STEP_BY_STEP BUTTON_F3
+#define FLIPIT_TOGGLE BUTTON_SELECT
+
#elif CONFIG_KEYPAD == PLAYER_PAD
#define FLIPIT_UP_PRE BUTTON_ON
#define FLIPIT_UP (BUTTON_ON | BUTTON_REL)
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 46a97f8..ba74879 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -35,6 +35,14 @@
#define JEWELS_SELECT BUTTON_PLAY
#define JEWELS_CANCEL BUTTON_OFF
+#elif CONFIG_KEYPAD == ARCHOS_AV300_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_OFF
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define JEWELS_UP BUTTON_UP
#define JEWELS_DOWN BUTTON_DOWN
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index f36bdd1..8b90c21 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -45,6 +45,16 @@
#define JPEG_PREVIOUS BUTTON_F2
#define JPEG_MENU BUTTON_OFF
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define JPEG_ZOOM_IN BUTTON_SELECT
+#define JPEG_ZOOM_OUT BUTTON_ON
+#define JPEG_UP BUTTON_UP
+#define JPEG_DOWN BUTTON_DOWN
+#define JPEG_LEFT BUTTON_LEFT
+#define JPEG_RIGHT BUTTON_RIGHT
+#define JPEG_NEXT BUTTON_F3
+#define JPEG_PREVIOUS BUTTON_F2
+#define JPEG_MENU BUTTON_OFF
#elif CONFIG_KEYPAD == ONDIO_PAD
#define JPEG_ZOOM_PRE BUTTON_MENU
diff --git a/apps/plugins/lib/pluginlib_actions.h b/apps/plugins/lib/pluginlib_actions.h
index b78163f..7ce43ce 100644
--- a/apps/plugins/lib/pluginlib_actions.h
+++ b/apps/plugins/lib/pluginlib_actions.h
@@ -52,6 +52,7 @@
|| (CONFIG_KEYPAD == IAUDIO_X5_PAD) \
|| (CONFIG_KEYPAD == GIGABEAT_PAD) \
|| (CONFIG_KEYPAD == RECORDER_PAD) \
+ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD) \
|| (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
{ PLA_UP, BUTTON_UP, BUTTON_NONE},
{ PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
@@ -145,6 +146,13 @@
{ PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
{ PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
{ PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
+ { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
+ { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ { PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ { PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_NONE},
#elif (CONFIG_KEYPAD == SANSA_E200_PAD)
{ PLA_LEFT, BUTTON_LEFT, BUTTON_NONE},
{ PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE},
@@ -199,6 +207,12 @@
{PLA_MENU, BUTTON_F1, BUTTON_NONE},
{PLA_FIRE, BUTTON_PLAY, BUTTON_NONE},
{PLA_FIRE_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ {PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
+ {PLA_START, BUTTON_ON, BUTTON_NONE},
+ {PLA_MENU, BUTTON_F1, BUTTON_NONE},
+ {PLA_FIRE, BUTTON_SELECT, BUTTON_NONE},
+ {PLA_FIRE_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
#elif CONFIG_KEYPAD == ONDIO_PAD
{PLA_QUIT, BUTTON_OFF, BUTTON_NONE},
{PLA_START, BUTTON_MENU, BUTTON_NONE},
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index 69c0fca..113737b 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -39,6 +39,18 @@
#define MANDELBROT_MAXITER_DEC BUTTON_F1
#define MANDELBROT_RESET BUTTON_F3
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define MANDELBROT_QUIT BUTTON_OFF
+#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_SELECT
+#define MANDELBROT_ZOOM_OUT BUTTON_ON
+#define MANDELBROT_MAXITER_INC BUTTON_F2
+#define MANDELBROT_MAXITER_DEC BUTTON_F1
+#define MANDELBROT_RESET BUTTON_F3
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define MANDELBROT_QUIT BUTTON_OFF
#define MANDELBROT_UP BUTTON_UP
diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c
index 2a8afc3..cd7446e 100644
--- a/apps/plugins/mazezam.c
+++ b/apps/plugins/mazezam.c
@@ -38,6 +38,18 @@
#define MAZEZAM_QUIT BUTTON_OFF
#define MAZEZAM_QUIT_KEYNAME "[OFF]"
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define MAZEZAM_UP BUTTON_UP
+#define MAZEZAM_DOWN BUTTON_DOWN
+#define MAZEZAM_LEFT BUTTON_LEFT
+#define MAZEZAM_RIGHT BUTTON_RIGHT
+#define MAZEZAM_SELECT BUTTON_SELECT
+
+#define MAZEZAM_RETRY BUTTON_F1
+#define MAZEZAM_RETRY_KEYNAME "[F1]"
+#define MAZEZAM_QUIT BUTTON_OFF
+#define MAZEZAM_QUIT_KEYNAME "[OFF]"
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define MAZEZAM_UP BUTTON_UP
#define MAZEZAM_DOWN BUTTON_DOWN
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c
index 4859e47..2500fed 100644
--- a/apps/plugins/minesweeper.c
+++ b/apps/plugins/minesweeper.c
@@ -45,6 +45,19 @@
# define MINESWP_RIGHT (BUTTON_F1 | BUTTON_RIGHT)
# define MINESWP_LEFT (BUTTON_F1 | BUTTON_LEFT)
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+# define MINESWP_UP BUTTON_UP
+# define MINESWP_DOWN BUTTON_DOWN
+# define MINESWP_QUIT BUTTON_OFF
+# define MINESWP_START BUTTON_ON
+# define MINESWP_TOGGLE BUTTON_SELECT
+# define MINESWP_TOGGLE2 BUTTON_F1
+# define MINESWP_DISCOVER BUTTON_ON
+# define MINESWP_DISCOVER2 BUTTON_F2
+# define MINESWP_INFO BUTTON_F3
+# define MINESWP_RIGHT (BUTTON_F1 | BUTTON_RIGHT)
+# define MINESWP_LEFT (BUTTON_F1 | BUTTON_LEFT)
+
#elif CONFIG_KEYPAD == ONDIO_PAD
# define MINESWP_UP BUTTON_UP
# define MINESWP_DOWN BUTTON_DOWN
@@ -423,6 +436,8 @@
rb->lcd_puts( 0, 6,
#if CONFIG_KEYPAD == RECORDER_PAD
"ON to start"
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ "ON to start"
#elif CONFIG_KEYPAD == ONDIO_PAD
"MODE to start"
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index b5f8594..dca2c30 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -46,6 +46,11 @@
#define MOSAIQUE_SPEED BUTTON_F1
#define MOSAIQUE_RESTART BUTTON_PLAY
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define MOSAIQUE_QUIT BUTTON_OFF
+#define MOSAIQUE_SPEED BUTTON_F1
+#define MOSAIQUE_RESTART BUTTON_SELECT
+
#elif CONFIG_KEYPAD == PLAYER_PAD
#define MOSAIQUE_QUIT BUTTON_STOP
#define MOSAIQUE_SPEED BUTTON_MENU
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index f8564b2..c9120e4 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -39,6 +39,17 @@
#define OSCILLOSCOPE_VOL_UP BUTTON_UP
#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define OSCILLOSCOPE_QUIT BUTTON_OFF
+#define OSCILLOSCOPE_DRAWMODE BUTTON_F1
+#define OSCILLOSCOPE_ADVMODE BUTTON_F2
+#define OSCILLOSCOPE_ORIENTATION BUTTON_F3
+#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
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define OSCILLOSCOPE_QUIT BUTTON_OFF
#define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_MENU
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index 5da61f5..b257a3a 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -44,6 +44,14 @@
#define PONG_RIGHT_UP BUTTON_F3
#define PONG_RIGHT_DOWN BUTTON_RIGHT
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define PONG_QUIT BUTTON_OFF
+#define PONG_PAUSE BUTTON_ON
+#define PONG_LEFT_UP BUTTON_F1
+#define PONG_LEFT_DOWN BUTTON_LEFT
+#define PONG_RIGHT_UP BUTTON_F3
+#define PONG_RIGHT_DOWN BUTTON_RIGHT
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define PONG_QUIT BUTTON_OFF
#define PONG_PAUSE BUTTON_RIGHT
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index ef6fcaf..b77c9b1 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -63,6 +63,17 @@
#define ROCKBLOX_DROP BUTTON_ON
#define ROCKBLOX_RESTART BUTTON_F1
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+
+#define ROCKBLOX_OFF BUTTON_OFF
+#define ROCKBLOX_ROTATE_RIGHT BUTTON_UP
+#define ROCKBLOX_ROTATE_LEFT BUTTON_SELECT
+#define ROCKBLOX_DOWN BUTTON_DOWN
+#define ROCKBLOX_LEFT BUTTON_LEFT
+#define ROCKBLOX_RIGHT BUTTON_RIGHT
+#define ROCKBLOX_DROP BUTTON_ON
+#define ROCKBLOX_RESTART BUTTON_F1
+
#elif CONFIG_KEYPAD == PLAYER_PAD
#define ROCKBLOX_OFF BUTTON_STOP
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index 2fe226c..1fccdad 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -29,6 +29,13 @@
#define PUZZLE_SHUFFLE BUTTON_F1
#define PUZZLE_PICTURE BUTTON_F2
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define PUZZLE_QUIT BUTTON_OFF
+#define PUZZLE_UP BUTTON_UP
+#define PUZZLE_DOWN BUTTON_DOWN
+#define PUZZLE_SHUFFLE BUTTON_F1
+#define PUZZLE_PICTURE BUTTON_F2
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define PUZZLE_QUIT BUTTON_OFF
#define PUZZLE_UP BUTTON_UP
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index 6b27c04..6cf197b 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -42,6 +42,12 @@
#define SNAKE_DOWN BUTTON_DOWN
#define SNAKE_PLAYPAUSE BUTTON_PLAY
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define SNAKE_QUIT BUTTON_OFF
+#define SNAKE_UP BUTTON_UP
+#define SNAKE_DOWN BUTTON_DOWN
+#define SNAKE_PLAYPAUSE BUTTON_SELECT
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SNAKE_QUIT BUTTON_OFF
#define SNAKE_UP BUTTON_UP
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index adcf3ea..7a017e4 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -157,6 +157,18 @@
#define SNAKE2_PLAYPAUSE BUTTON_PLAY
#define SNAKE2_PLAYPAUSE_TEXT "Play"
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define SNAKE2_UP BUTTON_UP
+#define SNAKE2_DOWN BUTTON_DOWN
+#define SNAKE2_QUIT BUTTON_OFF
+#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_F3
+#define SNAKE2_PLAYPAUSE BUTTON_SELECT
+#define SNAKE2_PLAYPAUSE_TEXT "Select"
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SNAKE2_UP BUTTON_UP
#define SNAKE2_DOWN BUTTON_DOWN
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index fbbbf3e..b88df50 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -50,6 +50,15 @@
#define SOKOBAN_LEVEL_DOWN BUTTON_F1
#define SOKOBAN_LEVEL_REPEAT BUTTON_F2
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define SOKOBAN_UP BUTTON_UP
+#define SOKOBAN_DOWN BUTTON_DOWN
+#define SOKOBAN_QUIT BUTTON_OFF
+#define SOKOBAN_UNDO BUTTON_ON
+#define SOKOBAN_LEVEL_UP BUTTON_F3
+#define SOKOBAN_LEVEL_DOWN BUTTON_F1
+#define SOKOBAN_LEVEL_REPEAT BUTTON_F2
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SOKOBAN_UP BUTTON_UP
#define SOKOBAN_DOWN BUTTON_DOWN
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 45e1883..835c3ab 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -64,6 +64,23 @@
# define HK_CUR2STACK "F2"
# define HK_REM2STACK "F3"
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+# define SOL_QUIT BUTTON_OFF
+# define SOL_UP BUTTON_UP
+# define SOL_DOWN BUTTON_DOWN
+# define SOL_LEFT BUTTON_LEFT
+# define SOL_RIGHT BUTTON_RIGHT
+# define SOL_MOVE BUTTON_ON
+# define SOL_DRAW BUTTON_F1
+# define SOL_REM2CUR BUTTON_SELECT
+# define SOL_CUR2STACK BUTTON_F2
+# define SOL_REM2STACK BUTTON_F3
+# define HK_MOVE "ON"
+# define HK_DRAW "F1"
+# define HK_REM2CUR "SELECT"
+# define HK_CUR2STACK "F2"
+# define HK_REM2STACK "F3"
+
#elif CONFIG_KEYPAD == ONDIO_PAD
# define SOL_QUIT BUTTON_OFF
# define SOL_UP_PRE BUTTON_UP
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 673c931..0143af9 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -38,6 +38,19 @@
#define AST_FIRE BUTTON_PLAY
#define AST_FIRE_REP BUTTON_PLAY | BUTTON_REPEAT
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define AST_PAUSE BUTTON_ON
+#define AST_QUIT BUTTON_OFF
+#define AST_THRUST_REP BUTTON_UP | BUTTON_REPEAT
+#define AST_THRUST BUTTON_UP
+#define AST_HYPERSPACE BUTTON_DOWN
+#define AST_LEFT BUTTON_LEFT
+#define AST_LEFT_REP BUTTON_LEFT | BUTTON_REPEAT
+#define AST_RIGHT BUTTON_RIGHT
+#define AST_RIGHT_REP (BUTTON_RIGHT | BUTTON_REPEAT)
+#define AST_FIRE BUTTON_SELECT
+#define AST_FIRE_REP BUTTON_SELECT | BUTTON_REPEAT
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define AST_PAUSE (BUTTON_MENU | BUTTON_OFF)
#define AST_QUIT BUTTON_OFF
@@ -147,6 +160,7 @@
(CONFIG_KEYPAD == IPOD_3G_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == GIGABEAT_PAD)|| \
+ (CONFIG_KEYPAD == ARCHOS_AV300_PAD)|| \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
#define ENEMY_MISSILE_SURVIVAL_LENGTH 140
#define MISSILE_SURVIVAL_LENGTH 40
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 60debc5..0287794 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -71,6 +71,19 @@
#define STAR_MENU_RUN2 BUTTON_RIGHT
#define STAR_MENU_RUN3 BUTTON_ON
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define STAR_QUIT BUTTON_OFF
+#define STAR_UP BUTTON_UP
+#define STAR_DOWN BUTTON_DOWN
+#define STAR_TOGGLE_CONTROL BUTTON_ON
+#define STAR_TOGGLE_CONTROL2 BUTTON_SELECT
+#define STAR_LEVEL_UP BUTTON_F3
+#define STAR_LEVEL_DOWN BUTTON_F1
+#define STAR_LEVEL_REPEAT BUTTON_F2
+#define STAR_MENU_RUN BUTTON_SELECT
+#define STAR_MENU_RUN2 BUTTON_RIGHT
+#define STAR_MENU_RUN3 BUTTON_ON
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define STAR_QUIT BUTTON_OFF
#define STAR_UP BUTTON_UP
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 8b02152..b6a824e 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -32,7 +32,8 @@
#define STATS_STOP BUTTON_STOP
#elif (CONFIG_KEYPAD == RECORDER_PAD) \
- || (CONFIG_KEYPAD == ONDIO_PAD)
+ || (CONFIG_KEYPAD == ONDIO_PAD) \
+ || (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
#define STATS_STOP BUTTON_OFF
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index f1e7355..d113af7 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -41,6 +41,13 @@
#define STOPWATCH_LAP_TIMER BUTTON_ON
#define STOPWATCH_SCROLL_UP BUTTON_UP
#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define STOPWATCH_QUIT BUTTON_OFF
+#define STOPWATCH_START_STOP BUTTON_SELECT
+#define STOPWATCH_RESET_TIMER BUTTON_LEFT
+#define STOPWATCH_LAP_TIMER BUTTON_ON
+#define STOPWATCH_SCROLL_UP BUTTON_UP
+#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
#elif CONFIG_KEYPAD == ONDIO_PAD
#define STOPWATCH_QUIT BUTTON_OFF
#define STOPWATCH_START_STOP BUTTON_RIGHT
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index fefaf9f..2628e32 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -35,6 +35,16 @@
#define SUDOKU_BUTTON_MENU BUTTON_F1
#define SUDOKU_BUTTON_POSSIBLE BUTTON_F2
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define SUDOKU_BUTTON_QUIT BUTTON_OFF
+#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_F1
+#define SUDOKU_BUTTON_POSSIBLE BUTTON_F2
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SUDOKU_BUTTON_QUIT BUTTON_OFF
#define SUDOKU_BUTTON_UP BUTTON_UP
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index af795e7..a8ef5eb 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -77,6 +77,19 @@
#define VIEWER_COLUMN_LEFT (BUTTON_ON | BUTTON_LEFT)
#define VIEWER_COLUMN_RIGHT (BUTTON_ON | BUTTON_RIGHT)
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define VIEWER_QUIT BUTTON_OFF
+#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_F1
+#define VIEWER_AUTOSCROLL BUTTON_SELECT
+#define VIEWER_LINE_UP (BUTTON_ON | BUTTON_UP)
+#define VIEWER_LINE_DOWN (BUTTON_ON | BUTTON_DOWN)
+#define VIEWER_COLUMN_LEFT (BUTTON_ON | BUTTON_LEFT)
+#define VIEWER_COLUMN_RIGHT (BUTTON_ON | BUTTON_RIGHT)
+
/* Ondio keys */
#elif CONFIG_KEYPAD == ONDIO_PAD
#define VIEWER_QUIT BUTTON_OFF
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 2ee708e..cbfc0ee 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -33,6 +33,17 @@
#define VUMETER_UP BUTTON_UP
#define VUMETER_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define VUMETER_QUIT BUTTON_OFF
+#define VUMETER_HELP BUTTON_ON
+#define VUMETER_MENU BUTTON_F1
+#define VUMETER_MENU_EXIT BUTTON_F1
+#define VUMETER_MENU_EXIT2 BUTTON_OFF
+#define VUMETER_LEFT BUTTON_LEFT
+#define VUMETER_RIGHT BUTTON_RIGHT
+#define VUMETER_UP BUTTON_UP
+#define VUMETER_DOWN BUTTON_DOWN
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define VUMETER_QUIT BUTTON_OFF
#define VUMETER_HELP_PRE BUTTON_MENU
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index 6a10fac..5afefb7 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -63,6 +63,22 @@
#define WORMS_TEXT "L/R"
#define KEY_CONTROL_TEXT "F1"
+#elif (CONFIG_KEYPAD == ARCHOS_AV300_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_PLAYER2_DIR1 BUTTON_F2
+#define BTN_PLAYER2_DIR2 BUTTON_F3
+#define BTN_STARTPAUSE BUTTON_SELECT
+#define BTN_QUIT BUTTON_OFF
+#define BTN_STOPRESET BUTTON_ON
+#define BTN_TOGGLE_KEYS BUTTON_F1
+
+#define PLAYERS_TEXT "UP/DN"
+#define WORMS_TEXT "L/R"
+#define KEY_CONTROL_TEXT "F1"
+
#elif (CONFIG_KEYPAD == ONDIO_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 e6b66b3..5669894 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -33,6 +33,16 @@
#define RC_QUIT BUTTON_RC_STOP
+#elif (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
+
+#define QUIT BUTTON_OFF
+#define LEFT BUTTON_LEFT
+#define RIGHT BUTTON_RIGHT
+#define PAUSE BUTTON_ON
+#define UP BUTTON_UP
+#define DOWN BUTTON_DOWN
+#define SELECT BUTTON_SELECT
+
#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD)
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index b7de0cb..a967b3a 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -45,6 +45,14 @@
#define ZX_UP BUTTON_UP
#define ZX_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define ZX_SELECT BUTTON_SELECT
+#define ZX_MENU BUTTON_OFF
+#define ZX_LEFT BUTTON_LEFT
+#define ZX_RIGHT BUTTON_RIGHT
+#define ZX_UP BUTTON_UP
+#define ZX_DOWN BUTTON_DOWN
+
#elif CONFIG_KEYPAD == ONDIO_PAD
#define ZX_SELECT BUTTON_MENU
#define ZX_MENU BUTTON_OFF
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index 4dcdc80..693e48b 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -32,6 +32,14 @@
#define KBD_UP BUTTON_UP
#define KBD_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+#define KBD_SELECT BUTTON_SELECT
+#define KBD_ABORT BUTTON_OFF
+#define KBD_LEFT BUTTON_LEFT
+#define KBD_RIGHT BUTTON_RIGHT
+#define KBD_UP BUTTON_UP
+#define KBD_DOWN BUTTON_DOWN
+
#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted Ondio keypad */
#define KBD_SELECT BUTTON_MENU
#define KBD_ABORT BUTTON_OFF
diff --git a/apps/plugins/zxbox/zxvid_com.h b/apps/plugins/zxbox/zxvid_com.h
index 0483251..730971d 100644
--- a/apps/plugins/zxbox/zxvid_com.h
+++ b/apps/plugins/zxbox/zxvid_com.h
@@ -13,6 +13,10 @@
#if LCD_HEIGHT >= ZX_HEIGHT && LCD_WIDTH >= ZX_WIDTH
#define WIDTH LCD_WIDTH
#define HEIGHT LCD_HEIGHT
+#define X_OFF 0
+#define Y_OFF 0
+#define X_STEP 1
+#define Y_STEP 1
#else
#define WIDTH 320 /* 256 */
#define HEIGHT 200 /* 192 */
diff --git a/apps/screens.h b/apps/screens.h
index 2bf2b32..0a13a9a 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -37,7 +37,7 @@
bool pitch_screen(void);
#endif
-#if CONFIG_KEYPAD == RECORDER_PAD
+#ifdef BUTTON_F3
extern bool quick_screen_f3(int button_enter);
#endif
extern bool quick_screen_quick(int button_enter);
diff --git a/firmware/export/config.h b/firmware/export/config.h
index e37cc3f..20fdc1d 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -37,14 +37,15 @@
#define SWCODEC 1 /* if codec is done by SW */
/* CONFIG_CPU */
-#define SH7034 7034
-#define MCF5249 5249
-#define MCF5250 5250
-#define PP5002 5002
-#define PP5020 5020
-#define PNX0101 101
-#define S3C2440 2440
-#define PP5024 5024
+#define SH7034 7034
+#define MCF5249 5249
+#define MCF5250 5250
+#define PP5002 5002
+#define PP5020 5020
+#define PNX0101 101
+#define S3C2440 2440
+#define PP5024 5024
+#define TMS320DSC25 25
/* CONFIG_KEYPAD */
#define PLAYER_PAD 1
@@ -60,6 +61,7 @@
#define IRIVER_H10_PAD 11
#define SANSA_E200_PAD 12
#define ELIO_TPJ1022_PAD 13
+#define ARCHOS_AV300_PAD 14
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@@ -99,6 +101,7 @@
#define LCD_H10 13 /* as used by iriver H10 20Gb */
#define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
#define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
+#define LCD_DSC25 16 /* as used by Archos AV300 */
/* LCD_PIXELFORMAT */
#define HORIZONTAL_PACKING 1
@@ -170,6 +173,8 @@
#include "config-ondiosp.h"
#elif defined(ARCHOS_ONDIOFM)
#include "config-ondiofm.h"
+#elif defined(ARCHOS_AV300)
+#include "config-av300.h"
#elif defined(IRIVER_H100)
#include "config-h100.h"
#elif defined(IRIVER_H120)
@@ -255,7 +260,8 @@
#endif
/* define for all cpus from ARM family */
-#if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440)
+#if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
+ || (CONFIG_CPU == TMS320DSC25)
#define CPU_ARM
#endif
diff --git a/firmware/target/arm/archos/av300/ata-av300.c b/firmware/target/arm/archos/av300/ata-av300.c
new file mode 100644
index 0000000..ae7b955
--- /dev/null
+++ b/firmware/target/arm/archos/av300/ata-av300.c
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: ata-pp5020.c 10521 2006-08-11 08:35:27Z bger $
+ *
+ * Target-specific ATA functions for AV3xx (TMS320DSC25)
+ *
+ * Based on code from the ArchOpen project - http://www.archopen.org
+ * Adapted for Rockbox in January 2007
+ *
+ * Original file:
+ * lib/target/arch_AV3XX/ata.c
+ *
+ * AvLo - linav project
+ * Copyright (c) 2005 by Christophe THOMAS (oxygen77 at free.fr)
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#include <stdbool.h>
+#include "system.h"
+#include "ata-target.h"
+
+void ata_reset()
+{
+ /* arch_ata_reset_HD(void) */
+ cpld_set_port_2(CPLD_HD_RESET);
+ cpld_clear_port_2(CPLD_HD_RESET);
+}
+
+void ata_enable(bool on)
+{
+ /* TODO: Implement ata_enable() */
+ (void)on;
+}
+
+bool ata_is_coldstart()
+{
+ /* TODO: Implement coldstart variable */
+ return true;
+}
+
+void ata_device_init()
+{
+ /* Set CF/HD selection to HD */
+ cpld_select(CPLD_HD_CF,CPLD_SEL_HD);
+}
diff --git a/firmware/target/arm/archos/av300/ata-target.h b/firmware/target/arm/archos/av300/ata-target.h
new file mode 100644
index 0000000..f570ddd
--- /dev/null
+++ b/firmware/target/arm/archos/av300/ata-target.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: ata-target.h 11655 2006-12-03 22:13:44Z amiconn $
+ *
+ * Copyright (C) 2007 by Dave Chapman
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/* Plain C read & write loops */
+
+#define ATA_IOBASE 0x02400000
+
+#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
+#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x080)))
+#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x100)))
+#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x180)))
+#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x200)))
+#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x280)))
+#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x300)))
+#define ATA_CONTROL (*((volatile unsigned char*)(ATA_IOBASE + 0x340)))
+#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x380)))
+
+#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 READ_PATTERN1_MASK 0xff
+#define READ_PATTERN2_MASK 0xff
+#define READ_PATTERN3_MASK 0xff
+#define READ_PATTERN4_MASK 0xff
+
+#define SET_REG(reg,val) reg = (val)
+#define SET_16BITREG(reg,val) reg = (val)
+
+void ata_reset(void);
+void ata_enable(bool on);
+bool ata_is_coldstart(void);
+void ata_device_init(void);
diff --git a/firmware/target/arm/archos/av300/button-target.h b/firmware/target/arm/archos/av300/button-target.h
new file mode 100644
index 0000000..b085626
--- /dev/null
+++ b/firmware/target/arm/archos/av300/button-target.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: button-target.h 11967 2007-01-09 23:29:07Z linus $
+ *
+ * Copyright (C) 2007 by Dave Chapman
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+#ifndef _BUTTON_TARGET_H_
+#define _BUTTON_TARGET_H_
+
+#include <stdbool.h>
+#include "config.h"
+
+void button_init_device(void);
+int button_read_device(void);
+
+/* Main unit's buttons */
+
+#define BUTTON_ON 0x00000001
+#define BUTTON_OFF 0x00000002
+
+#define BUTTON_LEFT 0x00000004
+#define BUTTON_RIGHT 0x00000008
+#define BUTTON_UP 0x00000010
+#define BUTTON_DOWN 0x00000020
+
+#define BUTTON_SELECT 0x00000040
+
+#define BUTTON_F1 0x00000080
+#define BUTTON_F2 0x00000100
+#define BUTTON_F3 0x00000200
+
+#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
+ |BUTTON_UP|BUTTON_DOWN|BUTTON_SELECT\
+ |BUTTON_F1|BUTTON_F2|BUTTON_F3)
+
+#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/archos/av300/power-av300.c b/firmware/target/arm/archos/av300/power-av300.c
new file mode 100644
index 0000000..cfdce69
--- /dev/null
+++ b/firmware/target/arm/archos/av300/power-av300.c
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id: power-x5.c 10967 2006-09-17 09:19:50Z jethead71 $
+ *
+ * Based on code from the ArchOpen project - http://www.archopen.org
+ * Adapted for Rockbox in January 2007
+ *
+ * Original files:
+ * lib/target/arch_AV3XX/ata.c
+ *
+ * AvLo - linav project
+ * Copyright (c) 2005 by Christophe THOMAS (oxygen77 at free.fr)
+ *
+ * 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.
+ *
+ ****************************************************************************/
+#include "config.h"
+#include "cpu.h"
+#include <stdbool.h>
+#include "kernel.h"
+#include "system.h"
+#include "power.h"
+
+#ifndef SIMULATOR
+
+void power_init(void)
+{
+ /* Charger detect */
+}
+
+bool charger_inserted(void)
+{
+ return false;
+}
+
+void ide_power_enable(bool on)
+{
+ if(on)
+ cpld_set_port_3(CPLD_HD_POWER); /* powering up HD */
+ else
+ cpld_clear_port_3(CPLD_HD_POWER);
+}
+
+bool ide_powered(void)
+{
+ return false;
+}
+
+void power_off(void)
+{
+}
+
+#else
+
+bool charger_inserted(void)
+{
+ return false;
+}
+
+void charger_enable(bool on)
+{
+ (void)on;
+}
+
+void power_off(void)
+{
+}
+
+void ide_power_enable(bool on)
+{
+ (void)on;
+}
+
+#endif /* SIMULATOR */
+
+static bool powered = false;
+
+bool radio_powered()
+{
+ return powered;
+}
+
+bool radio_power(bool status)
+{
+ bool old_status = powered;
+ powered = status;
+ return old_status;
+}
diff --git a/tools/configure b/tools/configure
index e2e0bef..0d119f6 100755
--- a/tools/configure
+++ b/tools/configure
@@ -560,7 +560,7 @@
3) Recorder v2 13) iFP-790 23) 3G
4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
- 26) Mini 2G
+ 6) AV300 26) Mini 2G
==iAudio== ==Toshiba== ==SanDisk==
30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
@@ -753,6 +753,30 @@
t_model="ondio"
;;
+ 6|av300)
+ target_id=26
+ archos="av300"
+ target="-DARCHOS_AV300"
+ memory=16 # always
+ arm7tdmicc
+ tool="$rootdir/tools/scramble -mm=C"
+ bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
+ bmp2rb_native="$rootdir/tools/bmp2rb -f 6"
+ output="cjbm.ajz"
+ appextra="recorder:gui"
+ archosrom=""
+ flash=""
+ plugins="yes"
+ codecs=""
+ # toolset is the tools within the tools directory that we build for
+ # this particular target.
+ toolset="$toolset scramble descramble bmp2rb codepages"
+ # architecture, manufacturer and model for the target-tree build
+ t_cpu="arm"
+ t_manufacturer="archos"
+ t_model="av300"
+ ;;
+
10|h120)
target_id=9
archos="h120"
diff --git a/uisimulator/sdl/UI-av300.bmp b/uisimulator/sdl/UI-av300.bmp
new file mode 100644
index 0000000..e86221c
--- /dev/null
+++ b/uisimulator/sdl/UI-av300.bmp
Binary files differ
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 6931d13..f5da828 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -421,6 +421,49 @@
new_btn = BUTTON_PLAY;
break;
+#elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
+ case SDLK_KP4:
+ case SDLK_LEFT:
+ new_btn = BUTTON_LEFT;
+ break;
+ case SDLK_KP6:
+ case SDLK_RIGHT:
+ new_btn = BUTTON_RIGHT;
+ break;
+ case SDLK_KP8:
+ case SDLK_UP:
+ new_btn = BUTTON_UP;
+ break;
+ case SDLK_KP2:
+ case SDLK_DOWN:
+ new_btn = BUTTON_DOWN;
+ break;
+ case SDLK_KP_PLUS:
+ case SDLK_F8:
+ new_btn = BUTTON_ON;
+ break;
+ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ case SDLK_a:
+ new_btn = BUTTON_OFF;
+ break;
+ case SDLK_KP_DIVIDE:
+ case SDLK_F1:
+ new_btn = BUTTON_F1;
+ break;
+ case SDLK_KP_MULTIPLY:
+ case SDLK_F2:
+ new_btn = BUTTON_F2;
+ break;
+ case SDLK_KP_MINUS:
+ case SDLK_F3:
+ new_btn = BUTTON_F3;
+ break;
+ case SDLK_KP5:
+ case SDLK_SPACE:
+ new_btn = BUTTON_SELECT;
+ break;
+
#elif CONFIG_KEYPAD == SANSA_E200_PAD
case SDLK_KP4:
case SDLK_LEFT:
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index e742155..7f0a567 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -241,6 +241,19 @@
#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#elif defined(ARCHOS_AV300)
+#define UI_TITLE "Archos AV300"
+/* We are temporarily using a 2bpp LCD driver and dummy bitmap */
+#define UI_WIDTH 420 /* width of GUI window */
+#define UI_HEIGHT 340 /* height of GUI window */
+#define UI_LCD_POSX 50 /* x position of lcd */
+#define UI_LCD_POSY 50 /* y position of lcd */
+#define UI_LCD_WIDTH 320
+#define UI_LCD_HEIGHT 240
+#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
+#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
+#define UI_LCD_BLACK 0, 0, 0 /* black */
+
#endif
extern SDL_Surface *gui_surface;
extern bool background; /* True if the background image is enabled */