summaryrefslogtreecommitdiff
path: root/recipes/frodo/frodo-4.1b/frodo-joystick-4state.diff
blob: 3234736d8b34bed15dc10838f2edcbc8d0e4cd0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff -u Src/C64_Qtopia.i Src/C64_Qtopia.i
--- Src/C64_Qtopia.i	2004-07-11 09:28:05.000000000 +0200
+++ Src/C64_Qtopia.i	2004-07-11 09:30:20.000000000 +0200
@@ -246,10 +246,16 @@
 	}
 
 	// Joystick keyboard emulation
-	if (TheDisplay->NumLock())
+	if (TheDisplay->NumLock() == 1)
 		TheCIA1->Joystick1 &= joykey;
 	else
+	if (TheDisplay->NumLock() == 2)
 		TheCIA1->Joystick2 &= joykey;
+	else
+	if (TheDisplay->NumLock() == 3) {
+		TheCIA1->Joystick1 &= joykey;
+		TheCIA1->Joystick2 &= joykey;
+	}
 
 	// Count TOD clocks
 	TheCIA1->CountTOD();
diff -u Src/Display.h Src/Display.h
--- Src/Display.h	2002-01-02 22:31:34.000000000 +0100
+++ Src/Display.h	2004-07-11 09:30:43.000000000 +0200
@@ -59,7 +59,7 @@
 #else
 	void PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joystick);
 #endif
-	bool NumLock(void);
+	int NumLock(void);
 	void InitColors(uint8 *colors);
 	void NewPrefs(Prefs *prefs);
 
diff -u Src/Display_QtopiaSDL.i Src/Display_QtopiaSDL.i
--- Src/Display_QtopiaSDL.i	2004-07-11 09:28:06.000000000 +0200
+++ Src/Display_QtopiaSDL.i	2004-07-11 09:31:47.000000000 +0200
@@ -17,7 +17,7 @@
 // Display surface
 static SDL_Surface *screen = NULL;
 
-// Mode of Joystick emulation. 0 = none, 1 = Joyport 1, 2 = Joyport 2
+// Mode of Joystick emulation. 0 = none, 1 = Joyport 1, 2 = Joyport 2, 3 = both
 static short joy_emu = 0;
 
 // Keyboard
@@ -210,6 +210,8 @@
 		draw_string(screen, DISPLAY_X * 4/5 + 2, (screen->h - 17) + 4, "1", black, fill_gray);
 	else if (joy_emu == 2)
 		draw_string(screen, DISPLAY_X * 4/5 + 2, (screen->h - 17) + 4, "2", black, fill_gray);
+	else if (joy_emu == 3)
+		draw_string(screen, DISPLAY_X * 4/5 + 2, (screen->h - 17) + 4, "3", black, fill_gray);
 	draw_string(screen, 24, (screen->h - 17) + 4, speedometer_string, black, fill_gray);
 
 	// Update display
@@ -500,7 +502,7 @@
 //				fprintf(stderr, "SDL-Key: %d\n", event.key.keysym.sym);
 				if (tab_pressed && event.key.keysym.sym == SDLK_j)
 				{
-					if (joy_emu < 2)
+					if (joy_emu < 3)
 						joy_emu++;
 					else
 						joy_emu = 0;
@@ -573,11 +575,9 @@
  *  Check if NumLock is down (for switching the joystick keyboard emulation)
  */
 
-bool C64Display::NumLock(void)
+int C64Display::NumLock(void)
 {
-	if (joy_emu == 2)
-		return true;
-	return false;
+	return joy_emu;
 }