INDIVIDUAL DOSBOX GUIDE DOSBox System Requirements Minimum CPU:i586 (Pentium) OS: 95,NT3.51,NT4 Memory: 128MB Video Card: 16bit color DirectX (95): DX7+ with ddraw acceleration OpenGL (95,NT4): OpenGL 1.2 compliant video card Recommended: CPU:i686 (Pentium Pro+) OS: 98+,2000+ Memory: 256MB Video Card: 16bit color, DX7+ compatible DirectX (98+,2000+): DX7+ with ddraw acceleration OpenGL (98+,2000+): OpenGL 1.2 compliant video card PREREQUISITES COMPRESSION 7-zip FILE EDITING Notepad++ LEGACYEXTENDER (To compile for NT3.51-95-98-NT4 on VS2008) http://www.legacyextender.com/ IDE -VS2017 for XP+ (i686) -VS2008 w/ legacyextender for NT3.51-2000 (i586+) Microsoft Visual Studio 2017 v15.3.3 (Windows 10 x64 v1703) Microsoft Visual Studio 2015 v14.0.25431.01 Update 3 (Windows 10 x64 v1703) Microsoft Visual Studio 2013 v12.0.40629.00 Update 5 (Windows 10 x64 v1703) Microsoft Visual Studio 2012 v11.0.50727.1 (Windows 10 x64 v1703) Microsoft Visual Studio 2010 v10.0.40219.1 (Windows 10 x64 v1703) Microsoft Visual Studio 2008 v9.0.21022.8 (Windows 10 x64 v1703) Microsoft Visual Studio 2005 v8.0.50727.867 (Windows 10 x64 v1703) Microsoft Visual Studio .NET 2003 v7.1.3088 (Windows 7 x64) (Windows 10 x64 v1703 only the compiler) DOSBOX WILL NOT COMPILE WITH VS2002 Microsoft Visual Studio .NET 2002 v7.0.9466 (Windows 7 x64) (Windows 10 x64 v1703 only the compiler) IDE ADDON Daffodil https://daffodil.codeplex.com/ DOSBOX SOURCE http://source.dosbox.com/dosboxsvn.tgz **For (2002) you'll need to convert the project from (2003) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2003 VS2002 dosbox.sln SDL https://www.libsdl.org/release/?C=N;O=A (2002) (2003) (2005) (2008) (2010) (2013) (2012) (2015) (2017) SDL-1.2.15.zip **For (2002) (2003) and (2005) you'll need to convert the project from (2008) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2008 VS2003 sdl.sln DIRECTX SDK DXSDK_feb10.exe https://www.microsoft.com/en-us/download/details.aspx?id=10084 DXSDK_jun10.exe from: (DDRAW.H is DEPRECATED) https://www.microsoft.com/en-us/download/details.aspx?id=6812 OR https://www.vogons.org/viewtopic.php?f=31&t=55706&p=614650#p614650 Download DXSDKFebJune2010forSDL1.2.x.zip You only need the following files from the DirectX SDK: INCLUDE ddraw.h dinput.h dsound.h LIB ddraw.lib dinput8.lib dsound.lib OPTIONAL LIBRARIES SDL_NET http://www.libsdl.org/projects/SDL_net/release/ SDL_net-1.2.8.zip **For (2002) (2003) and (2005) you'll need to convert the project from (2008) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2008 VS2003 SDL_net_VS2008.sln libpng https://sourceforge.net/projects/libpng/files/libpng16/ lpng1632.zip **For (2002) you'll need to convert the project from (2003) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2003 VS2002 libpng.sln zlib https://zlib.net/fossils/?C=M;O=D zlib-1.2.11.tar.gz LIBOGG http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz **For (2002) you'll need to convert the project from (2003) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2003 VS2002 ogg.sln LIBVORBIS http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz **For (2002) (2003) you'll need to convert the project from (2005) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2005 VS2003 vorbis_static.sln FLAC https://ftp.osuosl.org/pub/xiph/releases/flac/?C=M;O=A flac-1.3.1.tar.xz **For (2002) (2003) you'll need to convert the project from (2005) to a lower version using "Visual Studio Project Converter" on sourceforge. ex: vspc VS2003 VS2002 flac.sln SDL_SOUND https://www.icculus.org/SDL_sound/downloads/SDL_sound-1.0.3.tar.gz NASM http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/win32/ nasm_2.13.01-install-x86.exe INSTALL SOFTWARE 1. Install the following software: Visual Studio XXXX (If 2017 then Check Windows Universal CRT SDK and Windows XP Support for C++ in setup) Daffodil DirectX SDK February 2010 DirectX SDK June 2010 7-zip Notepad++ NASM Add "C:\Program Files (x86)\NASM" to system environment variables. (REQUIRED FOR FLAC) INDIVIDUAL VISUAL STUDIO DOSBOX INSTRUCTIONS SETUP FOLDER STRUCTURE 1. Create the following directory structure: 1. Create the following directory structure: C:\Build\DOSBOX\VS2017\XP C:\Build\DOSBOX\VS2017\Vista+ C:\Build\DOSBOX\VS2008\98-2000 C:\Build\DOSBOX\VS2008\95-NT4AD C:\Build\DOSBOX\VS2008\95-NT4 C:\Build\DOSBOX\VS2008\3.51 C:\Build\DOSBOX\VS2008\3.50 2. Create "DOWNLOAD" and "COMPILE" folders in each subfolder. 3. Copy all downloaded prerequisites into each "DOWNLOAD" folder. DXSDK_Jun10.exe (Only to VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) DXSDK_Feb10 (Only to VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) LegacyExtender (Only to VS2008\XX\DOWNLOAD) 4. (Only for VS2008\98-2000,VS2008\95-NT4AD,VS2008\95-NT4,VS2017\XP) a. Create a DXLEGACY folder under each \COMPILE folder. b. Copy "Include" and "Lib" folders from the "DirectX SDK June 2010" C:\Program Files (x86)\Microsoft DirectX SDK (June 2010) to the DXLEGACY folder. c. Copy "dvp.h" and "ddraw.h" from the DirectX SDK February 2010" INCLUDE folder C:\Program Files (x86)\Microsoft DirectX SDK (February 2010) to the same folder under the DXLEGACY folder. d. Copy "ddraw.lib" from the DirectX SDK February 2010" lib x86 and x64 folders C:\Program Files (x86)\Microsoft DirectX SDK (February 2010) to the same folders under the DXLEGACY folder. 5. Uncompress the below prerequisites to each "COMPILE" folder. dosboxsvn lpng1632 SDL_net-1.2.8 SDL-1.2.15 zlib-1.2.11 (Rename to ZLIB) LegacyExtender (Only to the VS2008 folder structure) LIBOGG LIBVORBIS FLAC SDL_SOUND COMPILE LIBPNG AND ZLIB 1. (2002) (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) a. Go here: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\libpng and open "libpng.sln" with Visual Studio. b. If Visual Studio asks you to retarget or "upgrade" then choose "OK". c. Wait for Visual Studio to to finish. d. In Solution Explorer right-click "Solution" and select properties. Choose "Multiple Startup Projects" and set "libpng" and "zlib" to "Start" e. Press "Apply" and then "OK". 2. a. Right-click "Solution" in "Solution Explorer" and choose "Configuration Manager" b. In "Active solution configuration" choose "LIB Release" c. Verify "libpng","pnglibconfig" (if availabe) and "zlib" are set to "Release", "Release Library" or "LIB Release" if not then change them to that. d. For all other items uncheck "Build". e. Click "OK" or "Close". 3. a. In Solution Explorer right-click "libpng" and select "properties". b. Verify that "Configuration Type" in the "Libpng Property Pages" box is set to "Static library (.lib)" c. Click "VC++ Directories" (2010) (2012) (2013) (2015) (2017) or "Resources","General","Additional Include Directories" (2002) (2003) (2005) (2008) d. Click on "Include Directories", select the down arrow to the right and choose edit, Click folder with an asterix and add the zlib folder. C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\Build\zlib e. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) f. (2010) Set "Floating Point Model" to Fast (/fp:fast) g. Click "OK" 4. a. In Solution Explorer right-click "zlib" and select "properties". b. Verify that "Configuration Type" in the "Libpng Property Pages" box is set to "Static library (.lib)" c. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) d. (2010) Set "Floating Point Model" to Fast (/fp:fast) e. Click "OK" 5. Compile the project and go here to view your .lib files (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release" COMPILE SDL 1. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC" and open "SDL.sln" with VS. If Visual Studio wants to upgrade the project then let it. 2. Right-click "Solution 'SDL" and select "Configuration Manager". Set "Active solution configuration" to "Release". Verify "SDL" and "SDLmain" are set to "Release" and checked. 3. In Solution Explorer right-click SDL and select properties. a. Go to "General"->"Configuration Type" and set to "Static library (.lib)" **If you want to keep SDL.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" b. (2002) Click on "Librarian" "General" and select "Output File". Enter the following: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\Release\sdl.lib (2002) (2003) c. Go to C:\Users\username\appdata\local\Microsoft\VisualStudio\7.0 d. Verify that VCComponents.dat exists. If not then create it. e. Open VCComponents.dat and add the following to the existing lines: Include Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include Library Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86 (2005) (2008) c. In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "INCLUDE FILES" add: "C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include" For "LIBRARY FILES" add: \BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86 (2010) (2012) (2013) (2015) (2017) c. Click on "VC++ Directories" and update "Include directories" by adding: "C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include" d. Click on "Library Directories" and update to add: "C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. In Solution Explorer right-click SDLmain and select properties. a. Go to "General"->"Configuration Type" and set to "Static library (.lib)" b. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) c. (2002) Click on "Librarian" "General" and select "Output File". Enter the following: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\sdlmain\Release\sdlmain.lib 6. In Solution Explorer expand "SDL" and go to SDL_dx5video.c a. Right-click SDL_dx5video.c and select "view code". b. Go to line 1516 and change "#if 0" to "#if 1". This change is required for DDRAW to work. #if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */ if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { video->flags |= SDL_HWSURFACE; } else { video->flags |= SDL_SWSURFACE; } 7. Compile! **(2003) If VS2003 complains about not finding files then rename the SDL folder to a shorter name or move it directly under root. 8. (2002) (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) Check C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release" for SDL.lib C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release" for "sdlmain.lib" COMPILE SDL_NET (2002) (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) 1. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_net-1.2.8\VisualC", unzip Visualc.zip and open SDL_net_VS2008.sln. Upgrade if prompted. 2. Right-click "Solution 'SDL_net'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "SDL_net" is set to "Release" and that "Build" is checked and then click "Close". Uncheck "Showinterfaces" if shown. 3. Right-click "sdl_net" and select properties. a. Set "Configuration Type" to Static Library (.lib) **If you want to keep SDL_net.DLL seperate from DOSBox.exe then set to "Dynamic Library (.dll)" b. (2002) Click on "Librarian" "General" and select "Output File". Enter the following: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\sdlnet\VisualC\Release\sdl_net.lib (2002) (2003) c. Go to C:\Users\username\appdata\local\Microsoft\VisualStudio\7.0 d. Verify that VCComponents.dat exists. If not then create it. e. Open VCComponents.dat and add the following to the existing lines: Total additions including the ones above should be: Include Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\include Library Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\SDLmain\Release;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\Release (2005) (2008) c. In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "INCLUDE FILES" add: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\include For "LIBRARY FILES" add: "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release" for SDL.lib "C:\Build\DOSBOX\SDL-1.2.15\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release" for "sdlmain.lib" (2010) (2012) (2013) (2015) (2017) c. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\include d. Click on "Library Directories" and update to add: "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release" for SDL.lib "C:\Build\DOSBOX\SDL-1.2.15\XXXX\XXXX\COMPILE\VisualC\SDLmain\Release" for "sdlmain.lib" e. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Go to sdlnet.c and comment out Lines 163-237 as follows. If you don't then you'll get an error when you try to compile DOSBOX. DOSBOX doesn't use this function anyway: ERROR: "1>sdl_net.lib(SDLnet.obj) : error LNK2019: unresolved external symbol _GetAdaptersInfo@8 referenced in function _SDLNet_GetLocalAddresses 1>.\Release/dosbox.exe : fatal error LNK1120: 1 unresolved externals" /* int SDLNet_GetLocalAddresses(IPaddress *addresses, int maxcount) { int count = 0; #ifdef SIOCGIFCONF #ifndef _SIZEOF_ADDR_IFREQ #define _SIZEOF_ADDR_IFREQ sizeof #endif SOCKET sock; struct ifconf conf; char data[4096]; struct ifreq *ifr; struct sockaddr_in *sock_addr; sock = socket(AF_INET, SOCK_DGRAM, 0); if ( sock == INVALID_SOCKET ) { return 0; } conf.ifc_len = sizeof(data); conf.ifc_buf = (caddr_t) data; if ( ioctl(sock, SIOCGIFCONF, &conf) < 0 ) { closesocket(sock); return 0; } ifr = (struct ifreq*)data; while ((char*)ifr < data+conf.ifc_len) { if (ifr->ifr_addr.sa_family == AF_INET) { if (count < maxcount) { sock_addr = (struct sockaddr_in*)&ifr->ifr_addr; addresses[count].host = sock_addr->sin_addr.s_addr; addresses[count].port = sock_addr->sin_port; } ++count; } ifr = (struct ifreq*)((char*)ifr + _SIZEOF_ADDR_IFREQ(*ifr)); } closesocket(sock); #elif defined(__WIN32__) PIP_ADAPTER_INFO pAdapterInfo; PIP_ADAPTER_INFO pAdapter; PIP_ADDR_STRING pAddress; DWORD dwRetVal = 0; ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) SDL_malloc(sizeof (IP_ADAPTER_INFO)); if (pAdapterInfo == NULL) { return 0; } if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) == ERROR_BUFFER_OVERFLOW) { pAdapterInfo = (IP_ADAPTER_INFO *) SDL_realloc(pAdapterInfo, ulOutBufLen); if (pAdapterInfo == NULL) { return 0; } dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen); } if (dwRetVal == NO_ERROR) { for (pAdapter = pAdapterInfo; pAdapter; pAdapter = pAdapter->Next) { for (pAddress = &pAdapterInfo->IpAddressList; pAddress; pAddress = pAddress->Next) { if (count < maxcount) { addresses[count].host = inet_addr(pAddress->IpAddress.String); addresses[count].port = 0; } ++count; } } } SDL_free(pAdapterInfo); #endif return count; }*/ 6. Compile! 7. Check "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_net-1.2.7\VisualC\Release" for sdl_net.lib. COMPILE LIBOGG 1. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg-1.3.2\win32\VSXXXX" and open the "static" .sln file. Upgrade if prompted. 2. Right-click "Solution 'libogg_static'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release", "Release Library" or "LIB Release" if not then change them to that. Verify that "libogg_static" is set to "Release" and that "Build" is checked and then click "Close". 3. Right-click "libogg_static" and select properties. a. Set "Configuration Type" to Static Library (.lib) 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg-1.3.2\win32\VSXXXX\Win32\Release COMPILE LIBVORBIS 1. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis-1.3.5\win32\VSXXXX" and open the "static" .sln file. Upgrade if prompted. 2. Right-click "Solution 'vorbis_static'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "vorbis_static,libvorbisfile" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click each "vorbis_static,libvorbisfile"and select properties. a. Set "Configuration Type" to Static Library (.lib) (2002) (2003) b. Go to C:\Users\username\appdata\local\Microsoft\VisualStudio\7.0 c. Verify that VCComponents.dat exists. If not then create it. d. Open VCComponents.dat and add the following to the existing lines: Include Dirs=;C:\Build\DOSBOX\VSXXXX\XXXX\COMPILE\libogg\include\ogg (2005) (2008) b. In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "INCLUDE FILES" add: C:\Build\DOSBOX\VSXXXX\XXXX\COMPILE\libogg\include\ogg (2010) (2012) (2013) (2015) (2017) b. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\VSXXXX\XXXX\COMPILE\libogg\include\ogg c. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis-1.3.5\win32\VSXXXX\Win32\Release COMPILE FLAC 1. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1" and open the "flac.sln" file. Upgrade if prompted. 2. Right-click "Solution 'FLAC'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "libFLAC_dynamic, libFLAC_static" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click each "libFLAC_dynamic, libFLAC_static"and select properties. a. Set "Configuration Type" to Static Library (.lib) b. Copy C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg\include\ogg to C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1\include\ogg c. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\XXXX\XX\COMPILE\flac-1.3.1\objs\release\lib COMPILE SDL_SOUND 1. Go to "C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL_sound-1.0.3\VisualC" and open the "sdl_sound.dsw" file. Upgrade if prompted. 2. Right-click "Solution 'sdl_sound'" and select "Configuration Manager. Set "Active solution configuration" and set to "Release". Verify that "sdl_sound_dll,sdl_sound_static" are set to "Release" and that "Build" is checked and then click "Close". 3. Right-click "sdl_sound_dll,sdl_sound_static" and select properties. a. Set "Configuration Type" to Static Library (.lib) (2002) (2003) b. Go to C:\Users\username\appdata\local\Microsoft\VisualStudio\7.0 c. Verify that VCComponents.dat exists. If not then create it. d. Open VCComponents.dat and add the following to the existing lines: Include Dirs=;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include;C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1\include;C:\Build\DOSBOX\multi\VS2017\XP\COMPILE\libvorbis-1.3.5\include (2005) (2008) b. In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "INCLUDE FILES" add: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1\include C:\Build\DOSBOX\multi\VS2017\XP\COMPILE\libvorbis-1.3.5\include (2010) (2012) (2013) (2015) (2017) b. Select "VC++ directories" then "Include Directories" and add the following directory: C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\multi\XXXX\XXXX\COMPILE\flac-1.3.1\include C:\Build\DOSBOX\multi\VS2017\XP\COMPILE\libvorbis-1.3.5\include c. Click "Apply" and then "OK" 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Compile! 6. Check C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound-1.0.3\VisualC\win32lib In SDL_sound.c Remove: #if (defined SOUND_SUPPORTS_MIKMOD) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MIKMOD; #endif #if (defined SOUND_SUPPORTS_MODPLUG) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MODPLUG; #endif #if (defined SOUND_SUPPORTS_MODPLUG) { 0, &__Sound_DecoderFunctions_MODPLUG }, #endif #if (defined SOUND_SUPPORTS_MIKMOD) { 0, &__Sound_DecoderFunctions_MIKMOD }, #endif Delete decoders\mikmod.c from both projects Delete decoders\modplug.c from both projects. Delete decoders\smpeg.c from both projects COMPILE DOSBOX 1. Go to C:\Build\XXXX\XXXX\COMPILE\DOSBOX\dosboxsvn\dosbox\visualc_net and click on dosbox.sln and upgrade if prompted. 2. In Solution Explorer right-click "Solution 'dosbox" and select "Configuration Manager". Set "Active solution configuration to "Release". Verify that "dosbox" is set to "Release" and checked. 3. In Solution Explorer right-click dosbox and select properties. (2002) (2003) c. Go to C:\Users\username\appdata\local\Microsoft\VisualStudio\7.0 d. Verify that VCComponents.dat exists. If not then create it. e. Open VCComponents.dat and add the following to the existing lines: Include Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\include;C:\Build\XXXX\XXXX\COMPILE\lpng1632;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\sdlnet;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\include;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\zlib;C:\Build\DOSBOX\\XXXX\XXXX\COMPILE\SDL_sound-1.0.3;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound-1.0.3;C:\Build\DOSBOX\XXXX\XXXX\\COMPILE\libogg;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis Library Dirs=;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\SDLmain\Release;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL\VisualC\SDL\Release;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\sdlnet\VisualC\Release;C:\Build\DOSBOX\\XXXX\XXXX\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug;C:\Build\DOSBOX\\XXXX\XXXX\COMPILE\flac-1.3.1\objs\release\lib;C:\Build\DOSBOX\\XXXX\XXXX\COMPILE\libogg\win32\VS2010\Win32\Release;C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis\win32\VS2010\Win32\Release (2005) (2008) a. In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "INCLUDE FILES" add the following if not already added: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_net-1.2.8 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\XXXX\XXXX\COMPILE\zlib C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1\objs\release\lib C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg\win32\VS2010\Win32\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis\win32\VS2010\Win32\Release For "LIBRARY FILES" add the following if not already added: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib C:\Build\DOSBOX\XXXXX\XXXX\COMPILE\SDL_net-1.2.8\VisualC\Release C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1\objs\release\lib C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg\win32\VS2010\Win32\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis\win32\VS2010\Win32\Release (2010) (2012) (2013) (2015) (2017) a. Select "VC++ Directories" and then "Include Directories". b. Add the following directories: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_net-1.2.8 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\include C:\Build\DOSBOX\XXXX\XXXX\COMPILE\zlib C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Include C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1 C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libvorbis d. Select "Library Directories" and add the following directories: C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL-1.2.15\VisualC\SDLmain\Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release C:\Build\DOSBOX\XXXX\XXXX\COMPILE\lpng1632\projects\visualc71\Win32_LIB_Release\ZLib C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_net-1.2.8\VisualC\Release C:\BUILD\DOSBOX\XXXX\XXXX\COMPILE\DXLEGACY\Lib\x86" C:\Build\DOSBOX\XXXX\XXXX\COMPILE\SDL_sound\VisualC\sdl_sound_static___Win32_Debug C:\Build\DOSBOX\XXXX\XXXX\COMPILE\flac-1.3.1\objs\release\lib C:\Build\DOSBOX\XXXX\XXXX\COMPILE\libogg\win32\VS2010\Win32\Release C:\Build\DOSBOX\XXXX\XXXXCOMPILE\libvorbis\win32\VS2010\Win32\Release 4. Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) 5. Expand "Linker" and select "Input". Replace the contents of "Input" with the following: (2002) (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) sdl_sound_static.lib libFLAC_static.lib libogg_static.lib libvorbis_static.lib dinput8.lib dxguid.lib opengl32.lib winmm.lib zlib.lib libpng.lib sdl_net.lib sdlmain.lib sdl.lib odbc32.lib odbccp32.lib ws2_32.lib or sdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;dinput8.lib;dxguid.lib;opengl32.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) CHANGES MADE TO ORIGINAL Added: dinput8.lib dxguid.lib Removed: curses.lib (Only needed for DOSBox Debug build) 6. In solution explorer expand "Source Files" and go to visualc and then config.h. Open config.h 7. Change #define C_CORE_INLINE 0 to #define C_CORE_INLINE 1 and then save config.h 8. Compile DOSBOX. **If you ever receive an error about debugging information being corrupt then: a. Right-click on "dosbox" in solution and select properties. b. Click on "Linker" and then click on "Debugging", set "Generate Debug Info" to "No" 9. Go here for the DOSBox binary: "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\dosboxsvn\dosbox\visualc_net\Release" TO DO: DEBUG SUPPORT CURSES http://pdcurses.sourceforge.net COMPILE DOSBOX USING VISUAL STUDIO 2005/2008 for Windows 95-98-NT4-2000 1. See above directions for setting up environment. 2. Go to C:\Build\DOSBOX\XXXX\XXXX\COMPILE\dosboxsvn\dosbox\visualc_net and click on dosbox.sln. 3. In Solution Explorer right-click dosbox and select properties In VS go to Tools->Options-> Project and Solutions -> VC++ Directories For "EXECUTABLE FILES" add: "C:Build\DOSBOX\XXXX\XXXX\COMPILE\LegacyExtender" For "LIBRARY FILES" add: "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\LegacyExtender" for SDL.lib 4. Click on "Linker" and select "Input" and add these dependencies: legacyextender.lib kernel32.lib user32.lib ole32.lib End result should look like this: legacyextender.lib kernel32.lib user32.lib ole32.lib sdl_sound_static.lib libFLAC_static.lib libogg_static.lib libvorbis_static.lib dinput8.lib dxguid.lib opengl32.lib winmm.lib zlib.lib libpng.lib sdl_net.lib sdlmain.lib sdl.lib odbc32.lib odbccp32.lib ws2_32.lib or legacyextender.lib;kernel32.lib;user32.lib;ole32.lib;sdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;dinput8.lib;dxguid.lib;opengl32.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) 5. Verify that "Ignore All Default Libaries" is set to "No". 6. For "Ignore Specific Library" add the following: kernel32.lib user32.lib ole32.lib 7. Click "Debugging" and set "Generate Debug Info" to "No". 8. Click on "Build Events", "Post-Build Event" and set "Command Line to "EditVersion "$(TargetPath)" 4.0" 9. Compile! REMOVING ACTIVE DESKTOP REQUIREMENT FOR NT3.5x,95,NT4 To remove IE4+ Active Desktop requirement comment out the following in DOSBox src/misc/cross.cpp. This will also cause the DOSBox icon to not show. Once done the DOSBox dosbox.conf file will be stored in C:\DOSBOX misc/cross.cpp Comment out Lines #42 and #52 #ifdef WIN32 static void W32_ConfDir(std::string& in,bool create) { int c = create?1:0; char result[MAX_PATH] = { 0 }; /* BOOL r = SHGetSpecialFolderPath(NULL,result,CSIDL_LOCAL_APPDATA,c); if(!r || result[0] == 0) r = SHGetSpecialFolderPath(NULL,result,CSIDL_APPDATA,c); if(!r || result[0] == 0) { char const * windir = getenv("windir"); if(!windir) windir = "c:\\windows"; safe_strncpy(result,windir,MAX_PATH); char const* appdata = "\\Application Data"; size_t len = strlen(result); if(len + strlen(appdata) < MAX_PATH) strcat(result,appdata); if(create) mkdir(result); }*/ in = result; } #endif REMOVE DIRECTSOUND,DIRECTDRAW AND OPENGL IN SDL AND DOSBOX FOR NT 3.51 SDL SOURCE NT 3.50-3.51 Remove DirectX and OpenGL support from SDL Make the following changes to SDL_config_win32.h: REMOVE #define SDL_AUDIO_DRIVER_DSOUND 1 #define SDL_VIDEO_DRIVER_DDRAW 1 #define SDL_VIDEO_OPENGL 1 #define SDL_VIDEO_OPENGL_WGL 1 DOSBOX SOURCE src/visualc/config.h REMOVE /* Define to 1 to use opengl display output support */ #define C_OPENGL 1 /* Define to 1 if you have the header file. #define HAVE_DDRAW_H 1 Linker Remove the following Libraries: ws2_32.lib,opengl32.lib,dinput8.lib,dxguid.lib Add the following: wsock32.lib Linker Input should look like: legacyextender.lib kernel32.lib user32.lib ole32.lib sdl_sound_static.lib libFLAC_static.lib libogg_static.lib libvorbis_static.lib winmm.lib zlib.lib libpng.lib sdl_net.lib sdlmain.lib sdl.lib odbc32.lib odbccp32.lib wsock32.lib or legacyextender.lib;kernel32.lib;user32.lib;ole32.libsdl_sound_static.lib;libFLAC_static.lib;libogg_static.lib;libvorbis_static.lib;winmm.lib;zlib.lib;libpng.lib;sdl_net.lib;sdlmain.lib;sdl.lib;odbc32.lib;odbccp32.lib;wsock32.lib;%(AdditionalDependencies) TROUBLESHOOTING VISUAL STUDIO Use /Verbose in linker for more lengthy output for troubleshooting OLD INFO DOSBOX ON NT 3.50 and NT 3.51 NT 3.51 Make the following changes to "SDL.DSP": REMOVE Directx.h SDL_dx5audio.c SDL_dx5audio.h SDL_dx5events.c SDL_dx5events_c.h SDL_dx5video.c SDL_dx5video.h SDL_dx5yuv.c SDL_dx5yuv_c.h NT 3.50 ADD #define NO_CHANGEDISPLAYSETTINGS 1 Make the following changes to "SDL.DSP": REMOVE Directx.h SDL_dx5audio.c SDL_dx5audio.h SDL_dx5events.c SDL_dx5events_c.h SDL_dx5video.c SDL_dx5video.h SDL_dx5yuv.c SDL_dx5yuv_c.h SDL_joystick.c SDL_joystick_c.h SDL_mmjoystick.c SDL_sysjoystick.h DOSBOX /* Define to 1 to enable internal modem support, requires SDL_net */ #define C_MODEM 1 /* Define to 1 to enable IPX networking support, requires SDL_net */ #define C_IPX 1 COMPILED DOSBOX Tested using DOSBox SVN 8-27-2017 Windows 95 v4.00.950 (2003) DOSBox works Install dependencies Windows Installer 2 (Not required by DOSBox) opengl95.exe (opengl32.dll) Winsock 2.2 w95ws2setup.exe (ws2_32.dll) Visual C++ 7.1 MSVCR71.dll MSVCP71.dll SHELL32.dll:SHGetSpecialFolderPathA Install IE4+ Active Desktop If IE5 SP2 IE5Setup.exe /C:"ie5wzd /e:IE4Shell_WIN /I:Y" (2005) DOSBox does not work. GetLongPathNameW Use Recompiled MSVCR80.DLL IsDebuggerPresent Need to look into removing in MSVCR80 https://www.doomworld.com/forum/topic/50983-windows-95-compatibility/ Windows 98SE (2003) (2005) DOSBox works (2017) DOSBox does not work Windows NT4 SP6 (2003) DOSBox works (2005) DOSBox works if you set C/C++->Code Generation-> and set Runtime Library to Multi-threaded for all libraries in your project. OLD INFO PREREQUISITES Microsoft Visual C++ 2005 Redistributable Recompiled MSVCR80.dll Out of the box without any changes DOSBox will not run on NT4 due to a dependency on the compile binary requiring MSVCR80.DLL requiring "GetLongPathNameW" which NT4 does not support. By modifying the MSVCR80 source and recompiling the dll you can then run DOSBox under NT4. (2017) DOSBox does not work THE BELOW IS NOT NEEDED IF YOU SET THE FOLLOWING FOR ALL OF THE PROJECTS IN SDL: Click on C/C++->Code Generation-> and set Runtime Library to Multi-threaded (/MT) If you do not set /MT then you will need to do the following to get DOSBox to work on NT4 when compiled with Visual Studio 2005 INSTRUCTIONS TO RECOMPILE MSVCR80 WITH MICROSOFT VISUAL STUDIO 2005 If you receive a "GetLongPathNameW" error when you launch DOSBox in NT4 then it's because DOSBox was compile with Visual Studio 2005 or newer. To fix this you'll need to do the following to compile a new MSVCR80.DLL. The following instructions have only been tested with Visual Studio 2005. 1. Go to the following folder: C:\Program Files\Microsoft Visual Studio 8\VC\CRT\SRC or C:\Program Files (x86)\Microsoft Visual Studio 8\VC\CRT\SRC **Make a copy of this SRC folder and then change the directories mentioned in this guide to that folder. 2. Run the following: copy _SAMPLE_.RC MSVCR80.RC copy SAMPLE_P.RC MSVCP80.RC copy SAMPLE_M.RC MSVCM80.RC copy SAMPLE_P.DEF MSVCP80.DEF copy SAMPLD_P.DEF MSVCP80D.DEF copy SAMPLE_M.DEF MSVCM80.DEF copy SAMPLD_M.DEF MSVCM80D.DEF copy SAMPLE_U.DEF MSVCU80.DEF copy SAMPLD_U.DEF MSVCU80D.DEF copy Intel\_SAMPLE_.DEF Intel\MSVCR80.DEF copy Intel\_SAMPLD_.DEF Intel\MSVCR80D.DEF 3. a. Uncheck Read-Only on each of the below files: b. Open each of the below .DEF files and change the "LIBRARY" file to match the name of the DEF file. MSVCP80.DEF MSVCP80D.DEF MSVCM80.DEF MSVCM80D.DEF MSVCU80.DEF MSVCU80D.DEF Intel\MSVCR80.DEF Intel\MSVCR80D.DEF 4. a. Remove read-only on the "makefile" b. Edit the "makefile" in the same "src" directory as the .DEF files and change the lines in the makefile to match the following: RETAIL_DLL_NAME=MSVCR80 RETAIL_LIB_NAME=MSVCR80 RETAIL_DLLCPP_NAME=MSVCP80 RETAIL_LIBCPP_NAME=MSVCP80 RETAIL_DLLMIXED_NAME=MSVCM80 RETAIL_LIBMIXED_NAME=MSVCM80 RETAIL_LIBPURE_NAME=MSVCU80 RETAIL_PT_LIBMIXED_NAME=PTRUSTM RETAIL_PT_LIBPURE_NAME=PTRUSTU DEBUG_DLL_NAME=MSVCR80D DEBUG_LIB_NAME=MSVCR80D DEBUG_DLLCPP_NAME=MSVCP80D DEBUG_LIBCPP_NAME=MSVCP80D DEBUG_DLLMIXED_NAME=MSVCM80D DEBUG_LIBMIXED_NAME=MSVCM80D DEBUG_LIBPURE_NAME=MSVCU80D DEBUG_PT_LIBMIXED_NAME=PTRUSTMD DEBUG_PT_LIBPURE_NAME=PTRUSTUD RC_NAME=MSVCR80 RCCPP_NAME=MSVCP80 RCMIXED_NAME=MSVCM80 3. a. Remove Read-only on "crtlib.c" b. Edit "crtlib.c" and replace the following line with ret - 0 Code should look as follows: NEW ret = 0; if (ret == 0 || ret >= _countof(moduleFilePath)) ORIGINAL ret = GetLongPathNameW(tempPath, moduleFilePath, _countof(moduleFilePath)); if (ret == 0 || ret >= _countof(moduleFilePath)) 4. a. Remove Read-only from "makefile" b. Remove the -wx option from lines 302,303,304,307,308 and 309. c. Remove Read-only from "makefile.sub" d. Remove the -wx option from line 103. 5. a. Open a "Microsoft Visual Studio 2005 Command Prompt" as an Administrator b. Go here: "C:\Program Files\Microsoft Visual Studio 8\VC\crt\src" or "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\crt\src" c. Run this command: for %i in (dll mt xdll xmt) do pushd intel\%i_lib && lib /extract:..\build\intel\%i_obj\unhandld.obj eh.lib && popd 6. In "sysdm.cpl" under "Environment Variables"->"System" Add the variable "VCTOOLS" with a value of: "C:\Program Files\Microsoft Visual Studio 8\VC" or "C:\Program Files (x86)\Microsoft Visual Studio 8\VC" 7. Open a "Microsoft Visual Studio 2005 Command Prompt" as an Administrator 8. Go to: "C:\Program Files\Microsoft Visual Studio 8\VC\crt\src" or "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\crt\src" 7. Type the following: set VCTOOLS=C:\Program Files\Microsoft Visual Studio 8\VC or set VCTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 8\VC C:\Program Files (x86)\Microsoft Visual Studio 8\VC\CRT\SRC BLDNT 8. The compiled DLLs are located here: C:\Program Files (x86)\Microsoft Visual Studio 8\VC\crt\src\build\intel The only one we need for DOSBox is MSVCR80.DLL 9. Backup the SRC folder with the changes you made and revert back to the old SRC folder. INFO This guide static links to the CRT, this matches the MinGW configuration. I see no alternate without causing problems for the end user and breaking compatibility. MULTI-TARGETING For some reason when targetting v71 in V2017 while compiling SDL it complained about missing "sal.h". No "sal.h" includes with VS2003. Copied "sal.h" from "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\crt\src" to the DirectX include directory which made it happy. THIRD PARTY PATCHES DirectX SDK newer than August 2007 only support d3d9+ (98+) TESTING i586 (Pentium) pcem qemu i686 (Pentium Pro+) qemu vmware workstation\player (No ddraw in 9x and NT4) TROUBLESHOOTING VISUAL STUDIO Use /Verbose in linker for more lengthy output for troubleshooting DOSBOX On opening DOSBox if you see a black screen with a blinking prompt then this is because the change in SDL in SDL_dx5video.c was not set, without this change the only solution is to run DOSBox in 16bit color or to use WARP. OLD DOSBOX (2002) 8. Go to "C:\Build\DOSBOX\XXXX\XXXX\COMPILE\dosboxsvn\dosbox\src" a. Open "winres.rc" with Notepad++. b. Change #include "afxres.h" to #include "Windows.h" and save winres.rc (2003) (2005) (2008) (2010) (2012) (2013) (2015) (2017) 8. In Solution Explorer right-click winres.rc and select "View Code" a. Change #include "afxres.h" to #include "Windows.h" and save winres.rc