forked from joncampbell123/dosbox-x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Windows
100 lines (62 loc) · 4.67 KB
/
README.Windows
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Getting started with DOSBox-X development under Windows 10
Visual Studio
-------------
Setting up the environment from scratch
---------------------------------------
- download Visual Studio installer from https://www.visualstudio.com/downloads
- launch the installer
- in 'Workloads' tab, tick 'Desktop development with C++'
- in 'Individual components' tab, 'SDKs, libraries, and frameworks' section, tick 'Windows 8.1 SDK'
- in 'Individual components' tab, 'Compilers, build tools, and runtimes' section, tick 'Windows Universal CRT SDK'
- download the DirectX SDK (June 2010) from https://www.microsoft.com/en-us/download/details.aspx?id=6812
- launch the installer and follow the instructions
- if you encounter error S1023 during installation, follow the instructions at https://support.microsoft.com/en-us/help/2728613/s1023-error-when-you-install-the-directx-sdk-june-2010
- open the DOSBox-X Visual Studio solution located in 'vs2015' folder of the repository
- for debugging, you might want to change 'Working Directory' default value of $(ProjectDir) to $(TargetDir)
Note that Visual Studio must be closed prior installing the DirectX SDK, else it won't pick up environment variables set by the DirectX SDK and this will result in building errors.
Pass additional options to the custom-build of SDL1
---------------------------------------------------
You can do that through the SDL1AdditionalOptions environment variable:
REM adding a preprocessor define
SET SDL1AdditionalOptions=/DMY_DEFINE
MSBUILD ...
Visual Studio Code
------------------
1. Install the building environment
If you have a side install of regular Visual Studio and already set up the development environment for DOSBox-X, you can skip this step.
Get and install Build Tools for Visual Studio 2017 from https://www.visualstudio.com/downloads/#other and install the following options:
Workloads
Visual C++ build tools
Individual components
Compilers, build tools, and runtimes
Windows Universal CRT SDK
SDKs, libraries, and frameworks
Windows 8.1 SDK
2. Add msbuild to path environment variable
- open Developer Command Prompt for VS 2017
- type 'where msbuild' and take note of first occurrence found
- open environment variables editor by running '%windir%\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables'
- add the found path to the environment variable
3. Setup VSCode build task
The default build task is 'build Windows SDL1 Debug Win32', you can switch to another in Tasks menu, Configure Default Build Task.
3. Setup C/C++ extension from Microsoft
Switch to the extensions pane and install it, its identifier is ms-vscode.cpptools. When done, open the Command Palette and search for 'C/Cpp: Select a Configuration' to select the appropriate configuration for your build task.
4. Setup the debugging
To change configuration, switch to the Debug pane and choose desired one in the combo box.
You can also do that from the bottom blue bar, but for some reason, VSCode does not always show it on startup; to remedy this problem execute the former procedure.
You can now build and debug DOSBox-X.
5. Notes and TODO
Even though it leverages existing Visual Studio solution, you do not need Visual Studio to be installed on your system, build tools are sufficient.
These instructions were written in an already set up environment, should some step be not reproducible, open an issue with the exact details so this guide can be improved.
The section about configuring IntelliSense still needs to be written.
CMake
-----
The CMakeLists.txt is provided as an alternative to the solution in 'vs2015' folder but with a few limitiations compared to it:
- VCPKG from Microsoft is the package manager used to fetch dependencies, consequently, only an SDL2 build is possible
- statically linking dependencies is not supported
Joystick improvements for SDL1 build
------------------------------------
XInput is now supported through the SDL_JOYSTICK_XINPUT define, this fixes the long plaguing issue where triggers were seen as the third axis on Xbox controllers. The resulting experience was an unsable input since both triggers shared the same the axis in the default DirectInput driver provided by Microsoft, for compatibility reasons. Some might have noticed that an earlier version of the device driver did not exhibit such behavior, at the cost of breaking legacy compatibility. By enabling this flag, XInput will be used in place of DirectInput. Consequently, the third axis will be the horizontal axis of the right thumbstick and triggers will act as the fifth and sixth axes when using the 'ch' joystick type.
To enable it:
set SDL1AdditionalOptions=/DSDL_JOYSTICK_XINPUT
msbuild dosbox-x.sln /p:Configuration=Debug /p:Platform=Win32