DOSBox Compilation Guides

General information and assistance with DOSBox.

DOSBox Compilation Guides

Postby DosFreak » 2017-8-30 @ 20:53

The intent of the attached guides is to update the documentation on the DOSBox WIKI:
https://www.dosbox.com/wiki/BuildingDOSBox
Attachments
vc6redistsetup_enu.zip
(1.71 MiB) Downloaded 1 time
DOSBOXVisualStudioMultTarget.txt
(28.22 KiB) Downloaded 3 times
DOSBOXVisualStudioIndiv.txt
(36.82 KiB) Downloaded 3 times
DOSBOXMingw64.txt
(4.61 KiB) Downloaded 5 times
DOSBOXMINGW.txt
(7.7 KiB) Downloaded 7 times
dosboxsvn09182017-3.51-vista.zip
(6.29 MiB) Downloaded 3 times
dosboxsvn09092017-MINGW64-vista+..zip
(1.66 MiB) Downloaded 6 times
dosboxsvn09092017-MINGW.zip
(1.48 MiB) Downloaded 8 times
User avatar
DosFreak
l33t++
 
Posts: 9429
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: DOSBox Compilation Guides

Postby DosFreak » 2017-9-20 @ 12:30

Compiled DOSBox not working in Vmware with a Windows 10 guest. Black screen with blinking prompt. Have to set compatibility mode 16bit color. Same executable works fine on the host. Issue with Vmware drivers?

0.74 works and SDL 1.2.15 w/ DOSBox compiled with GDI only works.

//Enabled WARP in Windows 10 in Vmware Guest and DOSBox working fine. Shitty Vmware driver. v8.15.1.50 12-12-2016 WDDM 1.1

Same behavior on both MINGW and MSVC builds.
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"Who's got time to read all the way down to the bottom of an email?"
User avatar
DosFreak
l33t++
 
Posts: 9429
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: DOSBox Compilation Guides

Postby DosFreak » 2017-9-21 @ 12:03

COMPILING DOSBOX
https://github.com/aqualung99/dosbox-0. ... 75GLES.txt
viewtopic.php?f=31&t=55706
MAC: https://hexeract.wordpress.com/2016/09/ ... os-sierra/

MSVC
Command to gather all executables and dlls
Equivalent to "make clean"
Need to verify dependencies work in dosbox
Add DOSBox files to package
Precompiled libraries
static link libraries or not?
viewtopic.php?t=3944
PNGLIB PATCH viewtopic.php?f=32&t=53116&p=573451#p573451
Support of OpenGL in NT3.51 or use Mesa3D?


GIT
GIT vs VisualSVN and TortoiseSVN
Visual Studio 2017 GIT support
https://github.com/svn2github/dosbox
https://git-for-windows.github.io/
Example:
git clone https://github.com/libretro/RetroArch.git retroarch
cd retroarch
git pull

Relative paths for projects:
If C:\BUILD\Dosbox
then should be able to point to $(ProjectDir)..\whatever or ..\whatever

STATIC LINK TO MSVCRT.dll like MS does for programs that come with Windows?
May have to use /MD with WDDK 2003 SP1 compiler or PSDK 2003 SP1
Windows Server 2003 SP1 Platform SDK https://www.microsoft.com/en-us/downloa ... x?id=12261
or mabye link with the 7600.16385.1 WDK


MINGW
Review guide
Command to gather all executables and dlls
make clean
No need for autogen.sh?
nt 3.51 build for mingw
Need to verify dependencies work in dosbox
VS and mingw-w64 sdl_net 1.2.8. mingw still 1.2.7
Add DOSBox files to package
Look into static linking .libs --disable-shared and --static switches?
Use --disable-whatever switch to disable functionality that's not needed?
Precompiled libraries
Static link libraries or not?
Add Mingw, MSYS and GCC versions
viewtopic.php?t=3944
Dumping source files in /lib and /include or keeping in original directories?
QtCreator vs Codeblocks
Support of OpenGL in NT3.51 or use Mesa3D?

GIT
https://github.com/svn2github/dosbox
Example:
git clone https://github.com/libretro/RetroArch.git retroarch
cd retroarch
git pull

