diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-21 09:12:53 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-21 13:24:01 +0000 |
commit | 6b13437aff3a2720763f3918aaa5cd3ce1624625 (patch) | |
tree | 4752a32ca65c40f85fe2a43c04154d4a4c6e0272 | |
parent | 6834d1a02f1099c7dcd1428613a12f6eef0c6821 (diff) | |
download | rockbox-6b13437aff3a2720763f3918aaa5cd3ce1624625.tar.gz rockbox-6b13437aff3a2720763f3918aaa5cd3ce1624625.zip |
Add UI Simulator for Eros Q / K series
Change-Id: I9ffc101bd904b3f0e2d6a86a43fb1ae3fda73a19
-rw-r--r-- | firmware/target/hosted/sdl/sim-ui-defines.h | 7 | ||||
-rw-r--r-- | uisimulator/bitmaps/UI-aigoerosq.bmp | bin | 0 -> 1044938 bytes | |||
-rw-r--r-- | uisimulator/buttonmap/SOURCES | 2 | ||||
-rw-r--r-- | uisimulator/buttonmap/erosq.c | 89 |
4 files changed, 98 insertions, 0 deletions
diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index 31c95b0e13..55ef96b984 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h | |||
@@ -528,6 +528,13 @@ | |||
528 | #define UI_LCD_POSX 26 | 528 | #define UI_LCD_POSX 26 |
529 | #define UI_LCD_POSY 40 | 529 | #define UI_LCD_POSY 40 |
530 | 530 | ||
531 | #elif defined(EROS_Q) | ||
532 | #define UI_TITLE "AIGO EROS Q" | ||
533 | #define UI_WIDTH 400 /* width of GUI window */ | ||
534 | #define UI_HEIGHT 653 /* height of GUI window */ | ||
535 | #define UI_LCD_POSX 45 | ||
536 | #define UI_LCD_POSY 50 | ||
537 | |||
531 | #elif defined(SIMULATOR) | 538 | #elif defined(SIMULATOR) |
532 | #error no UI defines | 539 | #error no UI defines |
533 | #endif | 540 | #endif |
diff --git a/uisimulator/bitmaps/UI-aigoerosq.bmp b/uisimulator/bitmaps/UI-aigoerosq.bmp new file mode 100644 index 0000000000..6fa83a7cd4 --- /dev/null +++ b/uisimulator/bitmaps/UI-aigoerosq.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index f7f85c057c..dfcfe87b42 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES | |||
@@ -85,5 +85,7 @@ xduoo-x3ii.c | |||
85 | xduoo-x20.c | 85 | xduoo-x20.c |
86 | #elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) | 86 | #elif (CONFIG_KEYPAD == IHIFI_770_PAD) || (CONFIG_KEYPAD == IHIFI_800_PAD) |
87 | ihifi2.c | 87 | ihifi2.c |
88 | #elif CONFIG_KEYPAD == EROSQ_PAD | ||
89 | erosq.c | ||
88 | #endif | 90 | #endif |
89 | #endif /* SIMULATOR */ | 91 | #endif /* SIMULATOR */ |
diff --git a/uisimulator/buttonmap/erosq.c b/uisimulator/buttonmap/erosq.c new file mode 100644 index 0000000000..3471b864ca --- /dev/null +++ b/uisimulator/buttonmap/erosq.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2020 Solomon Peachy | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License | ||
13 | * as published by the Free Software Foundation; either version 2 | ||
14 | * of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | |||
21 | #include <SDL.h> | ||
22 | #include "button.h" | ||
23 | #include "config.h" | ||
24 | #include "buttonmap.h" | ||
25 | |||
26 | int key_to_button(int keyboard_button) | ||
27 | { | ||
28 | int new_btn = BUTTON_NONE; | ||
29 | switch (keyboard_button) | ||
30 | { | ||
31 | case SDLK_KP4: | ||
32 | case SDLK_LEFT: | ||
33 | new_btn = BUTTON_PREV; | ||
34 | break; | ||
35 | case SDLK_KP6: | ||
36 | case SDLK_RIGHT: | ||
37 | new_btn = BUTTON_NEXT; | ||
38 | break; | ||
39 | case SDLK_KP8: | ||
40 | case SDLK_UP: | ||
41 | new_btn = BUTTON_SCROLL_BACK; | ||
42 | break; | ||
43 | case SDLK_KP2: | ||
44 | case SDLK_DOWN: | ||
45 | new_btn = BUTTON_SCROLL_FWD; | ||
46 | break; | ||
47 | case SDLK_KP_ENTER: | ||
48 | case SDLK_RETURN: | ||
49 | new_btn = BUTTON_PLAY; | ||
50 | break; | ||
51 | case SDLK_ESCAPE: | ||
52 | new_btn = BUTTON_POWER; | ||
53 | break; | ||
54 | case SDLK_BACKSPACE: | ||
55 | new_btn = BUTTON_BACK; | ||
56 | case SDLK_KP_PERIOD: | ||
57 | case SDLK_INSERT: | ||
58 | new_btn = BUTTON_MENU; | ||
59 | break; | ||
60 | case SDL_BUTTON_WHEELUP: | ||
61 | new_btn = BUTTON_SCROLL_BACK; | ||
62 | break; | ||
63 | case SDL_BUTTON_WHEELDOWN: | ||
64 | new_btn = BUTTON_SCROLL_FWD; | ||
65 | break; | ||
66 | case SDLK_KP_MINUS: | ||
67 | case SDLK_PAGEUP: | ||
68 | new_btn = BUTTON_VOL_UP; | ||
69 | break; | ||
70 | case SDLK_KP_PLUS: | ||
71 | case SDLK_PAGEDOWN: | ||
72 | new_btn = BUTTON_VOL_DOWN; | ||
73 | } | ||
74 | return new_btn; | ||
75 | } | ||
76 | |||
77 | struct button_map bm[] = { | ||
78 | { SDLK_KP_PERIOD, 60, 599, 25, "Menu" }, | ||
79 | { SDLK_KP8, 213, 473, 20, "Scroll Back" }, | ||
80 | { SDLK_KP2, 50, 473, 20, "Scroll Fwd" }, | ||
81 | { SDLK_KP4, 323, 384, 30, "Prev" }, | ||
82 | { SDLK_KP6, 323, 465, 30, "Next" }, | ||
83 | { SDLK_BACKSPACE, 323, 578, 25, "Back" }, | ||
84 | { SDLK_KP_PLUS, 397, 91, 30, "Vol Up" }, | ||
85 | { SDLK_KP_MINUS, 397, 185, 43, "Vol Dn" }, | ||
86 | { SDLK_KP_ENTER, 134, 473, 40, "Play" }, | ||
87 | { SDLK_ESCAPE, 338, 10, 25, "Power" }, | ||
88 | { 0, 0, 0 , 0, "None" } | ||
89 | }; | ||