-
Notifications
You must be signed in to change notification settings - Fork 0
/
mfdisp_exe_test.tmc
57 lines (40 loc) · 1.66 KB
/
mfdisp_exe_test.tmc
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
include "target.tmh"
define MAX_ARRAY 255
define MAX_EXECUTE 512
alias moduleName = "C-101";
alias programLocation = "C:\\\\Program Files (x86)\\\\Vyper Industries\\\\MFD4CTS";
alias programFullPath = "C:\\\\Program Files (x86)\\\\Vyper Industries\\\\MFD4CTS\\MFD4CTS.exe";
char argumentString[MAX_ARRAY];
char programString[MAX_ARRAY];
char executeString[MAX_ARRAY];
//program startup
int main()
{
if(Init(&EventHandle)) return 1; // declare the event handler, return on error
//add initialization code here
Configure(&LMFD,MODE_EXCLUDED);
Configure(&RMFD,MODE_EXCLUDED);
Configure(&Joystick,MODE_EXCLUDED);
Configure(&TFRPRudder,MODE_EXCLUDED);
Configure(&TFRPHARudder,MODE_EXCLUDED);
MapKey (&Throttle, APENG, EXEC("launch_mfdisplay();"));
}
//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
//add event handling code here
}
int launch_mfdisplay()
{
GameOutput(&Throttle, OUT_ID_LED_1, 2);
sprintf(&argumentString, "attempting to launch MFD4CTS\xa%s\xa", &moduleName);
printf(&argumentString);
sprintf(&executeString, "spawn -w \\\"%s\\\" \\\"%s\" -mod %s\xa", &programLocation, &programFullPath, &moduleName);
printf(&executeString);
// int launched = system("spawn -w \C:\\Program Files (x86)\\Vyper Industries\\MFD4CTS\ \C:\\Program Files (x86)\\Vyper Industries\\MFD4CTS\MFD4CTS.exe\ -mod C-101");
int launched = system(&executeString);
//int launched = system("spawn -w \"C:\\Program Files (x86)\\Vyper Industries\\MFD4CTS\" \"C:\\Program Files (x86)\\Vyper Industries\\MFD4CTS\\MFD4CTS.exe\" -mod FA-18C");
sprintf(&argumentString, "Result of system: %d\xa", launched);
printf(&argumentString);
}