diff -uBNr KoboDeluxe-0.4pre8/form.cpp KoboDeluxe-0.4pre8-new/form.cpp
--- KoboDeluxe-0.4pre8/form.cpp	2002-06-02 05:51:19.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/form.cpp	2004-06-18 05:49:35.000000000 +0200
@@ -191,6 +191,17 @@
 }
 
 
+void kobo_form_t::enum_list(int first, int last)
+{
+	char buf[50];
+	for(int i = first; i <= last; i++)
+	{
+		snprintf(buf, sizeof(buf), "%d", i);
+		item(buf, i);
+	}
+}
+
+
 void kobo_form_t::button(const char *cap, int tag)
 {
 	ct_widget_t *w = new ct_button_t(cap);
diff -uBNr KoboDeluxe-0.4pre8/form.h KoboDeluxe-0.4pre8-new/form.h
--- KoboDeluxe-0.4pre8/form.h	2002-04-28 03:26:46.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/form.h	2004-06-18 05:49:35.000000000 +0200
@@ -66,6 +66,7 @@
 	void list(const char *cap, int *var, int tag = 0);
 	void item(const char *cap, int value, int ind = 0);
 	void perc_list(int first, int last, int step);
+	void enum_list(int first, int last);
 
 	//Internal wrapper for build()
 	void build_all();
diff -uBNr KoboDeluxe-0.4pre8/kobo.cpp KoboDeluxe-0.4pre8-new/kobo.cpp
--- KoboDeluxe-0.4pre8/kobo.cpp	2002-06-22 02:17:25.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/kobo.cpp	2004-06-18 05:48:44.000000000 +0200
@@ -301,6 +301,7 @@
 	printf("              [-gfx <gfx dir path>]\n");
 	printf("              [-scores <scores dir path>]\n");
 	printf("              [-[no]joystick]\n");
+	printf("              [-joystick_no <n> (default: 0)]\n");
 	printf("\n");
 	exit(1);
 }
@@ -926,10 +927,15 @@
 			return -1;
 		}
 
-		if(SDL_NumJoysticks() > 0)
+		p->number_of_joysticks = SDL_NumJoysticks();
+		if(p->number_of_joysticks > 0)
 		{
 			SDL_JoystickEventState(SDL_ENABLE);
-			joystick = SDL_JoystickOpen(0);
+			if(p->joystick_no >= p->number_of_joysticks)
+			{
+				p->joystick_no = 0;
+			}
+			joystick = SDL_JoystickOpen(p->joystick_no);
 			if(!joystick)
 			{
 				SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
diff -uBNr KoboDeluxe-0.4pre8/options.cpp KoboDeluxe-0.4pre8-new/options.cpp
--- KoboDeluxe-0.4pre8/options.cpp	2002-06-16 08:16:18.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/options.cpp	2004-06-18 05:49:35.000000000 +0200
@@ -222,7 +222,19 @@
 	xoffs = 0.67;
 	space(4);
 		yesno("Use Joystick", &prf->use_joystick,
-				OS_RESTART_INPUT);
+				OS_RESTART_INPUT | OS_REBUILD);
+		if(prf->use_joystick)
+		{
+		  	if(prf->number_of_joysticks)
+			{
+			list("Joystick Number", &prf->joystick_no,
+					OS_RESTART_INPUT);
+				enum_list(0, prf->number_of_joysticks - 1);
+			} else
+			{
+			  	label("No Joysticks Found");
+			}
+		}
 		yesno("Use Mouse", &prf->use_mouse,
 				OS_RESTART_INPUT | OS_REBUILD);
 		if(prf->use_mouse)
diff -uBNr KoboDeluxe-0.4pre8/prefs.cpp KoboDeluxe-0.4pre8-new/prefs.cpp
--- KoboDeluxe-0.4pre8/prefs.cpp	2002-06-14 01:16:40.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/prefs.cpp	2004-06-18 05:49:35.000000000 +0200
@@ -35,6 +35,9 @@
 	comment("--------------------------------------------");
 	comment("--- Input options --------------------------");
 	yesno("joystick", use_joystick, 0); desc("Use Joystick");
+	key("joystick_no", joystick_no, 0); desc("Joystick Number");
+	key("number_of_joysticks", number_of_joysticks, 8);
+       		desc("Number of connected Joysticks");
 	yesno("mouse", use_mouse, 0); desc("Use Mouse");
 	key("mousemode", mousemode, MMD_CROSSHAIR); desc("Mouse Control Mode");
 	yesno("broken_numdia", broken_numdia, 0); desc("Broken NumPad Diagonals");
diff -uBNr KoboDeluxe-0.4pre8/prefs.h KoboDeluxe-0.4pre8-new/prefs.h
--- KoboDeluxe-0.4pre8/prefs.h	2002-06-14 01:17:26.000000000 +0200
+++ KoboDeluxe-0.4pre8-new/prefs.h	2004-06-18 05:49:35.000000000 +0200
@@ -30,6 +30,8 @@
   public:
 	//Input options
 	int	use_joystick;
+	int	joystick_no;		//which joystick to use
+	int	number_of_joysticks;	//no of connected joysticks
 	int	use_mouse;
 	int	mousemode;
 	int	broken_numdia;
