Skip to content

Commit

Permalink
Changes to block off MSVC-specific __asm blocks so that they compile …
Browse files Browse the repository at this point in the history
…for 32-bit, but not 64-bit.

Fixed Visual Studio 2008 project files, it is now possible to compile a 64-bit Windows build of DOSBox-X.
  • Loading branch information
joncampbell123 committed Feb 1, 2015
1 parent 0b7c491 commit 7159bc6
Show file tree
Hide file tree
Showing 12 changed files with 3,158 additions and 2,460 deletions.
2 changes: 1 addition & 1 deletion src/hardware/voodoo_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ INLINE UINT8 count_leading_zeros(UINT32 value)
{
INT32 result;

#if defined _MSC_VER
#if defined(_MSC_VER) && defined(_M_IX86)
__asm
{
bsr eax,value
Expand Down
2 changes: 1 addition & 1 deletion src/hardware/voodoo_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ INLINE INT32 mul_32x32_shift(INT32 a, INT32 b, INT8 shift)
{
INT32 result;

#if defined _MSC_VER
#if defined(_MSC_VER) && defined(_M_IX86)
__asm
{
mov eax,a
Expand Down
7 changes: 4 additions & 3 deletions src/libs/porttalk/porttalk.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "config.h"
#include "logging.h"

#if defined (_MSC_VER)
#if defined (_MSC_VER)
# if defined (_M_IX86)/*x86 only*/
void outportb(Bit32u portid, Bit8u value) {
__asm mov edx,portid
__asm mov al,value
Expand Down Expand Up @@ -46,7 +47,7 @@ Bit32u inportd(Bit32u portid) {
__asm mov value,eax
return value;
}

# endif
#else
void outportb(Bit32u portid, Bit8u value) {
__asm__ volatile (
Expand All @@ -72,7 +73,7 @@ Bit8u inportb(Bit32u portid) {
}
#endif

#ifdef WIN32
#if defined(WIN32) && defined(_M_IX86)/*WIN32 x86 only*/

// WIN specific
#include "sdl.h"
Expand Down
14 changes: 9 additions & 5 deletions vs2008/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* config.h.in. Generated from configure.ac by autoheader. */

/* Hand-edited by Jonathan Campbell for Visual Studio 2008 */

/*
* Copyright (C) 2002-2013 The DOSBox Team
Expand Down Expand Up @@ -48,8 +48,15 @@
*/
#undef C_DIRECTSERIAL

#ifdef _M_AMD64 /* Microsoft C++ amd64 */
# undef C_DYNAMIC_X86
# undef C_TARGETCPU
#else
/* The type of cpu this target has */
#define C_TARGETCPU X86
/* Define to 1 to use x86 dynamic cpu core */
#define C_DYNAMIC_X86 1
# define C_DYNAMIC_X86 1
#endif

/* Define to 1 to enable fluidsynth MIDI synthesis */
#undef C_FLUIDSYNTH
Expand Down Expand Up @@ -91,9 +98,6 @@
/* Define to 1 to enable screenshots, requires libpng */
#define C_SSHOT 1

/* The type of cpu this target has */
#define C_TARGETCPU X86

/* Define to 1 to use a unaligned memory access */
#define C_UNALIGNED_MEMORY 1

Expand Down
26 changes: 26 additions & 0 deletions vs2008/dosbox-x.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,59 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Debug|Win32.ActiveCfg = Debug|Win32
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Debug|Win32.Build.0 = Debug|Win32
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Debug|x64.ActiveCfg = Debug|x64
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Debug|x64.Build.0 = Debug|x64
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Release|Win32.ActiveCfg = Release|Win32
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Release|Win32.Build.0 = Release|Win32
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Release|x64.ActiveCfg = Release|x64
{8A52284E-5115-453E-AD4B-87B8FCDB1244}.Release|x64.Build.0 = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.ActiveCfg = LIB Debug|Win32
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.Build.0 = LIB Debug|Win32
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|x64.ActiveCfg = LIB Debug|x64
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|x64.Build.0 = LIB Debug|x64
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.ActiveCfg = LIB Release|Win32
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.Build.0 = LIB Release|Win32
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|x64.ActiveCfg = LIB Release|x64
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|x64.Build.0 = LIB Release|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = ReleaseWithoutAsm|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = ReleaseWithoutAsm|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = ReleaseWithoutAsm|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = ReleaseWithoutAsm|x64
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Debug|Win32.ActiveCfg = Debug|Win32
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Debug|Win32.Build.0 = Debug|Win32
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Debug|x64.ActiveCfg = Debug|x64
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Debug|x64.Build.0 = Debug|x64
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Release|Win32.ActiveCfg = Release|Win32
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Release|Win32.Build.0 = Release|Win32
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Release|x64.ActiveCfg = Release|x64
{8AB3504F-5E58-4910-AFE8-7A1E595AC3F4}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified vs2008/dosbox-x.suo
Binary file not shown.
167 changes: 167 additions & 0 deletions vs2008/dosbox-x.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
Expand Down Expand Up @@ -178,6 +181,170 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)/.."
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
Optimization="0"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="$(SolutionDir)/../include;$(SolutionDir)/../src;$(SolutionDir);$(SolutionDir)/zlib;$(SolutionDir)/sdl/include;$(SolutionDir)/libpng;$(SolutionDir)/sdlnet"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;__WIN32__"
GeneratePreprocessedFile="0"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib opengl32.lib $(SolutionDir)\..\zlibstat.lib"
ShowProgress="2"
OutputFile="$(OutDir)\DOSBox.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)/.."
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="$(SolutionDir)/../include;$(SolutionDir)/../src;$(SolutionDir);$(SolutionDir)/zlib;$(SolutionDir)/sdl/include;$(SolutionDir)/libpng;$(SolutionDir)/sdlnet"
PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;WIN32;__WIN32__"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib opengl32.lib $(SolutionDir)\..\zlibstat.lib"
ShowProgress="2"
OutputFile="$(OutDir)/DOSBox.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
Expand Down
Loading

0 comments on commit 7159bc6

Please sign in to comment.