1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (c) 2006 Alexander Levin
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _REVERSI_GUI_H
23 #define _REVERSI_GUI_H
27 #define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev"
29 /* variable button definitions */
30 #if CONFIG_KEYPAD == RECORDER_PAD
31 #define REVERSI_BUTTON_QUIT BUTTON_OFF
32 #define REVERSI_BUTTON_UP BUTTON_UP
33 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
34 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
35 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
36 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY
37 #define REVERSI_BUTTON_MENU BUTTON_F1
39 #elif CONFIG_KEYPAD == ONDIO_PAD
40 #define REVERSI_BUTTON_QUIT BUTTON_OFF
41 #define REVERSI_BUTTON_UP BUTTON_UP
42 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
43 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
44 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
45 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_MENU
46 #define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
47 #define REVERSI_BUTTON_MENU_LONGPRESS
48 #define REVERSI_BUTTON_MENU BUTTON_MENU
50 #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
51 (CONFIG_KEYPAD == IRIVER_H300_PAD)
52 #define REVERSI_BUTTON_QUIT BUTTON_OFF
53 #define REVERSI_BUTTON_UP BUTTON_UP
54 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
55 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
56 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
57 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
58 #define REVERSI_BUTTON_MENU BUTTON_MODE
60 #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
61 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
62 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
63 #define REVERSI_BUTTON_UP BUTTON_MENU
64 #define REVERSI_BUTTON_DOWN BUTTON_PLAY
65 #define REVERSI_BUTTON_LEFT (BUTTON_LEFT | BUTTON_SCROLL_BACK)
66 #define REVERSI_BUTTON_RIGHT (BUTTON_RIGHT | BUTTON_SCROLL_FWD)
67 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
68 #define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
69 #define REVERSI_BUTTON_MENU BUTTON_SELECT
70 #define REVERSI_BUTTON_MENU_LONGPRESS
72 #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD)
73 #define REVERSI_BUTTON_QUIT BUTTON_POWER
74 #define REVERSI_BUTTON_UP BUTTON_UP
75 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
76 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
77 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
78 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
79 #define REVERSI_BUTTON_MENU BUTTON_PLAY
81 #elif (CONFIG_KEYPAD == GIGABEAT_PAD)
82 #define REVERSI_BUTTON_QUIT BUTTON_POWER
83 #define REVERSI_BUTTON_UP BUTTON_UP
84 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
85 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
86 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
87 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
88 #define REVERSI_BUTTON_MENU BUTTON_MENU
90 #elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
91 #define REVERSI_BUTTON_QUIT BUTTON_POWER
92 #define REVERSI_BUTTON_UP BUTTON_UP
93 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
94 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
95 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
96 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
97 #define REVERSI_BUTTON_MENU BUTTON_MENU
99 #elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
100 #define REVERSI_BUTTON_QUIT BUTTON_POWER
101 #define REVERSI_BUTTON_UP BUTTON_SCROLL_UP
102 #define REVERSI_BUTTON_DOWN BUTTON_SCROLL_DOWN
103 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
104 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
105 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_REW
106 #define REVERSI_BUTTON_MENU BUTTON_PLAY
108 #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
109 (CONFIG_KEYPAD == SANSA_C200_PAD) || \
110 (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
111 (CONFIG_KEYPAD == SANSA_M200_PAD)
112 #define REVERSI_BUTTON_QUIT BUTTON_POWER
113 #define REVERSI_BUTTON_UP BUTTON_UP
114 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
115 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
116 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
117 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
118 #define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
119 #define REVERSI_BUTTON_MENU BUTTON_SELECT
120 #define REVERSI_BUTTON_MENU_LONGPRESS
122 #elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
123 #define REVERSI_BUTTON_QUIT (BUTTON_HOME|BUTTON_REPEAT)
124 #define REVERSI_BUTTON_UP BUTTON_UP
125 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
126 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
127 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
128 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
129 #define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
130 #define REVERSI_BUTTON_MENU BUTTON_SELECT
131 #define REVERSI_BUTTON_MENU_LONGPRESS
133 #elif CONFIG_KEYPAD == MROBE500_PAD
134 #define REVERSI_BUTTON_QUIT BUTTON_POWER
136 #elif (CONFIG_KEYPAD == MROBE100_PAD)
137 #define REVERSI_BUTTON_QUIT BUTTON_POWER
138 #define REVERSI_BUTTON_UP BUTTON_UP
139 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
140 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
141 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
142 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
143 #define REVERSI_BUTTON_MENU BUTTON_MENU
145 #elif CONFIG_KEYPAD == IAUDIO_M3_PAD
146 #define REVERSI_BUTTON_QUIT BUTTON_RC_REC
147 #define REVERSI_BUTTON_UP BUTTON_RC_VOL_UP
148 #define REVERSI_BUTTON_DOWN BUTTON_RC_VOL_DOWN
149 #define REVERSI_BUTTON_LEFT BUTTON_RC_REW
150 #define REVERSI_BUTTON_RIGHT BUTTON_RC_FF
151 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_RC_PLAY
152 #define REVERSI_BUTTON_MENU BUTTON_RC_MENU
154 #elif CONFIG_KEYPAD == COWON_D2_PAD
155 #define REVERSI_BUTTON_QUIT BUTTON_POWER
156 #define REVERSI_BUTTON_MENU BUTTON_MENU
158 #elif CONFIG_KEYPAD == IAUDIO67_PAD
159 #define REVERSI_BUTTON_QUIT BUTTON_POWER
160 #define REVERSI_BUTTON_UP BUTTON_STOP
161 #define REVERSI_BUTTON_DOWN BUTTON_PLAY
162 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
163 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
164 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_VOLUP
165 #define REVERSI_BUTTON_MENU BUTTON_MENU
167 #elif CONFIG_KEYPAD == CREATIVEZVM_PAD
168 #define REVERSI_BUTTON_QUIT BUTTON_BACK
169 #define REVERSI_BUTTON_UP BUTTON_UP
170 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
171 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
172 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
173 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
174 #define REVERSI_BUTTON_MENU BUTTON_MENU
176 #elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
177 #define REVERSI_BUTTON_QUIT BUTTON_POWER
178 #define REVERSI_BUTTON_UP BUTTON_UP
179 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
180 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
181 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
182 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
183 #define REVERSI_BUTTON_MENU BUTTON_MENU
185 #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
186 #define REVERSI_BUTTON_QUIT BUTTON_POWER
187 #define REVERSI_BUTTON_UP BUTTON_UP
188 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
189 #define REVERSI_BUTTON_LEFT BUTTON_PREV
190 #define REVERSI_BUTTON_RIGHT BUTTON_NEXT
191 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY
192 #define REVERSI_BUTTON_MENU BUTTON_MENU
194 #elif CONFIG_KEYPAD == ONDAVX747_PAD
195 #define REVERSI_BUTTON_QUIT BUTTON_POWER
196 #define REVERSI_BUTTON_MENU BUTTON_MENU
198 #elif CONFIG_KEYPAD == ONDAVX777_PAD
199 #define REVERSI_BUTTON_QUIT BUTTON_POWER
201 #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
202 #define REVERSI_BUTTON_QUIT BUTTON_REC
203 #define REVERSI_BUTTON_UP BUTTON_UP
204 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
205 #define REVERSI_BUTTON_LEFT BUTTON_LEFT
206 #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
207 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_FFWD
208 #define REVERSI_BUTTON_MENU BUTTON_PLAY
210 #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
211 #define REVERSI_BUTTON_QUIT BUTTON_REC
212 #define REVERSI_BUTTON_UP BUTTON_UP
213 #define REVERSI_BUTTON_DOWN BUTTON_DOWN
214 #define REVERSI_BUTTON_LEFT BUTTON_PREV
215 #define REVERSI_BUTTON_RIGHT BUTTON_NEXT
216 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_OK
217 #define REVERSI_BUTTON_MENU BUTTON_MENU
219 #elif CONFIG_KEYPAD == MPIO_HD200_PAD
220 #define REVERSI_BUTTON_UP BUTTON_REW
221 #define REVERSI_BUTTON_DOWN BUTTON_FF
222 #define REVERSI_BUTTON_LEFT BUTTON_VOL_DOWN
223 #define REVERSI_BUTTON_RIGHT BUTTON_VOL_UP
224 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_FUNC
225 #define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
226 #define REVERSI_BUTTON_MENU BUTTON_FUNC
227 #define REVERSI_BUTTON_MENU_LONGPRESS
230 #error No keymap defined!
233 #ifdef HAVE_TOUCHSCREEN
234 #ifndef REVERSI_BUTTON_QUIT
235 #define REVERSI_BUTTON_QUIT BUTTON_TOPLEFT
237 #ifndef REVERSI_BUTTON_UP
238 #define REVERSI_BUTTON_UP BUTTON_TOPMIDDLE
240 #ifndef REVERSI_BUTTON_DOWN
241 #define REVERSI_BUTTON_DOWN BUTTON_BOTTOMMIDDLE
243 #ifndef REVERSI_BUTTON_LEFT
244 #define REVERSI_BUTTON_LEFT BUTTON_MIDLEFT
246 #ifndef REVERSI_BUTTON_RIGHT
247 #define REVERSI_BUTTON_RIGHT BUTTON_MIDRIGHT
249 #ifndef REVERSI_BUTTON_MAKE_MOVE
250 #define REVERSI_BUTTON_MAKE_MOVE BUTTON_CENTER
252 #ifndef REVERSI_BUTTON_MENU
253 #define REVERSI_BUTTON_MENU BUTTON_TOPRIGHT
257 /* Modes for the cursor behaviour at the board edges */
258 typedef enum _cursor_wrap_mode_t
{
259 WRAP_FLAT
, /* No wrapping */
260 WRAP_SPHERE
, /* (7,7) > right > (7,0); (7,7) > down > (0,7) */
261 WRAP_TORUS
, /* (7,7) > right > (0,0); (7,7) > down > (0,0) */
262 } cursor_wrap_mode_t
;