summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-12-08 21:40:35 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-12-08 21:40:35 +0000
commit5a4b7c39200a361a6f9a4f842dc9dc39082c2f9a (patch)
tree55172c156bc94e7588219013fa99d2005350f359 /uisimulator
parent2aa511f6bdac6364fe09a0004e4e14b3fc17a6c2 (diff)
downloadrockbox-5a4b7c39200a361a6f9a4f842dc9dc39082c2f9a.tar.gz
rockbox-5a4b7c39200a361a6f9a4f842dc9dc39082c2f9a.zip
MPIO HD300 simulator. FS#11796 by Michael Leslie
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28775 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/bitmaps/UI-mpiohd300.bmpbin0 -> 450694 bytes
-rw-r--r--uisimulator/buttonmap/SOURCES2
-rw-r--r--uisimulator/buttonmap/mpio-hd300.c82
3 files changed, 84 insertions, 0 deletions
diff --git a/uisimulator/bitmaps/UI-mpiohd300.bmp b/uisimulator/bitmaps/UI-mpiohd300.bmp
new file mode 100644
index 0000000000..60dac62b8f
--- /dev/null
+++ b/uisimulator/bitmaps/UI-mpiohd300.bmp
Binary files differ
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES
index 7ab80da5d3..c9955d408f 100644
--- a/uisimulator/buttonmap/SOURCES
+++ b/uisimulator/buttonmap/SOURCES
@@ -63,5 +63,7 @@ samsung-yh820_yh92x.c
63pbell-vibe500.c 63pbell-vibe500.c
64#elif CONFIG_KEYPAD == MPIO_HD200_PAD 64#elif CONFIG_KEYPAD == MPIO_HD200_PAD
65mpio-hd200.c 65mpio-hd200.c
66#elif CONFIG_KEYPAD == MPIO_HD300_PAD
67mpio-hd300.c
66#endif 68#endif
67#endif /* SIMULATOR */ 69#endif /* SIMULATOR */
diff --git a/uisimulator/buttonmap/mpio-hd300.c b/uisimulator/buttonmap/mpio-hd300.c
new file mode 100644
index 0000000000..454e3a6d6f
--- /dev/null
+++ b/uisimulator/buttonmap/mpio-hd300.c
@@ -0,0 +1,82 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Michael Leslie
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#include <SDL.h>
24#include "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32
33 case SDLK_UP:
34 new_btn = BUTTON_UP;
35 break;
36 case SDLK_DOWN:
37 new_btn = BUTTON_DOWN;
38 break;
39
40 case SDLK_LEFT:
41 new_btn = BUTTON_LEFT;
42 break;
43 case SDLK_RIGHT:
44 new_btn = BUTTON_RIGHT;
45 break;
46
47 case SDLK_SPACE:
48 case SDLK_ESCAPE:
49 new_btn = BUTTON_MENU;
50 break;
51
52 case SDLK_RETURN:
53 new_btn = BUTTON_ENTER;
54 break;
55
56 case SDLK_p:
57 new_btn = BUTTON_PLAY;
58 break;
59
60 case SDLK_r:
61 new_btn = BUTTON_REC;
62 break;
63 }
64 return new_btn;
65}
66
67struct button_map bm[] = {
68 { SDLK_LEFT, 98, 312, 15, "Rew" },
69 { SDLK_RIGHT, 186, 312, 15, "FF" },
70
71 { SDLK_ESCAPE, 90, 364, 40, "Menu" },
72 { SDLK_RETURN, 196, 364, 40, "Enter" },
73
74 { SDLK_r, 98, 410, 15, "Rec" },
75 { SDLK_p, 186, 410, 15, "Play/Stop" },
76
77 { SDLK_UP, 143, 315, 40, "Up" },
78 { SDLK_DOWN, 143, 415, 40, "Down" },
79
80 { SDLK_h, 116, 52, 20, "Hold" },
81 { 0, 0, 0, 0, "None" }
82};