diff --git a/apps/SOURCES b/apps/SOURCES index 54f7461e05..4ae04a4cf8 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -302,4 +302,6 @@ keymaps/keymap-xduoox3ii.c keymaps/keymap-xduoox20.c #elif CONFIG_KEYPAD == FIIO_M3K_PAD keymaps/keymap-fiiom3k.c +#elif CONFIG_KEYPAD == EROSQ_PAD +keymaps/keymap-erosq.c #endif diff --git a/apps/bitmaps/native/SOURCES b/apps/bitmaps/native/SOURCES index 201ffc4ad3..1d1fcd4783 100644 --- a/apps/bitmaps/native/SOURCES +++ b/apps/bitmaps/native/SOURCES @@ -46,7 +46,7 @@ toolsicon.130x130x16.bmp hibyicon.70x70x16.bmp rockboxicon.70x70x16.bmp toolsicon.70x70x16.bmp -#elif (defined(XDUOO_X3II) || defined(XDUOO_X20)) +#elif (defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(EROS_Q)) hibyicon.130x130x16.bmp rockboxicon.130x130x16.bmp toolsicon.130x130x16.bmp diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 59d7227f0b..44e56cdd02 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2525,7 +2525,7 @@ static const struct { { "Screendump", dbg_screendump }, #endif { "Skin Engine RAM usage", dbg_skin_engine }, -#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20)) && !defined(SIMULATOR) +#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K)) && !defined(SIMULATOR) { "View HW info", dbg_hw_info }, #endif #if (CONFIG_PLATFORM & PLATFORM_NATIVE) diff --git a/apps/keymaps/keymap-erosq.c b/apps/keymaps/keymap-erosq.c new file mode 100644 index 0000000000..0a18fc5cf5 --- /dev/null +++ b/apps/keymaps/keymap-erosq.c @@ -0,0 +1,256 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2020 Solomon Peachy + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "action.h" +#include "button.h" +#include "settings.h" + +/* {Action Code, Button code, Prereq button code } */ + +/* + * The format of the list is as follows + * { Action Code, Button code, Prereq button code } + * if there's no need to check the previous button's value, use BUTTON_NONE + * Insert LAST_ITEM_IN_LIST at the end of each mapping + */ +static const struct button_mapping button_context_standard[] = { + { ACTION_STD_PREV, BUTTON_SCROLL_BACK, BUTTON_NONE }, + { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE }, + { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_SCROLL_FWD, BUTTON_NONE }, + { ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE }, + { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE }, + { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, + +/* ACTION_STD_QUICKSCREEN, + * ACTION_STD_KEYLOCK + * ACTION_STD_REC + * ACTION_STD_HOTKEY + */ + + LAST_ITEM_IN_LIST +}; /* button_context_standard */ + +static const struct button_mapping button_context_mainmenu[] = { + { ACTION_TREE_WPS, BUTTON_BACK, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE), +}; /* button_context_mainmenu as with sansa clip mapping - "back" button returns you to WPS */ + +static const struct button_mapping button_context_wps[] = { + { ACTION_WPS_BROWSE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, + { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT }, + { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT }, + { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, + { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, + { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, +/* ACTION_WPS_ID3SCREEN optional */ + { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, +// { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, + { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, /* this should be the same as ACTION_STD_MENU */ +/* ACTION_WPS_VIEW_PLAYLIST + * ACTION_WPS_LIST_BOOKMARKS, optional + * ACTION_WPS_CREATE_BOOKMARK, optional + */ + + { ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_wps */ + +static const struct button_mapping button_context_settings[] = { + { ACTION_SETTINGS_INC, BUTTON_SCROLL_FWD, BUTTON_NONE }, +// { ACTION_SETTINGS_INCREPEAT, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_INCBIGSTEP, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE }, +// { ACTION_SETTINGS_DECREPEAT, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DECBIGSTEP, BUTTON_VOL_DOWN, BUTTON_NONE }, +/* ACTION_SETTINGS_DECBIGSTEP */ + { ACTION_SETTINGS_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, +/* ACTION_SETTINGS_SET, Used by touchscreen targets */ + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), +}; /* button_context_settings */ + +static const struct button_mapping button_context_list[] = { +/* ACTION_LISTTREE_PGUP, optional + * ACTION_LISTTREE_PGDOWN, optional + */ + +#ifdef HAVE_VOLUME_IN_LIST + { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#endif + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) +}; /* button_context_list */ + +#if 0 // XXX? +static const struct button_mapping button_context_tree[] = { +/* ACTION_TREE_ROOT_INIT, + * ACTION_TREE_PGLEFT, optional + * ACTION_TREE_PGRIGHT, optional + * ACTION_TREE_STOP, + * ACTION_TREE_WPS, + * ACTION_TREE_HOTKEY, + */ +/* { ACTION_TREE_WPS, BUTTON_UP|BUTTON_REL, BUTTON_UP }, + * { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, + * { ACTION_TREE_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC }, + */ + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), +}; /* button_context_tree */ +#endif + +static const struct button_mapping button_context_yesno[] = { + { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), +}; /* button_context_settings_yesno */ + +static const struct button_mapping button_context_quickscreen[] = { + { ACTION_QS_TOP, BUTTON_PREV|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_TOP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_QS_DOWN, BUTTON_SCROLL_FWD|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_LEFT, BUTTON_SCROLL_BACK|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE }, + { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_quickscreen */ + +static const struct button_mapping button_context_settings_time[] = { + { ACTION_STD_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, + { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV }, + { ACTION_STD_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, + { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT }, + { ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK }, + { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_SETTINGS_INC, BUTTON_SCROLL_FWD, BUTTON_NONE }, +// { ACTION_SETTINGS_INCREPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_SETTINGS_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE }, +// { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST + //LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) +}; /* button_context_settings_time */ + +static const struct button_mapping button_context_pitchscreen[] = { + { ACTION_PS_INC_SMALL, BUTTON_SCROLL_FWD, BUTTON_NONE }, + { ACTION_PS_INC_BIG, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_PS_DEC_SMALL, BUTTON_SCROLL_BACK, BUTTON_NONE }, + { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_PS_NUDGE_LEFT, BUTTON_PREV, BUTTON_NONE }, +/* { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, */ + { ACTION_PS_NUDGE_RIGHT, BUTTON_NEXT, BUTTON_NONE }, +/* { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, */ + { ACTION_PS_TOGGLE_MODE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, + { ACTION_PS_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, + { ACTION_PS_EXIT, BUTTON_BACK, BUTTON_NONE }, + { ACTION_PS_SLOWER, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_PS_FASTER, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD), +}; /* button_context_pitchscreen */ + +static const struct button_mapping button_context_keyboard[] = { + { ACTION_KBD_LEFT, BUTTON_SCROLL_FWD, BUTTON_NONE }, + { ACTION_KBD_RIGHT, BUTTON_SCROLL_BACK, BUTTON_NONE }, + { ACTION_KBD_CURSOR_LEFT, BUTTON_PREV, BUTTON_NONE }, + { ACTION_KBD_CURSOR_RIGHT, BUTTON_NEXT, BUTTON_NONE }, + { ACTION_KBD_UP, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_KBD_UP, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_DOWN, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_KBD_DOWN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_PAGE_FLIP, BUTTON_MENU, BUTTON_NONE }, + { ACTION_KBD_BACKSPACE, BUTTON_BACK, BUTTON_NONE }, + { ACTION_KBD_BACKSPACE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_SELECT, BUTTON_PLAY, BUTTON_NONE }, + { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE }, + { ACTION_KBD_MORSE_INPUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_KBD_MORSE_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, + + LAST_ITEM_IN_LIST +}; /* button_context_keyboard */ + +static const struct button_mapping button_context_bmark[] = { + { ACTION_BMS_DELETE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, + + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), +}; /* button_context_bmark */ + +/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ +const struct button_mapping* get_context_mapping(int context) +{ + switch (context) + { + case CONTEXT_STD: + return button_context_standard; + + case CONTEXT_WPS: + return button_context_wps; + + case CONTEXT_MAINMENU: + return button_context_mainmenu; + case CONTEXT_TREE: + case CONTEXT_LIST: + return button_context_list; + + case CONTEXT_SETTINGS: + case CONTEXT_SETTINGS_EQ: + return button_context_settings; + + case CONTEXT_SETTINGS_TIME: + return button_context_settings_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: + case CONTEXT_MORSE_INPUT: + return button_context_keyboard; + + default: + return button_context_standard; + } + return button_context_standard; +} diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index f68e3ed5a3..bb431e3e04 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -24,7 +24,6 @@ #include "plugin.h" #include "lang_enum.h" - #define BATTERY_LOG HOME_DIR"/battery_bench.txt" #define BUF_SIZE 16000 @@ -83,7 +82,17 @@ #define BATTERY_ON_TXT "SELECT - start" #define BATTERY_OFF_TXT "HOME" -#elif CONFIG_KEYPAD == IRIVER_H10_PAD +#elif (CONFIG_KEYPAD == IRIVER_H10_PAD || \ + CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD || \ + CONFIG_KEYPAD == SONY_NWZ_PAD || \ + CONFIG_KEYPAD == AGPTEK_ROCKER_PAD || \ + CONFIG_KEYPAD == XDUOO_X3_PAD || \ + CONFIG_KEYPAD == IHIFI_770_PAD || \ + CONFIG_KEYPAD == IHIFI_800_PAD || \ + CONFIG_KEYPAD == XDUOO_X3II_PAD || \ + CONFIG_KEYPAD == XDUOO_X20_PAD || \ + CONFIG_KEYPAD == FIIO_M3K_PAD || \ + CONFIG_KEYPAD == EROSQ_PAD) #define BATTERY_ON BUTTON_PLAY #define BATTERY_OFF BUTTON_POWER @@ -177,7 +186,7 @@ #elif (CONFIG_KEYPAD == SAMSUNG_YH820_PAD) || \ (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD) - + #define BATTERY_ON BUTTON_LEFT #define BATTERY_OFF BUTTON_RIGHT #define BATTERY_ON_TXT "LEFT" @@ -214,12 +223,6 @@ #define BATTERY_ON_TXT "SELECT - start" #define BATTERY_OFF_TXT "POWER" -#elif CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF_TXT "POWER" - #elif (CONFIG_KEYPAD == HM60X_PAD) || (CONFIG_KEYPAD == HM801_PAD) #define BATTERY_ON BUTTON_SELECT #define BATTERY_OFF BUTTON_POWER @@ -227,12 +230,6 @@ #define BATTERY_OFF_TXT "POWER" -#elif CONFIG_KEYPAD == SONY_NWZ_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF_TXT "Power" - #elif CONFIG_KEYPAD == DX50_PAD #define BATTERY_ON BUTTON_PLAY #define BATTERY_OFF BUTTON_POWER_LONG @@ -245,53 +242,8 @@ #define BATTERY_OFF_TXT "Power" #define BATTERY_ON_TXT "Menu - start" -#elif CONFIG_KEYPAD == AGPTEK_ROCKER_PAD -#define BATTERY_ON BUTTON_LEFT -#define BATTERY_OFF BUTTON_RIGHT -#define BATTERY_OFF_TXT "Right" -#define BATTERY_ON_TXT "Left - start" +#elif defined(HAVE_TOUCHSCREEN) -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF_TXT "POWER" - -#elif CONFIG_KEYPAD == IHIFI_770_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF_TXT "POWER" - -#elif CONFIG_KEYPAD == IHIFI_800_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "PLAY - start" -#define BATTERY_OFF_TXT "POWER" - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "Play - start" -#define BATTERY_OFF_TXT "POWER" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "Play - start" -#define BATTERY_OFF_TXT "POWER" - -#elif CONFIG_KEYPAD == FIIO_M3K_PAD -#define BATTERY_ON BUTTON_PLAY -#define BATTERY_OFF BUTTON_POWER -#define BATTERY_ON_TXT "Play - start" -#define BATTERY_OFF_TXT "POWER" - -#else -#error No keymap defined! -#endif - -#ifdef HAVE_TOUCHSCREEN #ifndef BATTERY_ON #define BATTERY_ON BUTTON_CENTER #endif @@ -304,6 +256,9 @@ #ifndef BATTERY_OFF_TXT #define BATTERY_OFF_TXT "TOPLEFT" #endif + +#else +#error No keymap defined! #endif /****************************** Plugin Entry Point ****************************/ @@ -375,7 +330,7 @@ static bool exit_tsr(bool reenter) #define BIT_CHARGING 0x2 #define BIT_USB_POWER 0x4 -#define HMS(x) (x)/3600,((x)%3600)/60,((x)%3600)%60 +#define HMS(x) (x)/3600,((x)%3600)/60,((x)%3600)%60 #if CONFIG_CHARGING || defined(HAVE_USB_POWER) static unsigned int charge_state(void) @@ -476,7 +431,7 @@ static void thread(void) rb->register_storage_idle_func(flush_buffer); #endif } - + /* What to do when the measurement buffer is full: 1) save our measurements to disk but waste some power doing so? 2) throw away measurements to save some power? @@ -486,12 +441,12 @@ static void thread(void) if (buf_idx == BUF_ELEMENTS) { flush_buffer(); } - + /* sleep some time until next measurement */ rb->queue_wait_w_tmo(&thread_q, &ev, sleep_time); switch (ev.id) { - case SYS_USB_CONNECTED: + case SYS_USB_CONNECTED: in_usb_mode = true; rb->usb_acknowledge(SYS_USB_CONNECTED_ACK); break; @@ -516,7 +471,7 @@ static void thread(void) #else flush_buffer(); #endif - + /* log end of bench and exit reason */ fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666); if (fd >= 0) @@ -565,7 +520,7 @@ enum plugin_status plugin_start(const void* parameter) rb->lcd_remote_putsxy,LCD_REMOTE_WIDTH,2); rb->lcd_remote_update(); #endif - + do { button = rb->button_get(true); @@ -574,10 +529,10 @@ enum plugin_status plugin_start(const void* parameter) case BATTERY_ON: #ifdef BATTERY_RC_ON case BATTERY_RC_ON: -#endif +#endif on = true; - break; - case BATTERY_OFF: + break; + case BATTERY_OFF: #ifdef BATTERY_RC_OFF case BATTERY_RC_OFF: #endif @@ -588,7 +543,7 @@ enum plugin_status plugin_start(const void* parameter) return PLUGIN_USB_CONNECTED; } }while(!on); - + fd = rb->open(BATTERY_LOG, O_RDONLY); if (fd < 0) { diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index b2e0383187..b5e58c5914 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -543,39 +543,7 @@ enum { #define BJACK_QUIT_NAME "Volume up" #define BJACK_DOUBLE_NAME "Option+Down" -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define BJACK_SELECT_NAME "PLAY" -#define BJACK_STAY_NAME "NEXT" -#define BJACK_QUIT_NAME "POWER" -#define BJACK_DOUBLE_NAME "PREV" -#define BJACK_SELECT BUTTON_PLAY -#define BJACK_QUIT BUTTON_POWER -#define BJACK_MAX BUTTON_VOL_UP -#define BJACK_MIN BUTTON_VOL_DOWN -#define BJACK_STAY BUTTON_NEXT -#define BJACK_DOUBLEDOWN BUTTON_PREV -#define BJACK_UP BUTTON_HOME -#define BJACK_DOWN BUTTON_OPTION -#define BJACK_RIGHT BUTTON_NEXT -#define BJACK_LEFT BUTTON_PREV - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define BJACK_SELECT_NAME "PLAY" -#define BJACK_STAY_NAME "NEXT" -#define BJACK_QUIT_NAME "POWER" -#define BJACK_DOUBLE_NAME "PREV" -#define BJACK_SELECT BUTTON_PLAY -#define BJACK_QUIT BUTTON_POWER -#define BJACK_MAX BUTTON_VOL_UP -#define BJACK_MIN BUTTON_VOL_DOWN -#define BJACK_STAY BUTTON_NEXT -#define BJACK_DOUBLEDOWN BUTTON_PREV -#define BJACK_UP BUTTON_HOME -#define BJACK_DOWN BUTTON_OPTION -#define BJACK_RIGHT BUTTON_NEXT -#define BJACK_LEFT BUTTON_PREV - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define BJACK_SELECT_NAME "PLAY" #define BJACK_STAY_NAME "NEXT" #define BJACK_QUIT_NAME "POWER" @@ -607,7 +575,7 @@ enum { #define BJACK_RIGHT BUTTON_NEXT #define BJACK_LEFT BUTTON_PREV -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define BJACK_SELECT_NAME "PLAY" #define BJACK_STAY_NAME "NEXT" #define BJACK_QUIT_NAME "POWER" @@ -623,7 +591,7 @@ enum { #define BJACK_RIGHT BUTTON_NEXT #define BJACK_LEFT BUTTON_PREV -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define BJACK_SELECT_NAME "PLAY" #define BJACK_STAY_NAME "NEXT" #define BJACK_QUIT_NAME "POWER" @@ -632,12 +600,12 @@ enum { #define BJACK_QUIT BUTTON_POWER #define BJACK_MAX BUTTON_VOL_UP #define BJACK_MIN BUTTON_VOL_DOWN -#define BJACK_STAY BUTTON_NEXT -#define BJACK_DOUBLEDOWN BUTTON_PREV -#define BJACK_UP BUTTON_HOME -#define BJACK_DOWN (BUTTON_POWER | BUTTON_HOME) -#define BJACK_RIGHT BUTTON_NEXT -#define BJACK_LEFT BUTTON_PREV +#define BJACK_STAY BUTTON_MENU +#define BJACK_DOUBLEDOWN BUTTON_BACK +#define BJACK_UP BUTTON_PREV +#define BJACK_DOWN BUTTON_NEXT +#define BJACK_RIGHT BUTTON_SCROLL_FWD +#define BJACK_LEFT BUTTON_SCROLL_BACK #else #error No keymap defined! diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 4452f23357..4f4ffc8df6 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -41,9 +41,6 @@ #include "pluginbitmaps/brickmania_break.h" #endif - - - /* * * Keymaps @@ -307,27 +304,7 @@ CONFIG_KEYPAD == SANSA_CONNECT_PAD #define UP BUTTON_UP #define DOWN BUTTON_DOWN -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define QUIT BUTTON_POWER -#define LEFT BUTTON_PREV -#define RIGHT BUTTON_NEXT -#define ALTLEFT BUTTON_VOL_DOWN -#define ALTRIGHT BUTTON_VOL_UP -#define SELECT BUTTON_PLAY -#define UP BUTTON_HOME -#define DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define QUIT BUTTON_POWER -#define LEFT BUTTON_PREV -#define RIGHT BUTTON_NEXT -#define ALTLEFT BUTTON_VOL_DOWN -#define ALTRIGHT BUTTON_VOL_UP -#define SELECT BUTTON_PLAY -#define UP BUTTON_HOME -#define DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_PREV #define RIGHT BUTTON_NEXT @@ -347,7 +324,7 @@ CONFIG_KEYPAD == SANSA_CONNECT_PAD #define UP BUTTON_HOME #define DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_HOME #define RIGHT BUTTON_VOL_DOWN @@ -357,12 +334,10 @@ CONFIG_KEYPAD == SANSA_CONNECT_PAD #define UP BUTTON_PREV #define DOWN BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define QUIT BUTTON_POWER -#define LEFT BUTTON_HOME -#define RIGHT BUTTON_VOL_DOWN -#define ALTLEFT (BUTTON_POWER | BUTTON_HOME) -#define ALTRIGHT (BUTTON_POWER | BUTTON_VOL_UP) +#define LEFT BUTTON_SCROLL_BACK +#define RIGHT BUTTON_SCROLL_FWD #define SELECT BUTTON_PLAY #define UP BUTTON_PREV #define DOWN BUTTON_NEXT diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index f02f99ee0d..77f79f9057 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -493,29 +493,7 @@ F3: equal to "=" #define CALCULATOR_CALC BUTTON_VOLUP #define CALCULATOR_CLEAR (BUTTON_SELECT|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define CALCULATOR_LEFT BUTTON_PREV -#define CALCULATOR_RIGHT BUTTON_NEXT -#define CALCULATOR_UP BUTTON_HOME -#define CALCULATOR_DOWN BUTTON_OPTION -#define CALCULATOR_QUIT BUTTON_POWER -#define CALCULATOR_INPUT_CALC_PRE (BUTTON_OPTION|BUTTON_REPEAT) -#define CALCULATOR_INPUT (BUTTON_PLAY|BUTTON_REL) -#define CALCULATOR_CALC (BUTTON_PLAY|BUTTON_REPEAT) -#define CALCULATOR_CLEAR (BUTTON_POWER|BUTTON_REPEAT) - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CALCULATOR_LEFT BUTTON_PREV -#define CALCULATOR_RIGHT BUTTON_NEXT -#define CALCULATOR_UP BUTTON_HOME -#define CALCULATOR_DOWN BUTTON_OPTION -#define CALCULATOR_QUIT BUTTON_POWER -#define CALCULATOR_INPUT_CALC_PRE (BUTTON_OPTION|BUTTON_REPEAT) -#define CALCULATOR_INPUT (BUTTON_PLAY|BUTTON_REL) -#define CALCULATOR_CALC (BUTTON_PLAY|BUTTON_REPEAT) -#define CALCULATOR_CLEAR (BUTTON_POWER|BUTTON_REPEAT) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define CALCULATOR_LEFT BUTTON_PREV #define CALCULATOR_RIGHT BUTTON_NEXT #define CALCULATOR_UP BUTTON_HOME @@ -537,7 +515,7 @@ F3: equal to "=" #define CALCULATOR_CALC (BUTTON_PLAY|BUTTON_REPEAT) #define CALCULATOR_CLEAR (BUTTON_POWER|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define CALCULATOR_LEFT BUTTON_HOME #define CALCULATOR_RIGHT BUTTON_VOL_DOWN #define CALCULATOR_UP BUTTON_PREV @@ -548,16 +526,15 @@ F3: equal to "=" #define CALCULATOR_CALC (BUTTON_PLAY|BUTTON_REPEAT) #define CALCULATOR_CLEAR (BUTTON_POWER|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_800_PAD -#define CALCULATOR_LEFT BUTTON_HOME -#define CALCULATOR_RIGHT BUTTON_VOL_DOWN -#define CALCULATOR_UP BUTTON_PREV -#define CALCULATOR_DOWN BUTTON_NEXT -#define CALCULATOR_QUIT BUTTON_POWER -#define CALCULATOR_INPUT_CALC_PRE (BUTTON_HOME|BUTTON_REPEAT) -#define CALCULATOR_INPUT (BUTTON_PLAY|BUTTON_REL) -#define CALCULATOR_CALC (BUTTON_PLAY|BUTTON_REPEAT) -#define CALCULATOR_CLEAR (BUTTON_POWER|BUTTON_REPEAT) +#elif CONFIG_KEYPAD == EROSQ_PAD +#define CALCULATOR_LEFT BUTTON_SCROLL_BACK +#define CALCULATOR_RIGHT BUTTON_SCROLL_FWD +#define CALCULATOR_UP BUTTON_PREV +#define CALCULATOR_DOWN BUTTON_NEXT +#define CALCULATOR_QUIT BUTTON_POWER +#define CALCULATOR_INPUT BUTTON_PLAY +#define CALCULATOR_CALC BUTTON_MENU +#define CALCULATOR_CLEAR BUTTON_BACK #else #error No keymap defined! diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 89dcc61714..59aba941ae 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -381,27 +381,7 @@ #define CALENDAR_NEXT_MONTH (BUTTON_VOLDOWN) #define CALENDAR_PREV_MONTH (BUTTON_VOLUP) -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define CALENDAR_QUIT BUTTON_POWER -#define CALENDAR_SELECT BUTTON_PLAY -#define CALENDAR_NEXT_WEEK BUTTON_OPTION -#define CALENDAR_PREV_WEEK BUTTON_HOME -#define CALENDAR_NEXT_DAY BUTTON_NEXT -#define CALENDAR_PREV_DAY BUTTON_PREV -#define CALENDAR_NEXT_MONTH BUTTON_VOL_UP -#define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CALENDAR_QUIT BUTTON_POWER -#define CALENDAR_SELECT BUTTON_PLAY -#define CALENDAR_NEXT_WEEK BUTTON_OPTION -#define CALENDAR_PREV_WEEK BUTTON_HOME -#define CALENDAR_NEXT_DAY BUTTON_NEXT -#define CALENDAR_PREV_DAY BUTTON_PREV -#define CALENDAR_NEXT_MONTH BUTTON_VOL_UP -#define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define CALENDAR_QUIT BUTTON_POWER #define CALENDAR_SELECT BUTTON_PLAY #define CALENDAR_NEXT_WEEK BUTTON_OPTION @@ -421,7 +401,7 @@ #define CALENDAR_NEXT_MONTH BUTTON_VOL_UP #define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define CALENDAR_QUIT BUTTON_POWER #define CALENDAR_SELECT BUTTON_PLAY #define CALENDAR_NEXT_WEEK (BUTTON_POWER | BUTTON_VOL_DOWN) @@ -431,15 +411,15 @@ #define CALENDAR_NEXT_MONTH BUTTON_VOL_DOWN #define CALENDAR_PREV_MONTH BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define CALENDAR_QUIT BUTTON_POWER #define CALENDAR_SELECT BUTTON_PLAY -#define CALENDAR_NEXT_WEEK (BUTTON_POWER | BUTTON_VOL_DOWN) -#define CALENDAR_PREV_WEEK (BUTTON_POWER | BUTTON_VOL_UP) -#define CALENDAR_NEXT_DAY BUTTON_NEXT -#define CALENDAR_PREV_DAY BUTTON_PREV -#define CALENDAR_NEXT_MONTH BUTTON_VOL_DOWN -#define CALENDAR_PREV_MONTH BUTTON_VOL_UP +#define CALENDAR_NEXT_WEEK BUTTON_NEXT +#define CALENDAR_PREV_WEEK BUTTON_PREV +#define CALENDAR_NEXT_DAY BUTTON_SCROLL_FWD +#define CALENDAR_PREV_DAY BUTTON_SCROLL_BACK +#define CALENDAR_NEXT_MONTH BUTTON_VOL_UP +#define CALENDAR_PREV_MONTH BUTTON_VOL_DOWN #else #error "No keypad setting." diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h index 567dcb1acb..e9b66787ee 100644 --- a/apps/plugins/chessbox/chessbox_pgn.h +++ b/apps/plugins/chessbox/chessbox_pgn.h @@ -525,21 +525,7 @@ #define CB_SCROLL_LEFT (BUTTON_PREV|BUTTON_REPEAT) #define CB_SCROLL_RIGHT (BUTTON_NEXT|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CB_SELECT BUTTON_PLAY -#define CB_UP BUTTON_HOME -#define CB_DOWN BUTTON_OPTION -#define CB_LEFT BUTTON_PREV -#define CB_RIGHT BUTTON_NEXT -#define CB_PLAY BUTTON_VOL_UP -#define CB_LEVEL BUTTON_VOL_DOWN -#define CB_MENU BUTTON_POWER -#define CB_SCROLL_UP (BUTTON_HOME|BUTTON_REPEAT) -#define CB_SCROLL_DOWN (BUTTON_OPTION|BUTTON_REPEAT) -#define CB_SCROLL_LEFT (BUTTON_PREV|BUTTON_REPEAT) -#define CB_SCROLL_RIGHT (BUTTON_NEXT|BUTTON_REPEAT) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define CB_SELECT BUTTON_PLAY #define CB_UP BUTTON_HOME #define CB_DOWN BUTTON_OPTION @@ -567,7 +553,7 @@ #define CB_SCROLL_LEFT (BUTTON_PREV|BUTTON_REPEAT) #define CB_SCROLL_RIGHT (BUTTON_NEXT|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define CB_SELECT BUTTON_PLAY #define CB_UP BUTTON_PREV #define CB_DOWN BUTTON_NEXT @@ -581,19 +567,19 @@ #define CB_SCROLL_LEFT (BUTTON_HOME|BUTTON_REPEAT) #define CB_SCROLL_RIGHT (BUTTON_VOL_UP|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define CB_SELECT BUTTON_PLAY #define CB_UP BUTTON_PREV #define CB_DOWN BUTTON_NEXT -#define CB_LEFT BUTTON_HOME -#define CB_RIGHT BUTTON_VOL_DOWN -#define CB_PLAY BUTTON_VOL_UP -#define CB_LEVEL (BUTTON_PLAY|BUTTON_REPEAT) -#define CB_MENU BUTTON_POWER +#define CB_LEFT BUTTON_SCROLL_BACK +#define CB_RIGHT BUTTON_SCROLL_FWD +#define CB_PLAY BUTTON_VOL_DOWN +#define CB_MENU BUTTON_MENU +#define CB_LEVEL BUTTON_VOL_UP #define CB_SCROLL_UP (BUTTON_PREV|BUTTON_REPEAT) #define CB_SCROLL_DOWN (BUTTON_NEXT|BUTTON_REPEAT) -#define CB_SCROLL_LEFT (BUTTON_HOME|BUTTON_REPEAT) -#define CB_SCROLL_RIGHT (BUTTON_VOL_UP|BUTTON_REPEAT) +#define CB_SCROLL_LEFT (BUTTON_SCROLL_BACK|BUTTON_REPEAT) +#define CB_SCROLL_RIGHT (BUTTON_SCROLL_FWD|BUTTON_REPEAT) #else #error No keymap defined! diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index aee9c9f8e7..27b3990b8b 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -366,27 +366,7 @@ #define CHC_SETTINGS_CANCEL BUTTON_RIGHT #define CHC_SETTINGS_OK (BUTTON_SELECT|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define CHC_QUIT BUTTON_POWER -#define CHC_STARTSTOP BUTTON_PLAY -#define CHC_RESET BUTTON_OPTION -#define CHC_MENU BUTTON_HOME -#define CHC_SETTINGS_INC BUTTON_NEXT -#define CHC_SETTINGS_DEC BUTTON_PREV -#define CHC_SETTINGS_OK BUTTON_PLAY -#define CHC_SETTINGS_CANCEL BUTTON_POWER - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CHC_QUIT BUTTON_POWER -#define CHC_STARTSTOP BUTTON_PLAY -#define CHC_RESET BUTTON_OPTION -#define CHC_MENU BUTTON_HOME -#define CHC_SETTINGS_INC BUTTON_NEXT -#define CHC_SETTINGS_DEC BUTTON_PREV -#define CHC_SETTINGS_OK BUTTON_PLAY -#define CHC_SETTINGS_CANCEL BUTTON_POWER - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) || (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define CHC_QUIT BUTTON_POWER #define CHC_STARTSTOP BUTTON_PLAY #define CHC_RESET BUTTON_OPTION @@ -406,7 +386,7 @@ #define CHC_SETTINGS_OK BUTTON_PLAY #define CHC_SETTINGS_CANCEL BUTTON_POWER -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define CHC_QUIT BUTTON_POWER #define CHC_STARTSTOP BUTTON_PLAY #define CHC_RESET (BUTTON_PLAY|BUTTON_REPEAT) @@ -416,15 +396,15 @@ #define CHC_SETTINGS_OK BUTTON_PLAY #define CHC_SETTINGS_CANCEL BUTTON_HOME -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define CHC_QUIT BUTTON_POWER #define CHC_STARTSTOP BUTTON_PLAY -#define CHC_RESET (BUTTON_PLAY|BUTTON_REPEAT) -#define CHC_MENU BUTTON_HOME -#define CHC_SETTINGS_INC BUTTON_VOL_UP -#define CHC_SETTINGS_DEC BUTTON_VOL_DOWN +#define CHC_RESET BUTTON_BACK +#define CHC_MENU BUTTON_MENU +#define CHC_SETTINGS_INC BUTTON_NEXT +#define CHC_SETTINGS_DEC BUTTON_PREV #define CHC_SETTINGS_OK BUTTON_PLAY -#define CHC_SETTINGS_CANCEL BUTTON_HOME +#define CHC_SETTINGS_CANCEL BUTTON_POWER #else #error No keymap defined! @@ -481,7 +461,7 @@ static struct { } timer_holder[MAX_PLAYERS]; static int run_timer(int nr); -static int chessclock_set_int(char* string, +static int chessclock_set_int(char* string, int* variable, int step, int min, @@ -784,7 +764,7 @@ static int run_timer(int nr) return retval; } -static int chessclock_set_int(char* string, +static int chessclock_set_int(char* string, int* variable, int step, int min, @@ -856,4 +836,3 @@ static char * show_time(int seconds) rb->snprintf(buf, sizeof(buf), "%02d:%02d", seconds/60, seconds%60); return buf; } - diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index bbea442d8e..84e8e709c4 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c @@ -57,7 +57,7 @@ #ifndef EXTERN #define EXTERN extern #endif - + typedef unsigned char byte; /* sizeof(byte)==1 */ typedef unsigned short word; /* sizeof(word)>=2 */ @@ -390,11 +390,11 @@ static void op_system (word opcode) break; case 0xfc: scroll_left(); - break; + break; case 0xfd: DBG_(printf("SUPER: quit the emulator\n")); chip8_reset(); - break; + break; case 0xfe: DBG_(printf("SUPER: set CHIP-8 graphic mode\n")); memset (chip8_display,0,sizeof(chip8_display)); @@ -404,7 +404,7 @@ static void op_system (word opcode) DBG_(printf("SUPER: set SCHIP graphic mode\n")); memset (chip8_display,0,sizeof(chip8_display)); chip8_super = 1; - break; + break; #endif case 0xe0: memset (chip8_display,0,sizeof(chip8_display)); @@ -553,7 +553,7 @@ static void op_sprite (word opcode) x &= 64-1; y &= 32-1; q=chip8_display+y*CHIP8_WIDTH*2; - if(n == 0) + if(n == 0) n = 16; if (n+y>32) n=32-y; @@ -838,7 +838,7 @@ STATIC void chip8_execute(void) --chip8_regs.delay; if (chip8_regs.sound) if (--chip8_regs.sound == 0) - chip8_sound_off(); + chip8_sound_off(); /* Update the machine status */ chip8_interrupt (); @@ -1092,7 +1092,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define CHIP8_KEY8 BUTTON_DOWN #define CHIP8_KEY9 BUTTON_VIEW #define CHIP8_KEY0 BUTTON_VOL_DOWN - + #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD #define CHIP8_OFF BUTTON_POWER #define CHIP8_KEY1 BUTTON_LEFT @@ -1251,23 +1251,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define CHIP8_KEY6 BUTTON_RIGHT #define CHIP8_KEY8 BUTTON_LEFT -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define CHIP8_OFF BUTTON_POWER -#define CHIP8_KEY2 BUTTON_HOME -#define CHIP8_KEY4 BUTTON_PREV -#define CHIP8_KEY5 BUTTON_PLAY -#define CHIP8_KEY6 BUTTON_NEXT -#define CHIP8_KEY8 BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CHIP8_OFF BUTTON_POWER -#define CHIP8_KEY2 BUTTON_HOME -#define CHIP8_KEY4 BUTTON_PREV -#define CHIP8_KEY5 BUTTON_PLAY -#define CHIP8_KEY6 BUTTON_NEXT -#define CHIP8_KEY8 BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define CHIP8_OFF BUTTON_POWER #define CHIP8_KEY2 BUTTON_HOME #define CHIP8_KEY4 BUTTON_PREV @@ -1283,7 +1267,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define CHIP8_KEY6 BUTTON_NEXT #define CHIP8_KEY8 BUTTON_OPTION -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define CHIP8_OFF BUTTON_POWER #define CHIP8_KEY2 BUTTON_NEXT #define CHIP8_KEY4 BUTTON_HOME @@ -1291,12 +1275,12 @@ CONFIG_KEYPAD == MROBE500_PAD #define CHIP8_KEY6 BUTTON_VOL_DOWN #define CHIP8_KEY8 BUTTON_PREV -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define CHIP8_OFF BUTTON_POWER #define CHIP8_KEY2 BUTTON_NEXT -#define CHIP8_KEY4 BUTTON_HOME -#define CHIP8_KEY5 BUTTON_VOL_UP -#define CHIP8_KEY6 BUTTON_VOL_DOWN +#define CHIP8_KEY4 BUTTON_MENU +#define CHIP8_KEY5 BUTTON_PLAY +#define CHIP8_KEY6 BUTTON_BACK #define CHIP8_KEY8 BUTTON_PREV #else @@ -1342,15 +1326,15 @@ static unsigned long cycles; /* Number of update cycles (50Hz) */ /****************************************************************************/ /* Turn sound on */ /****************************************************************************/ -static void chip8_sound_on (void) +static void chip8_sound_on (void) { } /****************************************************************************/ /* Turn sound off */ /****************************************************************************/ -static void chip8_sound_off (void) -{ +static void chip8_sound_off (void) +{ } /****************************************************************************/ @@ -1587,7 +1571,7 @@ enum plugin_status plugin_start(const void* parameter) } else { - filename = (char*) parameter; + filename = (char*) parameter; } /* now go ahead and have fun! */ diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 6e9f923460..35c80a960b 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -198,32 +198,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define ACTION BUTTON_SELECT #define ACTIONTEXT "Select" -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define QUIT BUTTON_POWER -#define ACTION BUTTON_PLAY -#define ACTIONTEXT "PLAY" - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define QUIT BUTTON_POWER -#define ACTION BUTTON_PLAY -#define ACTIONTEXT "PLAY" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD -#define QUIT BUTTON_POWER -#define ACTION BUTTON_PLAY -#define ACTIONTEXT "PLAY" - -#elif CONFIG_KEYPAD == FIIO_M3K_PAD -#define QUIT BUTTON_POWER -#define ACTION BUTTON_PLAY -#define ACTIONTEXT "PLAY" - -#elif CONFIG_KEYPAD == IHIFI_770_PAD -#define QUIT BUTTON_POWER -#define ACTION BUTTON_PLAY -#define ACTIONTEXT "PLAY" - -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD || CONFIG_KEYPAD == FIIO_M3K_PAD || CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD || CONFIG_KEYPAD == EROSQ_PAD #define QUIT BUTTON_POWER #define ACTION BUTTON_PLAY #define ACTIONTEXT "PLAY" @@ -735,7 +710,7 @@ static void chopDrawScene(void) #elif LCD_DEPTH == 2 rb->lcd_set_foreground(LCD_WHITE); #endif - + #if LCD_WIDTH <= 128 rb->snprintf(s, sizeof(s), "Dist: %d", score); #else @@ -781,7 +756,7 @@ static int chopMenu(int menunum) { "Normal", -1 }, { "Steep", -1 }, }; - + MENUITEM_STRINGLIST(menu,"Chopper Menu",chopMenuCb, "Resume Game","Start New Game", "Level","Playback Control","Quit"); diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index d6b28b54b9..08264e8490 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -284,15 +284,7 @@ #define CLIX_BUTTON_RIGHT BUTTON_NEXT #define CLIX_BUTTON_CLICK BUTTON_PLAY -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define CLIX_BUTTON_QUIT BUTTON_POWER -#define CLIX_BUTTON_UP BUTTON_HOME -#define CLIX_BUTTON_DOWN BUTTON_OPTION -#define CLIX_BUTTON_LEFT BUTTON_PREV -#define CLIX_BUTTON_RIGHT BUTTON_NEXT -#define CLIX_BUTTON_CLICK BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define CLIX_BUTTON_QUIT BUTTON_POWER #define CLIX_BUTTON_UP BUTTON_HOME #define CLIX_BUTTON_DOWN BUTTON_OPTION @@ -308,7 +300,7 @@ #define CLIX_BUTTON_RIGHT BUTTON_NEXT #define CLIX_BUTTON_CLICK BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define CLIX_BUTTON_QUIT BUTTON_POWER #define CLIX_BUTTON_UP BUTTON_PREV #define CLIX_BUTTON_DOWN BUTTON_NEXT @@ -316,13 +308,13 @@ #define CLIX_BUTTON_RIGHT BUTTON_VOL_DOWN #define CLIX_BUTTON_CLICK BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define CLIX_BUTTON_QUIT BUTTON_POWER #define CLIX_BUTTON_UP BUTTON_PREV #define CLIX_BUTTON_DOWN BUTTON_NEXT -#define CLIX_BUTTON_LEFT BUTTON_HOME -#define CLIX_BUTTON_RIGHT BUTTON_VOL_DOWN -#define CLIX_BUTTON_CLICK BUTTON_VOL_UP +#define CLIX_BUTTON_LEFT BUTTON_SCROLL_BACK +#define CLIX_BUTTON_RIGHT BUTTON_SCROLL_FWD +#define CLIX_BUTTON_CLICK BUTTON_PLAY #else #error "no keymap" diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 87ab5c1102..416bf1105d 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -370,27 +370,7 @@ #define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_REPEAT) #define CUBE_PAUSE (BUTTON_LEFT | BUTTON_REPEAT) -#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) -#define CUBE_QUIT BUTTON_POWER -#define CUBE_NEXT BUTTON_NEXT -#define CUBE_PREV BUTTON_PREV -#define CUBE_INC BUTTON_VOL_UP -#define CUBE_DEC BUTTON_VOL_DOWN -#define CUBE_MODE BUTTON_OPTION -#define CUBE_PAUSE BUTTON_HOME -#define CUBE_HIGHSPEED BUTTON_PLAY - -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define CUBE_QUIT BUTTON_POWER -#define CUBE_NEXT BUTTON_NEXT -#define CUBE_PREV BUTTON_PREV -#define CUBE_INC BUTTON_VOL_UP -#define CUBE_DEC BUTTON_VOL_DOWN -#define CUBE_MODE BUTTON_OPTION -#define CUBE_PAUSE BUTTON_HOME -#define CUBE_HIGHSPEED BUTTON_PLAY - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) || (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define CUBE_QUIT BUTTON_POWER #define CUBE_NEXT BUTTON_NEXT #define CUBE_PREV BUTTON_PREV @@ -410,7 +390,7 @@ #define CUBE_PAUSE BUTTON_HOME #define CUBE_HIGHSPEED BUTTON_PLAY -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define CUBE_QUIT BUTTON_POWER #define CUBE_NEXT BUTTON_NEXT #define CUBE_PREV BUTTON_PREV @@ -420,14 +400,14 @@ #define CUBE_PAUSE BUTTON_HOME #define CUBE_HIGHSPEED BUTTON_PLAY -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) +#elif CONFIG_KEYPAD == EROSQ_PAD #define CUBE_QUIT BUTTON_POWER #define CUBE_NEXT BUTTON_NEXT #define CUBE_PREV BUTTON_PREV -#define CUBE_INC BUTTON_VOL_UP -#define CUBE_DEC BUTTON_VOL_DOWN -#define CUBE_MODE (BUTTON_HOME | BUTTON_POWER) -#define CUBE_PAUSE BUTTON_HOME +#define CUBE_INC BUTTON_SCROLL_FWD +#define CUBE_DEC BUTTON_SCROLL_BACK +#define CUBE_MODE BUTTON_MENU +#define CUBE_PAUSE BUTTON_BACK #define CUBE_HIGHSPEED BUTTON_PLAY #else @@ -666,7 +646,7 @@ static void cube_draw(void) { #if LCD_DEPTH > 1 || defined(USEGSLIB) case SOLID: - + old_foreground = mylcd_get_foreground(); for (i = 0; i < 6; i++) { @@ -882,7 +862,7 @@ enum plugin_status plugin_start(const void* parameter) t_disp = DISP_TIME; redraw = true; break; - + case CUBE_NEXT: if (++curr > 2) curr = 0; @@ -947,5 +927,3 @@ enum plugin_status plugin_start(const void* parameter) return PLUGIN_OK; } - - diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index cd3cd90edd..1fb913fbed 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -566,18 +566,7 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_ENTER BUTTON_PLAY #define DOOMBUTTON_WEAPON BUTTON_VOL_UP -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define DOOMBUTTON_UP BUTTON_HOME -#define DOOMBUTTON_DOWN BUTTON_OPTION -#define DOOMBUTTON_LEFT BUTTON_PREV -#define DOOMBUTTON_RIGHT BUTTON_NEXT -#define DOOMBUTTON_SHOOT BUTTON_PLAY -#define DOOMBUTTON_OPEN (BUTTON_HOME | BUTTON_POWER) -#define DOOMBUTTON_ESC BUTTON_POWER -#define DOOMBUTTON_ENTER BUTTON_PLAY -#define DOOMBUTTON_WEAPON BUTTON_VOL_UP - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define DOOMBUTTON_UP BUTTON_HOME #define DOOMBUTTON_DOWN BUTTON_OPTION #define DOOMBUTTON_LEFT BUTTON_PREV @@ -599,7 +588,7 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_ENTER BUTTON_PLAY #define DOOMBUTTON_WEAPON BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define DOOMBUTTON_UP BUTTON_PREV #define DOOMBUTTON_DOWN BUTTON_NEXT #define DOOMBUTTON_LEFT BUTTON_HOME @@ -611,17 +600,17 @@ void I_ShutdownGraphics(void) #define DOOMBUTTON_WEAPON (BUTTON_PLAY|BUTTON_REPEAT) #define DOOMBUTTON_MAP (BUTTON_POWER|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define DOOMBUTTON_UP BUTTON_PREV #define DOOMBUTTON_DOWN BUTTON_NEXT -#define DOOMBUTTON_LEFT BUTTON_HOME -#define DOOMBUTTON_RIGHT BUTTON_VOL_DOWN -#define DOOMBUTTON_OPEN BUTTON_PLAY -#define DOOMBUTTON_ESC BUTTON_POWER -#define DOOMBUTTON_ENTER BUTTON_VOL_UP -#define DOOMBUTTON_SHOOT BUTTON_VOL_UP -#define DOOMBUTTON_WEAPON (BUTTON_PLAY|BUTTON_REPEAT) -#define DOOMBUTTON_MAP (BUTTON_POWER|BUTTON_REPEAT) +#define DOOMBUTTON_LEFT BUTTON_SCROLL_BACK +#define DOOMBUTTON_RIGHT BUTTON_SCROLL_FWD +#define DOOMBUTTON_SHOOT BUTTON_PLAY +#define DOOMBUTTON_OPEN BUTTON_BACK +#define DOOMBUTTON_ESC BUTTON_MENU +#define DOOMBUTTON_ENTER BUTTON_PLAY +#define DOOMBUTTON_WEAPON BUTTON_VOL_UP +#define DOOMBUTTON_MAP BUTTON_VOL_DOWN #else #error Keymap not defined! @@ -745,7 +734,7 @@ static inline void getkey() D_PostEvent(&event); } #endif -#endif +#endif newbuttonstate = rb->button_status(); #ifdef DOOMBUTTON_SCROLLWHEEL newbuttonstate |= read_scroll_wheel(); @@ -954,7 +943,7 @@ void I_FinishUpdate (void) { int count; byte *src = d_screens[0]; - + #if (CONFIG_LCD == LCD_H300) && !defined(SIMULATOR) count = SCREENWIDTH*SCREENHEIGHT; @@ -1091,7 +1080,7 @@ void I_FinishUpdate (void) *dst++ = palette[*src++]; while (--count); } - rb->lcd_update(); + rb->lcd_update(); #else /* !HAVE_LCD_COLOR */ unsigned char *dst; @@ -1108,8 +1097,8 @@ void I_FinishUpdate (void) grey_ub_gray_bitmap(greybuffer, 0, y, SCREENWIDTH, 1); } -#endif -#endif +#endif +#endif } // @@ -1136,7 +1125,7 @@ void I_InitGraphics(void) printf("Starting Graphics engine\n"); noprintf=1; - + #if defined(HAVE_LCD_MODES) #if (HAVE_LCD_MODES & LCD_MODE_PAL256) rb->lcd_set_mode(LCD_MODE_PAL256); diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c index eeb6611488..4719446475 100644 --- a/apps/plugins/fft/fft.c +++ b/apps/plugins/fft/fft.c @@ -334,16 +334,7 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -# define FFT_PREV_GRAPH BUTTON_PREV -# define FFT_NEXT_GRAPH BUTTON_NEXT -# define FFT_ORIENTATION BUTTON_HOME -# define FFT_FREQ_SCALE BUTTON_OPTION -# define FFT_WINDOW (BUTTON_HOME|BUTTON_POWER) -# define FFT_AMP_SCALE BUTTON_PLAY -# define FFT_QUIT BUTTON_POWER - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) # define FFT_PREV_GRAPH BUTTON_PREV # define FFT_NEXT_GRAPH BUTTON_NEXT # define FFT_ORIENTATION BUTTON_HOME @@ -361,7 +352,7 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) # define FFT_PREV_GRAPH BUTTON_PREV # define FFT_NEXT_GRAPH BUTTON_NEXT # define FFT_ORIENTATION BUTTON_HOME @@ -370,13 +361,13 @@ GREY_INFO_STRUCT # define FFT_AMP_SCALE BUTTON_PLAY # define FFT_QUIT BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -# define FFT_PREV_GRAPH BUTTON_PREV -# define FFT_NEXT_GRAPH BUTTON_NEXT -# define FFT_ORIENTATION BUTTON_HOME -# define FFT_FREQ_SCALE BUTTON_VOL_UP -# define FFT_WINDOW BUTTON_VOL_DOWN -# define FFT_AMP_SCALE BUTTON_PLAY +#elif (CONFIG_KEYPAD == EROSQ_PAD) +# define FFT_PREV_GRAPH BUTTON_SCROLL_BACK +# define FFT_NEXT_GRAPH BUTTON_SCROLL_FWD +# define FFT_ORIENTATION BUTTON_VOL_UP +# define FFT_FREQ_SCALE BUTTON_VOL_DOWN +# define FFT_WINDOW BUTTON_BACK +# define FFT_AMP_SCALE BUTTON_MENU # define FFT_QUIT BUTTON_POWER #elif !defined(HAVE_TOUCHSCREEN) @@ -530,7 +521,7 @@ static struct fft_config int amp_scale; int freq_scale; int window_func; -} fft_disk = +} fft_disk = { /* Defaults */ .orientation = FFT_OR_VERT, @@ -647,7 +638,7 @@ static void apply_window_func(enum fft_window_func mode) /* Calculates the magnitudes from complex numbers and returns the maximum */ static unsigned calc_magnitudes(enum fft_amp_scale scale) { - /* A major assumption made when calculating the Q*MAX constants + /* A major assumption made when calculating the Q*MAX constants * is that the maximum magnitude is 29 bits long. */ unsigned this_max = 0; kiss_fft_cpx *this_output = output[output_head] + 1; /* skip DC */ @@ -806,7 +797,7 @@ static void draw_lines_vertical(unsigned this_max, unsigned graph_max) { int bins_acc = LCD_WIDTH / 2; unsigned bins_max = 0; - + for(int i = 0, x = 0; i < ARRAYLEN_PLOT; ++i) { unsigned bin = plot[i]; @@ -1107,7 +1098,7 @@ static inline bool fft_get_fft(void) /* This block can introduce discontinuities in our data. Meaning, the * FFT will not be done a continuous segment of the signal. Which can * be bad. Or not. - * + * * Anyway, this is a demo, not a scientific tool. If you want accuracy, * do a proper spectrum analysis.*/ @@ -1409,7 +1400,7 @@ static void fft_setting_update(unsigned which) [FFT_OR_HORZ] = draw_bars_horizontal, [FFT_OR_VERT] = draw_bars_vertical, }, - [FFT_DM_SPECTROGRAM] = + [FFT_DM_SPECTROGRAM] = { [FFT_OR_HORZ] = draw_spectrogram_horizontal, [FFT_OR_VERT] = draw_spectrogram_vertical, @@ -1533,7 +1524,7 @@ static void fft_cleanup(void) { myosd_destroy(); - fft_close_fft(); + fft_close_fft(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cancel_cpu_boost(); diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 4fe0681417..a4d59fff3d 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -436,31 +436,7 @@ #define FLIPIT_STEP_BY_STEP (BUTTON_LEFT|BUTTON_VOLUP) #define FLIPIT_TOGGLE BUTTON_SELECT -#elif CONFIG_KEYPAD == XDUOO_X3_PAD - -#define FLIPIT_LEFT BUTTON_PREV -#define FLIPIT_RIGHT BUTTON_NEXT -#define FLIPIT_UP BUTTON_HOME -#define FLIPIT_DOWN BUTTON_OPTION -#define FLIPIT_QUIT BUTTON_POWER -#define FLIPIT_SHUFFLE (BUTTON_HOME | BUTTON_PREV) -#define FLIPIT_SOLVE (BUTTON_HOME | BUTTON_NEXT) -#define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY) -#define FLIPIT_TOGGLE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - -#define FLIPIT_LEFT BUTTON_PREV -#define FLIPIT_RIGHT BUTTON_NEXT -#define FLIPIT_UP BUTTON_HOME -#define FLIPIT_DOWN BUTTON_OPTION -#define FLIPIT_QUIT BUTTON_POWER -#define FLIPIT_SHUFFLE (BUTTON_HOME | BUTTON_PREV) -#define FLIPIT_SOLVE (BUTTON_HOME | BUTTON_NEXT) -#define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY) -#define FLIPIT_TOGGLE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define FLIPIT_LEFT BUTTON_PREV #define FLIPIT_RIGHT BUTTON_NEXT @@ -484,7 +460,7 @@ #define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY) #define FLIPIT_TOGGLE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define FLIPIT_LEFT BUTTON_HOME #define FLIPIT_RIGHT BUTTON_VOL_DOWN @@ -496,16 +472,16 @@ #define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_PLAY) #define FLIPIT_TOGGLE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD -#define FLIPIT_LEFT BUTTON_HOME -#define FLIPIT_RIGHT BUTTON_VOL_DOWN +#define FLIPIT_LEFT BUTTON_SCROLL_BACK +#define FLIPIT_RIGHT BUTTON_SCROLL_FWD #define FLIPIT_UP BUTTON_PREV #define FLIPIT_DOWN BUTTON_NEXT #define FLIPIT_QUIT BUTTON_POWER -#define FLIPIT_SHUFFLE (BUTTON_POWER | BUTTON_PREV) -#define FLIPIT_SOLVE (BUTTON_POWER | BUTTON_NEXT) -#define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_PLAY) +#define FLIPIT_SHUFFLE BUTTON_MENU +#define FLIPIT_SOLVE BUTTON_VOL_DOWN +#define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP #define FLIPIT_TOGGLE BUTTON_PLAY #else @@ -562,8 +538,8 @@ static int cursor_pos, moves; /* draw a spot at the coordinates (x,y), range of p is 0-19 */ static void draw_spot(int p) { - rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT, - STRIDE(SCREEN_MAIN, BMPWIDTH_flipit_tokens, + rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT, + STRIDE(SCREEN_MAIN, BMPWIDTH_flipit_tokens, BMPHEIGHT_flipit_tokens), GRID_LEFT + (p%5) * (TK_WIDTH+TK_SPACE), GRID_TOP + (p/5) * (TK_HEIGHT+TK_SPACE), @@ -571,7 +547,7 @@ static void draw_spot(int p) } /* draw the cursor at the current cursor position */ -static void draw_cursor(void) +static void draw_cursor(void) { #ifdef HAVE_LCD_COLOR rb->lcd_bitmap_transparent( flipit_cursor, @@ -612,7 +588,7 @@ static inline void clear_cursor(void) } /* check if the puzzle is finished */ -static bool flipit_finished(void) +static bool flipit_finished(void) { int i; for (i=0; i<20; i++) @@ -653,7 +629,7 @@ static void flipit_toggle(void) } /* move the cursor in any direction */ -static void move_cursor(int x, int y) +static void move_cursor(int x, int y) { if (!(flipit_finished())) { clear_cursor(); @@ -665,7 +641,7 @@ static void move_cursor(int x, int y) } /* initialize the board */ -static void flipit_init(void) +static void flipit_init(void) { int i; @@ -690,7 +666,7 @@ static void flipit_init(void) } /* the main game loop */ -static bool flipit_loop(void) +static bool flipit_loop(void) { int i; int button; @@ -775,7 +751,7 @@ static bool flipit_loop(void) /*move cursor though the entire field*/ #ifdef FLIPIT_SCROLLWHEEL case FLIPIT_PREV: - case FLIPIT_PREV|BUTTON_REPEAT: + case FLIPIT_PREV|BUTTON_REPEAT: if ((cursor_pos)%5 == 0) { move_cursor(-1, -1); } diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h index 45de45c5cd..d4d013550e 100644 --- a/apps/plugins/fractals/fractal.h +++ b/apps/plugins/fractals/fractal.h @@ -458,19 +458,7 @@ #define FRACTAL_PRECISION_DEC (BUTTON_PLAY | BUTTON_PREV) #define FRACTAL_RESET (BUTTON_HOME | BUTTON_POWER) -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define FRACTAL_QUIT BUTTON_POWER -#define FRACTAL_UP BUTTON_HOME -#define FRACTAL_DOWN BUTTON_OPTION -#define FRACTAL_LEFT BUTTON_PREV -#define FRACTAL_RIGHT BUTTON_NEXT -#define FRACTAL_ZOOM_IN BUTTON_VOL_UP -#define FRACTAL_ZOOM_OUT BUTTON_VOL_DOWN -#define FRACTAL_PRECISION_INC (BUTTON_PLAY | BUTTON_NEXT) -#define FRACTAL_PRECISION_DEC (BUTTON_PLAY | BUTTON_PREV) -#define FRACTAL_RESET (BUTTON_HOME | BUTTON_POWER) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define FRACTAL_QUIT BUTTON_POWER #define FRACTAL_UP BUTTON_HOME #define FRACTAL_DOWN BUTTON_OPTION @@ -494,7 +482,7 @@ #define FRACTAL_PRECISION_DEC (BUTTON_PLAY | BUTTON_PREV) #define FRACTAL_RESET (BUTTON_HOME | BUTTON_POWER) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define FRACTAL_QUIT BUTTON_POWER #define FRACTAL_UP BUTTON_PREV #define FRACTAL_DOWN BUTTON_NEXT @@ -506,17 +494,17 @@ #define FRACTAL_PRECISION_DEC (BUTTON_POWER | BUTTON_PREV) #define FRACTAL_RESET (BUTTON_POWER | BUTTON_HOME) -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define FRACTAL_QUIT BUTTON_POWER #define FRACTAL_UP BUTTON_PREV #define FRACTAL_DOWN BUTTON_NEXT -#define FRACTAL_LEFT BUTTON_HOME -#define FRACTAL_RIGHT BUTTON_VOL_DOWN -#define FRACTAL_ZOOM_IN (BUTTON_POWER | BUTTON_VOL_UP) -#define FRACTAL_ZOOM_OUT (BUTTON_POWER | BUTTON_VOL_DOWN) -#define FRACTAL_PRECISION_INC (BUTTON_POWER | BUTTON_NEXT) -#define FRACTAL_PRECISION_DEC (BUTTON_POWER | BUTTON_PREV) -#define FRACTAL_RESET (BUTTON_POWER | BUTTON_HOME) +#define FRACTAL_LEFT BUTTON_SCROLL_BACK +#define FRACTAL_RIGHT BUTTON_SCROLL_FWD +#define FRACTAL_ZOOM_IN BUTTON_VOL_UP +#define FRACTAL_ZOOM_OUT BUTTON_VOL_DOWN +#define FRACTAL_PRECISION_INC BUTTON_MENU +#define FRACTAL_PRECISION_DEC BUTTON_BACK +#define FRACTAL_RESET BUTTON_PLAY #else #error No keymap defined! @@ -555,4 +543,3 @@ #endif #endif - diff --git a/apps/plugins/goban/goban.h b/apps/plugins/goban/goban.h index c6a10e3944..db70216464 100644 --- a/apps/plugins/goban/goban.h +++ b/apps/plugins/goban/goban.h @@ -443,19 +443,7 @@ #define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT #define GBN_BUTTON_NEXT_VAR BUTTON_HOME | BUTTON_PWRALT -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define GBN_BUTTON_UP BUTTON_HOME -#define GBN_BUTTON_DOWN BUTTON_OPTION -#define GBN_BUTTON_LEFT BUTTON_PREV -#define GBN_BUTTON_RIGHT BUTTON_NEXT -#define GBN_BUTTON_RETREAT BUTTON_VOL_DOWN -#define GBN_BUTTON_ADVANCE BUTTON_VOL_UP -#define GBN_BUTTON_MENU BUTTON_POWER -#define GBN_BUTTON_PLAY BUTTON_PLAY | BUTTON_REL -#define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT -#define GBN_BUTTON_NEXT_VAR BUTTON_HOME | BUTTON_POWER - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define GBN_BUTTON_UP BUTTON_HOME #define GBN_BUTTON_DOWN BUTTON_OPTION #define GBN_BUTTON_LEFT BUTTON_PREV @@ -479,7 +467,7 @@ #define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT #define GBN_BUTTON_NEXT_VAR BUTTON_HOME | BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define GBN_BUTTON_UP BUTTON_PREV #define GBN_BUTTON_DOWN BUTTON_NEXT @@ -492,18 +480,17 @@ #define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT #define GBN_BUTTON_NEXT_VAR BUTTON_POWER | BUTTON_HOME -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) - +#elif (CONFIG_KEYPAD == EROSQ_PAD) #define GBN_BUTTON_UP BUTTON_PREV #define GBN_BUTTON_DOWN BUTTON_NEXT -#define GBN_BUTTON_LEFT BUTTON_HOME -#define GBN_BUTTON_RIGHT BUTTON_VOL_DOWN -#define GBN_BUTTON_RETREAT BUTTON_POWER | BUTTON_VOL_DOWN -#define GBN_BUTTON_ADVANCE BUTTON_POWER | BUTTON_VOL_UP -#define GBN_BUTTON_MENU BUTTON_POWER -#define GBN_BUTTON_PLAY BUTTON_PLAY | BUTTON_REL -#define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT -#define GBN_BUTTON_NEXT_VAR BUTTON_POWER | BUTTON_HOME +#define GBN_BUTTON_LEFT BUTTON_SCROLL_BACK +#define GBN_BUTTON_RIGHT BUTTON_SCROLL_FWD +#define GBN_BUTTON_RETREAT BUTTON_VOL_DOWN +#define GBN_BUTTON_ADVANCE BUTTON_VOL_UP +#define GBN_BUTTON_MENU BUTTON_MENU +#define GBN_BUTTON_PLAY BUTTON_PLAY +#define GBN_BUTTON_CONTEXT BUTTON_MENU | BUTTON_REPEAT +#define GBN_BUTTON_NEXT_VAR BUTTON_BACK #else #error Unsupported keypad diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h index e637a09ca9..4559a7b3a3 100644 --- a/apps/plugins/imageviewer/imageviewer_button.h +++ b/apps/plugins/imageviewer/imageviewer_button.h @@ -476,22 +476,7 @@ #define IMGVIEW_MENU BUTTON_POWER #define IMGVIEW_SLIDE_SHOW (BUTTON_HOME|BUTTON_PWRALT) -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define IMGVIEW_ZOOM_PRE BUTTON_PLAY -#define IMGVIEW_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) -#define IMGVIEW_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) -#define IMGVIEW_UP BUTTON_HOME -#define IMGVIEW_DOWN BUTTON_OPTION -#define IMGVIEW_LEFT BUTTON_PREV -#define IMGVIEW_RIGHT BUTTON_NEXT -#define IMGVIEW_NEXT BUTTON_VOL_UP -#define IMGVIEW_NEXT_REPEAT (BUTTON_VOL_UP|BUTTON_REPEAT) -#define IMGVIEW_PREVIOUS BUTTON_VOL_DOWN -#define IMGVIEW_PREVIOUS_REPEAT (BUTTON_VOL_DOWN|BUTTON_REPEAT) -#define IMGVIEW_MENU BUTTON_POWER -#define IMGVIEW_SLIDE_SHOW (BUTTON_HOME|BUTTON_POWER) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define IMGVIEW_ZOOM_PRE BUTTON_PLAY #define IMGVIEW_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) #define IMGVIEW_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) @@ -521,7 +506,7 @@ #define IMGVIEW_MENU BUTTON_POWER #define IMGVIEW_SLIDE_SHOW (BUTTON_HOME|BUTTON_POWER) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define IMGVIEW_ZOOM_PRE BUTTON_PLAY #define IMGVIEW_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) #define IMGVIEW_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) @@ -536,20 +521,20 @@ #define IMGVIEW_MENU BUTTON_POWER #define IMGVIEW_SLIDE_SHOW (BUTTON_HOME|BUTTON_POWER) -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define IMGVIEW_ZOOM_PRE BUTTON_PLAY #define IMGVIEW_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) #define IMGVIEW_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) #define IMGVIEW_UP BUTTON_PREV #define IMGVIEW_DOWN BUTTON_NEXT -#define IMGVIEW_LEFT BUTTON_HOME -#define IMGVIEW_RIGHT (BUTTON_PLAY|BUTTON_POWER) +#define IMGVIEW_LEFT BUTTON_SCROLL_BACK +#define IMGVIEW_RIGHT BUTTON_SCROLL_FWD #define IMGVIEW_NEXT BUTTON_VOL_UP #define IMGVIEW_NEXT_REPEAT (BUTTON_VOL_UP|BUTTON_REPEAT) #define IMGVIEW_PREVIOUS BUTTON_VOL_DOWN #define IMGVIEW_PREVIOUS_REPEAT (BUTTON_VOL_DOWN|BUTTON_REPEAT) -#define IMGVIEW_MENU BUTTON_POWER -#define IMGVIEW_SLIDE_SHOW (BUTTON_HOME|BUTTON_POWER) +#define IMGVIEW_MENU BUTTON_MENU +#define IMGVIEW_SLIDE_SHOW BUTTON_BACK #else #error No keymap defined! diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c index 5e3cb12163..57d6fabe8d 100644 --- a/apps/plugins/invadrox.c +++ b/apps/plugins/invadrox.c @@ -268,14 +268,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define QUIT BUTTON_POWER #define FIRE BUTTON_MENU -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - -#define QUIT BUTTON_POWER -#define LEFT BUTTON_HOME -#define RIGHT BUTTON_VOL_DOWN -#define FIRE BUTTON_VOL_UP - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_HOME @@ -289,19 +282,19 @@ CONFIG_KEYPAD == MROBE500_PAD #define RIGHT BUTTON_VOL_DOWN #define FIRE BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_HOME #define RIGHT BUTTON_VOL_DOWN #define FIRE BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define QUIT BUTTON_POWER -#define LEFT BUTTON_HOME -#define RIGHT BUTTON_VOL_DOWN -#define FIRE BUTTON_VOL_UP +#define LEFT BUTTON_SCROLL_BACK +#define RIGHT BUTTON_SCROLL_FWD +#define FIRE BUTTON_PLAY #else #error INVADROX: Unsupported keypad @@ -829,8 +822,8 @@ static void draw_number(int x, int y, int num, int digits) d = num % 10; num = num / 10; rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0, - STRIDE( SCREEN_MAIN, - BMPWIDTH_invadrox_numbers, + STRIDE( SCREEN_MAIN, + BMPWIDTH_invadrox_numbers, BMPHEIGHT_invadrox_numbers), x + i * (NUMBERS_WIDTH + NUM_SPACING), y, NUMBERS_WIDTH, FONT_HEIGHT); @@ -861,17 +854,17 @@ static void draw_lives(void) int i; /* Lives num */ rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0, - STRIDE( SCREEN_MAIN, - BMPWIDTH_invadrox_numbers, - BMPHEIGHT_invadrox_numbers), + STRIDE( SCREEN_MAIN, + BMPWIDTH_invadrox_numbers, + BMPHEIGHT_invadrox_numbers), PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2, NUMBERS_WIDTH, FONT_HEIGHT); /* Ships */ for (i = 0; i < (lives - 1); i++) { - rb->lcd_bitmap_part(invadrox_ships, 0, 0, - STRIDE( SCREEN_MAIN, - BMPWIDTH_invadrox_ships, + rb->lcd_bitmap_part(invadrox_ships, 0, 0, + STRIDE( SCREEN_MAIN, + BMPWIDTH_invadrox_ships, BMPHEIGHT_invadrox_ships), PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING), PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT); @@ -893,11 +886,11 @@ static inline void draw_aliens(void) int i; for (i = 0; i < 5 * ALIENS; i++) { - rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0, + rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0, aliens[i].type * ALIEN_HEIGHT, - STRIDE( SCREEN_MAIN, - BMPWIDTH_invadrox_aliens, - BMPHEIGHT_invadrox_aliens), + STRIDE( SCREEN_MAIN, + BMPWIDTH_invadrox_aliens, + BMPHEIGHT_invadrox_aliens), PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED, ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT, ALIEN_WIDTH, ALIEN_HEIGHT); @@ -1035,11 +1028,11 @@ static bool move_aliens(void) x = PLAYFIELD_X + LIVES_X + aliens[curr_alien].x * ALIEN_SPEED; y = ALIEN_START_Y + aliens[curr_alien].y * ALIEN_HEIGHT; rb->lcd_bitmap_part(invadrox_aliens, - aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0, + aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0, aliens[curr_alien].type * ALIEN_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_invadrox_aliens, - BMPHEIGHT_invadrox_aliens), + BMPHEIGHT_invadrox_aliens), x, y, ALIEN_WIDTH, ALIEN_HEIGHT); if (!next_alien()) { @@ -1068,9 +1061,9 @@ static inline void draw_ship(void) /* Draw ship */ rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_invadrox_ships, - BMPHEIGHT_invadrox_ships), + BMPHEIGHT_invadrox_ships), ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT); if (ship_hit) { /* Alternate between frame 1 and 2 during hit */ @@ -1095,7 +1088,7 @@ static inline void fire_alpha(int xc, int yc, unsigned color) rb->lcd_set_foreground(color); rb->lcd_set_drawmode(DRMODE_FG); - + rb->lcd_mono_bitmap(invadrox_fire, xc - (FIRE_WIDTH/2), yc, FIRE_WIDTH, FIRE_HEIGHT); rb->lcd_set_foreground(LCD_BLACK); @@ -1311,9 +1304,9 @@ static inline void draw_bomb(int i) { rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH, bombs[i].frame * BOMB_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_invadrox_bombs, - BMPHEIGHT_invadrox_bombs), + BMPHEIGHT_invadrox_bombs), bombs[i].x, bombs[i].y, BOMB_WIDTH, BOMB_HEIGHT); /* Advance frame */ @@ -1415,9 +1408,9 @@ static void move_bombs(void) bombs[i].state = S_EXPLODE * 4; bombs[i].target = TARGET_SHIP; rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_invadrox_ships, - BMPHEIGHT_invadrox_ships), + BMPHEIGHT_invadrox_ships), ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT); break; diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 64a15ff4fc..b58c47dd12 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -347,27 +347,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define JEWELS_CANCEL BUTTON_POWER #define HK_CANCEL "Power" -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define JEWELS_UP BUTTON_HOME -#define JEWELS_DOWN BUTTON_OPTION -#define JEWELS_LEFT BUTTON_PREV -#define JEWELS_RIGHT BUTTON_NEXT -#define JEWELS_SELECT BUTTON_PLAY -#define JEWELS_CANCEL BUTTON_POWER -#define HK_SELECT "PLAY" -#define HK_CANCEL "POWER" - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define JEWELS_UP BUTTON_HOME -#define JEWELS_DOWN BUTTON_OPTION -#define JEWELS_LEFT BUTTON_PREV -#define JEWELS_RIGHT BUTTON_NEXT -#define JEWELS_SELECT BUTTON_PLAY -#define JEWELS_CANCEL BUTTON_POWER -#define HK_SELECT "PLAY" -#define HK_CANCEL "POWER" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define JEWELS_UP BUTTON_HOME #define JEWELS_DOWN BUTTON_OPTION #define JEWELS_LEFT BUTTON_PREV @@ -387,7 +367,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define HK_SELECT "PLAY" #define HK_CANCEL "POWER" -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define JEWELS_UP BUTTON_PREV #define JEWELS_DOWN BUTTON_NEXT #define JEWELS_LEFT BUTTON_HOME @@ -397,15 +377,16 @@ CONFIG_KEYPAD == MROBE500_PAD #define HK_SELECT "PLAY" #define HK_CANCEL "POWER" -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define JEWELS_UP BUTTON_PREV #define JEWELS_DOWN BUTTON_NEXT -#define JEWELS_LEFT BUTTON_HOME -#define JEWELS_RIGHT BUTTON_VOL_DOWN +#define JEWELS_LEFT BUTTON_SCROLL_BACK +#define JEWELS_RIGHT BUTTON_SCROLL_FWD #define JEWELS_SELECT BUTTON_PLAY -#define JEWELS_CANCEL BUTTON_POWER +#define JEWELS_CANCEL BUTTON_BACK #define HK_SELECT "PLAY" -#define HK_CANCEL "POWER" +#define HK_CANCEL "BACK" + #else #error No keymap defined! @@ -662,14 +643,14 @@ static void jewels_drawboard(struct game_context* bj) { TILE_WIDTH, TILE_HEIGHT); rb->lcd_bitmap_transparent_part(jewels, 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), - STRIDE( SCREEN_MAIN, - BMPWIDTH_jewels, BMPHEIGHT_jewels), + STRIDE( SCREEN_MAIN, + BMPWIDTH_jewels, BMPHEIGHT_jewels), j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, TILE_WIDTH, TILE_HEIGHT); #else rb->lcd_bitmap_part(jewels, 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_jewels, BMPHEIGHT_jewels), j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, TILE_WIDTH, TILE_HEIGHT); @@ -685,7 +666,7 @@ static void jewels_drawboard(struct game_context* bj) { rb->lcd_hline(BJ_WIDTH*TILE_WIDTH, LCD_WIDTH-1, 18); rb->lcd_hline(BJ_WIDTH*TILE_WIDTH, LCD_WIDTH-1, LCD_HEIGHT-10); - + /* draw progress bar */ #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_RGBPACK(104, 63, 63)); @@ -708,7 +689,7 @@ static void jewels_drawboard(struct game_context* bj) { (LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/2, ((LCD_HEIGHT-10)-18)*tempscore/size+1); #endif - + /* print text */ rb->lcd_getstringsize(title, &w, &h); rb->lcd_putsxy(LCD_WIDTH-(LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/2-w/2, 1, title); @@ -730,7 +711,7 @@ static void jewels_drawboard(struct game_context* bj) { rb->lcd_hline(0, LCD_WIDTH-1, 8*TILE_HEIGHT+YOFS); rb->lcd_hline(0, LCD_WIDTH-1, LCD_HEIGHT-14); rb->lcd_vline(LCD_WIDTH/2, LCD_HEIGHT-14, LCD_HEIGHT-1); - + /* draw progress bar */ #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_RGBPACK(104, 63, 63)); @@ -751,10 +732,10 @@ static void jewels_drawboard(struct game_context* bj) { LCD_WIDTH*tempscore/size+1, (LCD_HEIGHT-14-(8*TILE_HEIGHT+YOFS))/2); #endif - + /* print text */ rb->lcd_putsxyf(1, LCD_HEIGHT-10, "%s %d", title, bj->level); - + if (bj->type == GAME_TYPE_NORMAL) { rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); rb->lcd_getstringsize(str, &w, &h); @@ -796,7 +777,7 @@ static void jewels_drawboard(struct game_context* bj) { /* print text */ rb->lcd_putsxyf(1, LCD_HEIGHT-(LCD_HEIGHT-(8*TILE_HEIGHT+YOFS))/2-3,"%s %d", title, bj->level); - + if (bj->type == GAME_TYPE_NORMAL) { rb->snprintf(str, 6, "%d", (bj->level-1)*LEVEL_PTS+bj->score); rb->lcd_getstringsize(str, &w, &h); @@ -881,8 +862,8 @@ static void jewels_putjewels(struct game_context* bj){ #ifdef HAVE_LCD_COLOR rb->lcd_bitmap_transparent_part(jewels, 0, TILE_HEIGHT*(bj->playboard[i][j].type), - STRIDE( SCREEN_MAIN, - BMPWIDTH_jewels, + STRIDE( SCREEN_MAIN, + BMPWIDTH_jewels, BMPHEIGHT_jewels), j*TILE_WIDTH, (i-1)*TILE_HEIGHT+YOFS+ @@ -891,8 +872,8 @@ static void jewels_putjewels(struct game_context* bj){ #else rb->lcd_bitmap_part(jewels, 0, TILE_HEIGHT*(bj->playboard[i][j].type), - STRIDE( SCREEN_MAIN, - BMPWIDTH_jewels, + STRIDE( SCREEN_MAIN, + BMPWIDTH_jewels, BMPHEIGHT_jewels), j*TILE_WIDTH, (i-1)*TILE_HEIGHT+YOFS+ @@ -1113,7 +1094,7 @@ static unsigned int jewels_swapjewels(struct game_context* bj, rb->lcd_bitmap_transparent_part(jewels, 0, TILE_HEIGHT*(bj->playboard [y+1+vertmod][x+horzmod].type), - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_jewels, BMPHEIGHT_jewels), (x+horzmod)*TILE_WIDTH-horzmod* ((((movelen<<10)*k)/8)>>10), @@ -1122,7 +1103,7 @@ static unsigned int jewels_swapjewels(struct game_context* bj, TILE_WIDTH, TILE_HEIGHT); rb->lcd_bitmap_transparent_part(jewels, 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_jewels, BMPHEIGHT_jewels), x*TILE_WIDTH+horzmod* ((((movelen<<10)*k)/8)>>10), @@ -1133,7 +1114,7 @@ static unsigned int jewels_swapjewels(struct game_context* bj, rb->lcd_bitmap_part(jewels, 0, TILE_HEIGHT*(bj->playboard [y+1+vertmod][x+horzmod].type), - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_jewels, BMPHEIGHT_jewels), (x+horzmod)*TILE_WIDTH-horzmod* ((((movelen<<10)*k)/8)>>10), @@ -1143,7 +1124,7 @@ static unsigned int jewels_swapjewels(struct game_context* bj, rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_bitmap_part(jewels, 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_jewels, BMPHEIGHT_jewels), x*TILE_WIDTH+horzmod* ((((movelen<<10)*k)/8)>>10), @@ -1430,7 +1411,7 @@ static bool jewels_help(void) { static char *help_text[] = { "Jewels", "", "Aim", "", - "Swap", "pairs", "of", "jewels", "to", "form", "connected", + "Swap", "pairs", "of", "jewels", "to", "form", "connected", "segments", "of", "three", "or", "more", "of", "the", "same", "type.", "", "The", "goal", "of", "the", "game", "is", "to", "score", "as", "many", diff --git a/apps/plugins/lib/keymaps.h b/apps/plugins/lib/keymaps.h index 2865f9cdd7..7c1b998400 100644 --- a/apps/plugins/lib/keymaps.h +++ b/apps/plugins/lib/keymaps.h @@ -215,23 +215,7 @@ #define BTN_FIRE BUTTON_MENU #define BTN_PAUSE BUTTON_POWER -#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) -#define BTN_UP BUTTON_VOL_UP -#define BTN_DOWN BUTTON_VOL_DOWN -#define BTN_LEFT BUTTON_PREV -#define BTN_RIGHT BUTTON_NEXT -#define BTN_FIRE BUTTON_PLAY -#define BTN_PAUSE BUTTON_POWER - -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define BTN_UP BUTTON_VOL_UP -#define BTN_DOWN BUTTON_VOL_DOWN -#define BTN_LEFT BUTTON_PREV -#define BTN_RIGHT BUTTON_NEXT -#define BTN_FIRE BUTTON_PLAY -#define BTN_PAUSE BUTTON_POWER - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) || (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define BTN_UP BUTTON_VOL_UP #define BTN_DOWN BUTTON_VOL_DOWN #define BTN_LEFT BUTTON_PREV @@ -247,15 +231,15 @@ #define BTN_FIRE BUTTON_PLAY #define BTN_PAUSE BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == EROSQ_PAD) #define BTN_UP BUTTON_PREV #define BTN_DOWN BUTTON_NEXT -#define BTN_LEFT BUTTON_HOME -#define BTN_RIGHT BUTTON_VOL_DOWN +#define BTN_LEFT BUTTON_SCROLL_BACK +#define BTN_RIGHT BUTTON_SCROLL_FWD #define BTN_FIRE BUTTON_PLAY #define BTN_PAUSE BUTTON_POWER -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define BTN_UP BUTTON_PREV #define BTN_DOWN BUTTON_NEXT #define BTN_LEFT BUTTON_HOME diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c index 480dc446cb..4d2a08cf47 100644 --- a/apps/plugins/lib/pluginlib_actions.c +++ b/apps/plugins/lib/pluginlib_actions.c @@ -68,7 +68,7 @@ const struct button_mapping pla_remote_ctx[] = #endif /* HAVE_REMOTE_LCD */ /* these were taken from the bubbles plugin, so may need tweaking */ -const struct button_mapping pla_main_ctx[] = +const struct button_mapping pla_main_ctx[] = { /* Touchscreens */ #ifdef HAVE_TOUCHSCREEN @@ -242,6 +242,15 @@ const struct button_mapping pla_main_ctx[] = { PLA_DOWN_REPEAT, BUTTON_OPTION|BUTTON_REPEAT, BUTTON_NONE }, { PLA_LEFT_REPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, { PLA_RIGHT_REPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, +#elif (CONFIG_KEYPAD == EROSQ_PAD) + { PLA_UP, BUTTON_NEXT, BUTTON_NONE }, + { PLA_DOWN, BUTTON_PREV, BUTTON_NONE }, + { PLA_LEFT, BUTTON_SCROLL_BACK, BUTTON_NONE }, + { PLA_RIGHT, BUTTON_SCROLL_FWD, BUTTON_NONE }, + { PLA_UP_REPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, + { PLA_DOWN_REPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, +// { PLA_LEFT_REPEAT, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE }, +// { PLA_RIGHT_REPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE }, #elif (CONFIG_KEYPAD == IHIFI_770_PAD) { PLA_UP, BUTTON_PREV, BUTTON_NONE }, { PLA_DOWN, BUTTON_NEXT, BUTTON_NONE }, @@ -407,19 +416,19 @@ const struct button_mapping pla_main_ctx[] = {PLA_SELECT, BUTTON_OK, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_OK|BUTTON_REL, BUTTON_OK }, {PLA_SELECT_REPEAT, BUTTON_OK|BUTTON_REPEAT, BUTTON_NONE}, -#elif (CONFIG_KEYPAD == MPIO_HD200_PAD) +#elif (CONFIG_KEYPAD == MPIO_HD200_PAD) {PLA_CANCEL, BUTTON_REC, BUTTON_NONE}, {PLA_EXIT, (BUTTON_REC|BUTTON_PLAY), BUTTON_NONE}, {PLA_SELECT, BUTTON_FUNC, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_FUNC|BUTTON_REL, BUTTON_FUNC}, {PLA_SELECT_REPEAT, BUTTON_FUNC|BUTTON_REPEAT, BUTTON_NONE}, -#elif (CONFIG_KEYPAD == MPIO_HD300_PAD) +#elif (CONFIG_KEYPAD == MPIO_HD300_PAD) {PLA_CANCEL, BUTTON_MENU, BUTTON_NONE}, {PLA_EXIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE}, {PLA_SELECT, BUTTON_ENTER, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_ENTER|BUTTON_REL, BUTTON_ENTER}, {PLA_SELECT_REPEAT, BUTTON_ENTER|BUTTON_REPEAT, BUTTON_NONE}, -#elif (CONFIG_KEYPAD == RK27XX_GENERIC_PAD) +#elif (CONFIG_KEYPAD == RK27XX_GENERIC_PAD) {PLA_CANCEL, BUTTON_M, BUTTON_NONE}, {PLA_EXIT, BUTTON_M|BUTTON_REPEAT, BUTTON_NONE}, {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE}, @@ -431,7 +440,7 @@ const struct button_mapping pla_main_ctx[] = {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT}, {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, -#elif (CONFIG_KEYPAD == AGPTEK_ROCKER_PAD) +#elif (CONFIG_KEYPAD == AGPTEK_ROCKER_PAD) {PLA_CANCEL, BUTTON_VOLUP, BUTTON_NONE}, {PLA_EXIT, BUTTON_POWER, BUTTON_NONE}, {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, @@ -479,6 +488,12 @@ const struct button_mapping pla_main_ctx[] = {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE}, {PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY}, {PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE}, +#elif (CONFIG_KEYPAD == EROSQ_PAD) + {PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK}, + {PLA_EXIT, BUTTON_POWER, BUTTON_NONE}, + {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE}, + {PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY}, + {PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE}, #elif (CONFIG_KEYPAD == IHIFI_770_PAD) {PLA_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER}, {PLA_EXIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE}, @@ -501,7 +516,7 @@ const struct button_mapping pla_main_ctx[] = static struct button_mapping **plugin_context_order; static int plugin_context_count = 0; -static int last_context = 0; /* index into plugin_context_order +static int last_context = 0; /* index into plugin_context_order of the last context returned */ static const struct button_mapping* get_context_map(int context) diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index e34cedde21..641991cfeb 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -293,23 +293,7 @@ #define MIDI_VOL_DOWN BUTTON_VOLDOWN #define MIDI_PLAYPAUSE BUTTON_SELECT -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define MIDI_QUIT BUTTON_POWER -#define MIDI_FFWD BUTTON_NEXT -#define MIDI_REWIND BUTTON_PREV -#define MIDI_VOL_UP BUTTON_VOL_UP -#define MIDI_VOL_DOWN BUTTON_VOL_DOWN -#define MIDI_PLAYPAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define MIDI_QUIT BUTTON_POWER -#define MIDI_FFWD BUTTON_NEXT -#define MIDI_REWIND BUTTON_PREV -#define MIDI_VOL_UP BUTTON_VOL_UP -#define MIDI_VOL_DOWN BUTTON_VOL_DOWN -#define MIDI_PLAYPAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define MIDI_QUIT BUTTON_POWER #define MIDI_FFWD BUTTON_NEXT #define MIDI_REWIND BUTTON_PREV @@ -325,15 +309,7 @@ #define MIDI_VOL_DOWN BUTTON_VOL_DOWN #define MIDI_PLAYPAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD -#define MIDI_QUIT BUTTON_POWER -#define MIDI_FFWD BUTTON_VOL_DOWN -#define MIDI_REWIND BUTTON_HOME -#define MIDI_VOL_UP BUTTON_PREV -#define MIDI_VOL_DOWN BUTTON_NEXT -#define MIDI_PLAYPAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define MIDI_QUIT BUTTON_POWER #define MIDI_FFWD BUTTON_VOL_DOWN #define MIDI_REWIND BUTTON_HOME @@ -341,6 +317,14 @@ #define MIDI_VOL_DOWN BUTTON_NEXT #define MIDI_PLAYPAUSE BUTTON_PLAY +#elif CONFIG_KEYPAD == EROSQ_PAD +#define MIDI_QUIT BUTTON_POWER +#define MIDI_FFWD BUTTON_NEXT +#define MIDI_REWIND BUTTON_PREV +#define MIDI_VOL_UP BUTTON_VOL_UP +#define MIDI_VOL_DOWN BUTTON_VOL_DOWN +#define MIDI_PLAYPAUSE BUTTON_PLAY + #else #error No keymap defined! #endif @@ -716,4 +700,3 @@ enum plugin_status plugin_start(const void* parameter) return PLUGIN_ERROR; return PLUGIN_OK; } - diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 5872973a45..11c0e86619 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -382,20 +382,7 @@ CONFIG_KEYPAD == MROBE500_PAD # define MINESWP_DISCOVER2 BUTTON_VOL_UP # define MINESWP_INFO (BUTTON_PLAY | BUTTON_OPTION) -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -# define MINESWP_LEFT BUTTON_PREV -# define MINESWP_RIGHT BUTTON_NEXT -# define MINESWP_UP BUTTON_HOME -# define MINESWP_DOWN BUTTON_OPTION -# define MINESWP_QUIT BUTTON_POWER -# define MINESWP_TOGGLE_PRE BUTTON_PLAY -# define MINESWP_TOGGLE (BUTTON_PLAY | BUTTON_REL) -# define MINESWP_TOGGLE2 BUTTON_VOL_DOWN -# define MINESWP_DISCOVER (BUTTON_PLAY | BUTTON_REPEAT) -# define MINESWP_DISCOVER2 BUTTON_VOL_UP -# define MINESWP_INFO (BUTTON_PLAY | BUTTON_OPTION) - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) # define MINESWP_LEFT BUTTON_PREV # define MINESWP_RIGHT BUTTON_NEXT # define MINESWP_UP BUTTON_HOME @@ -421,7 +408,7 @@ CONFIG_KEYPAD == MROBE500_PAD # define MINESWP_DISCOVER2 BUTTON_VOL_UP # define MINESWP_INFO (BUTTON_PLAY | BUTTON_OPTION) -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) # define MINESWP_LEFT BUTTON_HOME # define MINESWP_RIGHT BUTTON_VOL_DOWN # define MINESWP_UP BUTTON_PREV @@ -434,18 +421,16 @@ CONFIG_KEYPAD == MROBE500_PAD # define MINESWP_DISCOVER2 (BUTTON_POWER | BUTTON_VOL_DOWN) # define MINESWP_INFO (BUTTON_POWER | BUTTON_HOME) -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -# define MINESWP_LEFT BUTTON_HOME -# define MINESWP_RIGHT BUTTON_VOL_DOWN +#elif (CONFIG_KEYPAD == EROSQ_PAD) +# define MINESWP_LEFT BUTTON_SCROLL_BACK +# define MINESWP_RIGHT BUTTON_SCROLL_FWD # define MINESWP_UP BUTTON_PREV # define MINESWP_DOWN BUTTON_NEXT # define MINESWP_QUIT BUTTON_POWER # define MINESWP_TOGGLE_PRE BUTTON_PLAY -# define MINESWP_TOGGLE (BUTTON_POWER | BUTTON_PREV) -# define MINESWP_TOGGLE2 (BUTTON_POWER | BUTTON_NEXT) -# define MINESWP_DISCOVER (BUTTON_POWER | BUTTON_VOL_UP) -# define MINESWP_DISCOVER2 (BUTTON_POWER | BUTTON_VOL_DOWN) -# define MINESWP_INFO (BUTTON_POWER | BUTTON_HOME) +# define MINESWP_TOGGLE (BUTTON_PLAY | BUTTON_REL) +# define MINESWP_DISCOVER (BUTTON_PLAY | BUTTON_REPEAT) +# define MINESWP_INFO BUTTON_VOL_UP #else #error No keymap defined! diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 0368edbc88..177835549c 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -152,7 +152,7 @@ static const uint8_t ht_count[2][2][16] = { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ -static const uint8_t t1HB[4] = {1,1,1,0}; +static const uint8_t t1HB[4] = {1,1,1,0}; static const uint8_t t2HB[9] = {1,2,1,3,1,1,3,2,0}; static const uint8_t t3HB[9] = {3,2,1,1,1,1,3,2,0}; static const uint8_t t5HB[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; @@ -802,7 +802,7 @@ static const int16_t win[18][4] = { { 529, -831,-3747,-2387 }, { 362, -471,-3579,-2747 }, { 134, -146,-3352,-3072 } }; - + static char* mp3_enc_err[] = { /* 0 */ "", /* 1 */ "Cannot open file.", @@ -880,21 +880,21 @@ static int wave_open(void) if((wavfile = rb->open(wav_filename, O_RDONLY)) < 0) return -1; - + if(!checkString(wavfile,"RIFF")) return -2; Read32BitsLowHigh(wavfile); /* complete wave chunk size */ if(!checkString(wavfile,"WAVE")) return -3; if(!checkString(wavfile,"fmt ")) return -4; - + header_size = Read32BitsLowHigh(wavfile); /* chunk size */ wFormatTag = Read16BitsLowHigh(wavfile); - + cfg.channels = Read16BitsLowHigh(wavfile); cfg.samplerate = Read32BitsLowHigh(wavfile); /*dAvgBytesPerSec*/ Read32BitsLowHigh(wavfile); /*wBlockAlign */ Read16BitsLowHigh(wavfile); bits_per_samp = Read16BitsLowHigh(wavfile); - + if(wFormatTag != 0x0001) return -5; /* linear PCM required */ if(bits_per_samp != 16) return -6; /* 16 bps required */ if(cfg.channels > 2) return -7; /* <=2 channels required */ @@ -904,11 +904,11 @@ static int wave_open(void) if((cfg.samplerate != 16000) && (cfg.samplerate != 22050) && (cfg.samplerate != 24000) && (cfg.samplerate != 32000) && (cfg.samplerate != 44100) && (cfg.samplerate != 48000)) return -9; - + header_size = 0x28; wav_size = rb->filesize(wavfile); rb->lseek(wavfile, header_size, SEEK_SET); - + return 0; } @@ -946,7 +946,7 @@ static void encodeSideInfo( side_info_t si[2][2] ) { int gr, ch, header; uint32_t cc=0, sz=0; - + /* * MPEG header layout: * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM @@ -1053,7 +1053,7 @@ static void Huffmancodebits( short *ix, char *xr_sign, side_info_t *gi ) if(bigvals > region2) bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); - + if(count1 > bigvals) bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); @@ -1251,7 +1251,7 @@ static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits ) { uint32_t i; int max, table0, table1; - + for(i=begin,max=0; i max) max = ix[i]; @@ -1408,7 +1408,7 @@ static int calc_runlen( short *ix, side_info_t *si ) int w = ix[i-2]; int x = ix[i-3]; int y = ix[i-4]; - + if((v | w | x | y) <= 1) { p = (y<<3) + (x<<2) + (w<<1) + (v); @@ -1473,7 +1473,7 @@ static int quantize_int(int *xr, short *ix, side_info_t *si) static void subdivide(side_info_t *si) { int scfb, count0, count1; - + if( !si->address3 ) { /* no bigvalue region */ si->region_0_1 = 0; @@ -1535,7 +1535,7 @@ static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si) /************************************************************************/ /* The code selects the best quantStep for a particular set of scalefacs*/ -/************************************************************************/ +/************************************************************************/ static int inner_loop(int *xr, int max_bits, side_info_t *si) { int bits; @@ -1877,7 +1877,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) a[ 7] -= a[ 6]; a[22] -= a[ 7]; a[23] -= a[22]; - + xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; @@ -1897,23 +1897,23 @@ void window_subband2(short *x1, int a[SBLIMIT]) xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; - + xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; - + xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; - + xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; - + xr = a[27]; a[27] = a[6] - xr; a[6] += xr; - + xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; @@ -1922,15 +1922,15 @@ void window_subband2(short *x1, int a[SBLIMIT]) xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; - + xr = a[24] - a[16]; a[24] = xr; xr = a[20] - xr; a[20] = xr; xr = a[28] - xr; a[28] = xr; - + xr = a[25] - a[17]; a[25] = xr; xr = a[21] - xr; a[21] = xr; xr = a[29] - xr; a[29] = xr; - + xr = a[17] - a[1]; a[17] = xr; xr = a[ 9] - xr; a[ 9] = xr; xr = a[25] - xr; a[25] = xr; @@ -1938,7 +1938,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) xr = a[21] - xr; a[21] = xr; xr = a[13] - xr; a[13] = xr; xr = a[29] - xr; a[29] = xr; - + xr = a[ 1] - a[0]; a[ 1] = xr; xr = a[16] - xr; a[16] = xr; xr = a[17] - xr; a[17] = xr; @@ -1954,7 +1954,7 @@ void window_subband2(short *x1, int a[SBLIMIT]) xr = a[13] - xr; a[13] = xr; xr = a[28] - xr; a[28] = xr; xr = a[29] - xr; a[29] = xr; - + xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; xr = a[16]; a[16] += a[15]; a[15] -= xr; @@ -1994,7 +1994,7 @@ void mdct_long(int *out, int *in) ct = (tc1 - tc3 - tc4) * cx[6]; out[5] = ct + st; out[6] = ct - st; - + tc2 = (in[16] - in[10]) * cx[6]; ts6 = ts6 * cx[7] + in[4] * cx[8]; @@ -2002,12 +2002,12 @@ void mdct_long(int *out, int *in) st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; out[1] = ct + st; out[2] = ct - st; - + ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; out[ 9] = ct + st; out[10] = ct - st; - + ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; out[13] = ct + st; @@ -2089,7 +2089,7 @@ static void init_mp3_encoder_engine(bool stereo, int bitrate, uint16_t sample_ra cfg.mpg.smpl_id = find_samplerate_index(cfg.samplerate, &cfg.mpg.type); cfg.mpg.bitr_id = find_bitrate_index(cfg.mpg.type, cfg.mpg.bitrate); cfg.mpg.num_bands = num_bands[stereo ? cfg.mpg.type : 2][cfg.mpg.bitr_id]; - + if(0 == cfg.mpg.type) { /* use MPEG2 format */ cfg.smpl_per_frm = MAX_SAMP_PER_FRAME/2; @@ -2172,13 +2172,13 @@ static void compress(void) { if((frames & 7) == 0) { rb->lcd_clear_display(); - rb->lcd_putsxyf(4, 20, "Frame %d / %d", frames, + rb->lcd_putsxyf(4, 20, "Frame %d / %d", frames, wav_size/cfg.smpl_per_frm/cfg.channels/2); rb->lcd_update(); } /* encode one mp3 frame in this loop */ memset(CodedData.bbuf, 0, sizeof(CodedData.bbuf)); - + if((cfg.slot_lag += cfg.frac_per_frame) >= 64) { /* Padding for this frame */ cfg.slot_lag -= 64; @@ -2556,19 +2556,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define MP3ENC_DONE BUTTON_POWER #define MP3ENC_SELECT BUTTON_SELECT -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define MP3ENC_PREV BUTTON_HOME -#define MP3ENC_NEXT BUTTON_OPTION -#define MP3ENC_DONE BUTTON_POWER -#define MP3ENC_SELECT BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define MP3ENC_PREV BUTTON_HOME -#define MP3ENC_NEXT BUTTON_OPTION -#define MP3ENC_DONE BUTTON_POWER -#define MP3ENC_SELECT BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define MP3ENC_PREV BUTTON_HOME #define MP3ENC_NEXT BUTTON_OPTION #define MP3ENC_DONE BUTTON_POWER @@ -2580,13 +2568,13 @@ CONFIG_KEYPAD == MROBE500_PAD #define MP3ENC_DONE BUTTON_POWER #define MP3ENC_SELECT BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define MP3ENC_PREV BUTTON_PREV #define MP3ENC_NEXT BUTTON_NEXT #define MP3ENC_DONE BUTTON_POWER #define MP3ENC_SELECT BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define MP3ENC_PREV BUTTON_PREV #define MP3ENC_NEXT BUTTON_NEXT #define MP3ENC_DONE BUTTON_POWER diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 43143bdaee..1bc7d4db96 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c @@ -316,17 +316,7 @@ struct mpeg_settings settings; #define MPEG_START_TIME_RIGHT2 BUTTON_VOL_DOWN #define MPEG_START_TIME_EXIT BUTTON_POWER -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define MPEG_START_TIME_SELECT BUTTON_PLAY -#define MPEG_START_TIME_LEFT BUTTON_PREV -#define MPEG_START_TIME_RIGHT BUTTON_NEXT -#define MPEG_START_TIME_UP BUTTON_HOME -#define MPEG_START_TIME_DOWN BUTTON_OPTION -#define MPEG_START_TIME_LEFT2 BUTTON_VOL_UP -#define MPEG_START_TIME_RIGHT2 BUTTON_VOL_DOWN -#define MPEG_START_TIME_EXIT BUTTON_POWER - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define MPEG_START_TIME_SELECT BUTTON_PLAY #define MPEG_START_TIME_LEFT BUTTON_PREV #define MPEG_START_TIME_RIGHT BUTTON_NEXT @@ -346,7 +336,7 @@ struct mpeg_settings settings; #define MPEG_START_TIME_RIGHT2 BUTTON_VOL_DOWN #define MPEG_START_TIME_EXIT BUTTON_POWER -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define MPEG_START_TIME_SELECT BUTTON_PLAY #define MPEG_START_TIME_LEFT BUTTON_HOME #define MPEG_START_TIME_RIGHT BUTTON_VOL_DOWN @@ -356,14 +346,12 @@ struct mpeg_settings settings; #define MPEG_START_TIME_RIGHT2 (BUTTON_POWER + BUTTON_VOL_DOWN) #define MPEG_START_TIME_EXIT BUTTON_POWER -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define MPEG_START_TIME_SELECT BUTTON_PLAY -#define MPEG_START_TIME_LEFT BUTTON_HOME -#define MPEG_START_TIME_RIGHT BUTTON_VOL_DOWN +#define MPEG_START_TIME_LEFT BUTTON_SCROLL_BACK +#define MPEG_START_TIME_RIGHT BUTTON_SCROLL_FWD #define MPEG_START_TIME_UP BUTTON_PREV #define MPEG_START_TIME_DOWN BUTTON_NEXT -#define MPEG_START_TIME_LEFT2 (BUTTON_POWER + BUTTON_HOME) -#define MPEG_START_TIME_RIGHT2 (BUTTON_POWER + BUTTON_VOL_DOWN) #define MPEG_START_TIME_EXIT BUTTON_POWER #else diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 8028913c94..f86a6e55fd 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -23,9 +23,9 @@ /**************************************************************************** * NOTES: - * + * * mpegplayer is structured as follows: - * + * * +-->Video Thread-->Video Output-->LCD * | * UI-->Stream Manager-->+-->Audio Thread-->PCM buffer--Audio Device @@ -36,53 +36,53 @@ * | Disk I/O * Stream services * (timing, etc.) - * + * * Thread list: * 1) The main thread - Handles user input, settings, basic playback control * and USB connect. - * + * * 2) Stream Manager thread - Handles playback state, events from streams * such as when a stream is finished, stream commands, PCM state. The * layer in which this thread run also handles arbitration of data * requests between the streams and the disk buffer. The actual specific * transport layer code may get moved out to support multiple container * formats. - * + * * 3) Buffer thread - Buffers data in the background, generates notifications * to streams when their data has been buffered, and watches streams' * progress to keep data available during playback. Handles synchronous * random access requests when the file cache is missed. - * + * * 4) Video thread (running on the COP for PortalPlayer targets) - Decodes * the video stream and renders video frames to the LCD. Handles * miscellaneous video tasks like frame and thumbnail printing. - * + * * 5) Audio thread (running on the main CPU to maintain consistency with the * audio FIQ hander on PP) - Decodes audio frames and places them into * the PCM buffer for rendering by the audio device. - * + * * Streams are neither aware of one another nor care about one another. All * streams shall have their own thread (unless it is _really_ efficient to * have a single thread handle a couple minor streams). All coordination of * the streams is done through the stream manager. The clocking is controlled * by and exposed by the stream manager to other streams and implemented at * the PCM level. - * + * * Notes about MPEG files: - * + * * MPEG System Clock is 27MHz - i.e. 27000000 ticks/second. - * + * * FPS is represented in terms of a frame period - this is always an * integer number of 27MHz ticks. - * + * * e.g. 29.97fps (30000/1001) NTSC video has an exact frame period of * 900900 27MHz ticks. - * + * * In libmpeg2, info->sequence->frame_period contains the frame_period. - * + * * Working with Rockbox's 100Hz tick, the common frame rates would need * to be as follows (1): - * + * * FPS | 27Mhz | 100Hz | 44.1KHz | 48KHz * --------|----------------------------------------------------------- * 10* | 2700000 | 10 | 4410 | 4800 @@ -93,9 +93,9 @@ * 25 | 1080000 | 4 | 1764 | 1920 * 29.9700 | 900900 | 3.336667 | 1471,47 | 1601.6 * 30 | 900000 | 3.333333 | 1470 | 1600 - * + * * *Unofficial framerates - * + * * (1) But we don't really care since the audio clock is used anyway and has * very fine resolution ;-) *****************************************************************************/ @@ -450,16 +450,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define MPEG_RW BUTTON_PREV #define MPEG_FF BUTTON_NEXT -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define MPEG_MENU BUTTON_PLAY -#define MPEG_STOP BUTTON_POWER -#define MPEG_PAUSE BUTTON_HOME -#define MPEG_VOLDOWN BUTTON_VOL_DOWN -#define MPEG_VOLUP BUTTON_VOL_UP -#define MPEG_RW BUTTON_PREV -#define MPEG_FF BUTTON_NEXT - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define MPEG_MENU BUTTON_PLAY #define MPEG_STOP BUTTON_POWER #define MPEG_PAUSE BUTTON_HOME @@ -477,7 +468,7 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define MPEG_RW BUTTON_PREV #define MPEG_FF BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define MPEG_MENU BUTTON_PLAY #define MPEG_STOP BUTTON_POWER #define MPEG_PAUSE BUTTON_HOME @@ -486,10 +477,10 @@ CONFIG_KEYPAD == SANSA_M200_PAD #define MPEG_RW BUTTON_PREV #define MPEG_FF BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_800_PAD -#define MPEG_MENU BUTTON_PLAY +#elif CONFIG_KEYPAD == EROSQ_PAD +#define MPEG_MENU BUTTON_MENU #define MPEG_STOP BUTTON_POWER -#define MPEG_PAUSE BUTTON_HOME +#define MPEG_PAUSE BUTTON_PLAY #define MPEG_VOLDOWN BUTTON_VOL_DOWN #define MPEG_VOLUP BUTTON_VOL_UP #define MPEG_RW BUTTON_PREV @@ -2508,7 +2499,7 @@ enum plugin_status plugin_start(const void* parameter) /* Enter button loop and process UI */ next_action = button_loop(); manual_skip = next_action & VIDEO_ACTION_MANUAL; - next_action &= ~VIDEO_ACTION_MANUAL; + next_action &= ~VIDEO_ACTION_MANUAL; } stream_close(); diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index 2cf9b96409..d8bef0ae7f 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -484,21 +484,7 @@ #define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN #define NEED_LASTBUTTON -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define OSCILLOSCOPE_QUIT BUTTON_POWER -#define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_PLAY -#define OSCILLOSCOPE_DRAWMODE (BUTTON_PLAY | BUTTON_REL) -#define OSCILLOSCOPE_ORIENTATION_PRE BUTTON_PLAY -#define OSCILLOSCOPE_ORIENTATION (BUTTON_PLAY | BUTTON_REPEAT) -#define OSCILLOSCOPE_ADVMODE BUTTON_HOME -#define OSCILLOSCOPE_PAUSE BUTTON_OPTION -#define OSCILLOSCOPE_SPEED_UP BUTTON_NEXT -#define OSCILLOSCOPE_SPEED_DOWN BUTTON_PREV -#define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP -#define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN -#define NEED_LASTBUTTON - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define OSCILLOSCOPE_QUIT BUTTON_POWER #define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_PLAY #define OSCILLOSCOPE_DRAWMODE (BUTTON_PLAY | BUTTON_REL) @@ -526,7 +512,7 @@ #define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN #define NEED_LASTBUTTON -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define OSCILLOSCOPE_QUIT BUTTON_POWER #define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_PLAY #define OSCILLOSCOPE_DRAWMODE (BUTTON_PLAY | BUTTON_REL) @@ -540,19 +526,16 @@ #define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN #define NEED_LASTBUTTON -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -#define OSCILLOSCOPE_QUIT BUTTON_POWER -#define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_PLAY -#define OSCILLOSCOPE_DRAWMODE (BUTTON_PLAY | BUTTON_REL) -#define OSCILLOSCOPE_ORIENTATION_PRE BUTTON_PLAY -#define OSCILLOSCOPE_ORIENTATION (BUTTON_PLAY | BUTTON_REPEAT) -#define OSCILLOSCOPE_ADVMODE BUTTON_HOME -#define OSCILLOSCOPE_PAUSE (BUTTON_HOME | BUTTON_REPEAT) -#define OSCILLOSCOPE_SPEED_UP BUTTON_NEXT -#define OSCILLOSCOPE_SPEED_DOWN BUTTON_PREV -#define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP -#define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN -#define NEED_LASTBUTTON +#elif CONFIG_KEYPAD == EROSQ_PAD +#define OSCILLOSCOPE_QUIT BUTTON_POWER +#define OSCILLOSCOPE_DRAWMODE BUTTON_PREV +#define OSCILLOSCOPE_ADVMODE BUTTON_NEXT +#define OSCILLOSCOPE_ORIENTATION BUTTON_BACK +#define OSCILLOSCOPE_PAUSE BUTTON_PLAY +#define OSCILLOSCOPE_SPEED_UP BUTTON_SCROLL_FWD +#define OSCILLOSCOPE_SPEED_DOWN BUTTON_SCROLL_BACK +#define OSCILLOSCOPE_VOL_UP BUTTON_VOL_UP +#define OSCILLOSCOPE_VOL_DOWN BUTTON_VOL_DOWN #else #error No keymap defined! @@ -881,7 +864,7 @@ static void anim_draw_cursor_h(int x) { #if LCD_DEPTH > 1 rb->lcd_set_foreground(CURSOR_COLOR); - rb->lcd_vline(x, 0, LCD_HEIGHT-1); + rb->lcd_vline(x, 0, LCD_HEIGHT-1); rb->lcd_set_foreground(GRAPH_COLOR); #else rb->lcd_set_drawmode(DRMODE_COMPLEMENT); @@ -895,7 +878,7 @@ static void anim_draw_cursor_v(int y) { #if LCD_DEPTH > 1 /* cursor bar */ rb->lcd_set_foreground(CURSOR_COLOR); - rb->lcd_hline(0, LCD_WIDTH-1, y); + rb->lcd_hline(0, LCD_WIDTH-1, y); rb->lcd_set_foreground(GRAPH_COLOR); #else rb->lcd_set_drawmode(DRMODE_COMPLEMENT); @@ -1040,9 +1023,9 @@ static long anim_peaks_horizontal(void) } else { - left = last_left + left = last_left + (LCD_WIDTH - last_pos) * (last_left - cur_left) / d; - right = last_right + right = last_right + (LCD_WIDTH - last_pos) * (last_right - cur_right) / d; rb->lcd_drawline( @@ -1066,7 +1049,7 @@ static long anim_peaks_horizontal(void) } } break; - + case DRAW_PIXEL: left = last_left; right = last_right; @@ -1090,14 +1073,14 @@ static long anim_peaks_horizontal(void) last_left = cur_left; last_right = cur_right; - + if (full_update) { osd_lcd_update(); } else { - anim_draw_cursor_h(cur_x + 1); /* cursor bar */ + anim_draw_cursor_h(cur_x + 1); /* cursor bar */ if (cur_x > last_pos) { @@ -1164,7 +1147,7 @@ static long anim_peaks_vertical(void) cur_y -= shift; last_pos -= shift; } - else + else { cur_y -= LCD_HEIGHT; } @@ -1219,7 +1202,7 @@ static long anim_peaks_vertical(void) } else { - left = last_left + left = last_left + (LCD_HEIGHT - last_pos) * (last_left - cur_left) / d; right = last_right + (LCD_HEIGHT - last_pos) * (last_right - cur_right) / d; @@ -1245,7 +1228,7 @@ static long anim_peaks_vertical(void) } } break; - + case DRAW_PIXEL: left = last_left; right = last_right; @@ -1269,7 +1252,7 @@ static long anim_peaks_vertical(void) last_left = cur_left; last_right = cur_right; - + if (full_update) { osd_lcd_update(); @@ -1358,7 +1341,7 @@ static void waveform_buffer_done(void) waveform_buffer_have = have; } - + /* where the samples are obtained and buffered */ static void waveform_buffer_callback(const void *start, size_t size) { @@ -2053,7 +2036,7 @@ enum plugin_status plugin_start(const void* parameter) osc_popupmsg(OSC_MSG_GRAPHMODE, osc.graphmode); break; #endif /* OSCILLOSCOPE_GRAPHMODE */ - + case OSCILLOSCOPE_ORIENTATION: #ifdef OSCILLOSCOPE_ORIENTATION_PRE if (lastbutton != OSCILLOSCOPE_ORIENTATION_PRE) @@ -2075,7 +2058,7 @@ enum plugin_status plugin_start(const void* parameter) graphmode_pause_unpause(paused); osc_popupmsg(OSC_MSG_PAUSED, paused ? 1 : 0); break; - + case OSCILLOSCOPE_SPEED_UP: case OSCILLOSCOPE_SPEED_UP | BUTTON_REPEAT: { @@ -2088,7 +2071,7 @@ enum plugin_status plugin_start(const void* parameter) osc_popupmsg(OSC_MSG_SPEED, *val); break; } - + case OSCILLOSCOPE_SPEED_DOWN: case OSCILLOSCOPE_SPEED_DOWN | BUTTON_REPEAT: { diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index a687806d96..39583edbd4 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h @@ -364,16 +364,7 @@ #define PACMAN_1UP BUTTON_VOLUP #define PACMAN_COIN BUTTON_VOLDOWN -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define PACMAN_UP BUTTON_PREV -#define PACMAN_DOWN BUTTON_NEXT -#define PACMAN_LEFT BUTTON_HOME -#define PACMAN_RIGHT BUTTON_VOL_DOWN -#define PACMAN_MENU BUTTON_POWER -#define PACMAN_1UP BUTTON_VOL_UP -#define PACMAN_COIN BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define PACMAN_UP BUTTON_PREV #define PACMAN_DOWN BUTTON_NEXT #define PACMAN_LEFT BUTTON_HOME @@ -391,7 +382,8 @@ #define PACMAN_1UP BUTTON_VOL_UP #define PACMAN_COIN BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD + #define PACMAN_UP BUTTON_PREV #define PACMAN_DOWN BUTTON_NEXT #define PACMAN_LEFT BUTTON_HOME @@ -400,13 +392,12 @@ #define PACMAN_1UP BUTTON_VOL_UP #define PACMAN_COIN BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_800_PAD - +#elif CONFIG_KEYPAD == EROSQ_PAD #define PACMAN_UP BUTTON_PREV #define PACMAN_DOWN BUTTON_NEXT -#define PACMAN_LEFT BUTTON_HOME -#define PACMAN_RIGHT BUTTON_VOL_DOWN -#define PACMAN_MENU BUTTON_POWER +#define PACMAN_LEFT BUTTON_SCROLL_BACK +#define PACMAN_RIGHT BUTTON_SCROLL_FWD +#define PACMAN_MENU BUTTON_MENU #define PACMAN_1UP BUTTON_VOL_UP #define PACMAN_COIN BUTTON_PLAY @@ -516,7 +507,7 @@ */ #if defined(TOSHIBA_GIGABEAT_S) || defined (TOSHIBA_GIGABEAT_F) || \ defined(SANSA_FUZEPLUS) -/* Gigabeat S,F and Sansa Fuze+ can manage the full framerate +/* Gigabeat S,F and Sansa Fuze+ can manage the full framerate (1 in 1 frames) */ #define FPS 60 #elif defined(IPOD_NANO) diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index 5f947fe5f2..b700051081 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c @@ -626,24 +626,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define LVL_UP_TEXT "VOL+" #define LVL_DOWN_TEXT "VOL-" -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define PEGBOX_SELECT BUTTON_PLAY -#define PEGBOX_QUIT BUTTON_POWER -#define PEGBOX_RESTART (BUTTON_POWER | BUTTON_HOME) -#define PEGBOX_LVL_UP BUTTON_VOL_UP -#define PEGBOX_LVL_DOWN BUTTON_VOL_DOWN -#define PEGBOX_UP BUTTON_HOME -#define PEGBOX_DOWN BUTTON_OPTION -#define PEGBOX_RIGHT BUTTON_NEXT -#define PEGBOX_LEFT BUTTON_PREV - -#define SELECT_TEXT "PLAY" -#define QUIT_TEXT "POWER" -#define RESTART_TEXT "HOME" -#define LVL_UP_TEXT "VOL+" -#define LVL_DOWN_TEXT "VOL-" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define PEGBOX_SELECT BUTTON_PLAY #define PEGBOX_QUIT BUTTON_POWER #define PEGBOX_RESTART (BUTTON_POWER | BUTTON_HOME) @@ -677,7 +660,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define LVL_UP_TEXT "VOL+" #define LVL_DOWN_TEXT "VOL-" -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define PEGBOX_SELECT BUTTON_PLAY #define PEGBOX_QUIT BUTTON_POWER #define PEGBOX_RESTART (BUTTON_POWER | BUTTON_HOME) @@ -694,16 +677,16 @@ CONFIG_KEYPAD == MROBE500_PAD #define LVL_UP_TEXT "VOL+" #define LVL_DOWN_TEXT "VOL-" -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == FIIO_M3K_PAD #define PEGBOX_SELECT BUTTON_PLAY #define PEGBOX_QUIT BUTTON_POWER #define PEGBOX_RESTART (BUTTON_POWER | BUTTON_HOME) -#define PEGBOX_LVL_UP (BUTTON_POWER | BUTTON_VOL_UP) -#define PEGBOX_LVL_DOWN (BUTTON_POWER | BUTTON_VOL_DOWN) -#define PEGBOX_UP BUTTON_PREV -#define PEGBOX_DOWN BUTTON_NEXT -#define PEGBOX_RIGHT BUTTON_HOME -#define PEGBOX_LEFT BUTTON_VOL_DOWN +#define PEGBOX_LVL_UP BUTTON_VOL_UP +#define PEGBOX_LVL_DOWN BUTTON_VOL_DOWN +#define PEGBOX_UP BUTTON_HOME +#define PEGBOX_DOWN BUTTON_OPTION +#define PEGBOX_RIGHT BUTTON_NEXT +#define PEGBOX_LEFT BUTTON_PREV #define SELECT_TEXT "PLAY" #define QUIT_TEXT "POWER" @@ -711,11 +694,24 @@ CONFIG_KEYPAD == MROBE500_PAD #define LVL_UP_TEXT "VOL+" #define LVL_DOWN_TEXT "VOL-" -#else -#error Unsupported keymap! -#endif +#elif CONFIG_KEYPAD == EROSQ_PAD +#define PEGBOX_SELECT BUTTON_PLAY +#define PEGBOX_QUIT BUTTON_POWER +#define PEGBOX_RESTART BUTTON_BACK +#define PEGBOX_LVL_UP BUTTON_VOL_UP +#define PEGBOX_LVL_DOWN BUTTON_VOL_DOWN +#define PEGBOX_UP BUTTON_PREV +#define PEGBOX_DOWN BUTTON_NEXT +#define PEGBOX_RIGHT BUTTON_SCROLL_FWD +#define PEGBOX_LEFT BUTTON_SCROLL_BACK -#ifdef HAVE_TOUCHSCREEN +#define SELECT_TEXT "PLAY" +#define QUIT_TEXT "POWER" +#define RESTART_TEXT "BACK" +#define LVL_UP_TEXT "VOL+" +#define LVL_DOWN_TEXT "VOL-" + +#elif defined(HAVE_TOUCHSCREEN) #ifndef PEGBOX_QUIT #define PEGBOX_QUIT BUTTON_TOPLEFT #endif @@ -758,9 +754,10 @@ CONFIG_KEYPAD == MROBE500_PAD #ifndef LVL_DOWN_TEXT #define LVL_DOWN_TEXT "BOTTOMRIGHT" #endif +#else +#error Unsupported keymap! #endif - /* get several sizes from the bitmaps */ #ifdef BMPWIDTH_pegbox_pieces #define PIECE_WIDTH BMPWIDTH_pegbox_pieces @@ -1083,7 +1080,7 @@ static void pegbox_draw_board(struct game_context* pb) if(type != SPACE) { rb->lcd_bitmap_part(pegbox_pieces, 0, (type-1)*PIECE_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_pegbox_pieces,BMPHEIGHT_pegbox_pieces), c * PIECE_WIDTH + BOARD_X, r * PIECE_HEIGHT + BOARD_Y, PIECE_WIDTH, diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 41525f3ffe..d5952aac35 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -293,15 +293,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define PONG_RIGHT_UP BUTTON_HOME #define PONG_RIGHT_DOWN BUTTON_NEXT -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define PONG_QUIT BUTTON_POWER -#define PONG_PAUSE BUTTON_PLAY -#define PONG_LEFT_UP BUTTON_PREV -#define PONG_LEFT_DOWN BUTTON_OPTION -#define PONG_RIGHT_UP BUTTON_HOME -#define PONG_RIGHT_DOWN BUTTON_NEXT - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define PONG_QUIT BUTTON_POWER #define PONG_PAUSE BUTTON_PLAY #define PONG_LEFT_UP BUTTON_PREV @@ -317,7 +309,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define PONG_RIGHT_UP BUTTON_HOME #define PONG_RIGHT_DOWN BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define PONG_QUIT BUTTON_POWER #define PONG_PAUSE BUTTON_PREV #define PONG_LEFT_UP BUTTON_PLAY @@ -325,13 +317,14 @@ CONFIG_KEYPAD == MROBE500_PAD #define PONG_RIGHT_UP BUTTON_VOL_UP #define PONG_RIGHT_DOWN BUTTON_VOL_DOWN -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define PONG_QUIT BUTTON_POWER -#define PONG_PAUSE BUTTON_PREV -#define PONG_LEFT_UP BUTTON_PLAY -#define PONG_LEFT_DOWN BUTTON_HOME -#define PONG_RIGHT_UP BUTTON_VOL_UP -#define PONG_RIGHT_DOWN BUTTON_VOL_DOWN +#define PONG_PAUSE BUTTON_PLAY +#define PONG_LEFT_UP BUTTON_SCROLL_BACK +#define PONG_LEFT_DOWN BUTTON_SCROLL_FWD +#define PONG_RIGHT_UP BUTTON_PREV +#define PONG_RIGHT_DOWN BUTTON_NEXT + #else #error No keymap defined! diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h index 1547e52573..0a2348a28d 100644 --- a/apps/plugins/reversi/reversi-gui.h +++ b/apps/plugins/reversi/reversi-gui.h @@ -45,9 +45,9 @@ #define REVERSI_BUTTON_LEFT (BUTTON_LEFT | BUTTON_SCROLL_BACK) #define REVERSI_BUTTON_RIGHT (BUTTON_RIGHT | BUTTON_SCROLL_FWD) #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS +#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS #define REVERSI_BUTTON_MENU BUTTON_SELECT -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU_LONGPRESS #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) #define REVERSI_BUTTON_QUIT BUTTON_POWER @@ -96,9 +96,9 @@ #define REVERSI_BUTTON_LEFT BUTTON_LEFT #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS +#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS #define REVERSI_BUTTON_MENU BUTTON_SELECT -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU_LONGPRESS #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) #define REVERSI_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT) @@ -107,9 +107,9 @@ #define REVERSI_BUTTON_LEFT BUTTON_LEFT #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS +#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS #define REVERSI_BUTTON_MENU BUTTON_SELECT -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU_LONGPRESS #elif CONFIG_KEYPAD == MROBE500_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER @@ -233,17 +233,17 @@ #define REVERSI_BUTTON_UP BUTTON_REW #define REVERSI_BUTTON_DOWN BUTTON_FF #define REVERSI_BUTTON_LEFT BUTTON_VOL_DOWN -#define REVERSI_BUTTON_RIGHT BUTTON_VOL_UP +#define REVERSI_BUTTON_RIGHT BUTTON_VOL_UP #define REVERSI_BUTTON_MAKE_MOVE BUTTON_FUNC -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS +#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS #define REVERSI_BUTTON_MENU BUTTON_FUNC -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU_LONGPRESS #elif CONFIG_KEYPAD == MPIO_HD300_PAD #define REVERSI_BUTTON_UP BUTTON_UP #define REVERSI_BUTTON_DOWN BUTTON_DOWN #define REVERSI_BUTTON_LEFT BUTTON_REW -#define REVERSI_BUTTON_RIGHT BUTTON_FF +#define REVERSI_BUTTON_RIGHT BUTTON_FF #define REVERSI_BUTTON_MAKE_MOVE BUTTON_ENTER #define REVERSI_BUTTON_MENU BUTTON_MENU @@ -251,7 +251,7 @@ #define REVERSI_BUTTON_UP BUTTON_UP #define REVERSI_BUTTON_DOWN BUTTON_DOWN #define REVERSI_BUTTON_LEFT BUTTON_LEFT -#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT +#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT #define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAYPAUSE #define REVERSI_BUTTON_MENU BUTTON_BACK @@ -269,7 +269,7 @@ #define REVERSI_BUTTON_UP BUTTON_UP #define REVERSI_BUTTON_DOWN BUTTON_DOWN #define REVERSI_BUTTON_LEFT BUTTON_LEFT -#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT +#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT #define REVERSI_BUTTON_MENU BUTTON_POWER @@ -319,18 +319,7 @@ #define REVERSI_BUTTON_MENU BUTTON_PLAY #define REVERSI_BUTTON_MENU_LONGPRESS -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define REVERSI_BUTTON_QUIT BUTTON_POWER -#define REVERSI_BUTTON_UP BUTTON_HOME -#define REVERSI_BUTTON_DOWN BUTTON_OPTION -#define REVERSI_BUTTON_LEFT BUTTON_PREV -#define REVERSI_BUTTON_RIGHT BUTTON_NEXT -#define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS -#define REVERSI_BUTTON_MENU BUTTON_PLAY -#define REVERSI_BUTTON_MENU_LONGPRESS - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER #define REVERSI_BUTTON_UP BUTTON_HOME #define REVERSI_BUTTON_DOWN BUTTON_OPTION @@ -352,27 +341,25 @@ #define REVERSI_BUTTON_MENU BUTTON_PLAY #define REVERSI_BUTTON_MENU_LONGPRESS -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER #define REVERSI_BUTTON_UP BUTTON_PREV #define REVERSI_BUTTON_DOWN BUTTON_NEXT #define REVERSI_BUTTON_LEFT BUTTON_PREV #define REVERSI_BUTTON_RIGHT BUTTON_VOL_DOWN #define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS +#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS #define REVERSI_BUTTON_MENU BUTTON_PLAY -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU_LONGPRESS -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER #define REVERSI_BUTTON_UP BUTTON_PREV #define REVERSI_BUTTON_DOWN BUTTON_NEXT -#define REVERSI_BUTTON_LEFT BUTTON_PREV -#define REVERSI_BUTTON_RIGHT BUTTON_VOL_DOWN +#define REVERSI_BUTTON_LEFT BUTTON_SCROLL_BACK +#define REVERSI_BUTTON_RIGHT BUTTON_SCROLL_FWD #define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY -#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS -#define REVERSI_BUTTON_MENU BUTTON_PLAY -#define REVERSI_BUTTON_MENU_LONGPRESS +#define REVERSI_BUTTON_MENU BUTTON_MENU #else #error No keymap defined! diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index ec6d892a0b..6a8b50a68d 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -431,31 +431,7 @@ #define ROCKBLOX_ROTATE_CCW BUTTON_VOLDOWN #define ROCKBLOX_DOWN BUTTON_DOWN -#elif CONFIG_KEYPAD == XDUOO_X3_PAD - -#define ROCKBLOX_OFF BUTTON_POWER -#define ROCKBLOX_ROTATE_CCW BUTTON_HOME -#define ROCKBLOX_ROTATE_CCW2 BUTTON_VOL_DOWN -#define ROCKBLOX_ROTATE_CW BUTTON_VOL_UP -#define ROCKBLOX_DOWN BUTTON_OPTION -#define ROCKBLOX_LEFT BUTTON_PREV -#define ROCKBLOX_RIGHT BUTTON_NEXT -#define ROCKBLOX_DROP (BUTTON_PLAY|BUTTON_REL) -#define ROCKBLOX_RESTART (BUTTON_PLAY|BUTTON_REPEAT) - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - -#define ROCKBLOX_OFF BUTTON_POWER -#define ROCKBLOX_ROTATE_CCW BUTTON_HOME -#define ROCKBLOX_ROTATE_CCW2 BUTTON_VOL_DOWN -#define ROCKBLOX_ROTATE_CW BUTTON_VOL_UP -#define ROCKBLOX_DOWN BUTTON_OPTION -#define ROCKBLOX_LEFT BUTTON_PREV -#define ROCKBLOX_RIGHT BUTTON_NEXT -#define ROCKBLOX_DROP (BUTTON_PLAY|BUTTON_REL) -#define ROCKBLOX_RESTART (BUTTON_PLAY|BUTTON_REPEAT) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) || (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define ROCKBLOX_OFF BUTTON_POWER #define ROCKBLOX_ROTATE_CCW BUTTON_HOME @@ -479,7 +455,7 @@ #define ROCKBLOX_DROP (BUTTON_PLAY|BUTTON_REL) #define ROCKBLOX_RESTART (BUTTON_PLAY|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define ROCKBLOX_OFF BUTTON_POWER #define ROCKBLOX_ROTATE_CCW BUTTON_HOME @@ -491,17 +467,15 @@ #define ROCKBLOX_DROP (BUTTON_POWER|BUTTON_PLAY) #define ROCKBLOX_RESTART (BUTTON_POWER|BUTTON_REPEAT) -#elif CONFIG_KEYPAD == IHIFI_800_PAD - +#elif CONFIG_KEYPAD == EROSQ_PAD #define ROCKBLOX_OFF BUTTON_POWER -#define ROCKBLOX_ROTATE_CCW BUTTON_HOME -#define ROCKBLOX_ROTATE_CCW2 BUTTON_VOL_DOWN -#define ROCKBLOX_ROTATE_CW BUTTON_VOL_UP -#define ROCKBLOX_DOWN BUTTON_PLAY +#define ROCKBLOX_ROTATE_CCW BUTTON_SCROLL_BACK +#define ROCKBLOX_ROTATE_CW BUTTON_SCROLL_FWD +#define ROCKBLOX_DOWN BUTTON_MENU #define ROCKBLOX_LEFT BUTTON_PREV #define ROCKBLOX_RIGHT BUTTON_NEXT -#define ROCKBLOX_DROP (BUTTON_POWER|BUTTON_PLAY) -#define ROCKBLOX_RESTART (BUTTON_POWER|BUTTON_REPEAT) +#define ROCKBLOX_DROP BUTTON_PLAY +#define ROCKBLOX_RESTART BUTTON_BACK #else #error No keymap defined! diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index c96946cf7d..75de5230f2 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -425,17 +425,7 @@ static void setoptions (void) options.SELECT = BUTTON_VOL_UP; options.MENU = BUTTON_POWER; -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - options.UP = BUTTON_PREV; - options.DOWN = BUTTON_NEXT; - - options.A = BUTTON_HOME; - options.B = BUTTON_OPTION; - options.START = BUTTON_VOL_DOWN; - options.SELECT = BUTTON_VOL_UP; - options.MENU = BUTTON_POWER; - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD options.UP = BUTTON_PREV; options.DOWN = BUTTON_NEXT; @@ -455,7 +445,7 @@ static void setoptions (void) options.SELECT = BUTTON_VOL_UP; options.MENU = BUTTON_POWER; -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD options.UP = BUTTON_PREV; options.DOWN = BUTTON_NEXT; @@ -465,14 +455,16 @@ static void setoptions (void) options.SELECT = BUTTON_HOME; options.MENU = BUTTON_POWER; -#elif CONFIG_KEYPAD == IHIFI_800_PAD - options.UP = BUTTON_PREV; - options.DOWN = BUTTON_NEXT; +#elif CONFIG_KEYPAD == EROSQ_PAD + options.UP = BUTTON_PREV; + options.DOWN = BUTTON_NEXT; + options.LEFT = BUTTON_SCROLL_BACK; + options.RIGHT = BUTTON_SCROLL_FWD; - options.A = BUTTON_VOL_UP; - options.B = BUTTON_VOL_DOWN; - options.START = BUTTON_PLAY; - options.SELECT = BUTTON_HOME; + options.A = BUTTON_MENU; + options.B = BUTTON_BACK; + options.START = BUTTON_VOL_DOWN; + options.SELECT = BUTTON_VOL_UP; options.MENU = BUTTON_POWER; #else diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index 7683016066..8c70f6b4a6 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -63,7 +63,7 @@ #define PUZZLE_PICTURE BUTTON_A #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ -(CONFIG_KEYPAD == SANSA_C200_PAD) +(CONFIG_KEYPAD == SANSA_C200_PAD) #define PUZZLE_QUIT BUTTON_POWER #define PUZZLE_LEFT BUTTON_LEFT #define PUZZLE_RIGHT BUTTON_RIGHT @@ -312,16 +312,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define PUZZLE_SHUFFLE (BUTTON_HOME | BUTTON_PWRALT) #define PUZZLE_PICTURE BUTTON_PLAY -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define PUZZLE_QUIT BUTTON_POWER -#define PUZZLE_LEFT BUTTON_PREV -#define PUZZLE_RIGHT BUTTON_NEXT -#define PUZZLE_UP BUTTON_HOME -#define PUZZLE_DOWN BUTTON_OPTION -#define PUZZLE_SHUFFLE (BUTTON_HOME | BUTTON_POWER) -#define PUZZLE_PICTURE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define PUZZLE_QUIT BUTTON_POWER #define PUZZLE_LEFT BUTTON_PREV #define PUZZLE_RIGHT BUTTON_NEXT @@ -339,7 +330,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define PUZZLE_SHUFFLE (BUTTON_HOME | BUTTON_POWER) #define PUZZLE_PICTURE BUTTON_PLAY -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define PUZZLE_QUIT BUTTON_POWER #define PUZZLE_LEFT BUTTON_HOME #define PUZZLE_RIGHT BUTTON_VOL_DOWN @@ -348,15 +339,16 @@ CONFIG_KEYPAD == MROBE500_PAD #define PUZZLE_SHUFFLE (BUTTON_HOME | BUTTON_POWER) #define PUZZLE_PICTURE BUTTON_PLAY -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) +#elif (CONFIG_KEYPAD == EROSQ_PAD) #define PUZZLE_QUIT BUTTON_POWER -#define PUZZLE_LEFT BUTTON_HOME -#define PUZZLE_RIGHT BUTTON_VOL_DOWN +#define PUZZLE_LEFT BUTTON_SCROLL_BACK +#define PUZZLE_RIGHT BUTTON_SCROLL_FWD #define PUZZLE_UP BUTTON_PREV #define PUZZLE_DOWN BUTTON_NEXT -#define PUZZLE_SHUFFLE (BUTTON_HOME | BUTTON_POWER) +#define PUZZLE_SHUFFLE BUTTON_BACK #define PUZZLE_PICTURE BUTTON_PLAY + #else #error No keymap defined! #endif @@ -383,13 +375,13 @@ CONFIG_KEYPAD == MROBE500_PAD #ifndef PUZZLE_PICTURE #define PUZZLE_PICTURE BUTTON_CENTER #endif -#ifndef PUZZLE_QUIT_TEXT +#ifndef PUZZLE_QUIT_TEXT #define PUZZLE_QUIT_TEXT "[TOPLEFT]" #endif -#ifndef PUZZLE_SHUFFLE_TEXT +#ifndef PUZZLE_SHUFFLE_TEXT #define PUZZLE_SHUFFLE_TEXT "[BOTTOMLEFT]" #endif -#ifndef PUZZLE_PICTURE_TEXT +#ifndef PUZZLE_PICTURE_TEXT #define PUZZLE_PICTURE_TEXT "[CENTER]" #endif #endif @@ -563,7 +555,7 @@ static void draw_spot(int p, int x, int y) an appropriate hole graphic */ rb->lcd_bitmap_part(sliding_puzzle, ((p-1)%SPOTS_X)*SPOTS_WIDTH, ((p-1)/SPOTS_X)*SPOTS_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle), x, y, SPOTS_WIDTH, SPOTS_HEIGHT); #else @@ -580,8 +572,8 @@ static void draw_spot(int p, int x, int y) { rb->lcd_bitmap_part( puzzle_bmp_ptr, ((p-1)%SPOTS_X)*SPOTS_WIDTH, ((p-1)/SPOTS_X)*SPOTS_HEIGHT, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle), + STRIDE( SCREEN_MAIN, + BMPWIDTH_sliding_puzzle, BMPHEIGHT_sliding_puzzle), x, y, SPOTS_WIDTH, SPOTS_HEIGHT); } else { rb->lcd_drawrect(x, y, SPOTS_WIDTH, SPOTS_HEIGHT); diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index ebfb39c9a7..0f2bcdce6c 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -24,7 +24,7 @@ Snake! by Itai Shaked -ok, a little explanation - +ok, a little explanation - board holds the snake and apple position - 1+ - snake body (the number represents the age [1 is the snake's head]). -1 is an apple, and 0 is a clear spot. @@ -273,15 +273,7 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #define SNAKE_DOWN BUTTON_OPTION #define SNAKE_PLAYPAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define SNAKE_QUIT BUTTON_POWER -#define SNAKE_LEFT BUTTON_PREV -#define SNAKE_RIGHT BUTTON_NEXT -#define SNAKE_UP BUTTON_HOME -#define SNAKE_DOWN BUTTON_OPTION -#define SNAKE_PLAYPAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define SNAKE_QUIT BUTTON_POWER #define SNAKE_LEFT BUTTON_PREV #define SNAKE_RIGHT BUTTON_NEXT @@ -297,7 +289,7 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #define SNAKE_DOWN BUTTON_OPTION #define SNAKE_PLAYPAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define SNAKE_QUIT BUTTON_POWER #define SNAKE_LEFT BUTTON_HOME #define SNAKE_RIGHT BUTTON_VOL_DOWN @@ -305,10 +297,10 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; #define SNAKE_DOWN BUTTON_NEXT #define SNAKE_PLAYPAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define SNAKE_QUIT BUTTON_POWER -#define SNAKE_LEFT BUTTON_HOME -#define SNAKE_RIGHT BUTTON_VOL_DOWN +#define SNAKE_LEFT BUTTON_SCROLL_BACK +#define SNAKE_RIGHT BUTTON_SCROLL_FWD #define SNAKE_UP BUTTON_PREV #define SNAKE_DOWN BUTTON_NEXT #define SNAKE_PLAYPAUSE BUTTON_PLAY diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index 77400dfff1..464af413f9 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -401,16 +401,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define SNAKE2_PLAYPAUSE BUTTON_PLAY #define SNAKE2_PLAYPAUSE_TEXT "PLAY" -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define SNAKE2_LEFT BUTTON_PREV -#define SNAKE2_RIGHT BUTTON_NEXT -#define SNAKE2_UP BUTTON_HOME -#define SNAKE2_DOWN BUTTON_OPTION -#define SNAKE2_QUIT BUTTON_POWER -#define SNAKE2_PLAYPAUSE BUTTON_PLAY -#define SNAKE2_PLAYPAUSE_TEXT "PLAY" - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define SNAKE2_LEFT BUTTON_PREV #define SNAKE2_RIGHT BUTTON_NEXT #define SNAKE2_UP BUTTON_HOME @@ -428,7 +419,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define SNAKE2_PLAYPAUSE BUTTON_PLAY #define SNAKE2_PLAYPAUSE_TEXT "PLAY" -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define SNAKE2_LEFT BUTTON_HOME #define SNAKE2_RIGHT BUTTON_VOL_DOWN #define SNAKE2_UP BUTTON_PREV @@ -437,9 +428,9 @@ CONFIG_KEYPAD == MROBE500_PAD #define SNAKE2_PLAYPAUSE BUTTON_PLAY #define SNAKE2_PLAYPAUSE_TEXT "PLAY" -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -#define SNAKE2_LEFT BUTTON_HOME -#define SNAKE2_RIGHT BUTTON_VOL_DOWN +#elif (CONFIG_KEYPAD == EROSQ_PAD) +#define SNAKE2_LEFT BUTTON_SCROLL_BACK +#define SNAKE2_RIGHT BUTTON_SCROLL_FWD #define SNAKE2_UP BUTTON_PREV #define SNAKE2_DOWN BUTTON_NEXT #define SNAKE2_QUIT BUTTON_POWER @@ -451,7 +442,7 @@ CONFIG_KEYPAD == MROBE500_PAD #endif #ifdef HAVE_TOUCHSCREEN -#ifndef SNAKE2_LEFT +#ifndef SNAKE2_LEFT #define SNAKE2_LEFT BUTTON_MIDLEFT #endif #ifndef SNAKE2_RIGHT diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index da3c303ace..e779722790 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -631,23 +631,7 @@ #define BUTTON_SAVE BUTTON_PLAY #define BUTTON_SAVE_NAME "PLAY" -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define SOKOBAN_LEFT BUTTON_PREV -#define SOKOBAN_RIGHT BUTTON_NEXT -#define SOKOBAN_UP BUTTON_HOME -#define SOKOBAN_DOWN BUTTON_OPTION -#define SOKOBAN_MENU BUTTON_POWER -#define SOKOBAN_UNDO_PRE BUTTON_PLAY -#define SOKOBAN_UNDO (BUTTON_PLAY | BUTTON_REL) -#define SOKOBAN_REDO (BUTTON_POWER | BUTTON_PLAY) -#define SOKOBAN_LEVEL_DOWN BUTTON_VOL_DOWN -#define SOKOBAN_LEVEL_REPEAT (BUTTON_PLAY | BUTTON_NEXT) -#define SOKOBAN_LEVEL_UP BUTTON_VOL_UP -#define SOKOBAN_PAUSE BUTTON_PLAY -#define BUTTON_SAVE BUTTON_PLAY -#define BUTTON_SAVE_NAME "PLAY" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define SOKOBAN_LEFT BUTTON_PREV #define SOKOBAN_RIGHT BUTTON_NEXT #define SOKOBAN_UP BUTTON_HOME @@ -679,7 +663,7 @@ #define BUTTON_SAVE BUTTON_PLAY #define BUTTON_SAVE_NAME "PLAY" -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define SOKOBAN_LEFT BUTTON_HOME #define SOKOBAN_RIGHT BUTTON_VOL_DOWN #define SOKOBAN_UP BUTTON_PREV @@ -695,18 +679,18 @@ #define BUTTON_SAVE BUTTON_PLAY #define BUTTON_SAVE_NAME "PLAY" -#elif CONFIG_KEYPAD == IHIFI_800_PAD -#define SOKOBAN_LEFT BUTTON_HOME -#define SOKOBAN_RIGHT BUTTON_VOL_DOWN +#elif CONFIG_KEYPAD == EROSQ_PAD +#define SOKOBAN_LEFT BUTTON_SCROLL_BACK +#define SOKOBAN_RIGHT BUTTON_SCROLL_FWD #define SOKOBAN_UP BUTTON_PREV #define SOKOBAN_DOWN BUTTON_NEXT -#define SOKOBAN_MENU BUTTON_POWER +#define SOKOBAN_MENU BUTTON_MENU #define SOKOBAN_UNDO_PRE BUTTON_PLAY #define SOKOBAN_UNDO (BUTTON_PLAY | BUTTON_REL) #define SOKOBAN_REDO (BUTTON_POWER | BUTTON_PLAY) -#define SOKOBAN_LEVEL_DOWN (BUTTON_POWER | BUTTON_VOL_DOWN) -#define SOKOBAN_LEVEL_REPEAT (BUTTON_POWER | BUTTON_HOME) -#define SOKOBAN_LEVEL_UP (BUTTON_POWER | BUTTON_VOL_UP) +#define SOKOBAN_LEVEL_DOWN BUTTON_VOL_DOWN +#define SOKOBAN_LEVEL_REPEAT BUTTON_BACK +#define SOKOBAN_LEVEL_UP BUTTON_VOL_UP #define SOKOBAN_PAUSE BUTTON_PLAY #define BUTTON_SAVE BUTTON_PLAY #define BUTTON_SAVE_NAME "PLAY" @@ -1286,56 +1270,56 @@ static void update_screen(void) case ' ': /* floor */ rb->lcd_bitmap_part(sokoban_tiles, 0, 0*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_sokoban_tiles, - BMPHEIGHT_sokoban_tiles), + BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; case '#': /* wall */ rb->lcd_bitmap_part(sokoban_tiles, 0, 1*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; case '$': /* box */ rb->lcd_bitmap_part(sokoban_tiles, 0, 2*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE,SOKOBAN_TILESIZE); break; case '*': /* box on goal */ rb->lcd_bitmap_part(sokoban_tiles, 0, 3*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; case '.': /* goal */ rb->lcd_bitmap_part(sokoban_tiles, 0, 4*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; case '@': /* player */ rb->lcd_bitmap_part(sokoban_tiles, 0, 5*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; case '+': /* player on goal */ rb->lcd_bitmap_part(sokoban_tiles, 0, 6*SOKOBAN_TILESIZE, - STRIDE( SCREEN_MAIN, - BMPWIDTH_sokoban_tiles, + STRIDE( SCREEN_MAIN, + BMPWIDTH_sokoban_tiles, BMPHEIGHT_sokoban_tiles), c, r, SOKOBAN_TILESIZE, SOKOBAN_TILESIZE); break; diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 1996dc97e7..6c496663cf 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -646,26 +646,7 @@ CONFIG_KEYPAD == MROBE500_PAD # define HK_CUR2STACK "DBL PLAY" # define HK_REM2STACK "NEXT" -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -# define SOL_QUIT BUTTON_POWER -# define SOL_UP BUTTON_HOME -# define SOL_DOWN BUTTON_OPTION -# define SOL_LEFT BUTTON_PREV -# define SOL_RIGHT BUTTON_NEXT -# define SOL_MOVE_PRE BUTTON_PLAY -# define SOL_MOVE (BUTTON_PLAY | BUTTON_REL) -# define SOL_DRAW (BUTTON_POWER | BUTTON_REPEAT) -# define SOL_REM2CUR BUTTON_VOL_DOWN -# define SOL_CUR2STACK_PRE BUTTON_PLAY -# define SOL_CUR2STACK (BUTTON_PLAY | BUTTON_REPEAT) -# define SOL_REM2STACK BUTTON_VOL_UP -# define HK_MOVE "PLAY" -# define HK_DRAW "DBL HOME" -# define HK_REM2CUR "PREV" -# define HK_CUR2STACK "DBL PLAY" -# define HK_REM2STACK "NEXT" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD # define SOL_QUIT BUTTON_POWER # define SOL_UP BUTTON_HOME # define SOL_DOWN BUTTON_OPTION @@ -703,7 +684,7 @@ CONFIG_KEYPAD == MROBE500_PAD # define HK_CUR2STACK "DBL PLAY" # define HK_REM2STACK "NEXT" -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD # define SOL_QUIT BUTTON_POWER # define SOL_UP BUTTON_PREV # define SOL_DOWN BUTTON_NEXT @@ -722,24 +703,24 @@ CONFIG_KEYPAD == MROBE500_PAD # define HK_CUR2STACK "DBL PLAY" # define HK_REM2STACK "POWER+" -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD # define SOL_QUIT BUTTON_POWER # define SOL_UP BUTTON_PREV # define SOL_DOWN BUTTON_NEXT -# define SOL_LEFT BUTTON_HOME -# define SOL_RIGHT BUTTON_VOL_DOWN -# define SOL_MOVE_PRE BUTTON_VOL_UP +# define SOL_LEFT BUTTON_SCROLL_BACK +# define SOL_RIGHT BUTTON_SCROLL_FWD +# define SOL_MOVE_PRE BUTTON_PLAY # define SOL_MOVE (BUTTON_PLAY | BUTTON_REL) # define SOL_DRAW (BUTTON_POWER | BUTTON_REPEAT) -# define SOL_REM2CUR (BUTTON_POWER | BUTTON_VOL_DOWN) +# define SOL_REM2CUR BUTTON_VOL_DOWN # define SOL_CUR2STACK_PRE BUTTON_PLAY # define SOL_CUR2STACK (BUTTON_PLAY | BUTTON_REPEAT) -# define SOL_REM2STACK (BUTTON_POWER | BUTTON_VOL_UP) +# define SOL_REM2STACK BUTTON_VOL_UP # define HK_MOVE "PLAY" -# define HK_DRAW "DBL POWER" -# define HK_REM2CUR "POWER" +# define HK_DRAW "DBL HOME" +# define HK_REM2CUR "PREV" # define HK_CUR2STACK "DBL PLAY" -# define HK_REM2STACK "POWER+" +# define HK_REM2STACK "NEXT" #else #error No keymap defined! @@ -950,8 +931,8 @@ static void draw_card( card_t *card, int x, int y, if( card->known ) { rb->lcd_bitmap_part( card_deck, CARD_GFX_WIDTH * card->num, - CARD_GFX_HEIGHT * card->suit, - STRIDE(SCREEN_MAIN, + CARD_GFX_HEIGHT * card->suit, + STRIDE(SCREEN_MAIN, BMPWIDTH_card_deck, BMPHEIGHT_card_deck), x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT ); } @@ -967,7 +948,7 @@ static void draw_card( card_t *card, int x, int y, static void draw_empty_stack( int s, int x, int y, bool cursor ) { rb->lcd_bitmap_part( solitaire_suitsi, 0, - CARD_GFX_HEIGHT * s, + CARD_GFX_HEIGHT * s, STRIDE( SCREEN_MAIN, BMPWIDTH_solitaire_suitsi, BMPHEIGHT_solitaire_suitsi), x+1, y+1, CARD_GFX_WIDTH, CARD_GFX_HEIGHT ); @@ -1618,11 +1599,11 @@ static int save_game( void ) static int load_game( void ) { int checksum, retval; - + int fd = open_save_file( O_RDONLY ); if( fd < 0 ) return -1; - + retval = 0; /* Assume good case */ if( ( rb->lseek( fd, -(off_t)sizeof( int ), SEEK_END ) == -((ssize_t)sizeof( int ))-1 ) || ( rb->read( fd, &checksum, sizeof( int ) ) < ((ssize_t)sizeof( int )) ) @@ -1646,7 +1627,7 @@ static int load_game( void ) rb->splash( 2*HZ, "Save file was corrupted. Aborting." ); retval = -3; } - + rb->close( fd ); delete_save_file(); return retval; diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 1b3bdda0d1..67816120a1 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -327,25 +327,7 @@ #define AST_RIGHT BUTTON_RIGHT #define AST_FIRE BUTTON_SELECT -#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) -#define AST_PAUSE BUTTON_VOL_UP -#define AST_QUIT BUTTON_POWER -#define AST_THRUST BUTTON_HOME -#define AST_HYPERSPACE BUTTON_OPTION -#define AST_LEFT BUTTON_PREV -#define AST_RIGHT BUTTON_NEXT -#define AST_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define AST_PAUSE BUTTON_VOL_UP -#define AST_QUIT BUTTON_POWER -#define AST_THRUST BUTTON_HOME -#define AST_HYPERSPACE BUTTON_OPTION -#define AST_LEFT BUTTON_PREV -#define AST_RIGHT BUTTON_NEXT -#define AST_FIRE BUTTON_PLAY - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3_PAD) || (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define AST_PAUSE BUTTON_VOL_UP #define AST_QUIT BUTTON_POWER #define AST_THRUST BUTTON_HOME @@ -363,7 +345,7 @@ #define AST_RIGHT BUTTON_NEXT #define AST_FIRE BUTTON_PLAY -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define AST_PAUSE BUTTON_PLAY #define AST_QUIT BUTTON_POWER #define AST_THRUST BUTTON_NEXT @@ -372,14 +354,14 @@ #define AST_RIGHT BUTTON_VOL_DOWN #define AST_FIRE BUTTON_VOL_UP -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) -#define AST_PAUSE BUTTON_PLAY +#elif (CONFIG_KEYPAD == EROSQ_PAD) +#define AST_PAUSE BUTTON_PREV #define AST_QUIT BUTTON_POWER -#define AST_THRUST BUTTON_NEXT -#define AST_HYPERSPACE BUTTON_PREV -#define AST_LEFT BUTTON_HOME -#define AST_RIGHT BUTTON_VOL_DOWN -#define AST_FIRE BUTTON_VOL_UP +#define AST_THRUST BUTTON_PLAY +#define AST_HYPERSPACE BUTTON_MENU +#define AST_LEFT BUTTON_SCROLL_BACK +#define AST_RIGHT BUTTON_SCROLL_FWD +#define AST_FIRE BUTTON_BACK #else #error No keymap defined! diff --git a/apps/plugins/star.c b/apps/plugins/star.c index cf8522fbac..e44c867cdc 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -588,23 +588,7 @@ #define STAR_LEVEL_DOWN_NAME "PLAY + PREV" #define STAR_LEVEL_REPEAT_NAME "PLAY + OPTION" -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define STAR_QUIT BUTTON_POWER -#define STAR_LEFT BUTTON_PREV -#define STAR_RIGHT BUTTON_NEXT -#define STAR_UP BUTTON_HOME -#define STAR_DOWN BUTTON_OPTION -#define STAR_TOGGLE_CONTROL BUTTON_PLAY -#define STAR_LEVEL_UP (BUTTON_PLAY | BUTTON_NEXT) -#define STAR_LEVEL_DOWN (BUTTON_PLAY | BUTTON_PREV) -#define STAR_LEVEL_REPEAT (BUTTON_PLAY | BUTTON_OPTION) -#define STAR_TOGGLE_CONTROL_NAME "PLAY" -#define STAR_QUIT_NAME "POWER" -#define STAR_LEVEL_UP_NAME "PLAY + NEXT" -#define STAR_LEVEL_DOWN_NAME "PLAY + PREV" -#define STAR_LEVEL_REPEAT_NAME "PLAY + OPTION" - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define STAR_QUIT BUTTON_POWER #define STAR_LEFT BUTTON_PREV #define STAR_RIGHT BUTTON_NEXT @@ -636,7 +620,7 @@ #define STAR_LEVEL_DOWN_NAME "PLAY + PREV" #define STAR_LEVEL_REPEAT_NAME "PLAY + OPTION" -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define STAR_QUIT BUTTON_POWER #define STAR_LEFT BUTTON_HOME #define STAR_RIGHT BUTTON_VOL_DOWN @@ -652,21 +636,21 @@ #define STAR_LEVEL_DOWN_NAME "POWER + VOL-" #define STAR_LEVEL_REPEAT_NAME "POWER + HOME" -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define STAR_QUIT BUTTON_POWER -#define STAR_LEFT BUTTON_HOME -#define STAR_RIGHT BUTTON_VOL_DOWN +#define STAR_LEFT BUTTON_SCROLL_BACK +#define STAR_RIGHT BUTTON_SCROLL_FWD #define STAR_UP BUTTON_PREV #define STAR_DOWN BUTTON_NEXT #define STAR_TOGGLE_CONTROL BUTTON_PLAY -#define STAR_LEVEL_UP (BUTTON_POWER | BUTTON_VOL_UP) -#define STAR_LEVEL_DOWN (BUTTON_POWER | BUTTON_VOL_DOWN) -#define STAR_LEVEL_REPEAT (BUTTON_POWER | BUTTON_HOME) +#define STAR_LEVEL_UP BUTTON_VOL_UP +#define STAR_LEVEL_DOWN BUTTON_VOL_DOWN +#define STAR_LEVEL_REPEAT BUTTON_BACK #define STAR_TOGGLE_CONTROL_NAME "PLAY" #define STAR_QUIT_NAME "POWER" -#define STAR_LEVEL_UP_NAME "POWER + VOL+" -#define STAR_LEVEL_DOWN_NAME "POWER + VOL-" -#define STAR_LEVEL_REPEAT_NAME "POWER + HOME" +#define STAR_LEVEL_UP_NAME "VOL UP" +#define STAR_LEVEL_DOWN_NAME "VOL DN" +#define STAR_LEVEL_REPEAT_NAME "BACK" #else #error No keymap defined! @@ -1035,8 +1019,8 @@ static void star_display_board_info(int current_level) label_pos_y, "C:"); rb->lcd_bitmap_part(star_tiles, 0, control == STAR_CONTROL_BALL ? - BALL*TILE_HEIGHT : BLOCK*TILE_HEIGHT, - STRIDE( SCREEN_MAIN, + BALL*TILE_HEIGHT : BLOCK*TILE_HEIGHT, + STRIDE( SCREEN_MAIN, BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles), STAR_OFFSET_X + (STAR_WIDTH-1) * TILE_WIDTH, tile_pos_y, TILE_WIDTH, TILE_HEIGHT); @@ -1082,7 +1066,7 @@ static int star_load_level(int current_level) STAR_OFFSET_X + x * TILE_WIDTH, \ STAR_OFFSET_Y + y * TILE_HEIGHT, \ TILE_WIDTH, TILE_HEIGHT); - + case STAR_VOID: DRAW_TILE( SPACE ); break; @@ -1128,12 +1112,12 @@ static void star_animate_tile(int tile_no, int start_x, int start_y, for (i = 1 ; i <= TILE_WIDTH ; i++) { STAR_SLEEP - rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, - STRIDE( SCREEN_MAIN, + rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, + STRIDE( SCREEN_MAIN, BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles), start_x, start_y, TILE_WIDTH, TILE_HEIGHT); rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT, - STRIDE( SCREEN_MAIN, + STRIDE( SCREEN_MAIN, BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles), start_x + delta_x * i, start_y, TILE_WIDTH, TILE_HEIGHT); rb->lcd_update_rect(start_x + delta_x * i - (delta_x>0?1:0), @@ -1145,12 +1129,12 @@ static void star_animate_tile(int tile_no, int start_x, int start_y, for (i = 1 ; i <= TILE_HEIGHT ; i++) { STAR_SLEEP - rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, - STRIDE( SCREEN_MAIN, + rb->lcd_bitmap_part(star_tiles, 0, SPACE * TILE_HEIGHT, + STRIDE( SCREEN_MAIN, BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles), start_x, start_y, TILE_WIDTH, TILE_HEIGHT); - rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT, - STRIDE( SCREEN_MAIN, + rb->lcd_bitmap_part(star_tiles, 0, tile_no * TILE_HEIGHT, + STRIDE( SCREEN_MAIN, BMPWIDTH_star_tiles, BMPHEIGHT_star_tiles), start_x, start_y + delta_y * i, TILE_WIDTH, TILE_HEIGHT); rb->lcd_update_rect(start_x, start_y + delta_y * i - (delta_y>0?1:0), @@ -1169,7 +1153,7 @@ static int star_run_game(int current_level) int key; #if defined(STAR_LEVEL_DOWN_PRE) || \ defined(STAR_LEVEL_UP_PRE) || \ - defined(STAR_TOGGLE_CONTROL_PRE) + defined(STAR_TOGGLE_CONTROL_PRE) int lastkey = BUTTON_NONE; #endif @@ -1261,7 +1245,7 @@ static int star_run_game(int current_level) } #if defined(STAR_LEVEL_DOWN_PRE) || \ defined(STAR_LEVEL_UP_PRE) || \ - defined(STAR_TOGGLE_CONTROL_PRE) + defined(STAR_TOGGLE_CONTROL_PRE) if (key != BUTTON_NONE) lastkey = key; #endif diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c index 801c735f00..db9cfd57da 100644 --- a/apps/plugins/stopwatch.c +++ b/apps/plugins/stopwatch.c @@ -277,23 +277,7 @@ #define STOPWATCH_SCROLL_UP BUTTON_UP #define STOPWATCH_SCROLL_DOWN BUTTON_DOWN -#elif CONFIG_KEYPAD == XDUOO_X3_PAD -#define STOPWATCH_QUIT BUTTON_POWER -#define STOPWATCH_START_STOP BUTTON_NEXT -#define STOPWATCH_RESET_TIMER BUTTON_PREV -#define STOPWATCH_LAP_TIMER BUTTON_PLAY -#define STOPWATCH_SCROLL_UP BUTTON_HOME -#define STOPWATCH_SCROLL_DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define STOPWATCH_QUIT BUTTON_POWER -#define STOPWATCH_START_STOP BUTTON_NEXT -#define STOPWATCH_RESET_TIMER BUTTON_PREV -#define STOPWATCH_LAP_TIMER BUTTON_PLAY -#define STOPWATCH_SCROLL_UP BUTTON_HOME -#define STOPWATCH_SCROLL_DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define STOPWATCH_QUIT BUTTON_POWER #define STOPWATCH_START_STOP BUTTON_NEXT #define STOPWATCH_RESET_TIMER BUTTON_PREV @@ -309,7 +293,7 @@ #define STOPWATCH_SCROLL_UP BUTTON_HOME #define STOPWATCH_SCROLL_DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define STOPWATCH_QUIT BUTTON_POWER #define STOPWATCH_START_STOP BUTTON_NEXT #define STOPWATCH_RESET_TIMER BUTTON_PREV @@ -317,13 +301,13 @@ #define STOPWATCH_SCROLL_UP BUTTON_VOL_UP #define STOPWATCH_SCROLL_DOWN BUTTON_VOL_DOWN -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define STOPWATCH_QUIT BUTTON_POWER -#define STOPWATCH_START_STOP BUTTON_NEXT -#define STOPWATCH_RESET_TIMER BUTTON_PREV -#define STOPWATCH_LAP_TIMER BUTTON_PLAY -#define STOPWATCH_SCROLL_UP BUTTON_VOL_UP -#define STOPWATCH_SCROLL_DOWN BUTTON_VOL_DOWN +#define STOPWATCH_START_STOP BUTTON_PLAY +#define STOPWATCH_RESET_TIMER BUTTON_BACK +#define STOPWATCH_LAP_TIMER BUTTON_MENU +#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD +#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK #else #error No keymap defined! @@ -405,24 +389,24 @@ static void ticks_to_string(int ticks,int lap,int buflen, char * buf) } } -/* +/* * Load saved stopwatch state, if exists. */ static void load_stopwatch(void) { int fd; - + fd = rb->open(STOPWATCH_FILE, O_RDONLY); - + if (fd < 0) { return; } - + /* variable stopwatch isn't saved/loaded, because it is only used * temporarily in main loop */ - + rb->read(fd, &start_at, sizeof(start_at)); rb->read(fd, &prev_total, sizeof(prev_total)); rb->read(fd, &counting, sizeof(counting)); @@ -430,7 +414,7 @@ static void load_stopwatch(void) rb->read(fd, &lap_scroll, sizeof(lap_scroll)); rb->read(fd, &lap_start, sizeof(lap_start)); rb->read(fd, lap_times, sizeof(lap_times)); - + if (counting && start_at > *rb->current_tick) { /* Stopwatch started in the future? Unlikely; probably started on a @@ -441,28 +425,28 @@ static void load_stopwatch(void) start_at = 0; counting = false; } - + rb->close(fd); } -/* +/* * Save stopwatch state. */ static void save_stopwatch(void) { int fd; - + fd = rb->open(STOPWATCH_FILE, O_CREAT|O_WRONLY|O_TRUNC, 0666); - + if (fd < 0) { return; } - + /* variable stopwatch isn't saved/loaded, because it is only used * temporarily in main loop */ - + rb->write(fd, &start_at, sizeof(start_at)); rb->write(fd, &prev_total, sizeof(prev_total)); rb->write(fd, &counting, sizeof(counting)); @@ -470,7 +454,7 @@ static void save_stopwatch(void) rb->write(fd, &lap_scroll, sizeof(lap_scroll)); rb->write(fd, &lap_start, sizeof(lap_start)); rb->write(fd, lap_times, sizeof(lap_times)); - + rb->close(fd); } @@ -491,9 +475,9 @@ enum plugin_status plugin_start(const void* parameter) lines = (LCD_HEIGHT / h) - (LAP_Y); load_stopwatch(); - + rb->lcd_clear_display(); - + while (!done) { if (counting) diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h index 749087260d..36f47a377a 100644 --- a/apps/plugins/sudoku/sudoku.h +++ b/apps/plugins/sudoku/sudoku.h @@ -404,21 +404,7 @@ #define SUDOKU_BUTTON_MENU (BUTTON_POWER | BUTTON_REL) #define SUDOKU_BUTTON_POSSIBLE (BUTTON_HOME | BUTTON_PWRALT) -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define SUDOKU_BUTTON_QUIT_PRE BUTTON_POWER -#define SUDOKU_BUTTON_QUIT (BUTTON_POWER | BUTTON_REPEAT) -#define SUDOKU_BUTTON_UP BUTTON_HOME -#define SUDOKU_BUTTON_DOWN BUTTON_OPTION -#define SUDOKU_BUTTON_LEFT BUTTON_PREV -#define SUDOKU_BUTTON_RIGHT BUTTON_NEXT -#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_VOL_DOWN -#define SUDOKU_BUTTON_TOGGLE BUTTON_VOL_UP -#define SUDOKU_BUTTON_ALTTOGGLE BUTTON_PLAY -#define SUDOKU_BUTTON_MENU_PRE BUTTON_POWER -#define SUDOKU_BUTTON_MENU (BUTTON_POWER | BUTTON_REL) -#define SUDOKU_BUTTON_POSSIBLE (BUTTON_HOME | BUTTON_POWER) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define SUDOKU_BUTTON_QUIT_PRE BUTTON_POWER #define SUDOKU_BUTTON_QUIT (BUTTON_POWER | BUTTON_REPEAT) #define SUDOKU_BUTTON_UP BUTTON_HOME @@ -446,7 +432,7 @@ #define SUDOKU_BUTTON_MENU (BUTTON_POWER | BUTTON_REL) #define SUDOKU_BUTTON_POSSIBLE (BUTTON_HOME | BUTTON_POWER) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define SUDOKU_BUTTON_QUIT_PRE BUTTON_POWER #define SUDOKU_BUTTON_QUIT (BUTTON_POWER | BUTTON_REPEAT) #define SUDOKU_BUTTON_UP BUTTON_PREV @@ -460,19 +446,18 @@ #define SUDOKU_BUTTON_MENU (BUTTON_POWER | BUTTON_REL) #define SUDOKU_BUTTON_POSSIBLE (BUTTON_POWER | BUTTON_HOME) -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define SUDOKU_BUTTON_QUIT_PRE BUTTON_POWER #define SUDOKU_BUTTON_QUIT (BUTTON_POWER | BUTTON_REPEAT) #define SUDOKU_BUTTON_UP BUTTON_PREV #define SUDOKU_BUTTON_DOWN BUTTON_NEXT -#define SUDOKU_BUTTON_LEFT BUTTON_HOME -#define SUDOKU_BUTTON_RIGHT BUTTON_VOL_DOWN -#define SUDOKU_BUTTON_TOGGLEBACK (BUTTON_POWER | BUTTON_VOL_DOWN) -#define SUDOKU_BUTTON_TOGGLE (BUTTON_POWER | BUTTON_VOL_UP) -#define SUDOKU_BUTTON_ALTTOGGLE BUTTON_PLAY -#define SUDOKU_BUTTON_MENU_PRE BUTTON_POWER -#define SUDOKU_BUTTON_MENU (BUTTON_POWER | BUTTON_REL) -#define SUDOKU_BUTTON_POSSIBLE (BUTTON_POWER | BUTTON_HOME) +#define SUDOKU_BUTTON_LEFT BUTTON_SCROLL_BACK +#define SUDOKU_BUTTON_RIGHT BUTTON_SCROLL_FWD +#define SUDOKU_BUTTON_TOGGLEBACK BUTTON_VOL_DOWN +#define SUDOKU_BUTTON_TOGGLE BUTTON_VOL_UP +#define SUDOKU_BUTTON_MENU_PRE BUTTON_MENU +#define SUDOKU_BUTTON_MENU (BUTTON_MENU | BUTTON_REL) +#define SUDOKU_BUTTON_POSSIBLE BUTTON_BACK #else #error No keymap defined! @@ -512,7 +497,7 @@ struct sudoku_state_t { char savedboard[9][9]; /* Cached copy of saved state */ int x,y; /* Cursor position */ int editmode; /* We are editing the start board */ -#ifdef SUDOKU_BUTTON_POSSIBLE +#ifdef SUDOKU_BUTTON_POSSIBLE short possiblevals[9][9]; /* possible values a cell could be, user sets them */ short savedpossible[9][9]; /* cached copy of possible cell values */ #endif diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h index dea87ebd52..cf3a2b777e 100644 --- a/apps/plugins/text_viewer/tv_button.h +++ b/apps/plugins/text_viewer/tv_button.h @@ -545,6 +545,18 @@ #define TV_LINE_DOWN BUTTON_OPTION #define TV_BOOKMARK (BUTTON_OPTION | BUTTON_PLAY) +#elif CONFIG_KEYPAD == EROSQ_PAD +#define TV_MENU BUTTON_MENU +#define TV_SCROLL_UP BUTTON_SCROLL_BACK +#define TV_SCROLL_DOWN BUTTON_SCROLL_FWD +#define TV_SCREEN_LEFT BUTTON_PREV +#define TV_SCREEN_RIGHT BUTTON_NEXT +#define TV_AUTOSCROLL BUTTON_PLAY +#define TV_QUIT BUTTON_POWER +#define TV_BOOKMARK BUTTON_BACK +#define TV_LINE_UP BUTTON_VOL_UP +#define TV_LINE_DOWN BUTTON_VOL_DOWN + /* Xuelin 770/770c keys */ #elif CONFIG_KEYPAD == IHIFI_770_PAD #define TV_QUIT BUTTON_POWER diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 66ddf03dd8..80e1960fad 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -397,18 +397,7 @@ #define LABEL_MENU "PLAY" #define LABEL_VOLUME "VOL UP/DN" -#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) -#define VUMETER_QUIT BUTTON_POWER -#define VUMETER_HELP BUTTON_HOME -#define VUMETER_MENU BUTTON_PLAY -#define VUMETER_UP BUTTON_VOL_UP -#define VUMETER_DOWN BUTTON_VOL_DOWN -#define LABEL_HELP "HOME" -#define LABEL_QUIT "POWER" -#define LABEL_MENU "PLAY" -#define LABEL_VOLUME "VOL UP/DN" - -#elif (CONFIG_KEYPAD == XDUOO_X20_PAD) +#elif (CONFIG_KEYPAD == XDUOO_X3II_PAD) || (CONFIG_KEYPAD == XDUOO_X20_PAD) #define VUMETER_QUIT BUTTON_POWER #define VUMETER_HELP BUTTON_HOME #define VUMETER_MENU BUTTON_PLAY @@ -430,7 +419,7 @@ #define LABEL_MENU "PLAY" #define LABEL_VOLUME "VOL UP/DN" -#elif (CONFIG_KEYPAD == IHIFI_770_PAD) +#elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) #define VUMETER_QUIT BUTTON_POWER #define VUMETER_HELP BUTTON_HOME #define VUMETER_MENU BUTTON_PLAY @@ -441,15 +430,15 @@ #define LABEL_MENU "PLAY" #define LABEL_VOLUME "VOL UP/DN" -#elif (CONFIG_KEYPAD == IHIFI_800_PAD) +#elif (CONFIG_KEYPAD == EROSQ_PAD) #define VUMETER_QUIT BUTTON_POWER -#define VUMETER_HELP BUTTON_HOME -#define VUMETER_MENU BUTTON_PLAY +#define VUMETER_HELP BUTTON_BACK +#define VUMETER_MENU BUTTON_MENU #define VUMETER_UP BUTTON_VOL_UP #define VUMETER_DOWN BUTTON_VOL_DOWN -#define LABEL_HELP "HOME" +#define LABEL_HELP "BACK" #define LABEL_QUIT "POWER" -#define LABEL_MENU "PLAY" +#define LABEL_MENU "MENU" #define LABEL_VOLUME "VOL UP/DN" #else @@ -551,7 +540,7 @@ struct saved_settings { bool analog_minimeters; bool digital_minimeters; int analog_decay; - int digital_decay; + int digital_decay; } vumeter_settings; static void reset_settings(void) { @@ -561,7 +550,7 @@ static void reset_settings(void) { vumeter_settings.analog_minimeters=true; vumeter_settings.digital_minimeters=false; vumeter_settings.analog_decay=3; - vumeter_settings.digital_decay=0; + vumeter_settings.digital_decay=0; } static void calc_scales(void) @@ -639,11 +628,11 @@ static bool vu_meter_menu(void) int selection; bool menu_quit = false; bool exit = false; - + MENUITEM_STRINGLIST(menu,"VU Meter Menu",NULL,"Meter Type","Scale", "Minimeters","Decay Speed","Playback Control", "Quit"); - + static const struct opt_items meter_type_option[2] = { { "Analog", -1 }, { "Digital", -1 }, @@ -666,7 +655,7 @@ static bool vu_meter_menu(void) rb->set_option("Meter Type", &vumeter_settings.meter_type, INT, meter_type_option, 2, NULL); break; - + case 1: if(vumeter_settings.meter_type==ANALOG) { @@ -679,7 +668,7 @@ static bool vu_meter_menu(void) "dBfs", -1, "Linear", -1, NULL); } break; - + case 2: if(vumeter_settings.meter_type==ANALOG) { @@ -692,16 +681,16 @@ static bool vu_meter_menu(void) &vumeter_settings.digital_minimeters); } break; - + case 3: if(vumeter_settings.meter_type==ANALOG) { - rb->set_option("Decay Speed", &vumeter_settings.analog_decay, INT, + rb->set_option("Decay Speed", &vumeter_settings.analog_decay, INT, decay_speed_option, 7, NULL); } else { - rb->set_option("Decay Speed", &vumeter_settings.digital_decay, INT, + rb->set_option("Decay Speed", &vumeter_settings.digital_decay, INT, decay_speed_option, 7, NULL); } break; @@ -779,7 +768,7 @@ static void draw_digital_minimeters(void) { if(8<(num_right_leds)) rb->lcd_mono_bitmap(sound_max_level, 46, half_height+8, 3, 8); rb->lcd_set_drawmode(DRMODE_SOLID); - + #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(screen_foreground); #endif @@ -880,10 +869,10 @@ static void digital_meter(void) { rb->lcd_set_foreground(LCD_RGBPACK(255, 255 - 23 * i, 0)); #endif rb->lcd_fillrect((digital_lead + (i*digital_block_width)), - (half_height + 20), digital_block_width - digital_block_gap, + (half_height + 20), digital_block_width - digital_block_gap, digital_block_height); } - + #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(screen_foreground); #endif diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 6cf03dfaff..e4286f35b4 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c @@ -362,16 +362,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define BTN_QUIT BUTTON_POWER #define BTN_STOPRESET (BUTTON_HOME | BUTTON_PWRALT) -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define BTN_DIR_UP BUTTON_HOME -#define BTN_DIR_DOWN BUTTON_OPTION -#define BTN_DIR_LEFT BUTTON_PREV -#define BTN_DIR_RIGHT BUTTON_NEXT -#define BTN_STARTPAUSE BUTTON_PLAY -#define BTN_QUIT BUTTON_POWER -#define BTN_STOPRESET (BUTTON_HOME | BUTTON_POWER) - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define BTN_DIR_UP BUTTON_HOME #define BTN_DIR_DOWN BUTTON_OPTION #define BTN_DIR_LEFT BUTTON_PREV @@ -389,7 +380,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define BTN_QUIT BUTTON_POWER #define BTN_STOPRESET (BUTTON_HOME | BUTTON_POWER) -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define BTN_DIR_UP BUTTON_PREV #define BTN_DIR_DOWN BUTTON_NEXT #define BTN_DIR_LEFT BUTTON_HOME @@ -398,14 +389,14 @@ CONFIG_KEYPAD == MROBE500_PAD #define BTN_QUIT BUTTON_POWER #define BTN_STOPRESET BUTTON_VOL_UP -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define BTN_DIR_UP BUTTON_PREV #define BTN_DIR_DOWN BUTTON_NEXT -#define BTN_DIR_LEFT BUTTON_HOME -#define BTN_DIR_RIGHT BUTTON_VOL_DOWN +#define BTN_DIR_LEFT BUTTON_SCROLL_BACK +#define BTN_DIR_RIGHT BUTTON_SCROLL_FWD #define BTN_STARTPAUSE BUTTON_PLAY #define BTN_QUIT BUTTON_POWER -#define BTN_STOPRESET BUTTON_VOL_UP +#define BTN_STOPRESET BUTTON_BACK #else #error No keymap defined! diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 94161c683d..f60938e900 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -315,25 +315,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define DOWN BUTTON_DOWN #define PAUSE BUTTON_SELECT -#elif CONFIG_KEYPAD == XDUOO_X3_PAD - -#define QUIT BUTTON_POWER -#define LEFT BUTTON_PREV -#define RIGHT BUTTON_NEXT -#define UP BUTTON_HOME -#define DOWN BUTTON_OPTION -#define PAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - -#define QUIT BUTTON_POWER -#define LEFT BUTTON_PREV -#define RIGHT BUTTON_NEXT -#define UP BUTTON_HOME -#define DOWN BUTTON_OPTION -#define PAUSE BUTTON_PLAY - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_PREV @@ -351,7 +333,7 @@ CONFIG_KEYPAD == MROBE500_PAD #define DOWN BUTTON_OPTION #define PAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define QUIT BUTTON_POWER #define LEFT BUTTON_HOME @@ -360,20 +342,16 @@ CONFIG_KEYPAD == MROBE500_PAD #define DOWN BUTTON_NEXT #define PAUSE BUTTON_PLAY -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define QUIT BUTTON_POWER -#define LEFT BUTTON_HOME -#define RIGHT BUTTON_VOL_DOWN +#define LEFT BUTTON_SCROLL_BACK +#define RIGHT BUTTON_SCROLL_FWD #define UP BUTTON_PREV #define DOWN BUTTON_NEXT #define PAUSE BUTTON_PLAY -#else -#error No keymap defined! -#endif - -#ifdef HAVE_TOUCHSCREEN +#elif defined(HAVE_TOUCHSCREEN) #ifndef QUIT #define QUIT BUTTON_TOPLEFT #endif @@ -392,6 +370,8 @@ CONFIG_KEYPAD == MROBE500_PAD #ifndef PAUSE #define PAUSE BUTTON_CENTER #endif +#else +#error No keymap defined! #endif #define MOVE_NO 0 /* player movement */ @@ -734,7 +714,7 @@ static void refresh_board (void) #else x = BOARD_X + CUBE_SIZE * BOARD_W - 40; #endif - rb->lcd_putsxyf (x, BOARD_Y + CUBE_SIZE * BOARD_H - 8, + rb->lcd_putsxyf (x, BOARD_Y + CUBE_SIZE * BOARD_H - 8, (player.lives != 1) ? "%d Lives" : "%d Life", player.lives); #if LCD_DEPTH>=2 @@ -1160,7 +1140,7 @@ static int xobox_menu_cb(int action, static int xobox_menu(bool ingame) { rb->button_clear_queue(); - + int selection = 0; MENUITEM_STRINGLIST(main_menu, "Xobox Menu", xobox_menu_cb, "Resume Game", "Start New Game", diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h index eae20e7976..6c0fac6ddf 100644 --- a/apps/plugins/zxbox/keymaps.h +++ b/apps/plugins/zxbox/keymaps.h @@ -266,15 +266,7 @@ #define ZX_UP BUTTON_HOME #define ZX_DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD -#define ZX_SELECT BUTTON_PLAY -#define ZX_MENU BUTTON_POWER -#define ZX_LEFT BUTTON_PREV -#define ZX_RIGHT BUTTON_NEXT -#define ZX_UP BUTTON_HOME -#define ZX_DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define ZX_SELECT BUTTON_PLAY #define ZX_MENU BUTTON_POWER #define ZX_LEFT BUTTON_PREV @@ -290,7 +282,7 @@ #define ZX_UP BUTTON_HOME #define ZX_DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define ZX_SELECT BUTTON_PLAY #define ZX_MENU BUTTON_POWER #define ZX_LEFT BUTTON_HOME @@ -298,11 +290,11 @@ #define ZX_UP BUTTON_PREV #define ZX_DOWN BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define ZX_SELECT BUTTON_PLAY -#define ZX_MENU BUTTON_POWER -#define ZX_LEFT BUTTON_HOME -#define ZX_RIGHT BUTTON_VOL_DOWN +#define ZX_MENU BUTTON_MENU +#define ZX_LEFT BUTTON_SCROLL_BACK +#define ZX_RIGHT BUTTON_SCROLL_FWD #define ZX_UP BUTTON_PREV #define ZX_DOWN BUTTON_NEXT diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c index c16c3cd20a..f77ce538d1 100644 --- a/apps/plugins/zxbox/zxbox_keyb.c +++ b/apps/plugins/zxbox/zxbox_keyb.c @@ -36,7 +36,7 @@ /* TODO: Check keyboard mappings */ -#define KBD_SELECT BUTTON_SELECT +#define KBD_SELECT BUTTON_SELECT #define KBD_ABORT BUTTON_PLAY #define KBD_LEFT BUTTON_LEFT #define KBD_RIGHT BUTTON_RIGHT @@ -257,16 +257,7 @@ #define KBD_UP BUTTON_HOME #define KBD_DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == XDUOO_X3II_PAD - -#define KBD_SELECT BUTTON_PLAY -#define KBD_ABORT BUTTON_POWER -#define KBD_LEFT BUTTON_PREV -#define KBD_RIGHT BUTTON_NEXT -#define KBD_UP BUTTON_HOME -#define KBD_DOWN BUTTON_OPTION - -#elif CONFIG_KEYPAD == XDUOO_X20_PAD +#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD #define KBD_SELECT BUTTON_PLAY #define KBD_ABORT BUTTON_POWER @@ -284,7 +275,7 @@ #define KBD_UP BUTTON_HOME #define KBD_DOWN BUTTON_OPTION -#elif CONFIG_KEYPAD == IHIFI_770_PAD +#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD #define KBD_SELECT BUTTON_PLAY #define KBD_ABORT BUTTON_POWER @@ -293,12 +284,12 @@ #define KBD_UP BUTTON_PREV #define KBD_DOWN BUTTON_NEXT -#elif CONFIG_KEYPAD == IHIFI_800_PAD +#elif CONFIG_KEYPAD == EROSQ_PAD #define KBD_SELECT BUTTON_PLAY -#define KBD_ABORT BUTTON_POWER -#define KBD_LEFT BUTTON_HOME -#define KBD_RIGHT BUTTON_VOL_DOWN +#define KBD_ABORT BUTTON_BACK +#define KBD_LEFT BUTTON_SCROLL_BACK +#define KBD_RIGHT BUTTON_SCROLL_FWD #define KBD_UP BUTTON_PREV #define KBD_DOWN BUTTON_NEXT @@ -581,7 +572,7 @@ int zx_kbd_input(char* text/*, int buflen*/) } cur_blink = !cur_blink; - + /* highlight the key that has focus */ FOR_NB_SCREENS(l) { @@ -591,7 +582,7 @@ int zx_kbd_input(char* text/*, int buflen*/) param[l].font_w, param[l].font_h); rb->screens[l]->set_drawmode(DRMODE_SOLID); } - + FOR_NB_SCREENS(l) rb->screens[l]->update(); @@ -687,7 +678,7 @@ int zx_kbd_input(char* text/*, int buflen*/) char_screen = 0; /* inserts the selected char */ - + /* find input char */ k = (param[char_screen].page*param[char_screen].lines + param[char_screen].y)*param[char_screen].max_chars + diff --git a/bootloader/SOURCES b/bootloader/SOURCES index e52c6e782a..849ed17c40 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES @@ -76,7 +76,7 @@ show_logo.c mpio_hd200_hd300.c #elif defined(SONY_NWZ_LINUX) nwz_linux.c -#elif defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(FIIO_M3K) +#elif defined(HIBY_LINUX) || defined(FIIO_M3K) rocker_linux.c #elif defined(RK27_GENERIC) || defined(HM60X) || defined(HM801) \ || defined(MA9) || defined(MA9C) || defined(MA8) || defined(MA8C) \ diff --git a/bootloader/rocker_linux.c b/bootloader/rocker_linux.c index 4abc88c413..28a1d78487 100644 --- a/bootloader/rocker_linux.c +++ b/bootloader/rocker_linux.c @@ -10,6 +10,7 @@ * Copyright (C) 2016 by Amaury Pouly * 2018 by Marcin Bukat * 2018 by Roman Stolyarov + * 2020 by Solomon Peachy * * Based on Rockbox iriver bootloader by Linus Nielsen Feltzing * and the ipodlinux bootloader by Daniel Palffy and Bernard Leach @@ -60,6 +61,9 @@ #define RBFILE "rockbox.x3ii" #define ICON_NAME bm_hibyicon #define OF_NAME "HIBY PLAYER" +#define BUTTON_UP BUTTON_OPTION +#define BUTTON_DOWN BUTTON_HOME +#define BUTTON_SELECT BUTTON_PLAY #include "bitmaps/hibyicon.h" #elif defined(XDUOO_X20) #define ICON_WIDTH 130 @@ -67,14 +71,30 @@ #define RBFILE "rockbox.x20" #define ICON_NAME bm_hibyicon #define OF_NAME "HIBY PLAYER" +#define BUTTON_UP BUTTON_OPTION +#define BUTTON_DOWN BUTTON_HOME +#define BUTTON_SELECT BUTTON_PLAY #include "bitmaps/hibyicon.h" #elif defined(FIIO_M3K) #define ICON_WIDTH 130 #define ICON_HEIGHT 130 #define RBFILE "rockbox.fiiom3k" #define ICON_NAME bm_fiioicon +#define BUTTON_LEFT BUTTON_PREV +#define BUTTON_RIGHT BUTTON_NEXT +#define BUTTON_SELECT BUTTON_PLAY #define OF_NAME "FIIO PLAYER" #include "bitmaps/fiioicon.h" +#elif defined(EROS_Q) +#define ICON_WIDTH 130 +#define ICON_HEIGHT 130 +#define RBFILE "rockbox.erosq" +#define ICON_NAME bm_hibyicon +#define OF_NAME "HIBY PLAYER" +#define BUTTON_UP BUTTON_SCROLL_BACK +#define BUTTON_DOWN BUTTON_SCROLL_FWD +#define BUTTON_SELECT BUTTON_PLAY +#include "bitmaps/hibyicon.h" #else #error "must define ICON_WIDTH/HEIGHT" #endif @@ -107,21 +127,8 @@ #error toolsicon has the wrong resolution #endif -#ifndef BUTTON_LEFT -#define BUTTON_LEFT BUTTON_REW -#endif -#ifndef BUTTON_RIGHT -#define BUTTON_RIGHT BUTTON_FF -#endif -#ifndef BUTTON_SELECT -#define BUTTON_SELECT BUTTON_PLAY -#endif -#ifndef BUTTON_DOWN -#define BUTTON_DOWN BUTTON_NEXT -#endif -#ifndef BUTTON_UP -#define BUTTON_UP BUTTON_PREV -#endif +/* If we started ADB, don't immediately boot into USB mode if we plug in. */ +static int adb_running = 0; /* return icon y position (x is always centered) */ static int get_icon_y(void) @@ -141,7 +148,6 @@ enum boot_mode BOOT_TOOLS, BOOT_OF, BOOT_COUNT, - BOOT_USB, /* special */ BOOT_STOP, /* power down/suspend */ }; @@ -199,6 +205,19 @@ static enum boot_mode load_boot_mode(enum boot_mode mode) return mode; } +static void mount_storage(int enable) +{ + if (enable) { + system("/bin/mkdir -p " BASE_DIR); + if (system("/bin/mount /dev/mmcblk0 " BASE_DIR)) + system("/bin/mount /dev/mmcblk0p1 " BASE_DIR); + // XXX possibly invoke sys_serv -> "MOUNT:MOUNT:%s %s", blkdev, mntpoint + } else { + system("/bin/unmount " BASE_DIR); + // XXX possibly invoke sys_serv -> "MOUNT:UNMOUNT:%s %s", mntpoint + } +} + static void save_boot_mode(enum boot_mode mode) { int fd = open(BASE_DIR "/.rockbox/rb_bl_mode.txt", O_RDWR | O_CREAT | O_TRUNC); @@ -221,13 +240,12 @@ static enum boot_mode get_boot_mode(void) #endif while(true) { - /* on usb detect, return to usb - * FIXME this is a hack, we need proper usb detection */ - if(power_input_status() & POWER_INPUT_USB_CHARGER) + /* on usb detect, immediately boot with last choice */ + if(!adb_running && power_input_status() & POWER_INPUT_USB_CHARGER) { /* save last choice */ save_boot_mode(mode); - return BOOT_USB; + return mode; } /* inactivity detection */ int timeout = last_activity + get_inactivity_tmo(); @@ -318,7 +336,7 @@ void error_screen(const char *msg) lcd_update(); } -int choice_screen(const char *title, bool center, int nr_choices, const char *choices[]) +int choice_screen(const char *title, bool center, int nr_choices, const char *choices[], int nr_extra, const char *extra[]) { int choice = 0; int max_len = 0; @@ -360,6 +378,14 @@ int choice_screen(const char *title, bool center, int nr_choices, const char *ch line++; } + lcd_set_foreground(LCD_RGBPACK(255, 201, 0)); + line++; + for (int i = 0 ; i < nr_extra && line < nr_lines ; i++) { + sprintf(buf, "%s", extra[i]); + display_text_center(top_y + h * line, buf); + line++; + } + lcd_update(); /* wait for a key */ @@ -370,15 +396,15 @@ int choice_screen(const char *title, bool center, int nr_choices, const char *ch if(btn & BUTTON_REPEAT) btn &= ~BUTTON_REPEAT; /* play -> stop loop and return mode */ - if(btn == BUTTON_SELECT || btn == BUTTON_LEFT) + if (btn == BUTTON_SELECT) { free(buf); return btn == BUTTON_SELECT ? choice : -1; } /* left/right/up/down: change mode */ - if(btn == BUTTON_UP) + if (btn == BUTTON_UP || btn == BUTTON_LEFT) choice = (choice + nr_choices - 1) % nr_choices; - if(btn == BUTTON_DOWN) + if(btn == BUTTON_DOWN || btn == BUTTON_RIGHT) choice = (choice + 1) % nr_choices; } } @@ -437,7 +463,7 @@ void run_script_menu(void) entries[nr_entries++] = strdup(ent->d_name); } closedir(dir); - int idx = choice_screen("RUN SCRIPT", false, nr_entries, entries); + int idx = choice_screen("RUN SCRIPT", false, nr_entries, entries, 0, NULL); if(idx >= 0) run_file(entries[idx]); for(int i = 0; i < nr_entries; i++) @@ -455,6 +481,7 @@ static void adb(int start) } int status; waitpid(pid, &status, 0); + adb_running = start; #if 0 if(WIFEXITED(status)) { @@ -471,8 +498,11 @@ static void adb(int start) static void tools_screen(void) { - const char *choices[] = {"ADB start", "ADB stop", "Run script", "Restart", "Shutdown"}; - int choice = choice_screen("TOOLS MENU", true, 5, choices); + const char *extra[] = { MODEL_NAME, rbversion }; + printf("Version: %s\n", rbversion); + printf("%s\n", MODEL_NAME); + const char *choices[] = {"ADB start", "ADB stop", "Run script", "Remount SD", "Restart", "Shutdown", "Recovery", "Back"}; + int choice = choice_screen("TOOLS MENU", true, 8, choices, 2, extra); if(choice == 0) { /* run service menu */ @@ -492,12 +522,30 @@ static void tools_screen(void) } else if(choice == 3) { - system_reboot(); + mount_storage(false); + mount_storage(true); } else if(choice == 4) + { + system_reboot(); + } + else if(choice == 5) { power_off(); } + else if(choice == 6) + { + int fd = open("/proc/jz/reset/reset", O_WRONLY); + if (fd >= 0) { + const char *buf = "recovery\n"; + write(fd, buf, strlen(buf)); + close(fd); + } + } + else if (choice == 7) + { + return; + } } #if 0 @@ -555,11 +603,13 @@ int main(int argc, char **argv) // if(font_id >= 0) // lcd_setfont(font_id); + mount_storage(true); + /* run all tools menu */ while(true) { enum boot_mode mode = get_boot_mode(); - if(mode == BOOT_USB || mode == BOOT_OF) + if (mode == BOOT_OF) { #if 0 fflush(stdout); @@ -567,7 +617,7 @@ int main(int argc, char **argv) close(fileno(stdout)); close(fileno(stderr)); #endif - /* for now the only way we have to trigger USB mode it to run the OF */ + mount_storage(false); /* boot OF */ execvp("/usr/bin/hiby_player", argv); error_screen("Cannot boot OF"); @@ -580,12 +630,14 @@ int main(int argc, char **argv) else if(mode == BOOT_ROCKBOX) { fflush(stdout); + mount_storage(true); system("/bin/cp " BASE_DIR "/.rockbox/" RBFILE " /tmp"); + system("/bin/chmod +x /tmp/" RBFILE); execl("/tmp/" RBFILE, RBFILE, NULL); printf("execvp failed: %s\n", strerror(errno)); /* fallback to OF in case of failure */ error_screen("Cannot boot Rockbox"); - sleep(5 * HZ); + sleep(2 * HZ); } else { diff --git a/firmware/SOURCES b/firmware/SOURCES index cbbebbc66f..8bf3d96bdf 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -115,7 +115,7 @@ target/hosted/sonynwz/nvp-nwz.c target/hosted/sonynwz/nwz-db.c #endif -#if ((defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(FIIO_M3K)) && !defined(SIMULATOR)) +#if ((defined(HIBY_LINUX) || defined(FIIO_M3K)) && !defined(SIMULATOR)) drivers/lcd-memframe.c target/hosted/alsa-controls.c target/hosted/pcm-alsa.c @@ -155,6 +155,14 @@ target/hosted/fiio/system-fiio.c target/hosted/fiio/usb-fiio.c #endif +#if (defined(EROS_Q)) && !defined(SIMULATOR) +target/hosted/aigo/button-erosq.c +target/hosted/aigo/debug-erosq.c +target/hosted/aigo/power-erosq.c +target/hosted/aigo/powermgmt-erosq.c +target/hosted/aigo/usb-erosq.c +#endif + #if defined(SAMSUNG_YPR0) && !defined(SIMULATOR) drivers/adc-as3514.c #if (CONFIG_RTC == RTC_AS3514) @@ -513,6 +521,8 @@ drivers/audio/rocker_codec.c drivers/audio/xduoolinux_codec.c #elif defined(HAVE_FIIO_LINUX_CODEC) && !defined(SIMULATOR) drivers/audio/fiiolinux_codec.c +#elif defined(HAVE_EROSQ_LINUX_CODEC) && !defined(SIMULATOR) +drivers/audio/erosqlinux_codec.c #elif defined(HAVE_SDL_AUDIO) drivers/audio/sdl.c diff --git a/firmware/asm/SOURCES b/firmware/asm/SOURCES index e93f77c770..2b18ea2026 100644 --- a/firmware/asm/SOURCES +++ b/firmware/asm/SOURCES @@ -15,8 +15,8 @@ mempcpy.c defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \ defined(COWON_D2) || defined(MINI2440) || defined(SAMSUNG_YPR0) || \ defined(SAMSUNG_YPR1) || defined(DX50) || defined(DX90) || (defined(MROBE_500) && !defined(LCD_USE_DMA)) || \ - defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(SONY_NWZ_LINUX) || defined(AGPTEK_ROCKER) || \ - defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(FIIO_M3K)) && \ + defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || \ + defined(FIIO_M3K)) && \ !defined(SIMULATOR) #if LCD_DEPTH >= 24 lcd-as-memframe-24bit.c diff --git a/firmware/drivers/audio/erosqlinux_codec.c b/firmware/drivers/audio/erosqlinux_codec.c new file mode 100644 index 0000000000..deb3bb4b87 --- /dev/null +++ b/firmware/drivers/audio/erosqlinux_codec.c @@ -0,0 +1,181 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * + * Copyright (c) 2018 Marcin Bukat + * Copyright (c) 2020 Solomon Peachy + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +//#define LOGF_ENABLE + +#include "config.h" +#include "audio.h" +#include "audiohw.h" +#include "button.h" +#include "system.h" +#include "kernel.h" +#include "panic.h" +#include "sysfs.h" +#include "alsa-controls.h" +#include "pcm-alsa.h" +#include "pcm_sw_volume.h" + +#include "logf.h" + +static int fd_hw; +static int inited = 0; + +static long int vol_l_hw = 255; +static long int vol_r_hw = 255; +static long int last_ps = 0; + +static void hw_open(void) +{ + fd_hw = open("/dev/snd/controlC0", O_RDWR); + if(fd_hw < 0) + panicf("Cannot open '/dev/snd/controlC0'"); +} + +static void hw_close(void) +{ + close(fd_hw); +} + +void audiohw_mute(int mute) +{ + logf("mute %d", mute); + + if(mute) + { + long int ps0 = 0; + alsa_controls_set_ints("Output Port Switch", 1, &ps0); + } + else + { + last_ps = 0; + erosq_get_outputs(); + } +} + +int erosq_get_outputs(void) { + long int ps = 0; // Muted, if nothing is plugged in! + + int status = 0; + + if (!inited) return ps; + + const char * const sysfs_lo_switch = "/sys/class/switch/lineout/state"; + const char * const sysfs_hs_switch = "/sys/class/switch/headset/state"; + + sysfs_get_int(sysfs_lo_switch, &status); + if (status) ps = 1; // lineout + + sysfs_get_int(sysfs_hs_switch, &status); + if (status) ps = 2; // headset + + erosq_set_output(ps); + + return ps; +} + +void erosq_set_output(int ps) +{ + if (!inited) return; + + if (last_ps != ps) + { + logf("set out %d/%d", ps, last_ps); + /* Output port switch */ + last_ps = ps; + alsa_controls_set_ints("Output Port Switch", 1, &last_ps); + audiohw_set_volume(vol_l_hw, vol_r_hw); + } +} + +void audiohw_preinit(void) +{ + logf("hw preinit"); + alsa_controls_init(); + hw_open(); + audiohw_mute(true); /* Start muted to avoid the POP */ + inited = 1; +} + +void audiohw_postinit(void) +{ + logf("hw postinit"); + erosq_set_output(erosq_get_outputs()); /* Unmute */ +} + +void audiohw_close(void) +{ + logf("hw close"); + inited = 0; + hw_close(); + alsa_controls_close(); +} + +void audiohw_set_frequency(int fsel) +{ + (void)fsel; +} + +void audiohw_set_volume(int vol_l, int vol_r) +{ + logf("hw vol %d %d", vol_l, vol_r); + + long l,r; + + vol_l_hw = vol_l; + vol_r_hw = vol_r; + + if (lineout_inserted()) { + l = 0; + r = 0; + } else { + l = vol_l_hw; + r = vol_r_hw; + } + + /* SW volume for <= 1.0 gain, HW at unity, < -740 == MUTE */ + int sw_volume_l = l <= -740 ? PCM_MUTE_LEVEL : MIN(l, 0); + int sw_volume_r = r <= -740 ? PCM_MUTE_LEVEL : MIN(r, 0); + pcm_set_master_volume(sw_volume_l, sw_volume_r); +} + +void audiohw_set_lineout_volume(int vol_l, int vol_r) +{ + long l,r; + + logf("lo vol %d %d", vol_l, vol_r); + + (void)vol_l; + (void)vol_r; + + if (lineout_inserted()) { + l = 0; + r = 0; + } else { + l = vol_l_hw; + r = vol_r_hw; + } + + int sw_volume_l = l <= -740 ? PCM_MUTE_LEVEL : MIN(l, 0); + int sw_volume_r = r <= -740 ? PCM_MUTE_LEVEL : MIN(r, 0); + pcm_set_master_volume(sw_volume_l, sw_volume_r); +} diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 1ff220e403..8a46cbea78 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -226,6 +226,8 @@ struct sound_settings_info #include "xduoolinux_codec.h" #elif defined(HAVE_FIIO_LINUX_CODEC) #include "fiiolinux_codec.h" +#elif defined(HAVE_EROSQ_LINUX_CODEC) +#include "erosqlinux_codec.h" #endif /* convert caps into defines */ diff --git a/firmware/export/config.h b/firmware/export/config.h index a9753e3cf8..7e8d751090 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -162,6 +162,7 @@ #define XDUOO_X3II_PAD 69 #define XDUOO_X20_PAD 70 #define FIIO_M3K_PAD 71 +#define EROSQ_PAD 72 /* CONFIG_REMOTE_KEYPAD */ #define H100_REMOTE 1 @@ -602,6 +603,8 @@ Lyre prototype 1 */ #include "config/xduoox20.h" #elif defined(FIIO_M3K) #include "config/fiiom3k.h" +#elif defined(EROS_Q) +#include "config/aigoerosq.h" #else //#error "unknown hwardware platform!" #endif diff --git a/firmware/export/config/agptekrocker.h b/firmware/export/config/agptekrocker.h index a97522d976..230dc6cac4 100644 --- a/firmware/export/config/agptekrocker.h +++ b/firmware/export/config/agptekrocker.h @@ -17,6 +17,7 @@ #define CONFIG_PLATFORM (PLATFORM_HOSTED) #endif +#define HIBY_LINUX #define HAVE_FPU /* define this if you have a colour LCD */ diff --git a/firmware/export/config/aigoerosq.h b/firmware/export/config/aigoerosq.h new file mode 100644 index 0000000000..9207b5548f --- /dev/null +++ b/firmware/export/config/aigoerosq.h @@ -0,0 +1,132 @@ +/* + * This config file is for the AIGO EROS Q / EROS K (and its clones) + */ + +/* For Rolo and boot loader */ +#define MODEL_NUMBER 113 + +#define MODEL_NAME "AIGO Eros Q" + +/* LCD dimensions */ +#define LCD_WIDTH 320 +#define LCD_HEIGHT 240 +/* sqrt(240^2 + 320^2) / 2.0 = 200 */ +#define LCD_DPI 200 + +#ifndef SIMULATOR +#define CONFIG_PLATFORM (PLATFORM_HOSTED) +#endif + +#define HIBY_LINUX +#define HAVE_FPU + +/* define this if you have a colour LCD */ +#define HAVE_LCD_COLOR + +#define HAVE_LCD_ENABLE + +/* Define this if the LCD can shut down */ +#define HAVE_LCD_SHUTDOWN + +/* define this if you want album art for this target */ +#define HAVE_ALBUMART + +/* define this to enable bitmap scaling */ +#define HAVE_BMP_SCALING + +/* define this to enable JPEG decoding */ +#define HAVE_JPEG + +/* define this if you have access to the quickscreen */ +#define HAVE_QUICKSCREEN + +/* define this if you would like tagcache to build on this target */ +#define HAVE_TAGCACHE + +#define LCD_DEPTH 32 +/* Check that but should not matter */ +#define LCD_PIXELFORMAT XRGB8888 + +#define HAVE_BACKLIGHT +#define HAVE_BACKLIGHT_BRIGHTNESS + +/* Main LCD backlight brightness range and defaults: the backlight driver + * has levels from 0 to 255. But 0 is off so start at 1. + */ +#define MIN_BRIGHTNESS_SETTING 1 +#define MAX_BRIGHTNESS_SETTING 255 +#define BRIGHTNESS_STEP 5 +#define DEFAULT_BRIGHTNESS_SETTING 70 + +/* Which backlight fading type? */ +#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING + +/* define this if you have a real-time clock */ +#define CONFIG_RTC APPLICATION + +/* The number of bytes reserved for loadable codecs */ +#define CODEC_SIZE 0x80000 + +/* The number of bytes reserved for loadable plugins */ +#define PLUGIN_BUFFER_SIZE 0x100000 + +#define HAVE_HEADPHONE_DETECTION +#define HAVE_LINEOUT_DETECTION + +/* KeyPad configuration for plugins */ +#define CONFIG_KEYPAD EROSQ_PAD + +/* define this if the target has volume keys which can be used in the lists */ +#define HAVE_VOLUME_IN_LIST + +#ifndef SIMULATOR +/* We have usb power and can detect usb but it is handled by Linux */ +#define HAVE_USB_POWER + +#endif + +#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE + +/* Linux controlls charging, we can monitor */ +#define CONFIG_CHARGING CHARGING_MONITOR + +/* define this if the hardware can be powered off while charging */ +#define HAVE_POWEROFF_WHILE_CHARGING + +/* same dimensions as gigabeats */ +#define CONFIG_LCD LCD_INGENIC_LINUX + +/* Define this if you have a software controlled poweroff */ +#define HAVE_SW_POWEROFF + +/* Define this to the CPU frequency */ +#define CPU_FREQ 108000000 + +/* No special storage */ +#define CONFIG_STORAGE STORAGE_HOSTFS +#define HAVE_STORAGE_FLUSH + +/* Battery */ +#define BATTERY_TYPES_COUNT 1 + +/* Audio codec */ +#define HAVE_EROSQ_LINUX_CODEC +/* Rockbox has to handle the volume level */ +#define HAVE_SW_VOLUME_CONTROL + +/* We don't have hardware controls */ +#define HAVE_SW_TONE_CONTROLS + +/* HW codec is flexible */ +#define HW_SAMPR_CAPS SAMPR_CAP_ALL_192 + +/* Battery */ +#define BATTERY_CAPACITY_DEFAULT 2000 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 2000 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 2000 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 0 /* capacity increment */ + +/* ROLO */ +#define BOOTFILE_EXT "erosq" +#define BOOTFILE "rockbox." BOOTFILE_EXT +#define BOOTDIR "/.rockbox" diff --git a/firmware/export/config/fiiom3k.h b/firmware/export/config/fiiom3k.h index 5b68f3738e..88652b633f 100644 --- a/firmware/export/config/fiiom3k.h +++ b/firmware/export/config/fiiom3k.h @@ -17,6 +17,8 @@ #define CONFIG_PLATFORM (PLATFORM_HOSTED) #endif +#define HAVE_FPU + #define HW_SAMPR_CAPS (SAMPR_CAP_44 | SAMPR_CAP_48 | SAMPR_CAP_88 | SAMPR_CAP_96 | SAMPR_CAP_176 | SAMPR_CAP_192) /* define this if you have a bitmap LCD display */ diff --git a/firmware/export/config/xduoox20.h b/firmware/export/config/xduoox20.h index a8d2175719..70e6131cb7 100644 --- a/firmware/export/config/xduoox20.h +++ b/firmware/export/config/xduoox20.h @@ -17,6 +17,8 @@ #define CONFIG_PLATFORM (PLATFORM_HOSTED) #endif +#define HIBY_LINUX + #define HAVE_FPU /* define this if you have a colour LCD */ diff --git a/firmware/export/config/xduoox3ii.h b/firmware/export/config/xduoox3ii.h index 143d4442fd..d19165114a 100644 --- a/firmware/export/config/xduoox3ii.h +++ b/firmware/export/config/xduoox3ii.h @@ -17,6 +17,7 @@ #define CONFIG_PLATFORM (PLATFORM_HOSTED) #endif +#define HIBY_LINUX #define HAVE_FPU /* define this if you have a colour LCD */ diff --git a/firmware/export/erosqlinux_codec.h b/firmware/export/erosqlinux_codec.h new file mode 100644 index 0000000000..8a3afbfe3c --- /dev/null +++ b/firmware/export/erosqlinux_codec.h @@ -0,0 +1,13 @@ +#ifndef __EROSQLINUX_CODEC__ +#define __EROSQLINUX_CODEC__ + +#define AUDIOHW_CAPS (LINEOUT_CAP) + +AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -74, 6, -25) + + +void audiohw_mute(int mute); +void erosq_set_output(int ps); +int erosq_get_outputs(void); + +#endif diff --git a/firmware/export/rbpaths.h b/firmware/export/rbpaths.h index 6b686eec0e..215b4c0c4b 100644 --- a/firmware/export/rbpaths.h +++ b/firmware/export/rbpaths.h @@ -42,7 +42,7 @@ #if !defined(APPLICATION) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \ defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || \ - defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(FIIO_M3K) + defined(HIBY_LINUX) || defined(FIIO_M3K) #if defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) #define HOME_DIR "/mnt/media0" @@ -51,7 +51,7 @@ #elif defined(DX50) || defined(DX90) /* Where to put save files like recordings, playlists, screen dumps ...*/ #define HOME_DIR "/mnt/sdcard" -#elif defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20) +#elif defined(HIBY_LINUX) #define HOME_DIR "/mnt/sd_0" #elif defined(FIIO_M3K) #define HOME_DIR "/mnt" @@ -92,7 +92,7 @@ #define VIEWERS_DIR PLUGIN_DIR "/viewers" #if defined(APPLICATION) && !(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \ - defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20)) + defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX)) #define PLUGIN_DATA_DIR ROCKBOX_DIR "/rocks.data" #define PLUGIN_GAMES_DATA_DIR PLUGIN_DATA_DIR #define PLUGIN_APPS_DATA_DIR PLUGIN_DATA_DIR diff --git a/firmware/export/system.h b/firmware/export/system.h index cfec235bc4..1885acfffd 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -347,7 +347,7 @@ static inline void cpu_boost_unlock(void) #ifndef SIMULATOR bool dbg_ports(void); #endif -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20) +#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K) bool dbg_hw_info(void); #endif diff --git a/firmware/font.c b/firmware/font.c index 3208125a6a..b2ac1a3c3c 100644 --- a/firmware/font.c +++ b/firmware/font.c @@ -85,7 +85,7 @@ /* compiled-in font */ extern struct font sysfont; -#if !defined(BOOTLOADER) || defined(SONY_NWZ_LINUX) +#if !defined(BOOTLOADER) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K) struct buflib_alloc_data { struct font font; /* must be the first member! */ diff --git a/firmware/target/hosted/aigo/adc-target.h b/firmware/target/hosted/aigo/adc-target.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/firmware/target/hosted/aigo/button-erosq.c b/firmware/target/hosted/aigo/button-erosq.c new file mode 100644 index 0000000000..2735c48c71 --- /dev/null +++ b/firmware/target/hosted/aigo/button-erosq.c @@ -0,0 +1,188 @@ +/*************************************************************************** + * __________ __ ___ + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2017 Marcin Bukat + * Copyright (C) 2020 Solomon Peachy + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include +//#include +#include +#include +#include +#include +#include +#include +#include + +#include "sysfs.h" +#include "button.h" +#include "button-target.h" +#include "panic.h" + +#include "kernel.h" +#include "backlight.h" +#include "backlight-target.h" +#include "erosqlinux_codec.h" + +#define NR_POLL_DESC 3 +static struct pollfd poll_fds[NR_POLL_DESC]; + +static int button_map(int keycode) +{ + switch(keycode) + { + case KEY_POWER: + return BUTTON_POWER; + + case KEY_MENU: + return BUTTON_MENU; + + case KEY_BACK: + return BUTTON_BACK; + + case KEY_NEXTSONG: + return BUTTON_PREV; + + case KEY_PREVIOUSSONG: + return BUTTON_NEXT; // Yes, backwards! + + case KEY_PLAYPAUSE: + return BUTTON_PLAY; + + case KEY_LEFT: + return BUTTON_SCROLL_BACK; + + case KEY_RIGHT: + return BUTTON_SCROLL_FWD; + + case KEY_VOLUMEUP: + return BUTTON_VOL_UP; + + case KEY_VOLUMEDOWN: + return BUTTON_VOL_DOWN; + + default: + return 0; + } +} + +void button_init_device(void) +{ + const char * const input_devs[] = { + "/dev/input/event0", // Rotary encoder + "/dev/input/event1" // Keys + }; + + for(int i = 0; i < NR_POLL_DESC; i++) + { + int fd = open(input_devs[i], O_RDWR | O_CLOEXEC); + + if(fd < 0) + { + panicf("Cannot open input device: %s\n", input_devs[i]); + } + + poll_fds[i].fd = fd; + poll_fds[i].events = POLLIN; + poll_fds[i].revents = 0; + } +} + +int button_read_device(void) +{ + static int button_bitmap = 0; + struct input_event event; + + // FIXME TODO: Make this work via HAVE_SCROLL_WHEEL instead + + /* Wheel gives us press+release back to back, clear them after time elapses */ + static long last_tick = 0; + if (button_bitmap & (BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD) && + current_tick - last_tick >= 2) + { + button_bitmap &= ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD); + } + + /* check if there are any events pending and process them */ + while(poll(poll_fds, NR_POLL_DESC, 0)) + { + for(int i = 0; i < NR_POLL_DESC; i++) + { + /* read only if non-blocking */ + if(poll_fds[i].revents & POLLIN) + { + int size = read(poll_fds[i].fd, &event, sizeof(event)); + if(size == (int)sizeof(event)) + { + int keycode = event.code; + /* event.value == 1 means press + * event.value == 0 means release + */ + bool press = event.value ? true : false; + + /* map linux event code to rockbox button bitmap */ + if(press) + { + int bmap = button_map(keycode); + if (bmap & (BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD)) + last_tick = current_tick; + button_bitmap |= bmap; + } + else + { + /* Wheel gives us press+release back to back; ignore the release */ + int bmap = button_map(keycode) & ~(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD); + button_bitmap &= ~bmap; + } + } + } + } + } + + return button_bitmap; +} + +bool headphones_inserted(void) +{ +#ifdef BOOTLOADER + int ps = 0; +#else + int ps = erosq_get_outputs(); +#endif + + return (ps == 2); +} + +bool lineout_inserted(void) +{ +#ifdef BOOTLOADER + int ps = 0; +#else + int ps = erosq_get_outputs(); +#endif + + return (ps == 1); +} + +void button_close_device(void) +{ + /* close descriptors */ + for(int i = 0; i < NR_POLL_DESC; i++) + { + close(poll_fds[i].fd); + } +} diff --git a/firmware/target/hosted/aigo/button-target.h b/firmware/target/hosted/aigo/button-target.h new file mode 100644 index 0000000000..f59f491d2f --- /dev/null +++ b/firmware/target/hosted/aigo/button-target.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2020 Solomon Peachy + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * 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_ + +/* Main unit's buttons */ +#define BUTTON_POWER 0x00000001 +#define BUTTON_MENU 0x00000002 +#define BUTTON_BACK 0x00000004 +#define BUTTON_PLAY 0x00000008 +#define BUTTON_NEXT 0x00000010 +#define BUTTON_PREV 0x00000020 +#define BUTTON_VOL_UP 0x00000040 +#define BUTTON_VOL_DOWN 0x00000080 +#define BUTTON_SCROLL_BACK 0x00000100 +#define BUTTON_SCROLL_FWD 0x00000200 + +#define BUTTON_MAIN (BUTTON_POWER | BUTTON_MENU | BUTTON_BACK | BUTTON_PREV | \ + BUTTON_NEXT | BUTTON_PLAY | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_SCROLL_BACK | BUTTON_SCROLL_FWD) + +#define BUTTON_LEFT BUTTON_PREV +#define BUTTON_RIGHT BUTTON_NEXT + +/* Software power-off */ +#define POWEROFF_BUTTON BUTTON_POWER +#define POWEROFF_COUNT 25 + +#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/hosted/aigo/debug-erosq.c b/firmware/target/hosted/aigo/debug-erosq.c new file mode 100644 index 0000000000..9812b8f8b9 --- /dev/null +++ b/firmware/target/hosted/aigo/debug-erosq.c @@ -0,0 +1 @@ +#include "../agptek/debug-agptek.c" diff --git a/firmware/target/hosted/aigo/erosq.make b/firmware/target/hosted/aigo/erosq.make new file mode 100644 index 0000000000..d159db77f3 --- /dev/null +++ b/firmware/target/hosted/aigo/erosq.make @@ -0,0 +1,49 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id$ +# + +INCLUDES += -I$(FIRMDIR)/include -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) + +SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) + +# bootloader build is sligtly different +ifneq (,$(findstring bootloader,$(APPSDIR))) + +SRC += $(call preprocess, $(APPSDIR)/SOURCES) +CLEANOBJS += $(BUILDDIR)/bootloader.* + +endif #bootloader + +.SECONDEXPANSION: # $$(OBJ) is not populated until after this + +ifneq (,$(findstring bootloader,$(APPSDIR))) +# bootloader build + +$(BUILDDIR)/bootloader.elf : $$(OBJ) $(FIRMLIB) $(CORE_LIBS) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -o $@ $(OBJ) \ + -L$(BUILDDIR)/firmware -lfirmware \ + -L$(BUILDDIR)/lib $(call a2lnk,$(CORE_LIBS)) \ + $(LDOPTS) $(GLOBAL_LDOPTS) -Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/bootloader.map + +$(BUILDDIR)/$(BINARY): $(BUILDDIR)/bootloader.elf + $(call PRINTS,OC $(@F))$(call objcopy,$^,$@) + +else +# rockbox app build + +$(BUILDDIR)/rockbox.elf : $$(OBJ) $(FIRMLIB) $(VOICESPEEXLIB) $(CORE_LIBS) + $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -o $@ $(OBJ) \ + -L$(BUILDDIR)/firmware -lfirmware \ + -L$(RBCODEC_BLD)/codecs $(call a2lnk, $(VOICESPEEXLIB)) \ + -L$(BUILDDIR)/lib $(call a2lnk,$(CORE_LIBS)) \ + $(LDOPTS) $(GLOBAL_LDOPTS) -Wl,-Map,$(BUILDDIR)/rockbox.map + +$(BUILDDIR)/$(BINARY): $(BUILDDIR)/rockbox.elf + $(call PRINTS,OC $(@F))$(call objcopy,$^,$@) + +endif diff --git a/firmware/target/hosted/aigo/lcd-target.h b/firmware/target/hosted/aigo/lcd-target.h new file mode 100644 index 0000000000..808df3c60a --- /dev/null +++ b/firmware/target/hosted/aigo/lcd-target.h @@ -0,0 +1,32 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2016 Amaury Pouly + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef __LCD_TARGET_H__ +#define __LCD_TARGET_H__ + +/* needs special ioctl() to redraw updated framebuffer content */ +#define LCD_OPTIMIZED_UPDATE +#define LCD_OPTIMIZED_UPDATE_RECT + +extern fb_data *framebuffer; /* see lcd-erosq.c */ +#define LCD_FRAMEBUF_ADDR(col, row) (framebuffer + (row)*LCD_WIDTH + (col)) + +extern void lcd_set_active(bool active); +#endif /* __LCD_TARGET_H__ */ diff --git a/firmware/target/hosted/aigo/power-erosq.c b/firmware/target/hosted/aigo/power-erosq.c new file mode 100644 index 0000000000..0a4f820337 --- /dev/null +++ b/firmware/target/hosted/aigo/power-erosq.c @@ -0,0 +1,74 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2017 by Marcin Bukat + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include +#include +#include +#include +#include + +#include "system.h" +#include "power-erosq.h" +#include "power.h" +#include "panic.h" +#include "sysfs.h" + +const char * const sysfs_bat_voltage = + "/sys/class/power_supply/battery/voltage_now"; + +const char * const sysfs_bat_capacity = + "/sys/class/power_supply/battery/capacity"; + +const char * const sysfs_bat_status = + "/sys/class/power_supply/battery/status"; + +const char * const sysfs_pow_supply = + "/sys/class/power_supply/usb/present"; + +unsigned int erosq_power_input_status(void) +{ + int present = 0; + sysfs_get_int(sysfs_pow_supply, &present); + + return present ? POWER_INPUT_USB_CHARGER : POWER_INPUT_NONE; +} + +bool erosq_power_charging_status(void) +{ + char buf[12] = {0}; + sysfs_get_string(sysfs_bat_status, buf, sizeof(buf)); + + return (strncmp(buf, "Charging", 8) == 0); +} + +unsigned int erosq_power_get_battery_voltage(void) +{ + int battery_voltage; + sysfs_get_int(sysfs_bat_voltage, &battery_voltage); + + return battery_voltage/1000; +} + +unsigned int erosq_power_get_battery_capacity(void) +{ + int battery_capacity; + sysfs_get_int(sysfs_bat_capacity, &battery_capacity); + + return battery_capacity; +} diff --git a/firmware/target/hosted/aigo/power-erosq.h b/firmware/target/hosted/aigo/power-erosq.h new file mode 100644 index 0000000000..d06b956924 --- /dev/null +++ b/firmware/target/hosted/aigo/power-erosq.h @@ -0,0 +1,31 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2017 by Marcin Bukat + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef _POWER_XDUOO_H_ +#define _POWER_XDUOO_H_ + +#include +#include "config.h" + +unsigned int erosq_power_input_status(void); +bool erosq_power_charging_status(void); +unsigned int erosq_power_get_battery_voltage(void); +unsigned int erosq_power_get_battery_capacity(void); +#endif /* _POWER_XDUOO_H_ */ + diff --git a/firmware/target/hosted/aigo/powermgmt-erosq.c b/firmware/target/hosted/aigo/powermgmt-erosq.c new file mode 100644 index 0000000000..14286de3fd --- /dev/null +++ b/firmware/target/hosted/aigo/powermgmt-erosq.c @@ -0,0 +1,61 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2017 Marcin Bukat + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "powermgmt.h" +#include "power.h" +#include "power-erosq.h" + +const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = +{ + 3470 +}; + +/* the OF shuts down at this voltage */ +const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = +{ + 3400 +}; + +/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ +const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = +{ + { 3400, 3639, 3697, 3723, 3757, 3786, 3836, 3906, 3980, 4050, 4159 } +}; + +/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ +const unsigned short const percent_to_volt_charge[11] = +{ + 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4062, 4158, 4185, 4196 +}; + +unsigned int power_input_status(void) +{ + /* POWER_INPUT_USB_CHARGER, POWER_INPUT_NONE */ + return erosq_power_input_status(); +} + +int _battery_voltage(void) +{ + return erosq_power_get_battery_voltage(); +} + +bool charging_state(void) +{ + return erosq_power_charging_status(); +} diff --git a/firmware/target/hosted/aigo/system-target.h b/firmware/target/hosted/aigo/system-target.h new file mode 100644 index 0000000000..830f19fde4 --- /dev/null +++ b/firmware/target/hosted/aigo/system-target.h @@ -0,0 +1,28 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2017 Marcin Bukat + * Copyright (C) 2016 Amaury Pouly + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#ifndef __SYSTEM_TARGET_H__ +#define __SYSTEM_TARGET_H__ + +#include "kernel-unix.h" +#include "system-hosted.h" + +#define NEED_GENERIC_BYTESWAPS +#endif /* __SYSTEM_TARGET_H__ */ diff --git a/firmware/target/hosted/aigo/usb-erosq.c b/firmware/target/hosted/aigo/usb-erosq.c new file mode 100644 index 0000000000..2a3acf4d62 --- /dev/null +++ b/firmware/target/hosted/aigo/usb-erosq.c @@ -0,0 +1,118 @@ +/*************************************************************************** + * __________ __ ___ + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2018 by Marcin Bukat + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include +#include +#include +#include "config.h" +#include "disk.h" +#include "usb.h" +#include "sysfs.h" +#include "power.h" +#include "power-erosq.h" + +static bool adb_mode = false; + +/* TODO: implement usb detection properly */ +int usb_detect(void) +{ + return power_input_status() == POWER_INPUT_USB_CHARGER ? USB_INSERTED : USB_EXTRACTED; +} + +void usb_enable(bool on) +{ + /* Ignore usb enable/disable when ADB is enabled so we can fireup adb shell + * without entering ums mode + */ + if (!adb_mode) + { + sysfs_set_int("/sys/class/android_usb/android0/enable", on ? 1 : 0); + } +} + +/* This is called by usb thread after usb extract in order to return + * regular FS access + * + * returns the # of successful mounts +*/ +int disk_mount_all(void) +{ + const char *dev[] = {"/dev/mmcblk0p1", "/dev/mmcblk0"}; + const char *fs[] = {"vfat", "exfat"}; + + sysfs_set_string("/sys/class/android_usb/android0/f_mass_storage/lun/file", ""); + + for (int i=0; i<2; i++) + { + for (int j=0; j<2; j++) + { + if (mount(dev[i], "/mnt/sd_0", fs[j], 0, NULL) == 0) + { + return 1; + } + } + } + + return 0; +} + +/* This is called by usb thread after all threads ACKs usb inserted message + * + * returns the # of successful unmounts + */ +int disk_unmount_all(void) +{ + if (umount("/mnt/sd_0") == 0) + { + sysfs_set_string("/sys/class/android_usb/android0/f_mass_storage/lun/file", "/dev/mmcblk0"); + return 1; + } + + return 0; +} + +void usb_init_device(void) +{ + char functions[32] = {0}; + + /* Check if ADB was activated in bootloader */ + sysfs_get_string("/sys/class/android_usb/android0/functions", functions, sizeof(functions)); + adb_mode = (strstr(functions, "adb") == NULL) ? false : true; + + usb_enable(false); + + if (adb_mode) + { + sysfs_set_string("/sys/class/android_usb/android0/functions", "mass_storage,adb"); + sysfs_set_string("/sys/class/android_usb/android0/idVendor", "18D1"); + sysfs_set_string("/sys/class/android_usb/android0/idProduct", "D002"); + } + else + { + sysfs_set_string("/sys/class/android_usb/android0/functions", "mass_storage"); + sysfs_set_string("/sys/class/android_usb/android0/idVendor", "C502"); + sysfs_set_string("/sys/class/android_usb/android0/idProduct", "0023"); + } + + sysfs_set_string("/sys/class/android_usb/android0/iManufacturer", "Rockbox.org"); + sysfs_set_string("/sys/class/android_usb/android0/iProduct", "Rockbox media player"); + sysfs_set_string("/sys/class/android_usb/android0/iSerial", "0123456789ABCDEF"); + sysfs_set_string("/sys/class/android_usb/android0/f_mass_storage/inquiry_string", "ErosQ 0100"); +} diff --git a/firmware/target/hosted/filesystem-app.c b/firmware/target/hosted/filesystem-app.c index 4e2fa8db7b..24c5a7e062 100644 --- a/firmware/target/hosted/filesystem-app.c +++ b/firmware/target/hosted/filesystem-app.c @@ -37,7 +37,7 @@ #include "logf.h" #if !(defined(BOOTLOADER) || defined(CHECKWPS) || defined(SIMULATOR)) -#if (defined(AGPTEK_ROCKER) || defined(XDUOO_X3II) || defined(XDUOO_X20)) +#if defined(HIBY_LINUX) #define PIVOT_ROOT "/mnt/sd_0" #elif defined(FIIO_M3K) #define PIVOT_ROOT "/mnt" // XXX check this! @@ -56,8 +56,8 @@ static const char rbhome[] = HOME_DIR; #endif #if !(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || defined(DX50) || \ - defined(SONY_NWZ_LINUX) || defined(DX90) || defined(AGPTEK_ROCKER) || \ - defined(XDUOO_X3II) || defined(XDUOO_X20) || defined(FIIO_M3K) || defined(FIIO_M3K_PRO)) && \ + defined(SONY_NWZ_LINUX) || defined(DX90) || defined(HIBY_LINUX) || \ + defined(FIIO_M3K)) && \ !defined(__PCTOOL__) /* Special dirs are user-accessible (and user-writable) dirs which take priority * over the ones where Rockbox is installed to. Classic example would be diff --git a/firmware/target/hosted/xduoo/button-target.h b/firmware/target/hosted/xduoo/button-target.h index d41b33894a..3240d3df8e 100644 --- a/firmware/target/hosted/xduoo/button-target.h +++ b/firmware/target/hosted/xduoo/button-target.h @@ -41,4 +41,3 @@ #define POWEROFF_COUNT 25 #endif /* _BUTTON_TARGET_H_ */ - diff --git a/tools/builds.pm b/tools/builds.pm index 6f0c4d0445..36c6e9b1fb 100644 --- a/tools/builds.pm +++ b/tools/builds.pm @@ -448,6 +448,10 @@ $releasenotes="/wiki/ReleaseNotes315"; name => 'FiiO M3K', status => 1, }, + 'erosq' => { + name => 'AIGO EROS Q / K', + status => 1, + }, 'ihifi770' => { name => 'Xuelin iHIFI 770', status => 2, diff --git a/tools/configure b/tools/configure index f5fb6351c0..2b34ed4cff 100755 --- a/tools/configure +++ b/tools/configure @@ -1589,7 +1589,8 @@ cat <) { if ($rootfs_found) { if (/file_path=(.*)/) { $ubiname = basename($1); - $ubiname =~ tr/[a-z]/[A-Z]/; last; } } else { @@ -92,7 +95,11 @@ while () { } close UPDATE; -die("can't locate rootfs image") if (! -e "$isowork/$ubiname"); +if (! -e "$isowork/$ubiname") { + $ubiname =~ tr/[a-z]/[A-Z]/; + die("can't locate rootfs image ($ubiname)") if (! -e "$isowork/$ubiname"); +} + $ubiname = "$isowork/$ubiname"; ### Extract RootFS @@ -102,6 +109,7 @@ mkdir($rootfsdir) || die ("Can't create '$rootfsdir'"); @sysargs = ("ubireader_extract_files", "-k", "-o", $rootfsdir, $ubiname); system(@sysargs); +# exit(0); ### Mangle RootFS # Generate rb_bootloader.sh @@ -109,19 +117,74 @@ my $rbbasename = basename($rbbname); my $bootloader_sh = "#!/bin/sh -mount /dev/mmcblk0 /mnt/sd_0 &>/dev/null || \ -mount /dev/mmcblk0p1 /mnt/sd_0 &>/dev/null +#mkdir -p /mnt/sd_0 +# +#mount /dev/mmcblk0 /mnt/sd_0 &>/dev/null || \ +#mount /dev/mmcblk0p1 /mnt/sd_0 &>/dev/null -killall $rbbasename -killall -9 $rbbasename +killall hiby_player &>/dev/null +killall -9 hiby_player &>/dev/null +killall $rbbasename &>/dev/null +killall -9 $rbbasename &>/dev/null + +# /etc/init.d/K90adb start + +# Rockbox launcher! /usr/bin/$rbbasename sleep 1 reboot - "; +"; open FILE, ">$rootfsdir/usr/bin/hiby_player.sh" || die ("can't write bootloader script!"); print FILE $bootloader_sh; close FILE; +chmod 0755, "$rootfsdir/usr/bin/hiby_player.sh"; + +# Auto mount/unmount external USB drives +open FILE, ">>$rootfsdir/etc/mdev.conf" || die ("can't access mdev conf!"); +print FILE "sd[a-z][0-9]+ 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "mmcblk[0-9]p[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "mmcblk[0-9] 0:0 664 @ /etc/rb_inserting.sh\n"; +print FILE "sd[a-z] 0:0 664 \$ /etc/rb_removing.sh"; +print FILE "mmcblk[0-9] 0:0 664 \$ /etc/rb_removing.sh\n"; +close FILE; + +my $insert_sh = ' +#!/bin/sh +# $MDEV is the device + +case $MDEV in + mmc*) + MNT_POINT=/mnt/sd_0 + ;; + sd*) + MNT_POINT=/mnt/sd_0/USB + ;; +esac + +if [ ! -d $MNT_POINT ];then + mkdir $MNT_POINT +fi + +mount $MDEV $MNT_POINT +'; + +open FILE, ">$rootfsdir/etc/rb_inserting.sh" || die("can't write hotplug helpers!"); +print FILE $insert_sh; +close FILE; +chmod 0755, "$rootfsdir/etc/rb_inserting.sh"; + +my $remove_sh = ' +#!/bin/sh +# $MDEV is the device +sync; +unmount -f $MDEV; +'; + +open FILE, ">$rootfsdir/etc/rb_removing.sh" || die("can't write hotplug helpers!"); +print FILE $remove_sh; +close FILE; +chmod 0755, "$rootfsdir/etc/rb_removing.sh"; # Copy bootloader over @sysargs=("cp", "$rbbname", "$rootfsdir/usr/bin/$rbbasename"); diff --git a/tools/root.make b/tools/root.make index fd42f9b6b2..3f5b4bca17 100644 --- a/tools/root.make +++ b/tools/root.make @@ -104,6 +104,8 @@ ifneq (,$(findstring bootloader,$(APPSDIR))) include $(ROOTDIR)/firmware/target/hosted/agptek/rocker.make else ifneq (,$(findstring xduoo,$(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/xduoo/xduoo.make + else ifneq (,$(findstring erosq,$(APP_TYPE))) + include $(ROOTDIR)/firmware/target/hosted/aigo/erosq.make else ifneq (,$(findstring fiio,$(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make else @@ -156,6 +158,10 @@ else # core include $(ROOTDIR)/firmware/target/hosted/fiio/fiio.make endif + ifneq (,$(findstring erosq,$(APP_TYPE))) + include $(ROOTDIR)/firmware/target/hosted/aigo/erosq.make + endif + ifneq (,$(findstring android_ndk, $(APP_TYPE))) include $(ROOTDIR)/firmware/target/hosted/ibasso/android_ndk.make else diff --git a/wps/WPSLIST b/wps/WPSLIST index 2932ff400d..70970dee58 100644 --- a/wps/WPSLIST +++ b/wps/WPSLIST @@ -83,7 +83,7 @@ wps.800x480x(16|24): cabbiev2.800x480x16.wps wps.480x800x(16|24): cabbiev2.480x800x16.wps wps.400x240x(16|24): cabbiev2.400x240x16.wps wps.320x480x(16|24): cabbiev2.320x480x16.wps -wps.320x240x(16|24): cabbiev2.320x240x16.wps +wps.320x240x(16|24|32): cabbiev2.320x240x16.wps wps.240x400x(16|24): cabbiev2.240x400x16.wps wps.240x320x(16|24|32): cabbiev2.240x320x16.wps wps.220x176x(16|24): cabbiev2.220x176x16.wps @@ -171,7 +171,7 @@ iconset.800x480x(16|24): icons/tango_icons.32x32.bmp iconset.480x800x(16|24): icons/tango_icons.32x32.bmp iconset.400x240x(16|24): icons/tango_icons.16x16.bmp iconset.320x480x(16|24): icons/tango_icons.24x24.bmp -iconset.320x240x(16|24): icons/tango_icons.16x16.bmp +iconset.320x240x(16|24|32): icons/tango_icons.16x16.bmp iconset.128x128x(16|24): icons/tango_icons.12x12.bmp iconset.128x160x(16|24|32): icons/tango_icons.12x12.bmp iconset.132x80x(16|24): icons/tango_icons.12x12.bmp