WGET
Example:
wget http://sourceforge.net/projects/msys2/f ... z/download -O mingw-w64-i686-nvidia-cg-toolkit-3.1-2-any.pkg.tar.xz
pacman -U mingw-w64-i686-nvidia-cg-toolkit-3.1-2-any.pkg.tar.xz


OPERATING SYSTEM COMPATIBILITY

COMPILE DOSBOX WITH COMPILERS THAT DO NOT SUPPORT WINDOWS 95

Blackwingcat vcfix
http://blog.livedoor.jp/blackwingcat/ar ... 52362.html

To use:
-----------------------
add to dosbox.cpp
#define WINVER2 0x0400
#include "commonfix.h"

and add commonfix.h to the dosbox\src directory for now.
--------------------------------------------


VS2005 compiled DOSBox

Windows 95 missing:
InterlockedCompareExchange (Fixed with LegacyExtender)

VS2010 compiled DOSBox

Windows 95 missing:
EncodePointer (Fixed with LegacyExtender)
DecodePointer (Fixed with LegacyExtender)
FindFirstFileExA
HeapSetInformation (Fixed with LegacyExtender)

VS2012 compiled DOSBox

Windows 95 missing:
InitializeCriticalSectionEx
EncodePointer
DecodePointer
GetModuleHandleExW
FindFirstFileExW
InitOnceExecuteOnce
SetFilePointerEx
FlsAlloc
FlsGetValue
FlsSetValue
FlsFree
GetTickCount64
CompareStringEx
GetLocaleInfoEx
GetUserDefaultLocaleName
LCMapStringEx
IsValidLocaleName
EnumSystemLocalesEx

NT 3.5 SP0

missing:

missed functions:

KERNEL32.DLL
GetSystemTimeAsFileTime

USER32.DLL
ChangeDisplaySettingsA
EnumDisplaySettingsA

WINMM.DLL
joyGetPosEx

Reported by roytam1

Need to post mingw 3.5x build for getsystemtimeasfiletime

WINMM is likely SDL which I never removed joystick support from

USER32
Mabye SDL trying to use missing GDI features? Someone would need to code a replacement or mabye remove fullscreen support?








Add compressed audio support
viewtopic.php?f=32&t=50077
https://www.dosbox.com/wiki/Building_DOSBox_with_MinGW
SDL_Sound
Edit config.h to only compile the following otherwise math.h errors during compile:
wav
flac
ogg


BUILDBOT

DIRECTX SDK
Figure out exactly what files required from DirectX SDK see if equivalent in Windows Platform SDK can be used on operating systems less than Vista.
c:\program files (x86)\Microsoft SDKs\Windows

INCLUDE
ddraw.h
dinput.h
dsound.h
d3dtypes.h
directx.h

LIB
libdsound.a
libddraw.a
libdplayx.a
libdinput.a
libdxguid.a


C:\Program Files (X86)\Microsoft Visual Studio 8\VC\PlatformSDK\Include



Need to look into either a #define to remove ActiveDesktop or a fallback if no Active Desktop found.


THIRD PARTY PATCHES
viewtopic.php?f=32&t=35256&p=301919#p301814
https://blogs.msdn.microsoft.com/chuckw ... rtain-age/
Pixel Perfect Patch
https://roadtoalm.com/2013/10/22/use-vi ... cal-files/
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe
http://gnuwin32.sourceforge.net/packages/patch.htm

SDL2 on Windows 2000
https://www.tapatalk.com/groups/win2kga ... t1073.html
viewtopic.php?f=32&t=34770&start=60#p537272

MIDI
https://www.dosbox.com/wiki/MIDI_software_devices
viewtopic.php?f=33&t=55993

MUNT Windows 98

A multi-platform software synthesiser emulating (somewhat inaccurately) pre-GM MIDI devices such as the Roland MT-32, CM-32L, CM-64 and LAPC-I. In no way endorsed by or affiliated with Roland Corp.

viewtopic.php?f=40&t=55981

