Mercurial > sdl-ios-xcode
annotate src/joystick/nds/SDL_sysjoystick.c @ 2695:c04a266c277a gsoc2008_nds
More sprite-driven texture work in the render/video drivers.
author | Darren Alton <dalton@stevens.edu> |
---|---|
date | Sun, 17 Aug 2008 09:50:28 +0000 |
parents | 082cc3ffd7d8 |
children | e1da92da346c |
rev | line source |
---|---|
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
1 /* |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
4 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Library General Public |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
8 version 2 of the License, or (at your option) any later version. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
9 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
13 Library General Public License for more details. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
14 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Library General Public |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
18 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
19 Sam Lantinga |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
20 slouken@devolution.com |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
21 */ |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
22 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
23 #ifdef SAVE_RCSID |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
24 static char rcsid = |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
25 "@(#) $Id: SDL_sysjoystick.c,v 1.2 2001/04/26 16:50:17 hercules Exp $"; |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
26 #endif |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
27 |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
28 #include "SDL_config.h" |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
29 |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
30 #ifdef SDL_JOYSTICK_NDS |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
31 |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
32 /* This is the system specific header for the SDL joystick API */ |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
33 #include <nds.h> |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
34 //#include <nds/registers_alt.h> |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
35 #include <stdio.h> /* For the definition of NULL */ |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
36 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
37 #include "SDL_error.h" |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
38 #include "SDL_events.h" |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
39 #include "SDL_joystick.h" |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
40 #include "SDL_sysjoystick.h" |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
41 #include "SDL_joystick_c.h" |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
42 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
43 #include "../../video/nds/SDL_ndsevents_c.h" |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
44 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
45 /* Function to scan the system for joysticks. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
46 * This function should set SDL_numjoysticks to the number of available |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
47 * joysticks. Joystick 0 should be the system default joystick. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
48 * It should return 0, or -1 on an unrecoverable fatal error. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
49 */ |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
50 int |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
51 SDL_SYS_JoystickInit(void) |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
52 { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
53 SDL_numjoysticks = 1; |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
54 /* keysInit();*/ |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
55 return (1); |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
56 } |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
57 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
58 /* Function to get the device-dependent name of a joystick */ |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
59 const char * |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
60 SDL_SYS_JoystickName(int index) |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
61 { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
62 if (!index) |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
63 return "NDS builtin joypad"; |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
64 SDL_SetError("No joystick available with that index"); |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
65 return (NULL); |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
66 } |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
67 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
68 /* Function to open a joystick for use. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
69 The joystick to open is specified by the index field of the joystick. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
70 This should fill the nbuttons and naxes fields of the joystick structure. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
71 It returns 0, or -1 if there is an error. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
72 */ |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
73 int |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
74 SDL_SYS_JoystickOpen(SDL_Joystick * joystick) |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
75 { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
76 joystick->nbuttons = 8; |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
77 joystick->nhats = 0; |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
78 joystick->nballs = 0; |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
79 joystick->naxes = 2; |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
80 return 0; |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
81 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
82 |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
83 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
84 /* Function to update the state of a joystick - called as a device poll. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
85 * This function shouldn't update the joystick structure directly, |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
86 * but instead should call SDL_PrivateJoystick*() to deliver events |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
87 * and update joystick device state. |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
88 */ |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
89 void |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
90 SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
91 { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
92 u32 keysd, keysu; |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
93 int magnitude = 16384; |
2676
082cc3ffd7d8
Fixed a conflict between the touch and joystick drivers. They now should both behave as expected.
Darren Alton <dalton@stevens.edu>
parents:
2673
diff
changeset
|
94 /*scanKeys();*/ |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
95 keysd = keysDown(); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
96 keysu = keysUp(); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
97 |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
98 if ((keysd & KEY_UP)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
99 SDL_PrivateJoystickAxis(joystick, 1, -magnitude); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
100 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
101 if ((keysd & KEY_DOWN)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
102 SDL_PrivateJoystickAxis(joystick, 1, magnitude); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
103 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
104 if ((keysd & KEY_LEFT)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
105 SDL_PrivateJoystickAxis(joystick, 0, -magnitude); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
106 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
107 if ((keysd & KEY_RIGHT)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
108 SDL_PrivateJoystickAxis(joystick, 0, magnitude); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
109 } |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
110 |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
111 if ((keysu & (KEY_UP|KEY_DOWN))) { |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
112 SDL_PrivateJoystickAxis(joystick, 1, 0); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
113 } |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
114 if ((keysu & (KEY_LEFT|KEY_RIGHT))) { |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
115 SDL_PrivateJoystickAxis(joystick, 0, 0); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
116 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
117 |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
118 if ((keysd & KEY_A)) { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
119 SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED); |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
120 } |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
121 if ((keysd & KEY_B)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
122 SDL_PrivateJoystickButton(joystick, 1, SDL_PRESSED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
123 } |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
124 if ((keysd & KEY_X)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
125 SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
126 } |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
127 if ((keysd & KEY_Y)) { |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
128 SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
129 } |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
130 |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
131 if ((keysd & KEY_L)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
132 SDL_PrivateJoystickButton(joystick, 4, SDL_PRESSED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
133 } |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
134 if ((keysd & KEY_R)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
135 SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
136 } |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
137 |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
138 if ((keysd & KEY_SELECT)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
139 SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
140 } |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
141 if ((keysd & KEY_START)) { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
142 SDL_PrivateJoystickButton(joystick, 7, SDL_PRESSED); |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
143 } |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
144 |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
145 if ((keysu & KEY_A)) { |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
146 SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
147 } |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
148 if ((keysu & KEY_B)) { |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
149 SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
150 } |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
151 if ((keysu & KEY_X)) { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
152 SDL_PrivateJoystickButton(joystick, 2, SDL_RELEASED); |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
153 } |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
154 if ((keysu & KEY_Y)) { |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
155 SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED); |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
156 } |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
157 |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
158 if ((keysu & KEY_L)) { |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
159 SDL_PrivateJoystickButton(joystick, 4, SDL_RELEASED); |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
160 } |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
161 if ((keysu & KEY_R)) { |
2671
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
162 SDL_PrivateJoystickButton(joystick, 5, SDL_RELEASED); |
c3e7c0698cbb
some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents:
2670
diff
changeset
|
163 } |
2670
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
164 |
6e4669f4db49
Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff
changeset
|
165 if ((keysu & KEY_SELECT)) { |
2673
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
166 SDL_PrivateJoystickButton(joystick, 6, SDL_RELEASED); |
24a6b3588eac
Cleaned up and added joypad support from 1.2.9 NDS port. Also some minor video driver bugfixes.
Darren Alton <dalton@stevens.edu>
parents:
2671
diff
changeset
|
167 } |