blob: 3a3cdda3ce220811bd0c2a65165bdbf812b9a6db [file] [log] [blame]
Antoine Cellerierb4b34f02007-06-30 20:04:42 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (c) 2006 Alexander Levin
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _REVERSI_GUI_H
23#define _REVERSI_GUI_H
24
25#include "plugin.h"
26
Jonathan Gordonfda7d722007-08-06 13:42:52 +000027#define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev"
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000028
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
38
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_PRE BUTTON_MENU
46#define REVERSI_BUTTON_MAKE_MOVE (BUTTON_MENU | BUTTON_REL)
47#define REVERSI_BUTTON_ALT_MAKE_MOVE (BUTTON_MENU | BUTTON_DOWN)
48#define REVERSI_BUTTON_MENU_PRE BUTTON_MENU
49#define REVERSI_BUTTON_MENU (BUTTON_MENU | BUTTON_REPEAT)
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
52 (CONFIG_KEYPAD == IRIVER_H300_PAD)
53#define REVERSI_BUTTON_QUIT BUTTON_OFF
54#define REVERSI_BUTTON_UP BUTTON_UP
55#define REVERSI_BUTTON_DOWN BUTTON_DOWN
56#define REVERSI_BUTTON_LEFT BUTTON_LEFT
57#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
58#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
59#define REVERSI_BUTTON_MENU BUTTON_MODE
60
61#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
Jens Arnoldb7013222007-07-27 09:57:27 +000062 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
63 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
Antoine Cellerierabf92322007-07-01 22:21:35 +000064#define REVERSI_BUTTON_UP BUTTON_MENU
65#define REVERSI_BUTTON_DOWN BUTTON_PLAY
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000066#define REVERSI_BUTTON_LEFT BUTTON_LEFT
67#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
Antoine Cellerierabf92322007-07-01 22:21:35 +000068#define REVERSI_BUTTON_ALT_LEFT BUTTON_SCROLL_BACK
69#define REVERSI_BUTTON_ALT_RIGHT BUTTON_SCROLL_FWD
70#define REVERSI_BUTTON_MAKE_MOVE (BUTTON_SELECT | BUTTON_REL)
71#define REVERSI_BUTTON_MENU (BUTTON_MENU | BUTTON_SELECT)
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000072
Antoine Cellerierfd6a9272007-06-30 20:14:53 +000073#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD)
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000074#define REVERSI_BUTTON_QUIT BUTTON_POWER
75#define REVERSI_BUTTON_UP BUTTON_UP
76#define REVERSI_BUTTON_DOWN BUTTON_DOWN
77#define REVERSI_BUTTON_LEFT BUTTON_LEFT
78#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
79#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
80#define REVERSI_BUTTON_MENU BUTTON_PLAY
81
82#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
Robert Kukla6e209442008-03-18 09:24:35 +000083#define REVERSI_BUTTON_QUIT BUTTON_POWER
Antoine Cellerierb4b34f02007-06-30 20:04:42 +000084#define REVERSI_BUTTON_UP BUTTON_UP
85#define REVERSI_BUTTON_DOWN BUTTON_DOWN
86#define REVERSI_BUTTON_LEFT BUTTON_LEFT
87#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
88#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
89#define REVERSI_BUTTON_MENU BUTTON_MENU
90
Michael Sevakisa74d1502008-05-02 00:38:11 +000091#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
92#define REVERSI_BUTTON_QUIT BUTTON_POWER
93#define REVERSI_BUTTON_UP BUTTON_UP
94#define REVERSI_BUTTON_DOWN BUTTON_DOWN
95#define REVERSI_BUTTON_LEFT BUTTON_LEFT
96#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
97#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
98#define REVERSI_BUTTON_MENU BUTTON_MENU
99
Antoine Cellerierb4b34f02007-06-30 20:04:42 +0000100#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
101#define REVERSI_BUTTON_QUIT BUTTON_POWER
102#define REVERSI_BUTTON_UP BUTTON_SCROLL_UP
103#define REVERSI_BUTTON_DOWN BUTTON_SCROLL_DOWN
104#define REVERSI_BUTTON_LEFT BUTTON_LEFT
105#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
106#define REVERSI_BUTTON_MAKE_MOVE BUTTON_REW
107#define REVERSI_BUTTON_MENU BUTTON_PLAY
108
Marianne Arnold12ddb8e2007-09-20 10:49:48 +0000109#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
110(CONFIG_KEYPAD == SANSA_C200_PAD)
Antoine Cellerierb4b34f02007-06-30 20:04:42 +0000111#define REVERSI_BUTTON_QUIT BUTTON_POWER
112#define REVERSI_BUTTON_UP BUTTON_UP
113#define REVERSI_BUTTON_DOWN BUTTON_DOWN
114#define REVERSI_BUTTON_LEFT BUTTON_LEFT
115#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
116#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
117#define REVERSI_BUTTON_MENU (BUTTON_SELECT|BUTTON_REPEAT)
118
Karl Kurbjun38548c72007-11-02 05:21:34 +0000119#elif CONFIG_KEYPAD == MROBE500_PAD
120#define REVERSI_QUIT BUTTON_POWER
121#define REVERSI_BUTTON_UP BUTTON_RC_PLAY
122#define REVERSI_BUTTON_DOWN BUTTON_RC_DOWN
123#define REVERSI_BUTTON_LEFT BUTTON_RC_REW
124#define REVERSI_BUTTON_RIGHT BUTTON_RC_FF
125#define REVERSI_BUTTON_MAKE_MOVE BUTTON_RC_MODE
126#define REVERSI_BUTTON_MENU (BUTTON_POWER | BUTTON_REL)
127
Robert Kuklad6c8b572008-03-01 22:55:09 +0000128#elif (CONFIG_KEYPAD == MROBE100_PAD)
Robert Kukla6e209442008-03-18 09:24:35 +0000129#define REVERSI_BUTTON_QUIT BUTTON_POWER
Robert Kuklad6c8b572008-03-01 22:55:09 +0000130#define REVERSI_BUTTON_UP BUTTON_UP
131#define REVERSI_BUTTON_DOWN BUTTON_DOWN
132#define REVERSI_BUTTON_LEFT BUTTON_LEFT
133#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
134#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT
135#define REVERSI_BUTTON_MENU BUTTON_MENU
136
Jens Arnold106ac752008-03-22 14:20:04 +0000137#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
138#define REVERSI_BUTTON_QUIT BUTTON_RC_REC
139#define REVERSI_BUTTON_UP BUTTON_RC_VOL_UP
140#define REVERSI_BUTTON_DOWN BUTTON_RC_VOL_DOWN
141#define REVERSI_BUTTON_LEFT BUTTON_RC_REW
142#define REVERSI_BUTTON_RIGHT BUTTON_RC_FF
143#define REVERSI_BUTTON_MAKE_MOVE BUTTON_RC_PLAY
144#define REVERSI_BUTTON_MENU BUTTON_RC_MENU
145
Rob Purchase554d7ed2008-03-22 22:03:34 +0000146#elif CONFIG_KEYPAD == COWOND2_PAD
147#define REVERSI_QUIT BUTTON_POWER
Rob Purchase554d7ed2008-03-22 22:03:34 +0000148#define REVERSI_BUTTON_MENU BUTTON_MENU
149
Karl Kurbjun38548c72007-11-02 05:21:34 +0000150#else
Robert Kuklad6c8b572008-03-01 22:55:09 +0000151#error No keymap defined!
Antoine Cellerierb4b34f02007-06-30 20:04:42 +0000152#endif
153
Rob Purchase297e0502008-04-27 15:30:19 +0000154#ifdef HAVE_TOUCHPAD
155#ifndef REVERSI_QUIT
156#define REVERSI_QUIT BUTTON_TOPLEFT
157#endif
158#ifndef REVERSI_BUTTON_UP
159#define REVERSI_BUTTON_UP BUTTON_TOPMIDDLE
160#endif
161#ifndef REVERSI_BUTTON_DOWN
162#define REVERSI_BUTTON_DOWN BUTTON_BOTTOMMIDDLE
163#endif
164#ifndef REVERSI_BUTTON_LEFT
165#define REVERSI_BUTTON_LEFT BUTTON_MIDLEFT
166#endif
167#ifndef REVERSI_BUTTON_RIGHT
168#define REVERSI_BUTTON_RIGHT BUTTON_MIDRIGHT
169#endif
170#ifndef REVERSI_BUTTON_MAKE_MOVE
171#define REVERSI_BUTTON_MAKE_MOVE BUTTON_CENTER
172#endif
173#ifndef REVERSI_BUTTON_MENU
174#define REVERSI_BUTTON_MENU BUTTON_TOPRIGHT
175#endif
176#endif
Antoine Cellerierb4b34f02007-06-30 20:04:42 +0000177
178/* Modes for the cursor behaviour at the board edges */
179typedef enum _cursor_wrap_mode_t {
180 WRAP_FLAT, /* No wrapping */
181 WRAP_SPHERE, /* (7,7) > right > (7,0); (7,7) > down > (0,7) */
182 WRAP_TORUS, /* (7,7) > right > (0,0); (7,7) > down > (0,0) */
183} cursor_wrap_mode_t;
184
185
186#endif