annotate src/joystick/nds/SDL_sysjoystick.c @ 2698:e1da92da346c gsoc2008_nds

Clean up.
author Darren Alton <dalton@stevens.edu>
date Wed, 27 Aug 2008 04:23:38 +0000
parents 082cc3ffd7d8
children
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
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
23 #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
24
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
25 #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
26
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
27 /* 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
28 #include <nds.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
29 #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
30
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
31 #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
32 #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
33 #include "SDL_joystick.h"
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
34 #include "SDL_sysjoystick.h"
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
35 #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
36
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
37 #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
38
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
39 /* 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
40 * 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
41 * 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
42 * 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
43 */
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
44 int
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
45 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
46 {
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
47 SDL_numjoysticks = 1;
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
48
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
49 return (1);
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
50 }
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
51
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
52 /* Function to get the device-dependent name of a joystick */
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
53 const char *
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
54 SDL_SYS_JoystickName(int index)
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
55 {
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
56 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
57 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
58 SDL_SetError("No joystick available with that index");
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
59 return (NULL);
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
60 }
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
61
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
62 /* 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
63 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
64 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
65 It returns 0, or -1 if there is an error.
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
66 */
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
67 int
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
68 SDL_SYS_JoystickOpen(SDL_Joystick * 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
69 {
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
70 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
71 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
72 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
73 joystick->naxes = 2;
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
74 return 0;
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
75 }
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
76
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
77
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
78 /* 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
79 * 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
80 * 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
81 * and update joystick device state.
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
82 */
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
83 void
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
84 SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
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
85 {
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
86 u32 keysd, keysu;
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
87 int magnitude = 16384;
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
88
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
89 /*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
90 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
91 keysu = keysUp();
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
92
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
93 if ((keysd & KEY_UP)) {
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
94 SDL_PrivateJoystickAxis(joystick, 1, -magnitude);
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
95 }
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
96 if ((keysd & 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
97 SDL_PrivateJoystickAxis(joystick, 1, magnitude);
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 }
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 if ((keysd & KEY_LEFT)) {
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 SDL_PrivateJoystickAxis(joystick, 0, -magnitude);
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 }
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 if ((keysd & 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
103 SDL_PrivateJoystickAxis(joystick, 0, magnitude);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
104 }
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
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
106 if ((keysu & (KEY_UP | KEY_DOWN))) {
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
107 SDL_PrivateJoystickAxis(joystick, 1, 0);
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 }
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
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
110 if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
111 SDL_PrivateJoystickAxis(joystick, 0, 0);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
112 }
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
113
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
114 if ((keysd & KEY_A)) {
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
115 SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED);
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
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
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
118 if ((keysd & KEY_B)) {
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
119 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
120 }
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
121
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
122 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
123 SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
124 }
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
125
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
126 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
127 SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
128 }
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
129
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
130 if ((keysd & KEY_L)) {
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
131 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
132 }
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
133
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
134 if ((keysd & 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
135 SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
136 }
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
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)) {
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
139 SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED);
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
140 }
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
141
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
142 if ((keysd & KEY_START)) {
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
143 SDL_PrivateJoystickButton(joystick, 7, 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
144 }
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
145
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
146 if ((keysu & KEY_A)) {
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
147 SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
148 }
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
149
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
150 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
151 SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED);
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
152 }
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
153
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
154 if ((keysu & KEY_X)) {
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
155 SDL_PrivateJoystickButton(joystick, 2, 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 }
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
157
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
158 if ((keysu & KEY_Y)) {
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
159 SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED);
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
160 }
2671
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
161
c3e7c0698cbb some changes to the dummy driver for debug purposes that should be reverted.
Darren Alton <dalton@stevens.edu>
parents: 2670
diff changeset
162 if ((keysu & KEY_L)) {
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
163 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
164 }
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
165
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
166 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
167 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
168 }
2670
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
169
6e4669f4db49 Fix for the previous commit: actually 'svn add'ed some files.
Darren Alton <dalton@stevens.edu>
parents:
diff changeset
170 if ((keysu & KEY_SELECT)) {
2698
e1da92da346c Clean up.
Darren Alton <dalton@stevens.edu>
parents: 2676
diff changeset
171 SDL_PrivateJoystickButton(joystick, 6, 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
172 }