winport: remove userconfig, replace with msbuild-based system. easily support newer SSE versions while we're at it

This commit is contained in:
zeromus 2016-03-22 06:27:58 +00:00
parent 8e7c58e11f
commit 9766d2d8a6
7 changed files with 2599 additions and 2575 deletions

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="IntegrityChecks" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
<PropertyGroup>
<SSE_Level>0,10,20,30,31,40</SSE_Level> (31 is SSSE3; 0 is disabled. if using x64, SSE2 or better will be forcibly enabled)
<AVX_Level>0,10,20</AVX_Level> (10 is AVX; 20 is AVX2; 0 is disabled. if using AVX, SSE2 or better will be forcibly enabled)
<DEVELOPER>true</DEVELOPER> (enable dev+ feature)
<GDB_STUB>true</GDB_STUB> (enable GDB stub feature)
<EXPERIMENTAL_WIFI_COMM>true</EXPERIMENTAL_WIFI_COMM> (enable EXPERIMENTAL_WIFI_COMM feature)
</PropertyGroup>
-->
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
#ifndef _CONFIG_H
#define _CONFIG_H
#include "userconfig.h"
#endif

View File

@ -1,19 +0,0 @@
#ifndef _USERCONFIG_H
#define _USERCONFIG_H
//this is a default file. it should not be edited, or else you will mess up the defaults.
//to customize your build, place a customized copy in the userconfig directory
//(alongside this defaultconfig directory)
//disables SSE and SSE2 optimizations (better change it in the vc++ codegen options too)
//note that you may have to use this if your compiler doesn't support standard SSE intrinsics
//#define NOSSE
//#define NOSSE2
//#define DEVELOPER //enables dev+ features
//#define GDB_STUB //enables the gdb stub. for some reason this is separate from dev+ for now. requires DEVELOPER.
//#define EXPERIMENTAL_WIFI_COMM //enables experimental wifi communication features which do not actually work yet
//basic wifi register emulation is still enabled, to at least make it seem like the wifi is working in an empty universe
#endif //_USERCONFIG_H

View File

