Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
joystick.c
Go to the documentation of this file.
1/*
2 * Joystick sampling.
3 *
4 * Retail object 0x44F1F0-0x44F2FF (link order; see docs/ORDER.md).
5 */
6#include "game.h"
7
8/* Function start: 0x44F1F0 */
10 unsigned int fallback)
11{
12 GetJoystickPosition((unsigned int *)&samples[0].x,
13 (unsigned int *)&samples[0].y,
14 (int *)&samples[0].buttons, 0, fallback);
15 GetJoystickPosition((unsigned int *)&samples[1].x,
16 (unsigned int *)&samples[1].y,
17 (int *)&samples[1].buttons, 1, fallback);
18 return 1;
19}
20
21/* Function start: 0x44F247 */
22void SampleJoystickDevice(InputDeviceSample *samples, short joystick,
23 unsigned int fallback)
24{
25 short sampleIndex;
26
27 sampleIndex = 0;
28 if (joystick != 0)
29 sampleIndex = 1;
30 else
31 sampleIndex = 0;
33 (unsigned int *)&samples[sampleIndex].x,
34 (unsigned int *)&samples[sampleIndex].y,
35 (int *)&samples[sampleIndex].buttons, joystick, fallback);
36}
37
38/* Function start: 0x44F2B8 */
39/* Nothing in the shipped executable calls this. */
41{
42 return GetJoystickButtons();
43}
44
45/* Function start: 0x44F2CD */
46/* Nothing in the shipped executable calls this. Samples the active input
47 * device into its own sample slot. */
54
55/* Linker commons defined here. LINK lays a unit's commons out by the
56 * identifiers' hash keys, so these spellings follow the original addresses. */
57short g_8_nActiveInputDeviceWord; /* 0x005d1726 */
59int g_nJoystickHorizDeadZone; /* 0x005d172c */
60int g_26_nUnusedControllerNumber[3]; /* 0x005d1730 */ /* never referenced */
61int g_59_nJoystickUpScaleWord; /* 0x005d173c */
62int g_12_nControllerLeftScaleValue; /* 0x005d1740 */
63int g_4_nJoystickMaximumXValue; /* 0x005d1744 */
64int g_nJoystickMaximumY; /* 0x005d1748 */
65int g_12_nJoystickMinimumXNumber; /* 0x005d174c */
66int g_2_nJsMinimumY; /* 0x005d1750 */
67int g_nJoystickVerticalRangeNumber; /* 0x005d1754 */
68int g_3_nControllerHorizontalRange; /* 0x005d1758 */
69int g_1_nJsRightScaleWord; /* 0x005d175c */
70int g_12_nJoystickDownScaleWord; /* 0x005d1760 */
71int g_2_nJoystickCentreY; /* 0x005d1764 */
72int g_1_nJoystickCentreXNumber; /* 0x005d1768 */
73int g_4_nControllerFailureValue; /* 0x005d176c */
74char g_nUnusedJsWord; /* 0x005d1770 */ /* never referenced */
76short g_3_nFlightControlCommandValue; /* 0x005d1798 */
77char g_16_nUnusedJoystickWord; /* 0x005d179a */ /* never referenced */
void GetJoystickPosition(unsigned int *x, unsigned int *y, int *buttons, unsigned short joystick, unsigned int fallback)
Definition winmain.c:657
short SampleBothJoysticks(InputDeviceSample *samples, unsigned int fallback)
Definition joystick.c:9
short GetJoystickButtons(void)
Definition winmain.c:706
void SampleJoystickDevice(InputDeviceSample *samples, short joystick, unsigned int fallback)
Definition joystick.c:22
void SampleActiveJoystickDevice(void)
Definition joystick.c:48
short ReadJoystickButtons(void)
Definition joystick.c:40
Shared Win32 declarations, types and library interfaces.
short g_3_nFlightControlCommandValue
Definition joystick.c:76
int g_nControllerVerticalDeadZoneWord
Definition joystick.c:58
int g_12_nJoystickDownScaleWord
Definition joystick.c:70
int g_12_nControllerLeftScaleValue
Definition joystick.c:62
int g_4_nJoystickMaximumXValue
Definition joystick.c:63
int g_1_nJoystickCentreXNumber
Definition joystick.c:72
int g_2_nJsMinimumY
Definition joystick.c:66
int g_1_nJsRightScaleWord
Definition joystick.c:69
InputDeviceSample g_aInputDeviceSamplesList[2]
Definition joystick.c:75
int g_nJoystickVerticalRangeNumber
Definition joystick.c:67
int g_2_nJoystickCentreY
Definition joystick.c:71
short g_8_nActiveInputDeviceWord
Definition joystick.c:57
int g_nJoystickHorizDeadZone
Definition joystick.c:59
int g_4_nControllerFailureValue
Definition joystick.c:73
int g_3_nControllerHorizontalRange
Definition joystick.c:68
int g_12_nJoystickMinimumXNumber
Definition joystick.c:65
int g_59_nJoystickUpScaleWord
Definition joystick.c:61
int g_nJoystickMaximumY
Definition joystick.c:64
char g_nUnusedJsWord
Definition joystick.c:74
char g_16_nUnusedJoystickWord
Definition joystick.c:77
int g_26_nUnusedControllerNumber[3]
Definition joystick.c:60