diff --git a/apps/SOURCES b/apps/SOURCES index e617d5f174..c8cd03a29d 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -187,4 +187,6 @@ keymaps/keymap-mr100.c keymaps/keymap-cowond2.c #elif CONFIG_KEYPAD == CREATIVEZVM_PAD keymaps/keymap-creativezvm.c +#elif CONFIG_KEYPAD == CREATIVEZV_PAD +keymaps/keymap-creativezv.c #endif diff --git a/apps/keymaps/keymap-creativezv.c b/apps/keymaps/keymap-creativezv.c new file mode 100644 index 0000000000..5de67f5669 --- /dev/null +++ b/apps/keymaps/keymap-creativezv.c @@ -0,0 +1,254 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Maurus Cuelenaere + * + * 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 the Creative Zen Vision target */ +/* Copied from ZVM target for now... */ +#include +#include +#include + +#include "config.h" +#include "action.h" +#include "button.h" +#include "settings.h" + +/* + * The format of the list is as follows + * { Action Code, Button code, Prereq button code } + * if there's no need to check the previous button's value, use BUTTON_NONE + * Insert LAST_ITEM_IN_LIST at the end of each mapping + */ + +/* CONTEXT_CUSTOM's used in this file... + +CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) +CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens + i.e where up/down is inc/dec + CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec + +*/ + +static const struct button_mapping button_context_standard[] = { + { ACTION_STD_PREV, BUTTON_UP|BUTTON_REL, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + + { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, + + { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, + + { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, + { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_standard */ + + +static const struct button_mapping button_context_wps[] = { + { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, + + { 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_ABSETB_NEXTDIR,BUTTON_RIGHT, BUTTON_CUSTOM }, + //{ ACTION_WPS_ABSETA_PREVDIR,BUTTON_LEFT, BUTTON_CUSTOM }, + //{ ACTION_WPS_ABRESET, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, + + { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, + + { ACTION_WPS_PITCHSCREEN, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK }, + + { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + { ACTION_WPS_MENU, BUTTON_POWER, BUTTON_NONE }, + { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, + + { ACTION_WPS_ID3SCREEN, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, + { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_BACK }, + LAST_ITEM_IN_LIST +}; /* button_context_wps */ + +static const struct button_mapping button_context_list[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_list */ + +static const struct button_mapping button_context_tree[] = { + { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, + { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) +}; /* button_context_tree */ + +static const struct button_mapping button_context_listtree_scroll_without_combo[] = { + { 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|CONTEXT_TREE), +}; + +static const struct button_mapping button_context_settings[] = { + { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, + { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, + { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, + { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, + { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings */ + +static const struct button_mapping button_context_settings_right_is_inc[] = { + { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, + { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, + { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_RESET, BUTTON_BACK, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settingsgraphical */ + +static const struct button_mapping button_context_yesno[] = { + { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_settings_yesno */ + +static const struct button_mapping button_context_colorchooser[] = { + { ACTION_STD_OK, BUTTON_BACK|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_colorchooser */ + +static const struct button_mapping button_context_eq[] = { + { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), +}; /* button_context_eq */ + +/** Bookmark Screen **/ +static const struct button_mapping button_context_bmark[] = { + { ACTION_BMS_DELETE, BUTTON_BACK, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), +}; /* button_context_bmark */ + +static const struct button_mapping button_context_time[] = { + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), +}; /* button_context_time */ + +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_MENU, BUTTON_NONE }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_quickscreen */ + +static const struct button_mapping button_context_pitchscreen[] = { + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_pitchcreen */ + +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_CUSTOM, BUTTON_NONE }, + { ACTION_KBD_CURSOR_LEFT, BUTTON_CUSTOM|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY, BUTTON_NONE }, + { ACTION_KBD_CURSOR_RIGHT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, + { ACTION_KBD_PAGE_FLIP, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE }, + { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_KBD_ABORT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, + { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, + { ACTION_KBD_BACKSPACE, BUTTON_MENU|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 */ + +const struct button_mapping* get_context_mapping(int context) +{ + switch (context&~CONTEXT_REMOTE) + { + case CONTEXT_STD: + return button_context_standard; + case CONTEXT_WPS: + return button_context_wps; + case CONTEXT_LIST: + return button_context_list; + case CONTEXT_MAINMENU: + case CONTEXT_TREE: + return button_context_listtree_scroll_without_combo; + case CONTEXT_CUSTOM|CONTEXT_TREE: + return button_context_tree; + case CONTEXT_SETTINGS: + return button_context_settings; + case CONTEXT_CUSTOM|CONTEXT_SETTINGS: + return button_context_settings_right_is_inc; + case CONTEXT_SETTINGS_COLOURCHOOSER: + return button_context_colorchooser; + case CONTEXT_SETTINGS_EQ: + return button_context_eq; + case CONTEXT_SETTINGS_TIME: + return button_context_time; + case CONTEXT_YESNOSCREEN: + return button_context_yesno; + case CONTEXT_BOOKMARKSCREEN: + return button_context_bmark; + case CONTEXT_QUICKSCREEN: + return button_context_quickscreen; + case CONTEXT_PITCHSCREEN: + return button_context_pitchscreen; + case CONTEXT_KEYBOARD: + return button_context_keyboard; + } + return button_context_standard; +} diff --git a/firmware/export/config-creativezv.h b/firmware/export/config-creativezv.h index af9bedf307..7304dda728 100644 --- a/firmware/export/config-creativezv.h +++ b/firmware/export/config-creativezv.h @@ -68,7 +68,7 @@ /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE -#define CONFIG_KEYPAD CREATIVEZVM_PAD +#define CONFIG_KEYPAD CREATIVEZV_PAD #define HAS_BUTTON_HOLD #define HAVE_HEADPHONE_DETECTION //#define HAVE_TOUCHPAD diff --git a/firmware/export/config.h b/firmware/export/config.h index 595b731e0f..51c79abccf 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -81,6 +81,7 @@ #define IAUDIO_M3_PAD 23 #define CREATIVEZVM_PAD 24 #define SANSA_M200_PAD 25 +#define CREATIVEZV_PAD 26 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 diff --git a/firmware/target/arm/tms320dm320/creative-zvm/button-target.h b/firmware/target/arm/tms320dm320/creative-zvm/button-target.h index 1b63895374..6530a1c9e0 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/button-target.h +++ b/firmware/target/arm/tms320dm320/creative-zvm/button-target.h @@ -37,11 +37,26 @@ #define BUTTON_HOLD (1 << 10) +#ifdef CREATIVE_ZV +#define BUTTON_PREV (1 << 11) +#define BUTTON_NEXT (1 << 12) + +#define BUTTON_VOL_UP (1 << 13) +#define BUTTON_VOL_DOWN (1 << 14) +#endif + #define BUTTON_REMOTE 0 +#ifndef CREATIVE_ZV #define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \ | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \ | BUTTON_PLAY | BUTTON_HOLD | BUTTON_CUSTOM ) +#else +#define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \ + | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \ + | BUTTON_PLAY | BUTTON_HOLD | BUTTON_NEXT | BUTTON_PREV \ + | BUTTON_VOL_UP | BUTTON_VOL_DOWN ) +#endif #define POWEROFF_BUTTON BUTTON_POWER #define POWEROFF_COUNT 10 diff --git a/tools/configure b/tools/configure index da3d7db045..27d6d43c4c 100755 --- a/tools/configure +++ b/tools/configure @@ -1503,7 +1503,7 @@ fi 92|creativezenvision) target_id=39 - modelname="creativezm" + modelname="creativezv" target="-DCREATIVE_ZV" memory=64 arm926ejscc diff --git a/uisimulator/sdl/UI-creativezv.bmp b/uisimulator/sdl/UI-creativezv.bmp new file mode 100644 index 0000000000..4d82b18da7 Binary files /dev/null and b/uisimulator/sdl/UI-creativezv.bmp differ diff --git a/uisimulator/sdl/UI-creativezvm.bmp b/uisimulator/sdl/UI-creativezvm60.bmp similarity index 100% rename from uisimulator/sdl/UI-creativezvm.bmp rename to uisimulator/sdl/UI-creativezvm60.bmp diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 07e53ce951..76a1f2f10c 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -833,6 +833,53 @@ void button_event(int key, bool pressed) case SDLK_ESCAPE: new_btn = BUTTON_POWER; break; +#elif CONFIG_KEYPAD == CREATIVEZV_PAD + case SDLK_KP1: + new_btn = BUTTON_PREV; + break; + case SDLK_KP3: + new_btn = BUTTON_NEXT; + break; + case SDLK_KP7: + new_btn = BUTTON_BACK; + break; + case SDLK_p: + new_btn = BUTTON_PLAY; + break; + case SDLK_KP9: + new_btn = BUTTON_MENU; + break; + 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_KP5: + case SDLK_SPACE: + new_btn = BUTTON_SELECT; + break; + case SDLK_KP_MULTIPLY: + case SDLK_F8: + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; + case SDLK_z: + new_btn = BUTTON_VOL_DOWN; + break; + case SDLK_s: + new_btn = BUTTON_VOL_UP; + break; #else #error No keymap defined! #endif /* CONFIG_KEYPAD */ diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index fa935c7263..abd320ad18 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h @@ -374,8 +374,12 @@ #define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ #define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ -#elif defined(CREATIVE_ZVM) -#define UI_TITLE "Creative Zen Vision:M 30GB" +#elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB) +#ifdef CREATIVE_ZVM + #define UI_TITLE "Creative Zen Vision:M 30GB" +#else + #define UI_TITLE "Creative Zen Vision:M 60GB" +#endif #define UI_WIDTH 383 /* width of GUI window */ #define UI_HEIGHT 643 /* height of GUI window */ #define UI_LCD_POSX 31 /* x position of lcd */ @@ -387,6 +391,19 @@ #define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ #define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ +#elif defined(CREATIVE_ZV) +#define UI_TITLE "Creative Zen Vision" +#define UI_WIDTH 1054 /* width of GUI window */ +#define UI_HEIGHT 643 /* height of GUI window */ +#define UI_LCD_POSX 129 /* x position of lcd */ +#define UI_LCD_POSY 85 /* y position of lcd */ +#define UI_LCD_WIDTH 640 +#define UI_LCD_HEIGHT 480 +#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ +#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ +#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ +#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ + #endif extern SDL_Surface *gui_surface; extern bool background; /* True if the background image is enabled */