OPL3
https://sourceforge.net/p/dosbox/patches/270/
viewtopic.php?f=41&t=49327

XBRZ
viewtopic.php?f=41&t=34125

NE2000
https://sourceforge.net/p/dosbox/patches/238/

Check
https://sourceforge.net/p/dosbox/patches/125/


Need to categorize third party patches:
What are the "necessary" third party patches?
cross-platform
Never will be crossplatform
Already in DOSBox
Never will be in DOSBox
etc


-----------------------------

OLD INFO

RUNNING DOSBOX ON OLD VERSIONS OF WINDOWS

DOSBOX compiled with mingw-w64 7.2.0 run in Windows 95 missing the following:

DOSBOX
ImportPatcher shows the following missing using the lastest MinGW ver
lc_codepage_func (XP+)
fstat64 (98+)
time32 (95+)

/OPT:WIN98 WAS REMOVED IN VS2008
This switch just improves loading times

For 98/ME
/OPT:WIN98

For NT OS
/OPT:NOWIN98


NOT NEEDED

Link-time Code Generation
Whole Program Optimization

Visual Studio 2005+ do not support setting /subsystem and /osversion less than 4.00 in the linker. EDITBIN has same limitation

Sticking with Static Linking the CRT. Only see downsides to not static linking it. Potentially mabye might be a good idea for Windows Operating systems currently in support and that receive all Windows updates not just security updates.
If don't static link CRT then for XP need to install Visual Studio 2015 VCRedist.
For Vista+ the Universal CRT should be pushed through Windows Update but unknown if EOL OS will receive this update or not. (If only security updates pushed to box then will not receive the Universal CRT)
https://blogs.msdn.microsoft.com/vcblog ... ersal-crt/

Keeping this out until someone complains:
Check src/platform/sdl-win32.diff for DOSBOX SDL modifications.

Visual Studio with Mingw as the compiler
Looks like VS2017 requires remote access to a Linux system. To use it on the local filesystem requires using the App Store. Tried to use the Ubunto distro without the App Store but no luck. Ridiculous.

OLD INFO
Use VS2005 for NT4-98-2000 Visual Studio 2005 (NT4 if /MT set or if CRT recompiled)
Use VS2003 for 95,98,NT4,2000

NOT NEEDED
Use VS2008 Pre-SP1 for 2000
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"Who's got time to read all the way down to the bottom of an email?"
User avatar
DosFreak
l33t++
 
Posts: 9429
Joined: 2002-6-30 @ 16:35
Location: Your Head

Re: DOSBox Compilation Guides

Postby DosFreak » 2017-9-22 @ 13:03

Got Mesa 7.5.1 to work on Windows 95.

7.10.3 is the last ver to support Visual Studio. 6-13-2011 OpenGL 2.1

Download: https://mesa.freedesktop.org/archive/ol ... 7.x/7.5.1/
Compile with VS2008 and LegacyExtender
EDITVERSION from LegacyExtender should work if not then use VS2005 EDITBIN
EDITBIN from VS2005 C++ Command prompt "editbin /subsystem:windows,4.00 /osversion:4.0 opengl32.dll"
https://www.gamingonlinux.com/wiki/Buil ... rom_source

Copy opengl32.dll to quake 2 directory to test.

https://mesa.freedesktop.org/archive/ol ... .x/7.10.3/
https://wiki.qt.io/Cross_compiling_Mesa_for_Windows
https://wiki.qt.io/MesaLlvmpipe
https://github.com/florianlink/MesaOnWindows


OTHER

EXEVersion may work: http://louis.steelbytes.com/vs2008_vs_win40.html

https://fdossena.com/?p=mesa/build.frag
https://stackoverflow.com/questions/178 ... 7-mesa-9-1
Attachments
95Quake2Mesa7.5.1.PNG
Game Acronym List
DosBox CVS Builds
DosBox Feature Request Thread
DosBox FAQ
PC Game Compatibility List
"Who's got time to read all the way down to the bottom of an email?"
User avatar
DosFreak
l33t++
 
Posts: 9429
Joined: 2002-6-30 @ 16:35
Location: Your Head


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 3 guests