+ return result;
+}
+
+#else /* MSDOS */
+
+/* allegro global variables for joystick control */
+extern int num_joysticks;
+extern JOYSTICK_INFO joy[];
+
+int Joystick(int player_nr)
+{
+ int joystick_nr = stored_player[player_nr].joystick_fd;
+ int result = 0;
+
+ if (joystick_status == JOYSTICK_OFF)
+ return 0;
+
+ if (game_status == SETUPINPUT)
+ return 0;
+
+ if (joystick_nr < 0)
+ return 0;
+
+ /* the allegro global variable ïnum_joysticksï contains the number
+ of joysticks found at initialization under MSDOS / Windows */
+
+#if 0
+ if (joystick_nr >= num_joysticks || !setup.input[player_nr].use_joystick)
+ return 0;
+#else
+
+#if 1
+ if (joystick_nr >= num_joysticks ||
+ (game_status == PLAYING && !setup.input[player_nr].use_joystick))
+ return 0;
+#else
+ if (joystick_nr >= num_joysticks)
+ return 0;
+#endif
+
+#endif
+
+ poll_joystick();
+
+ if (joy[joystick_nr].stick[0].axis[0].d1)
+ result |= JOY_LEFT;
+ else if (joy[joystick_nr].stick[0].axis[0].d2)
+ result |= JOY_RIGHT;
+ if (joy[joystick_nr].stick[0].axis[1].d1)
+ result |= JOY_UP;
+ else if (joy[joystick_nr].stick[0].axis[1].d2)
+ result |= JOY_DOWN;
+
+ if (joy[joystick_nr].button[0].b)
+ result |= JOY_BUTTON_1;
+ if (joy[joystick_nr].button[1].b)
+ result |= JOY_BUTTON_2;
+
+ return result;