]> git.pld-linux.org Git - packages/Atari800.git/blob - Atari800-joystick.patch
- joystick patch (argh, STICK is UBYTE[4], STICK[0xFF] pointed to sth else...)
[packages/Atari800.git] / Atari800-joystick.patch
1 --- Atari800/src/input.c.orig   Mon Nov  5 00:30:10 2001
2 +++ Atari800/src/input.c        Sat Dec 22 18:00:00 2001
3 @@ -279,30 +279,30 @@
4         STICK[2] = i & 0x0f;
5         STICK[3] = (i >> 4) & 0x0f;
6  
7 -       if (joy_block_opposite_directions) {
8 -               if ((STICK[i] & 0x0c) == 0) {   /* right and left simultaneously */
9 -                       if (last_stick[i] & 0x04)       /* if wasn't left before, move left */
10 -                               STICK[i] |= 0x08;
11 -                       else                                            /* else move right */
12 -                               STICK[i] |= 0x04;
13 -               }
14 -               else {
15 -                       last_stick[i] &= 0x03;
16 -                       last_stick[i] |= STICK[i] & 0x0c;
17 -               }
18 -               if ((STICK[i] & 0x03) == 0) {   /* up and down simultaneously */
19 -                       if (last_stick[i] & 0x01)       /* if wasn't up before, move up */
20 -                               STICK[i] |= 0x02;
21 -                       else                                            /* else move down */
22 -                               STICK[i] |= 0x01;
23 -               }
24 -               else {
25 -                       last_stick[i] &= 0x0c;
26 -                       last_stick[i] |= STICK[i] & 0x03;
27 +       for (i = 0; i < 4; i++) {
28 +               if (joy_block_opposite_directions) {
29 +                       if ((STICK[i] & 0x0c) == 0) {   /* right and left simultaneously */
30 +                               if (last_stick[i] & 0x04)       /* if wasn't left before, move left */
31 +                                       STICK[i] |= 0x08;
32 +                               else                                            /* else move right */
33 +                                       STICK[i] |= 0x04;
34 +                       }
35 +                       else {
36 +                               last_stick[i] &= 0x03;
37 +                               last_stick[i] |= STICK[i] & 0x0c;
38 +                       }
39 +                       if ((STICK[i] & 0x03) == 0) {   /* up and down simultaneously */
40 +                               if (last_stick[i] & 0x01)       /* if wasn't up before, move up */
41 +                                       STICK[i] |= 0x02;
42 +                               else                                            /* else move down */
43 +                                       STICK[i] |= 0x01;
44 +                       }
45 +                       else {
46 +                               last_stick[i] &= 0x0c;
47 +                               last_stick[i] |= STICK[i] & 0x03;
48 +                       }
49                 }
50 -       }
51  
52 -       for (i = 0; i < 4; i++) {
53                 last_stick[i] = STICK[i];
54                 TRIG[i] = Atari_TRIG(i);
55                 if ((joy_autofire[i] == AUTOFIRE_FIRE && !TRIG[i]) || (joy_autofire[i] == AUTOFIRE_CONT))
This page took 0.058766 seconds and 4 git commands to generate.