Mercurial > hg > index.fcgi > lj > lj046
view src/dsjoy.c @ 2:80a2761bd3a4
change DS keys (add alt. rotate)
author | paulo@localhost |
---|---|
date | Mon, 23 Mar 2009 01:19:12 -0700 |
parents | c84446dfb3f5 |
children | 17286938e22a |
line source
1 #include "ljcontrol.h"
2 #ifdef ARM9
3 #include <nds.h>
4 #else
5 #include <gba.h>
6 #endif
8 LJBits readHWKeys(void);
10 LJBits readPad(unsigned int player) {
11 LJBits hwKeys = readHWKeys();
12 LJBits out = 0;
14 if (hwKeys & KEY_UP) {
15 out |= VKEY_UP;
16 }
17 if (hwKeys & KEY_DOWN) {
18 out |= VKEY_DOWN;
19 }
20 if (hwKeys & KEY_LEFT) {
21 out |= VKEY_LEFT;
22 }
23 if (hwKeys & KEY_RIGHT) {
24 out |= VKEY_RIGHT;
25 }
26 if (hwKeys & KEY_B) {
27 out |= VKEY_ROTL;
28 }
29 if (hwKeys & KEY_A) {
30 out |= VKEY_ROTR;
31 }
32 if (hwKeys & (KEY_L | KEY_R)) {
33 out |= VKEY_HOLD;
34 }
36 #ifdef ARM9
37 // if (hwKeys & KEY_X) {
38 // out |= VKEY_MACRO(3);
39 // }
40 if (hwKeys & KEY_Y) {
41 out |= VKEY_MACRO(0);//VKEY_MACRO(2);
42 }
43 #endif
45 // on the GBA and DS, we need to add the console buttons in
46 out |= hwKeys << 16;
47 return out;
48 }