@ -11,10 +11,19 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<!-- reformat version to be more useful -->
<PropertyGroup>
<NDS_VSVER Condition="'$(VisualStudioVersion)' == '10.0'">10</NDS_VSVER>
<NDS_VSVER Condition="'$(VisualStudioVersion)' == '11.0'">11</NDS_VSVER>
<NDS_VSVER Condition="'$(VisualStudioVersion)' == '12.0'">12</NDS_VSVER>
<NDS_VSVER Condition="'$(VisualStudioVersion)' == '14.0'">14</NDS_VSVER>
<!-- others may not be supported, so lets not list them here -->
<NDS_VisualStudioName Condition="'$(NDS_VSVER)' == '10'">VS2010</NDS_VisualStudioName>
<NDS_VisualStudioName Condition="'$(NDS_VSVER)' == '14'">VS2015</NDS_VisualStudioName>
</PropertyGroup>
<!-- General project setup -->
<PropertyGroup>
<NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '10.0'">VS2010</NDS_VisualStudioName>
<NDS_VisualStudioName Condition="'$(VisualStudioVersion)' == '14.0'">VS2015</NDS_VisualStudioName>
<IntDir>$(SolutionDir).obj\$(NDS_VisualStudioName)-$(Platform)-$(Configuration)\</IntDir>
<OutDir>$(SolutionDir)__bins\</OutDir>
<TargetName>$(ProjectName)-$(NDS_VisualStudioName)-$(Configuration)</TargetName>
@ -22,6 +31,28 @@
<TargetPath>$(OutDir)$(TargetName).exe</TargetPath>
</PropertyGroup>
<!-- load user preferences -->
<PropertyGroup>
<UserProps_Path>$(MSBuildThisFileDirectory)DeSmuME-user.props</UserProps_Path>
<UserProps_Path Condition="!Exists($(UserProps_Path))">$(MSBuildThisFileDirectory)DeSmuME-user.props.template</UserProps_Path>
</PropertyGroup>
<Import Project="$(UserProps_Path)" />
<!-- some defaults and validation of user prefs -->
<PropertyGroup>
<SSE_Level Condition="'$(SSE_Level)' == ''">20</SSE_Level>
<AVX_Level Condition="'$(AVX_Level)' == ''">0</AVX_Level>
<!-- dont use optimizations the compiler cant handle. this isn't accurate to the compiler capabilities but we're only supporting 2010 and 2015 -->
<SSE_Level Condition="'$(NDS_VSVER)' &lt; '14' AND '$(SSE_Level)' &gt; '20'">20</SSE_Level>
<!-- validation: x64 14.0 can't handle SSE_Level 1.0 and anyway SSE2 is automatically available -->
<SSE_Level Condition="'$(Platform)' == 'x64' AND '$(SSE_Level)' &lt; '20'">20</SSE_Level>
<!-- no AVX support on 2010 -->
<AVX_Level Condition="'$(NDS_VSVER)' &lt; '14' AND '$(AVX_Level)' != '0'">0</AVX_Level>
<!-- AVX implies SSE2 at least -->
<SSE_Level Condition="'$(AVX_Level)' != '0' AND '$(SSE_Level)' &lt; '20'">20</SSE_Level>
</PropertyGroup>
<!-- global optimizations -->
<PropertyGroup>
<WholeProgramOptimization Condition="'$(Configuration)' == 'Release'">true</WholeProgramOptimization>
@ -77,14 +108,33 @@
<!-- Not sure why we chose this, study it later -->
<CallingConvention>Cdecl</CallingConvention>
<RuntimeLibrary Condition="'$(Configuration)' == 'Debug'">MultiThreadedDebugDll</RuntimeLibrary>
<RuntimeLibrary Condition="'$(Configuration)' != 'Debug'">MultiThreadedDll</RuntimeLibrary>
<!-- optimizatons / instruction sets -->
<EnableEnhancedInstructionSet Condition="'$(SSE_Level)' >= '10'">StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet Condition="'$(SSE_Level)' >= '20'">StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet Condition="'$(SSE_Level)' >= '30'">StreamingSIMDExtensions3</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet Condition="'$(AVX_Level)' >= '10'">AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet Condition="'$(AVX_Level)' >= '20'">AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<PreprocessorDefinitions Condition="'$(SSE_Level)' >= '10'">ENABLE_SSE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(SSE_Level)' >= '20'">ENABLE_SSE2=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(SSE_Level)' >= '30'">ENABLE_SSE3=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(SSE_Level)' >= '31'">ENABLE_SSSE3=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(SSE_Level)' >= '40'">ENABLE_SSE4=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(AVX_Level)' >= '10'">ENABLE_AVX=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(AVX_Level)' >= '20'">ENABLE_AVX2=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- export other user options to preprocessor -->
<PreprocessorDefinitions Condition="'$(DEVELOPER)' == 'true'">DEVELOPER=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(GDB_STUB)' == 'true'">GDB_STUB=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(EXPERIMENTAL_WIFI_COMM)' == 'true'">EXPERIMENTAL_WIFI_COMM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<OutputFile>$(TargetPath)</OutputFile>
<ProgramDatabaseFile>$(IntDir)TargetName.pdb</ProgramDatabaseFile>
<!-- deps config for x64 -->
<AdditionalLibraryDirectories Condition="'$(Platform)' == 'x64'">.\zlib128;agg;.libs;.libs\x64</AdditionalLibraryDirectories>
@ -95,7 +145,7 @@
<AdditionalDependencies Condition="'$(Platform)' == 'Win32'">directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;zlib-vc8-Win32.lib;agg-2.5.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- special deps config for newer VS -->
<AdditionalDependencies Label="Configuration" Condition="'$(VisualStudioVersion)' == '14.0'">legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Label="Configuration" Condition="'$(NDS_VSVER)' == '14'">legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<!-- general deps config -->
<AdditionalDependencies>lua51.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -172,7 +222,6 @@
</UsingTask>
<Target Name="UNDUPOBJ">
<message importance="high" text="PLATFORM: $(Platform)"/>
<!-- see stackoverflow topics for discussion on why we need to do some loopy copying stuff here -->
<ItemGroup>
<ClCompileCopy Include="@(ClCompile)"/>

View File

@ -1 +0,0 @@
see the defaultconfig directory for more information on what this is all about