From 0c2ebbb2cf5abb4dfe9d43dcb23213a39fbc67ff Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Fri, 8 Nov 2013 13:05:58 +0000 Subject: zenxfi: add simulator keymap and bitmap Change-Id: Ic82ad39234d3056c3cc06d9f8f0ba6f28892e15f --- firmware/target/hosted/sdl/sim-ui-defines.h | 7 +++++++ uisimulator/bitmaps/UI-creativezenxfi.bmp | Bin 0 -> 505614 bytes uisimulator/buttonmap/creative-zen.c | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 uisimulator/bitmaps/UI-creativezenxfi.bmp diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index 7289329d21..f3ef41edb4 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h @@ -487,6 +487,13 @@ #define UI_LCD_POSX 35 #define UI_LCD_POSY 36 +#elif defined(CREATIVE_ZENXFI) +#define UI_TITLE "Creative ZEN X-Fi" +#define UI_WIDTH 510 /* width of GUI window */ +#define UI_HEIGHT 330 /* height of GUI window */ +#define UI_LCD_POSX 32 +#define UI_LCD_POSY 33 + #elif defined(SIMULATOR) #error no UI defines #endif diff --git a/uisimulator/bitmaps/UI-creativezenxfi.bmp b/uisimulator/bitmaps/UI-creativezenxfi.bmp new file mode 100644 index 0000000000..003378e946 Binary files /dev/null and b/uisimulator/bitmaps/UI-creativezenxfi.bmp differ diff --git a/uisimulator/buttonmap/creative-zen.c b/uisimulator/buttonmap/creative-zen.c index f19df4eb6a..275de5616f 100644 --- a/uisimulator/buttonmap/creative-zen.c +++ b/uisimulator/buttonmap/creative-zen.c @@ -46,14 +46,20 @@ int key_to_button(int keyboard_button) new_btn = BUTTON_DOWN; break; case SDLK_KP9: + new_btn = BUTTON_TOPRIGHT; + break; case SDLK_PAGEUP: new_btn = BUTTON_MENU; break; case SDLK_KP1: + new_btn = BUTTON_BOTTOMLEFT; + break; case SDLK_END: new_btn = BUTTON_SHORTCUT; break; case SDLK_KP3: + new_btn = BUTTON_BOTTOMRIGHT; + break; case SDLK_PAGEDOWN: new_btn = BUTTON_PLAYPAUSE; break; @@ -70,6 +76,8 @@ int key_to_button(int keyboard_button) break; #endif case SDLK_KP7: + new_btn = BUTTON_TOPLEFT; + break; case SDLK_HOME: case SDLK_BACKSPACE: new_btn = BUTTON_BACK; @@ -97,6 +105,23 @@ struct button_map bm[] = { { SDLK_PAGEDOWN, 462, 275, 20, "Play" }, { 0, 0, 0, 0, "None" } }; +#elif defined(CREATIVE_ZENXFI) +struct button_map bm[] = { + { SDLK_LEFT, 386, 166, 13, "Left" }, + { SDLK_RIGHT, 466, 166, 13, "Right" }, + { SDLK_UP, 426, 126, 13, "Up" }, + { SDLK_DOWN, 426, 206, 13, "Down" }, + { SDLK_RETURN, 426, 166, 13, "Select" }, + { SDLK_KP7, 386, 126, 13, "Top Left" }, + { SDLK_KP9, 466, 126, 13, "Top Right" }, + { SDLK_KP3, 466, 166, 13, "Bottom Right" }, + { SDLK_KP1, 386, 166, 13, "Bottom Left" }, + { SDLK_HOME, 390, 63, 16, "Back" }, + { SDLK_PAGEUP, 463, 63, 16, "Menu" }, + { SDLK_END, 390, 267, 16, "Shortcut" }, + { SDLK_PAGEDOWN, 463, 267, 16, "Play" }, + { 0, 0, 0, 0, "None" } +}; #else #error please define button map #endif -- cgit v1.2.3