00001 /* 00002 * Copyright 2009-2010 The MegaDrive.Org Team 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without modification, are 00006 * permitted provided that the following conditions are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright notice, this list of 00009 * conditions and the following disclaimer. 00010 * 00011 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 00012 * of conditions and the following disclaimer in the documentation and/or other materials 00013 * provided with the distribution. 00014 * 00015 * THIS SOFTWARE IS PROVIDED BY THE MEGADRIVE.ORG TEAM ``AS IS'' AND ANY EXPRESS OR IMPLIED 00016 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00017 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EMMANUEL VADOT OR 00018 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00019 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00020 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00021 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00022 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00023 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 00026 /* $Id: joy_8h_source.html,v 1.7 2010/01/16 18:03:05 elbarto Exp $ */ 00027 00036 #define JOY_1 0x0 00037 00042 #define JOY_2 0x1 00043 00048 #define JOY_3 0x2 00049 00054 #define JOY_4 0x3 00055 00060 #define JOY_EXT 0x2 00061 00062 00067 #define JOY_UP 0x1 00068 00072 #define JOY_DOWN 0x2 00073 00077 #define JOY_LEFT 0x004 00078 00082 #define JOY_RIGHT 0x008 00083 00088 #define JOY_B 0x010 00089 00094 #define JOY_C 0x020 00095 00100 #define JOY_A 0x040 00101 00106 #define JOY_START 0x080 00107 00108 00113 #define JOY_X 0x400 00114 00119 #define JOY_Y 0x200 00120 00125 #define JOY_Z 0x100 00126 00131 #define JOY_MODE 0x800 00132 00137 #define JOY_IS_PRESSED(x, y) ((x & y) != 0) 00138 00145 void joy_init(void); 00146 00151 #define JOY_NONE 0x0 00152 00157 #define JOY_3BTS 0x1 00158 00163 #define JOY_6BTS 0x2 00164 00170 u8 joy_gettype(u8 joy_num); 00171 00178 u16 joy_read(u8 joy_num, u8 type); 00179 00185 void joy_ea4way_set(u8 joy_num); 00186 00193 u8 joy_isea4way(void);