]> git.pld-linux.org Git - packages/Atari800.git/blobdiff - Atari800-joystick.patch
- joystick patch (argh, STICK is UBYTE[4], STICK[0xFF] pointed to sth else...)
[packages/Atari800.git] / Atari800-joystick.patch
diff --git a/Atari800-joystick.patch b/Atari800-joystick.patch
new file mode 100644 (file)
index 0000000..8b4c737
--- /dev/null
@@ -0,0 +1,55 @@
+--- Atari800/src/input.c.orig  Mon Nov  5 00:30:10 2001
++++ Atari800/src/input.c       Sat Dec 22 18:00:00 2001
+@@ -279,30 +279,30 @@
+       STICK[2] = i & 0x0f;
+       STICK[3] = (i >> 4) & 0x0f;
+-      if (joy_block_opposite_directions) {
+-              if ((STICK[i] & 0x0c) == 0) {   /* right and left simultaneously */
+-                      if (last_stick[i] & 0x04)       /* if wasn't left before, move left */
+-                              STICK[i] |= 0x08;
+-                      else                                            /* else move right */
+-                              STICK[i] |= 0x04;
+-              }
+-              else {
+-                      last_stick[i] &= 0x03;
+-                      last_stick[i] |= STICK[i] & 0x0c;
+-              }
+-              if ((STICK[i] & 0x03) == 0) {   /* up and down simultaneously */
+-                      if (last_stick[i] & 0x01)       /* if wasn't up before, move up */
+-                              STICK[i] |= 0x02;
+-                      else                                            /* else move down */
+-                              STICK[i] |= 0x01;
+-              }
+-              else {
+-                      last_stick[i] &= 0x0c;
+-                      last_stick[i] |= STICK[i] & 0x03;
++      for (i = 0; i < 4; i++) {
++              if (joy_block_opposite_directions) {
++                      if ((STICK[i] & 0x0c) == 0) {   /* right and left simultaneously */
++                              if (last_stick[i] & 0x04)       /* if wasn't left before, move left */
++                                      STICK[i] |= 0x08;
++                              else                                            /* else move right */
++                                      STICK[i] |= 0x04;
++                      }
++                      else {
++                              last_stick[i] &= 0x03;
++                              last_stick[i] |= STICK[i] & 0x0c;
++                      }
++                      if ((STICK[i] & 0x03) == 0) {   /* up and down simultaneously */
++                              if (last_stick[i] & 0x01)       /* if wasn't up before, move up */
++                                      STICK[i] |= 0x02;
++                              else                                            /* else move down */
++                                      STICK[i] |= 0x01;
++                      }
++                      else {
++                              last_stick[i] &= 0x0c;
++                              last_stick[i] |= STICK[i] & 0x03;
++                      }
+               }
+-      }
+-      for (i = 0; i < 4; i++) {
+               last_stick[i] = STICK[i];
+               TRIG[i] = Atari_TRIG(i);
+               if ((joy_autofire[i] == AUTOFIRE_FIRE && !TRIG[i]) || (joy_autofire[i] == AUTOFIRE_CONT))
This page took 0.285018 seconds and 4 git commands to generate.