Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (c) 2006 Alexander Levin |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 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 | #ifndef _REVERSI_GUI_H |
| 23 | #define _REVERSI_GUI_H |
| 24 | |
| 25 | #include "plugin.h" |
| 26 | |
Jonathan Gordon | fda7d72 | 2007-08-06 13:42:52 +0000 | [diff] [blame] | 27 | #define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev" |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 28 | |
| 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 Arnold | b701322 | 2007-07-27 09:57:27 +0000 | [diff] [blame] | 62 | (CONFIG_KEYPAD == IPOD_3G_PAD) || \ |
| 63 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) |
Antoine Cellerier | abf9232 | 2007-07-01 22:21:35 +0000 | [diff] [blame] | 64 | #define REVERSI_BUTTON_UP BUTTON_MENU |
| 65 | #define REVERSI_BUTTON_DOWN BUTTON_PLAY |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 66 | #define REVERSI_BUTTON_LEFT BUTTON_LEFT |
| 67 | #define REVERSI_BUTTON_RIGHT BUTTON_RIGHT |
Antoine Cellerier | abf9232 | 2007-07-01 22:21:35 +0000 | [diff] [blame] | 68 | #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 Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 72 | |
Antoine Cellerier | fd6a927 | 2007-06-30 20:14:53 +0000 | [diff] [blame] | 73 | #elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 74 | #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 Kukla | 6e20944 | 2008-03-18 09:24:35 +0000 | [diff] [blame] | 83 | #define REVERSI_BUTTON_QUIT BUTTON_POWER |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 84 | #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 Sevakis | a74d150 | 2008-05-02 00:38:11 +0000 | [diff] [blame] | 91 | #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 Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 100 | #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 Arnold | 12ddb8e | 2007-09-20 10:49:48 +0000 | [diff] [blame] | 109 | #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ |
| 110 | (CONFIG_KEYPAD == SANSA_C200_PAD) |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 111 | #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 Kurbjun | 38548c7 | 2007-11-02 05:21:34 +0000 | [diff] [blame] | 119 | #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 Kukla | d6c8b57 | 2008-03-01 22:55:09 +0000 | [diff] [blame] | 128 | #elif (CONFIG_KEYPAD == MROBE100_PAD) |
Robert Kukla | 6e20944 | 2008-03-18 09:24:35 +0000 | [diff] [blame] | 129 | #define REVERSI_BUTTON_QUIT BUTTON_POWER |
Robert Kukla | d6c8b57 | 2008-03-01 22:55:09 +0000 | [diff] [blame] | 130 | #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 Arnold | 106ac75 | 2008-03-22 14:20:04 +0000 | [diff] [blame] | 137 | #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 Purchase | 554d7ed | 2008-03-22 22:03:34 +0000 | [diff] [blame] | 146 | #elif CONFIG_KEYPAD == COWOND2_PAD |
| 147 | #define REVERSI_QUIT BUTTON_POWER |
Rob Purchase | 554d7ed | 2008-03-22 22:03:34 +0000 | [diff] [blame] | 148 | #define REVERSI_BUTTON_MENU BUTTON_MENU |
| 149 | |
Karl Kurbjun | 38548c7 | 2007-11-02 05:21:34 +0000 | [diff] [blame] | 150 | #else |
Robert Kukla | d6c8b57 | 2008-03-01 22:55:09 +0000 | [diff] [blame] | 151 | #error No keymap defined! |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 152 | #endif |
| 153 | |
Rob Purchase | 297e050 | 2008-04-27 15:30:19 +0000 | [diff] [blame] | 154 | #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 Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 177 | |
| 178 | /* Modes for the cursor behaviour at the board edges */ |
| 179 | typedef 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 |