Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,308 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9E8FD088-3571-4BCD-896D-8DBFEC3042FC}</ProjectGuid>
<RootNamespace>dxv</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>16.0.32002.118</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>..\..\..\obj\dxv\$(PlatformShortName)_$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>..\..\..\obj\dxv\$(PlatformShortName)_$(Configuration)\</IntDir>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<PropertyGroup Label="Vcpkg">
<VcpkgEnableManifest>false</VcpkgEnableManifest>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgConfiguration>Debug</VcpkgConfiguration>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Vcpkg">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgConfiguration>Debug</VcpkgConfiguration>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Vcpkg">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;..\..\..\include;..\..\..\..\libvp6\include;..\..\..\..\libvp6\corelibs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>None</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>4013;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\..\include;..\..\..\include;..\..\..\..\libvp6\include;..\..\..\..\libvp6\corelibs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>None</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>4013;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\..\include;..\..\..\..\libvp6\include;..\..\..\..\libvp6\corelibs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\include;..\..\..\include;..\..\..\..\libvp6\include;..\..\..\..\libvp6\corelibs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Lib>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="generic\dxlvinfd.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\dxl_attr.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\dxl_main.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\dxl_reg.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\dxv_init.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\vscreen.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="generic\ximage.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="win32\dxAccurateTime.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="win32\icmdxv.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="generic">
<UniqueIdentifier>{12c2bb0c-53fa-442f-812f-1e57762a8b14}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{16f6450f-7013-49fe-a82b-a2a13821ec8c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="generic\dxl_attr.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\dxl_main.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\dxl_reg.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\dxlvinfd.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\dxv_init.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="win32\icmdxv.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\vscreen.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="generic\ximage.c">
<Filter>generic</Filter>
</ClCompile>
<ClCompile Include="win32\dxAccurateTime.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,33 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "dxl_main.h"
int DXL_SetVScreenBlitQuality(DXL_VSCREEN_HANDLE dst, enum BLITQUALITY blitquality)
{
int oldBQ;
validate(dst);
oldBQ = dst->bq;
dst->bq = blitquality;
return oldBQ;
}
enum BLITQUALITY DXL_GetVScreenBlitQuality(DXL_VSCREEN_HANDLE dst)
{
if (dst) {
return dst->bq;
}
return DXBLIT_SAME;
}

View file

@ -0,0 +1,69 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "duck_mem.h"
#include "dxl_main.h"
static DXL_VSCREEN_HANDLE vScreens = NULL;
static int maxScreens;
int preallocVScreens(int lmaxScreens)
{
(void) lmaxScreens; // not used
#if PRE_ALLOCATE
vScreens = (DXL_VSCREEN_HANDLE)duck_calloc(maxScreens = lmaxScreens,sizeof(DXL_VSCREEN),DMEM_GENERAL);
if (vScreens == NULL)
return DXL_ALLOC_FAILED;
#endif
return DXL_OK;
}
void freeVScreens(void)
{
#if PRE_ALLOCATE
int i;
if (vScreens)
{
for(i = 0; i < maxScreens; i++)
DXL_DestroyVScreen(&vScreens[i]);
duck_free(vScreens);
}
#endif
}
DXL_VSCREEN_HANDLE vScreenCreate(void)
{
DXL_VSCREEN_HANDLE nScreen;
#if PRE_ALLOCATE
if (vScreens)
{
int i;
nScreen = vScreens;
for(i=0; i < maxScreens; i++,nScreen++)
if (!nScreen->dkFlags.inUse) break;
if (i < maxScreens)
return nScreen;
}
#endif
nScreen = (DXL_VSCREEN_HANDLE)duck_calloc(1,sizeof(DXL_VSCREEN),DMEM_GENERAL);
if (nScreen)
nScreen->dkFlags.allocated = 1;
return nScreen;
}

View file

@ -0,0 +1,236 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
/********
DXL_REG.C - functions for registration of "Blit" functions
(C)1996 The Duck Corporation
********/
#include <assert.h>
#include <dxl_main.h>
#include <stdio.h>
#include <string.h>
#include "duck_mem.h"
typedef struct tBlitStruct {
blitFunc setup, blit, exit;
} DXL_BLITTER, DXL_BLITTER_HANDLE;
static int nextBlitter = 1;
/**************/
static DXL_BLITTER blitTable[32][DXL_MAX_IFORMATS];
static signed char blitTranslateTable[MAX_BQUALITIES][MAX_CDEPTHS];
static void nullBlitter(void){}
static DXL_INTERNAL_FORMAT iFormats[] = {
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT,
DXL_NULL_IFORMAT
};
DXL_INTERNAL_FORMAT dxl_GetFOURCCInternalFormat(unsigned long fourcc)
{
int aHandle = dxl_GetAlgHandle(fourcc);
if (aHandle != -1)
return iFormats[aHandle];
return DXL_NULL_IFORMAT;
}
int dxl_RegisterInternalFormat(int xHandle, DXL_INTERNAL_FORMAT xFormat)
{
iFormats[xHandle] = xFormat;
return DXL_OK;
}
DXL_BLIT_FORMAT DXL_ReserveBlitter(void)
{
if (nextBlitter >= 32)
return -1; /*DXL_EXCEEDED_MAX_BLITTERS;*/
return nextBlitter++;
}
DXL_BLIT_FORMAT DXL_OverrideBlitter(enum BLITQUALITY bq,enum BITDEPTH bd)
{
if(blitTranslateTable[bq][bd] == (signed char)-1)
blitTranslateTable[bq][bd] = (char)DXL_ReserveBlitter();
return blitTranslateTable[bq][bd];
}
int DXL_RegisterBlitter(DXL_BLIT_FORMAT dFormat, DXL_INTERNAL_FORMAT sFormat,
blitFunc blit, blitFunc setup, blitFunc exit)
{
if ((dFormat >= nextBlitter) || (sFormat >= DXL_MAX_IFORMATS))
return -1; /*DXL_INVALID_BLIT_FORMAT;*/
blitTable[dFormat][sFormat].setup = setup;
blitTable[dFormat][sFormat].exit = exit;
blitTable[dFormat][sFormat].blit = blit;
return 0; /*DXL_OK;*/
}
DXL_INTERNAL_FORMAT DXL_GetXImageInternalFormat(DXL_XIMAGE_HANDLE xImage,
DXL_VSCREEN_HANDLE vScreen)
{
int ret;
ret = xImage->internalFormat(xImage,vScreen);
if (ret == DXL_NULL_IFORMAT)
{
return (DXL_INTERNAL_FORMAT )
dxl_GetFOURCCInternalFormat(DXL_GetXImageFOURCC(xImage));
}
return (DXL_INTERNAL_FORMAT ) ret;
}
DXL_INTERNAL_FORMAT DXL_GetVScreenInternalFormat(DXL_VSCREEN_HANDLE vScreen)
{
if (vScreen->bd == DXRGB16){
return DXL_LINE16;
}else if (vScreen->bd == DXRGB8||vScreen->bd == DXHALFTONE8){
return DXL_LINE8;
}else
return (DXL_INTERNAL_FORMAT) -1;
}
blitFunc DXL_GetVBlitFunc(DXL_VSCREEN_HANDLE src,DXL_VSCREEN_HANDLE dst)
{
return blitTable[DXL_GetVScreenBlitFormat(dst)]
[DXL_GetVScreenInternalFormat(src)].blit;
}
blitFunc DXL_GetVBlitSetupFunc(DXL_VSCREEN_HANDLE src,DXL_VSCREEN_HANDLE dst)
{
return blitTable[DXL_GetVScreenBlitFormat(dst)]
[DXL_GetVScreenInternalFormat(src)].setup;
}
blitFunc DXL_GetBlitFunc(DXL_XIMAGE_HANDLE xImage,DXL_VSCREEN_HANDLE vScreen)
{
DXL_BLIT_FORMAT i = DXL_GetVScreenBlitFormat(vScreen);
DXL_INTERNAL_FORMAT j = DXL_GetXImageInternalFormat(xImage,vScreen);
if(i == -1)
return (blitFunc)-1;
if(j == DXL_NULL_IFORMAT)
#pragma warning(disable:4054) // typecase from function pointer to data pointer
return (blitFunc)nullBlitter;
#pragma warning(default:4054) // typecase from function pointer to data pointer
else
return blitTable[i][j].blit;
}
void *DXL_GetBlitSetupFunc(DXL_XIMAGE_HANDLE xImage,DXL_VSCREEN_HANDLE vScreen)
{
return blitTable[DXL_GetVScreenBlitFormat(vScreen)]
[DXL_GetXImageInternalFormat(xImage,vScreen)].setup;
}
void *DXL_GetBlitExitFunc(DXL_XIMAGE_HANDLE xImage,DXL_VSCREEN_HANDLE vScreen)
{
return blitTable[DXL_GetVScreenBlitFormat(vScreen)]
[DXL_GetXImageInternalFormat(xImage,vScreen)].exit;
}
DXL_BLIT_FORMAT DXL_GetVScreenBlitFormat(DXL_VSCREEN_HANDLE vScreen)
{ enum BLITQUALITY bq;
if (vScreen->blitFormat != (signed char)-1)
return vScreen->blitFormat;
bq = DXL_GetVScreenBlitQuality(vScreen);
return blitTranslateTable[bq]
[vScreen->bd];
}
void resetBlitters(void)
{
nextBlitter = 0;
duck_memset(blitTable,-1,sizeof(blitTable));
duck_memset(blitTranslateTable,-1,sizeof(blitTranslateTable));
}
int DXL_CheckFCCToVScreenFormat(unsigned long FCC,enum BITDEPTH format, enum BLITQUALITY bq)
{
DXL_XIMAGE_HANDLE src;
DXL_VSCREEN_HANDLE dst;
int ret = DXL_INVALID_BLIT;
src = DXL_CreateXImageOfType(NULL,FCC);
assert(src != NULL);
if (src)
{
dst = DXL_CreateVScreen(
(unsigned char *)0xDEADBEEF, format, 1280,480);
assert(dst != NULL);
if (dst)
{
dst->bq = bq;
ret = DXL_CheckdxImageToVScreen(src, dst);
DXL_DestroyVScreen(dst);
}
DXL_DestroyXImage(src);
}
return ret;
}
int DXL_CheckVScreenXImageBlit(DXL_VSCREEN_HANDLE dst,DXL_XIMAGE_HANDLE src)
{
validate(src);
if (!src->dx)
return -1;
if (!dst) return -1;
if (src->verify != NULL)
return(src->verify(src,dst));
#pragma warning(disable:4054) // typecase from function pointer to data pointer
if((void *)(src->internalFormat) != NULL){
dst->blitter = DXL_GetBlitFunc(src, dst);
if ((dst->blitter != (void *) -1) && (dst->blitter != nullBlitter))
return DXL_OK;
}
#pragma warning(default:4054) // typecase from function pointer to data pointer
return DXL_INVALID_BLIT;
}
int DXL_CheckVScreenBlit(DXL_VSCREEN_HANDLE dst,unsigned long fourcc)
{
return DXL_CheckFCCToVScreenFormat(fourcc,dst->bd, dst->bq);
}
int DXL_CheckdxImageToVScreen(DXL_XIMAGE_HANDLE src, DXL_VSCREEN_HANDLE dst)
{
return DXL_CheckVScreenXImageBlit( dst, src);
}

View file

@ -0,0 +1,76 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
/*/////////////////////////////////////////////////////////////////////////
//
// dxlvinfd.c
//
// Purpose: A list of helper functions to the quick time codec code
//
///////////////////////////////////////////////////////////////////////*/
//#include <stdio.h>
//#include <math.h>
//#include <string.h>
#include "dxl_main.h"
struct DisplaySetting {
long dotOne;
long dotTwo;
long dotThree;
long dotFour;
long dotFive;
};
static struct DisplaySetting id_RGB24 ={0x00000000,0x00000000,0xffffffff,0x00000000,0xffffffff};
static struct DisplaySetting id_RGB32 ={0x00000000,0x00000000,0x00000000,0x00000000,0xffffffff};
static struct DisplaySetting id_RGB555={0xffffffff,0x00000000,0xffffffff,0x00000000,0xffffffff};
static struct DisplaySetting id_RGB565={0xffffffff,0x00000000,0x00000000,0x00000000,0xffffffff};
static struct DisplaySetting id_UYVY ={0xff80ff80,0x00800080,0xff80ff80,0x00800080,0x00800080};
static struct DisplaySetting id_YUY2 ={0x80ff80ff,0x80008000,0x80008000,0x80008000,0x80008000};
static struct DisplaySetting id_YVU9 ={0x80008000,0x80008000,0xff80ff80,0xff80ff80,0xff80ff80};
static struct DisplaySetting id_RGB8 ={0x00000000,0xffffffff,0x00000000,0xffffffff,0x00000000};
static struct DisplaySetting id_STRETCH ={0x00000000,0xffffffff,0x00000000,0x00000000,0x00000000};
static struct DisplaySetting id_STRETCH_BRIGHT ={0xffffffff,0xffffffff,0x00000000,0x00000000,0x00000000};
static struct DisplaySetting id_STRETCH_SAME ={0xffffffff,0x00000000,0x00000000,0x00000000,0x00000000};
static struct DisplaySetting id_KEY = {0x00000000,0x00000000,0xffffffff,0x00000000,0x00000000};
static struct DisplaySetting id_NOTKEY = {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000};
static struct DisplaySetting id_CLEAR_ME = {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000};
static void OrSettings(struct DisplaySetting *src1,struct DisplaySetting *src2, struct DisplaySetting *dst)
{
if (dst) {
dst->dotOne = src1->dotOne | src2->dotOne;
dst->dotTwo = src1->dotTwo | src2->dotTwo;
dst->dotThree = src1->dotThree | src2->dotThree;
dst->dotFour = src1->dotFour | src2->dotFour;
dst->dotFive = src1->dotFive | src2->dotFive;
}
}
static void SetSettings(struct DisplaySetting *dst,struct DisplaySetting *src)
{
if (dst) {
dst->dotOne = src->dotOne ;
dst->dotTwo = src->dotTwo ;
dst->dotThree = src->dotThree ;
dst->dotFour = src->dotFour ;
dst->dotFive = src->dotFive ;
}
}

View file

@ -0,0 +1,43 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "duck_mem.h"
#include "dxl_main.h"
#if defined(DISPLAYDIB)
#if DISPLAYDIB
int globalIsDIB,globalDIBWidth,globalDIBHeight;
#endif
#endif
extern int preallocVScreens(int lmaxScreens);
extern void freeVScreens(void);
int DXL_InitVideo(int lmaxScreens,int lmaxImages)
{
(void)lmaxImages; // Not Used;
/* registerDuckBlitters(); */
resetBlitters();
// DXL_RegisterXImage(NULL,0L,(DXL_INTERNAL_FORMAT ) 0);
preallocVScreens(lmaxScreens);
return DXL_OK;
}
void DXL_ExitVideo(void)
{
freeVScreens();
}

View file

@ -0,0 +1,175 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "duck_mem.h"
#include "dxl_main.h"
#include <assert.h>
/***********************************************/
int DXL_GetVScreenSizeOfPixel(DXL_VSCREEN_HANDLE vSc)
{
switch (vSc->bd){
case DXRGB8:
case DXHALFTONE8:
case DXRGB8VESA:
return 1;
case DXRGB16_555:
case DXRGB16_565:
case DXRGB16VESA:
case DXYUY2:
case DXUYVY:
return 2;
case DXRGB24:
return 3;
case DXRGB32:
return 4;
default:
return -1;
}
}
void DXL_DestroyVScreen(DXL_VSCREEN_HANDLE dst)
{
if (dst != NULL){
dst->dkFlags.inUse = 0;
dst->addr = NULL;
if (dst->dkFlags.allocated)
duck_free(dst);
}
}
int DXL_AlterVScreen(DXL_VSCREEN_HANDLE dst, unsigned char *addr,enum BITDEPTH bd, int p,int h)
{
validate(dst);
if (addr != NULL) dst->addr = addr;
if (bd != DXRGBNULL) dst->bd = bd;
if (p != -1) dst->pitch = (short) p;
if (h != -1) dst->height = (short) h;
return DXL_OK;
}
int DXL_AlterVScreenView(DXL_VSCREEN_HANDLE dst,int x,int y,int w,int h)
{
validate(dst);
if (x > -1) dst->viewX = (short)x;// & 0xfffe;
if (y > -1) dst->viewY = (short)y;
if (w > -1) dst->viewW = (short)w;// & 0xfffe;
if (h > -1) dst->viewH = (short)h;
return DXL_OK;
}
DXL_VSCREEN_HANDLE DXL_CreateVScreen(unsigned char *addr, enum BITDEPTH bd, short p,short h)
{
#pragma warning(disable: 4210) // nonstandard extension used : function given file scope
DXL_VSCREEN_HANDLE vScreenCreate(void);
#pragma warning(default: 4210) // nonstandard extension used : function given file scope
DXL_VSCREEN_HANDLE nScreen = vScreenCreate();
if (!nScreen) return NULL;
nScreen->dkFlags.inUse = 1;
nScreen->blitFormat = -1;
DXL_AlterVScreen(nScreen, addr, bd, p, h);
nScreen->bx = nScreen->by = 0;
nScreen->bAddr = NULL;
nScreen->bq = DXBLIT_SAME;
return nScreen;
}
int DXL_GetVScreenView(DXL_VSCREEN_HANDLE dst,int *x,int *y,int *w,int *h)
{
validate(dst);
*x = dst->viewX;
*y = dst->viewY;
*w = dst->viewW;
*h = dst->viewH;
return DXL_OK;
}
int DXL_GetVScreenAttributes(
DXL_VSCREEN_HANDLE vScreen,
void **addr,
dxvBlitQuality *bq,
dxvBitDepth *bd,
short *pitch,
short *height
)
{
if (addr)
{
*addr = (void *) (vScreen->addr);
}
else
{
assert(0);
}
if (bq)
{
*bq = vScreen->bq;
}
else
{
assert(0);
}
if (bd)
{
*bd = vScreen->bd;
}
else
{
assert(0);
}
if (pitch)
{
*pitch = vScreen->pitch;
}
else
{
assert(0);
}
if (height)
{
*height = vScreen->height;
}
else
{
assert(0);
}
return 0;
} /* end get attributes */

View file

@ -0,0 +1,353 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#include "duck_mem.h"
#include "dxl_main.h"
int DXL_SetXImageCSize(DXL_XIMAGE_HANDLE src, int temp)
{
src->fSize = temp;
return temp;
}
void DXL_DestroyXImage(DXL_XIMAGE_HANDLE src)
{
{
#pragma warning(disable:4210) //nonstandard extension used : function given file scope
void DXL_AccurateTime(UINT64* time);
#pragma warning(default:4210) //nonstandard extension used : function given file scope
UINT64 clocksTotal;
double ratio, ratio2;
DXL_AccurateTime(&src->prof.profileEnd);
clocksTotal = (src->prof.profileEnd - src->prof.profileStart);
if (clocksTotal)
{
ratio = src->prof.dxClocks * 1.0 / clocksTotal;
ratio2 = (double)(src->prof.dxClocks / src->prof.frameCount);
}
}
if (src != NULL)
{
if (src->dkFlags.inUse)
{
src->destroy(src);
}
}
}
int DXL_MoveXImage(DXL_XIMAGE_HANDLE src,enum OFFSETXY mode, int x,int y)
{
validate(src);
if (mode != DXL_RELATIVE){
src->x = 0;
src->y = 0;
}
src->x = (short)(src->x + x);
src->y = (short)(src->y + y);
return DXL_OK;
}
int DXL_AlterXImageData(DXL_XIMAGE_HANDLE src, unsigned char *data)
{
validate(src);
src->addr = data;
src->dkFlags.DXed = 0;
if (data == NULL) return DXL_OK;
if (src->seedData)
return src->seedData(src);
else
return 0;
}
int DXL_GetXImageXYWH(DXL_XIMAGE_HANDLE src,int *x,int *y,int *w, int *h)
{
validate(src);
*x = src->x;
*y = src->y;
*w = src->w;
*h = src->h;
return DXL_OK;
}
int DXL_IsXImageKeyFrame(DXL_XIMAGE_HANDLE src)
{
validate(src);
return src->dkFlags.keyFrame;
}
/* typedef DXL_XIMAGE_HANDLE (*createFunc)(unsigned char *data); */
#define NUM_ALG 16
static createFunc creator[NUM_ALG];
static unsigned long fourCC[NUM_ALG];
DXL_XIMAGE_HANDLE DXL_CreateXImage(unsigned char *data)
{
int i;
DXL_XIMAGE_HANDLE nImage = NULL;
for(i = 0; i < NUM_ALG; i++){
if (fourCC[i]){
nImage = creator[i](data);
if ( nImage )
break;
}else
break;
}
if (nImage)
{
nImage->dkFlags.inUse = 1;
nImage->addr = data;
nImage->create = (struct tXImage *(__cdecl *)(void *))creator[i];
}
return nImage;
}
DXL_XIMAGE_HANDLE DXL_CreateXImageOfType(unsigned char *data,unsigned long type)
{
int i;
DXL_XIMAGE_HANDLE nImage = NULL;
for(i = 0; i < NUM_ALG; i++){
if (fourCC[i] == type){
nImage = creator[i](data);
if ( nImage )
break;
}
}
if (nImage)
{
nImage->dkFlags.inUse = 1;
nImage->addr = data;
nImage->prof.profileStart = 0;
nImage->prof.dxClocks = 0;
nImage->prof.frameCount = 0;
}
return nImage;
}
DXL_XIMAGE_HANDLE DXL_CreateXImageFromBMI(
unsigned char *data,
unsigned long fcc,
DK_BITMAPINFOHEADER *srcAndDest /* There will always be two Obiwan */
)
{
int i;
DXL_XIMAGE_HANDLE nImage = NULL;
for(i = 0; i < NUM_ALG; i++){
if (fourCC[i] == fcc){
nImage = creator[i]((unsigned char *) srcAndDest);
if ( nImage )
break;
}
}
if (nImage)
{
nImage->dkFlags.inUse = 1;
nImage->addr = data;
duck_memset(&nImage->prof,0,sizeof(DXL_PROFILEPACK)); /* probably redundent */
}
return nImage;
}
int DXL_RegisterXImage(createFunc myCreator,unsigned long fourcc, DXL_INTERNAL_FORMAT xFormat)
{
int i;
if (!fourcc){
duck_memset(creator,0,sizeof(creator));
duck_memset(fourCC,0,sizeof(fourCC));
return 0;
}
for (i = 0; i < sizeof(fourCC)/sizeof(unsigned long);i++){
if (!fourCC[i]){
creator[i] = myCreator;
fourCC[i] = fourcc;
dxl_RegisterInternalFormat(i, xFormat);
return i;
}
}
return -1;
}
unsigned long *DXL_GetFourCCList(void)
{
/*********
return a list of all supported fourccs
*********/
return fourCC;
}
int dxl_GetAlgHandle(unsigned long fourcc)
{
/*********
search through the fourcc table to find a dx'er's index
*********/
int i;
for (i = 0; i < sizeof(fourCC)/sizeof(unsigned long);i++)
if (fourCC[i] == fourcc) return i;
return -1;
}
unsigned long DXL_GetXImageFOURCC(DXL_XIMAGE_HANDLE src)
{
/*********
find an ximages fourcc (by comparing creator functions)
*********/
int i;
for (i = 0; i < sizeof(fourCC)/sizeof(unsigned long);i++)
if (creator[i] == (createFunc)src->create)
return fourCC[i];
return 0L;
}
unsigned char *DXL_GetDestAddress(DXL_XIMAGE_HANDLE src, DXL_VSCREEN_HANDLE dst)
{
/*********
get the address within the vscreen to start writing at
*********/
unsigned char *scrnDest = (unsigned char *)0L;
int x,y;
y = dst->viewY + src->y;
x = dst->viewX + src->x;
scrnDest = (unsigned char *) dst->addr;
scrnDest += (x * DXL_GetVScreenSizeOfPixel(dst)) + (y * dst->pitch);
return scrnDest;
}
int DXL_dxImageToVScreen(DXL_XIMAGE_HANDLE src, DXL_VSCREEN_HANDLE dst)
{
int dxvCode;
validate(src);
if (!src->dx)
return -1;
#pragma warning(disable:4054) // typecase from function pointer to data pointer
if(dst && ((void *)(src->internalFormat) != NULL)) {
/* get your hamdy damdy((c)1997 Duck North) registered blitter setup */
dst->blitSetup = DXL_GetBlitSetupFunc(src,dst);
dst->blitExit = DXL_GetBlitExitFunc(src,dst);
dst->blitter = DXL_GetBlitFunc(src, dst);
if (dst->blitter == (void *) -1)
return DXL_INVALID_BLIT;
}
#pragma warning(default:4054) // typecase from function pointer to data pointer
// if (!src->addr)
// return 1;
#if 1 /* we want to profile ... this should constitute no performance hit to profile */
{
UINT64 timerStart;
UINT64 timerEnd;
void DXL_AccurateTime(UINT64* time);
DXL_AccurateTime(&timerStart);
if (src->prof.profileStart == 0)
src->prof.profileStart = timerStart;
dxvCode = src->dx(src,dst);
DXL_AccurateTime(&timerEnd);
src->prof.dxClocks += (timerEnd - timerStart);
src->prof.frameCount += 1;
}
#else
dxvCode = src->dx(src,dst);
#endif
return dxvCode;
}
long DXL_GetXImageCSize(DXL_XIMAGE_HANDLE src)
{
if (src == NULL) return -1;
if (!src->GetXImageCSize)
return -2;
return(src->GetXImageCSize(src));
}
/***********************************************/
DXL_XIMAGE_HANDLE DXL_AlterXImage(DXL_XIMAGE_HANDLE src,
unsigned char *data,int type,
enum BITDEPTH bitDepth,int width,int height)
{
if (src == NULL)
{
if (type) /* if type specified, try using it as the fourcc */
src = DXL_CreateXImageOfType(data,type);
if (src == NULL) /* if still null, try creating it blind from the data */
src = DXL_CreateXImage(data);
if (src == NULL) /* if still null, give up */
return NULL;
}
if (!src->recreate) /* no way to recreate, assume create is good enough */
return src;
return(src->recreate(src,data,type,bitDepth,width,height));
}
void DXL_SetParameter(DXL_XIMAGE_HANDLE src, int Command, unsigned long Parameter )
{
src->setParameter(src,Command,Parameter);
}

View file

@ -0,0 +1,40 @@
#include "dxl_main.h"
#include "duck_dxl.h"
/*-------------------------------------------------------------------
File : dxv_util.c
Any extra functions whose lifespan/utility might be "questionable".
Functions that are not part of the "core", but yet are not really
anything but Dxv specific.
-------------------------------------------------------------------*/
/* This function used during the development of ICM wrapper */
/*----------------------------------------------------------*/
char *DXL_DumpRegistry(char *buf);
char *DXL_DumpRegistry(char *buf)
{
int sprintf( char *buffer, const char *format, ...);
unsigned long *g = DXL_GetFourCCList();
int i = 0;
while(g)
{
sprintf(buf,"fourCC[%d] = %c%c%c%c\n",i,
(g[i] & 0xFF000000) >> 24,
(g[i] & 0xFF0000) >> 16,
(g[i] & 0xFF00) >> 8,
(g[i] & 0xFF) >> 0
);
g++;
}
return buf;
}

View file

@ -0,0 +1,104 @@
/***********************************************\
??? dkprof.c
? profiling functions
? also see perf.asm and pentium.asm
\***********************************************/
#include "duck_mem.h"
#include "dkprof.h"
#define MAX_PROFILE 15
int profStarted = 0;
enum PROFILESECTION {
LOSSLESSDX = 0,
PLANARDX,
BLITME,
RD_FRAME_DESC,
RASTER_CONFIG,
DELTA_TABLES,
HANDLER_CONFIG,
STRING_DECODER,
STRING_DATA,
TSC0,
TSC1,
TSC2,
TSC3
};
PSECTION pSectionArray[MAX_PROFILE];
unsigned long pentiumKiloCycles(void);
#if 1
/***********************************************/
void tscStart(enum PROFILESECTION sel)
{
PSECTION *pSection;
if(profStarted) {
pSection = &pSectionArray[sel];
pSection->pkc1 = pentiumKiloCycles();
}
}
/***********************************************/
void tscEnd(enum PROFILESECTION sel)
{
PSECTION *pSection;
if(profStarted) {
pSection = &pSectionArray[sel];
pSection->pkc2 = pentiumKiloCycles();
pSection->pkc2 = (pSection->pkc2 - pSection->pkc1);
pSection->avgKc += pSection->pkc2;
pSection->numTimes += 1;
if(pSection->pkc2 < pSection->minKc)
pSection->minKc = pSection->pkc2;
if(pSection->pkc2 > pSection->maxKc)
pSection->maxKc = pSection->pkc2;
}
}
/***********************************************/
void tscInit()
{
int i;
for(i=0; i<MAX_PROFILE; i++) {
duck_memset(&pSectionArray[i],0,sizeof(PSECTION));
pSectionArray[i].minKc = 0xffffffff;
}
profStarted = 1;
}
/***********************************************/
void tscUninit()
{
profStarted = 0;
}
/***********************************************/
unsigned long tscProcessCounts(unsigned long *cnt, enum PROFILESECTION sel)
{
unsigned long rv = 0;
*cnt = 0;
if(profStarted) {
if(pSectionArray[sel].numTimes) {
rv = pSectionArray[sel].avgKc /= pSectionArray[sel].numTimes;
*cnt = pSectionArray[sel].numTimes;
duck_memset(&pSectionArray[sel],0,sizeof(PSECTION));
pSectionArray[sel].minKc = 0xffffffff;
}
/* reset all vars */
}
return (rv);
}
#endif

View file

@ -0,0 +1,30 @@
#include "dkpltfrm.h"
static void readTSC(UINT64 *bigOne)
{
unsigned long xhigh;
unsigned long xlow;
__asm
{
rdtsc
mov [xlow],EAX;
mov [xhigh],edx;
}
*bigOne = xhigh ;
*bigOne <<= 32;
*bigOne |= xlow;
return;
}
void DXL_AccurateTime(UINT64 *temp)
{
readTSC(temp);
}

View file

@ -0,0 +1,20 @@
#include "dkpltfrm.h"
#include "dxl_main.h"
unsigned long cpuFeatures;
#define CHECK_MMX 0x800000
#define CHECK_TSC 0x10
#define CHECK_CMOV 0x8000
#define CHECK_FCMOV 0x10000
CPU_FEATURES DXL_GetCPUFeatures(void)
{
enum CPU_FEATURES currentFeatures = NO_FEATURES;
if(cpuFeatures & CHECK_MMX)
currentFeatures |= MMX_SUPPORTED;
return currentFeatures;
}

View file

@ -0,0 +1,70 @@
#include <stdio.h>
#include <windows.h>
#include <windowsx.h>
// ************************************************************************
// FUNCTION : DllMain( HINSTANCE, DWORD, LPVOID )
// PURPOSE : DllMain is called by the C run-time library from the
// _DllMainCRTStartup entry point. The DLL entry point gets
// called (entered) on the following events: "Process Attach",
// "Thread Attach", "Thread Detach" or "Process Detach".
// COMMENTS : No initialization is needed here so this entry point simply
// returns TRUE.
// ************************************************************************
BOOL WINAPI
DllMain( HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
UNREFERENCED_PARAMETER( hInstDLL );
UNREFERENCED_PARAMETER( fdwReason );
UNREFERENCED_PARAMETER( lpvReserved );
return( TRUE );
}
int DXV_GetVersion()
{
return (int)0x0365;
}
extern "C" {
char* pannounce;
char *announcestart;
#define ANNBUFSIZE 2048
FILE* hf = NULL;
void Announcement(const char* lpszString)
{
#if _DEBUG
if (!hf) {
hf = fopen("Announce.txt","w");
}
if (hf) {
fprintf(hf,lpszString);
fflush(hf);
}
#endif
if ((2 * strlen(lpszString) + pannounce) > announcestart + ANNBUFSIZE) {
pannounce = announcestart + ANNBUFSIZE - 2 * strlen(lpszString); // lock up at end
}
strcpy(pannounce,lpszString); // copy and bump
pannounce += strlen(lpszString);
}
void AnnDone()
{
#if _DEBUG
Announcement("Closing Announcements");
if(hf) fclose(hf);
// hf = 0; // don't reset handle or file will re-open on next call
#endif
}
void ErrorBuffer(char *errorbuf)
{
pannounce = announcestart = errorbuf;
}
}

View file

@ -0,0 +1,97 @@
; -------------------------------------------------------------------------
;
; Duck Developer Support
; Copyright (c) 1995 Duck Corporation
; -------------------------------------------------------------------------
; MODULE : Dukdll.DEF
; PURPOSE : module-definition file for the Duck Player
; COMMENTS :
; -------------------------------------------------------------------------
;LIBRARY DXV
DESCRIPTION 'Duck Windows Player'
EXPORTS
DXL_InitVideo @2
DXL_ExitVideo @3
DXL_CreateVScreen @4
DXL_DestroyVScreen @5
DXL_AlterVScreen @6
DXL_AlterVScreenClip @7
DXL_AlterVScreenView @8
DXL_AlterVScreenBackground @9
DXL_CreateXImage @10
DXL_DestroyXImage @11
DXL_AlterXImageData @12
DXL_MoveXImage @13
; DXL_AlterXImageSpriteModes @14
DXL_GetXImageColorDepth @15
; DXL_GetXImageDirtyXYWH @16
DXL_GetXImageXYWH @17
DXL_dxImageToVScreen @19
DXL_IsXImageKeyFrame @20
DXL_GetVScreenView @21
; DXL_CreateDirtyBuffer @22
; DXL_DeriveVScreenFromXImage @23
; DXL_DisplayVScreen @24
DXL_SetVScreenBlitQuality @25
DXL_GetVScreenBlitQuality @26
DXL_GetVScreenAddr @27
DXL_CreateGenericXImage @28
DXL_EraseVScreen @29
DXL_BlitXImageToVScreen @30
DXL_BlitVScreenToVScreen @31
DXL_GetXImageFrameBuffer @32
DXL_AlterXImage @33
DXL_SetVScreenCLUTs @34
DXL_ResetVScreenCLUTs @35
; BlackBox @81
AnnDone @86
Announcement @88
; RestoreDirty @90
; GetScreenAddr @91
; resetDisplay @92
; SetClutPtrs @93
; MarkSkips @94
DXL_Decompress16BitAs565 @107
ErrorBuffer @108
DXL_SetXImageBlitAll @109
DXV_Setmalloc @111
DXV_Setcalloc @112
DXV_Setfree @113
; DUCK_rdtsc_Start @114
; DUCK_rdtsc_End @115
; DUCK_InitProfile @116
; DUCK_ProcessCounts @117
; DUCK_UninitProfile @118
; DUCK_ClearI @119
; DUCK_SetI @120
DXL_CheckdxImageToVScreen @121
DXL_GetFourCCList @122
DXL_CreateXImageOfType @123
DXL_GetXImageCSize @124
DXL_GetBitDepthPalette @125
DXL_CheckVScreenBlit @126
DXL_CheckVScreenXImageBlit @127
DXL_BlackLineVScreen @128
DXL_GetCPUFeatures @129
DXL_GetXImageFOURCC @130
DXL_SetXImageCSize @131
DXL_InitVideoEx @132

View file

@ -0,0 +1,126 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifndef MAJ
#define MAJ 0
#endif
#ifndef MIN
#define MIN 0
#endif
#ifndef PVER
#define PVER 0
#endif
#ifndef BVER
#define BVER ".b1"
#endif
#ifndef PROJ
#define PROJ UNKNOWN!!
#endif
#define DT(x) #x
#define VTEXT(x) DT(x)
#define VERSTRING(w,x,y,z) DT(w) "." DT(x) "." DT(y) DT(z) "\0"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x10004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "The Duck Corporation\0"
VALUE "FileDescription", "TruePlay SDK Library - " VTEXT(PROJ) ".dll\0"
VALUE "FileVersion", VERSTRING(MAJ,MIN,PVER,BVER)
VALUE "InternalName", "MPVE - " VTEXT(PROJ) "\0"
VALUE "LegalCopyright", "Copyright ©1998 The Duck Corp.\0"
VALUE "ProductName", "TruePlay SDK - " VTEXT(PROJ) " Library \0"
VALUE "ProductVersion", VERSTRING(MAJ,MIN,PVER,BVER)
VALUE "Providing", VTEXT(ALG)
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
//resource
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,103 @@
/*
Windows 95 Memory allocation abstraction functions
*/
#include <stdio.h>
#include <windows.h>
#include "dkpltfrm.h"
#include "duck_mem.h"
#define CHECK_FOR_MEMORY_LEAK 0
void *malloc_32b(size_t size)
{
return LocalAlloc( LMEM_FIXED, size );
}
void *calloc_32b(size_t count,size_t size)
{
/* maybe we should rewrite this to use dwords
(who knows if they do it automatica like) */
return LocalAlloc( LMEM_ZEROINIT, size*count );
}
void free_32b(void * hMem)
{
LocalFree(hMem);
}
static void *(*ptr_malloc)(size_t size) = malloc_32b;
static void *(*ptr_calloc)(size_t, size_t size) = calloc_32b;
static void (*ptr_free)(void *) = free_32b;
void *duck_malloc(size_t size, enum tmemtype fred)
{
void *temp;
temp = (*ptr_malloc)(size);
#if CHECK_FOR_MEMORY_LEAK
{
FILE * out;
if ((out = fopen("c:\\sjl.log","a")) != NULL) {
fprintf(out,"DXV duck_malloc:%x %d\n", temp, size);
fclose(out);
}
}
#endif
return temp;
}
void *duck_calloc(size_t n,size_t size, enum tmemtype fred)
{
void *temp = (*ptr_calloc) (n, size);
#if CHECK_FOR_MEMORY_LEAK
{
FILE * out;
if ((out = fopen("c:\\sjl.log","a")) != NULL) {
fprintf(out,"DXV duck_calloc:%x %d %d \n", temp, n, size);
fclose(out);
}
}
#endif
return temp;
}
void duck_free(void *old_blk)
{
#if CHECK_FOR_MEMORY_LEAK
{
FILE * out;
if ((out = fopen("c:\\sjl.log","a")) != NULL) {
fprintf(out,"DXV duck_free:%x\n", old_blk);
fclose(out);
}
}
#endif
(*ptr_free) (old_blk);
}
void DXV_Setmalloc(void *(*ptr)(size_t))
{
ptr_malloc = ptr;
}
void DXV_Setcalloc(void *(*ptr)(size_t, size_t))
{
ptr_calloc = ptr;
}
void DXV_Setfree(void (*ptr)(void *))
{
ptr_free = ptr;
}

View file

@ -0,0 +1,9 @@
$(OBJDIR)sc_$(PROJECT).lib: $(LIBDIR)\sc_tm20.lib $(LIBDIR)\sc_torq.lib
LIB $(OBJS) /OUT:$@
LIB $@ $(LIBDIR)\s_tm1.lib /OUT:$@
LIB $@ $(LIBDIR)\sc_tm20.lib /OUT:$@
LIB $@ $(LIBDIR)\s_tmrt.lib /OUT:$@
LIB $@ $(LIBDIR)\sc_torq.lib /OUT:$@
copy $@ $(LIBDIR)

View file

@ -0,0 +1,717 @@
// dxvmpg.cpp : Defines the entry point for the console application.
//
#include <stdlib.h>
#include <stdio.h>
#include "dkpltfrm.h" /* platform specifics */
#include "duktypes.h" /* predefined general types used at duck */
#include "duck_mem.h" /* interface to memory manager */
#include "dxl_main.h" /* interface to dxv */
#include <windows.h>
#include <mmsystem.h>
#include <vfw.h>
/* formats that might be supported by a codec and dxv */
/* call me crazy ... but I want to make this public ... ie in the HEADER ! */
BMIMapping DXL_BMIMap[] =
{
{ DXL_MKFOURCC('Y','V','1','2'), 12, 3, DXYV12 },
{ DXL_MKFOURCC('I','Y','U','V'), 12, 1, DXI420 },
{ DXL_MKFOURCC('Y','U','Y','2'), 16, 1, DXYUY2 },
{ DXL_MKFOURCC('Y','V','Y','U'), 16, 1, DXYVYU },
{ DXL_MKFOURCC('U','Y','V','Y'), 16, 1, DXUYVY },
{ 0, 24, 1, DXRGB24 },
{ 0, 32, 1, DXRGB32 }
};
static char *MakeFourCCString(unsigned long fcc, char *buff)
{
sprintf(buff,"%c%c%c%c",
(fcc & 0xFF) >> 0,
(fcc & 0xFF00) >> 8,
(fcc & 0xFF0000) >> 16,
(fcc & 0xFF000000) >> 24
);
return buff;
}
/* Report to a little HTML file */
void DXL_ReportBMIMapping(char *filename)
{
FILE *fp;
int len = sizeof(DXL_BMIMap) / sizeof(BMIMapping);
fp = fopen(filename,"w");
if (fp)
{
int t;
char temp[5];
fprintf(fp, "<table BORDER=1>");
fprintf(fp, "<tr><td>FOURCC</td><td>BitDepth</td><td>Planes</td><td>dxvBitDepth</td></tr>");
for(t = 0; t < len; t++)
{
fprintf(fp, "<tr><td>%s<br>%x</td> <td>%ld</td> <td>%ld</td> <td>%ld</td></tr>",
MakeFourCCString(DXL_BMIMap[t].biCompression,temp),
DXL_BMIMap[t].biCompression,
DXL_BMIMap[t].biBitCount,
DXL_BMIMap[t].biPlanes,
DXL_BMIMap[t].bd
);
}
fprintf(fp,"</table>");
fclose(fp);
}
}
/********* USAGE
In addition to regular DXV services, this library will invoke VFW
codecs for decompression services.
Because of a bug in the frame parsing, the library is compiled to
decompress TM2X via its codec as well. So be certain to have a
TM2X VFW codec installed.
The library has only been tested with TM2X(2.5.1.8),
Indeo 5.2 and MPEG4.2. Other codecs may work, but only if
they support RGB32, RGB24, and RGB16 (555 and/or 565).
MS-CRAM and Cinepak crashed painfully in tests so far.
The library assumes support for all 4 RGB truecolor modes
mentioned above, (NOTE: TM2X doesn't support RGB24 yet!)
- 5/19/99 -
We added black-lining blitters for stretched modes. Note that
24 bit display uses a 32bit offscreen buffer which is blitted
down to 24bit when stretched, this makes the asm code that much
simpler.
To use:
in addition to the regular DXV,
link s_icm.lib to your application and do the following
substitute:
DXL_InitVideoEx(int lmaxScreens,int lmaxImages);
in place of:
DXL_InitVideo(int lmaxScreens,int lmaxImages)
use:
movie->xImage =
DXL_AlterXImage(movie->xImage,movie->vData,
HFB_GetStreamInfo(movie->vStream)->a.BitmapInfo.ulHandler,
0,
HFB_GetStreamInfo(movie->vStream)->a.BitmapInfo.usWidth,
HFB_GetStreamInfo(movie->vStream)->a.BitmapInfo.usHeight);
in place of:
movie->xImage = DXL_CreateXImage(movie->vData);
and, prior to any calls to:
DXL_dxImageToVScreen(movie->xImage, movie->vScreen);
you must call:
DXL_SetXImageCSize(movie->xImage, movie->vLength);
********/
static dxvBitDepth bitDepths[] =
{
DXRGB32,DXRGB24,DXRGB16,DXRGBNULL
};
/* define an xImage structure based on the core xImage struct */
typedef struct tXImageCODEC{
xImageBaseStruct;
DK_BITMAPINFOHEADER bihIn;
unsigned long bihInFields[3];
DK_BITMAPINFOHEADER bihOut;
unsigned long bihOutFields[3];
HIC hic;
int changeVScreen;
BMIMapping* maps[20];
int maxMaps;
} DXL_CODEC,*DXL_CODEC_HANDLE;
char* DXL_DecodeICERR(int err, char *storage, int length)
{
(void)length; // not used
switch (err)
{
case ICERR_UNSUPPORTED :
strcpy(storage,"ICERR_UNSUPPORTED");
break;
case ICERR_BADFORMAT :
strcpy(storage,"ICERR_BADFORMAT");
break;
case ICERR_MEMORY :
strcpy(storage,"ICERR_MEMORY");
break;
case ICERR_ERROR :
strcpy(storage,"ICERR_ERROR");
break;
default :
strcpy(storage,"Defaulted to ICERR_ERROR");
break;
}
return storage;
}
DK_BITMAPINFOHEADER* DXL_VSCREEN_2_BMI
(
DXL_XIMAGE_HANDLE xImage,
DXL_VSCREEN_HANDLE vScreen,
DK_BITMAPINFOHEADER *bmih,
dxvBitDepth* bd1
)
{
unsigned char *addr;
dxvBlitQuality bq;
dxvBitDepth bd;
short pitch;
short height;
int t;
DXL_CODEC_HANDLE src = (DXL_CODEC_HANDLE ) xImage;
duck_memcpy(bmih,&((DXL_CODEC_HANDLE ) xImage)->bihIn,sizeof(DK_BITMAPINFOHEADER));
DXL_GetVScreenAttributes(vScreen, (void **) &addr, &bq, &bd, &pitch, &height );
for(t = 0; t < src->maxMaps; t++)
{
if (src->maps[t]->bd == bd)
{
bmih->biBitCount = src->maps[t]->biBitCount;
bmih->biCompression = src->maps[t]->biCompression;
bmih->biPlanes = src->maps[t]->biPlanes;
bmih->biWidth = pitch / (bmih->biBitCount / 8);
bmih->biHeight = height;
bmih->biSizeImage = pitch * bmih->biHeight;
fprintf(stderr,"\nBMI from VScreen attributes ...\n");
fprintf(stderr,"\t pitch = %ld\n", pitch);
fprintf(stderr,"\t width = %ld\n", bmih->biWidth);
fprintf(stderr,"\t height = %ld\n", bmih->biHeight);
fprintf(stderr,"\t biCompression = %c%c%c%c\n",
((char *) &bmih->biCompression)[0],
((char *) &bmih->biCompression)[1],
((char *) &bmih->biCompression)[2],
((char *) &bmih->biCompression)[3]
);
fflush(stderr);
return bmih;
}
}
*bd1 = bd;
return 0;
}
int DXL_ReportBestBMIMatch(DXL_XIMAGE_HANDLE xImage, BMIMapping** map, int *maxMaps, int doConsoleReport)
{
int t;
int ret;
char buff[5];
int len = sizeof(DXL_BMIMap)/sizeof(BMIMapping);
int matches = 0;
DXL_CODEC_HANDLE src = (DXL_CODEC_HANDLE ) xImage;
DK_BITMAPINFOHEADER temp;
(void)doConsoleReport; //unused
src->bihIn.dxFlavor = 2; /* use the extended ICM functions */
duck_memcpy(&temp,&src->bihIn,sizeof(DK_BITMAPINFOHEADER));
for(t = 0; t < len; t++) /* for each one we support with out mapping */
{
temp.biBitCount = DXL_BMIMap[t].biBitCount;
temp.biCompression = DXL_BMIMap[t].biCompression;
temp.biPlanes = DXL_BMIMap[t].biPlanes;
temp.biSizeImage = temp.biBitCount * temp.biWidth * temp.biHeight / 8;
ret = ICDecompressQuery(src->hic, &(src->bihIn), &temp );
if (ret == ICERR_OK)
{
fprintf(stderr,"format of %s supported, planes = %ld, rank = %ld\n",
MakeFourCCString(temp.biCompression, buff ), temp.biPlanes, matches + 1);
fflush(stderr);
if (matches < *maxMaps)
{
src->maps[matches] = map[matches] = &DXL_BMIMap[t];
matches += 1;
}
}
else
{
fprintf(stderr,"format of %s NOT supported, planes = %ld\n",
MakeFourCCString(temp.biCompression, buff ), temp.biPlanes);
fflush(stderr);
}
}
src->maxMaps = *maxMaps = matches;
/* This could be done somewhere else ! */
duck_memset(&src->bihOut,0,sizeof(DK_BITMAPINFOHEADER));
return matches;
}
static int decompress1(DXL_XIMAGE_HANDLE xImage, DXL_VSCREEN_HANDLE vScreen)
{
/* Keep the warnings away ! */
DXL_CODEC_HANDLE src = (DXL_CODEC_HANDLE ) xImage;
// DWORD dwFlags = 0;
DWORD ret;
dxvBitDepth bd;
int changeOutput = src->changeVScreen;
if (changeOutput)
{
/* should be cleared first time in so width zero ! */
if (src->bihOut.biWidth != 0)
ICDecompressEnd(src->hic);
if ( DXL_VSCREEN_2_BMI(xImage, vScreen, (DK_BITMAPINFOHEADER *) &(src->bihOut), &bd ) == 0)
{
/* user asks for unsupported surface FOURCC */
fprintf(stderr, "User asks for unsupported dxvBitDepth = %ld\n", bd );
fflush(stderr);
return ICERR_BADFORMAT;
}
ret = ICDecompressBegin(src->hic, &src->bihIn, &src->bihOut);
if (ret != ICERR_OK)
{
return ret;
}
}
src->bihIn.biSizeImage = src->fSize;
ret = ICDecompress( src->hic, 0,
(BITMAPINFOHEADER *) &src->bihIn, src->addr,
(BITMAPINFOHEADER *) &src->bihOut,
(char *) vScreen->addr);
if (ret != ICERR_OK)
{
fprintf(stderr,"Oh boy decompress may have failed !\n");
assert(0);
exit(0);
}
src->changeVScreen = 0;
return ICERR_OK;
}
static int decompress2(DXL_XIMAGE_HANDLE xImage, DXL_VSCREEN_HANDLE vScreen)
{
/* Keep the warnings away ! */
DXL_CODEC_HANDLE src = (DXL_CODEC_HANDLE ) xImage;
DWORD dwFlags = 0;
DWORD ret;
dxvBitDepth bd;
if (src->changeVScreen)
{
/* should be cleared first time in so width zero ! */
if (src->bihOut.biWidth != 0)
ICDecompressExEnd(src->hic);
if ( DXL_VSCREEN_2_BMI(xImage, vScreen, (DK_BITMAPINFOHEADER *) &(src->bihOut), &bd ) == 0)
{
/* user asks for unsupported surface FOURCC */
fprintf(stderr, "User asks for unsupported dxvBitDepth = %ld\n", bd );
fflush(stderr);
return ICERR_BADFORMAT;
}
ret = ICDecompressExBegin(
src->hic,
dwFlags,
(BITMAPINFOHEADER *) &(src->bihIn),
src->addr,
0,
0,
src->bihIn.biWidth,
src->bihIn.biHeight,
(BITMAPINFOHEADER *) &(src->bihOut),
(char *) vScreen->addr,
0,
0,
src->bihIn.biWidth,
src->bihIn.biHeight
);
if (ret == ICERR_UNSUPPORTED)
{
return ICERR_UNSUPPORTED;
}
if (ret != ICERR_OK)
{
char *storage = (char *) calloc(256,sizeof(char));
fprintf(stderr,"ICDecompressExBegin returns error code = %ld\n", ret);
fprintf(stderr,"Decoded as ... %s\n", DXL_DecodeICERR(ret, storage, sizeof(storage) - 1));
fflush(stderr);
if (storage)
free(storage);
assert(0);
}
src->changeVScreen = 0;
}
src->bihIn.biSizeImage = src->fSize;
ret = ICDecompressEx(
src->hic,
dwFlags,
(BITMAPINFOHEADER *) &src->bihIn,
src->addr,
0,
0,
src->bihIn.biWidth,
src->bihIn.biHeight,
(BITMAPINFOHEADER *) &src->bihOut,
(char *) vScreen->addr,
0,
0,
src->bihIn.biWidth,
src->bihIn.biHeight
);
if (ret != ICERR_OK)
{
fprintf(stderr,"Oh boy decompress may have failed !\n");
assert(0);
exit(0);
}
return 0;
}
static int decompress(DXL_XIMAGE_HANDLE xImage, DXL_VSCREEN_HANDLE vScreen2)
{
DXL_CODEC_HANDLE xThis = (DXL_CODEC_HANDLE) xImage;
int retVal = ICERR_OK;
/* Try the version that handles wack pitch first ! */
if (xThis->bihIn.dxFlavor == 2)
{
retVal = decompress2(xImage, vScreen2);
if (retVal == ICERR_UNSUPPORTED)
{
xThis->bihIn.dxFlavor = 1;
}
}
/* if the wack pitch one failed */
if (xThis->bihIn.dxFlavor == 1)
{
retVal = decompress1(xImage, vScreen2);
}
return retVal;
}
/*
close down a decompressor, releasing the icm decompressor,
the xImage (decompressor), and the intermediate vScreen (surface)
*/
static int destroyCodec(DXL_XIMAGE_HANDLE xImage)
{
DXL_CODEC_HANDLE xThis = (DXL_CODEC_HANDLE ) xImage;
if (xThis)
{
if (xThis->hic)
{
ICDecompressEnd(xThis->hic);
ICClose(xThis->hic);
}
duck_free(xThis);
}
return DXL_OK;
}
static char* duckToNarrow(char *s)
{
char dst[256];
int t=0;
if (s)
{
do
{
dst[t] = s[2*t];
t = t + 1;
}
while ( *((short *) &s[t]) );
dst[t] = '\0';
strcpy(s,dst);
return s;
}
else
{
return 0;
}
} /* end duckToNarrow */
/*
called during initialization and/or when xImage (decompressor)
attributes change, note that nImage and src are actually
synonymous and should be cleared out a bit (to say the least!)
!!!!!!
This function should be prepared to get data that is NOT of the
type native to the decoder, It should do it's best to verify it
as valid data and should clean up after itself and return NULL
if it doesn't recognize the format of the data
*/
static DXL_XIMAGE_HANDLE reCreateCodec(DXL_CODEC_HANDLE src,unsigned char *data,
int type,enum BITDEPTH bitDepth,int w,int h)
{
#pragma warning(disable: 4210) // nonstandard extension used : function given file scope
DXL_XIMAGE_HANDLE createCodec(unsigned char *data);
#pragma warning(default: 4210) // nonstandard extension used : function given file scope
DXL_XIMAGE_HANDLE nImage;
DK_BITMAPINFOHEADER *bmiHeader = (DK_BITMAPINFOHEADER *) data;
unsigned long fccHandler;
(void)h; // unused
(void)w; // unused
(void)bitDepth; //unused
(void)type; //unused
if (src != NULL) /* if an xImage/decompressor already exists, destroy it */
destroyCodec((DXL_XIMAGE_HANDLE ) src);
/* create a new xImage, specific to this type of decoder, (
see "DXL_CODEC" struct above and dxl_main.h) */
nImage = (DXL_XIMAGE_HANDLE)duck_calloc(1,sizeof(DXL_CODEC),DMEM_GENERAL);
src = (DXL_CODEC_HANDLE ) nImage;
if (!nImage) return NULL;
duck_memset(nImage,0,sizeof(DXL_CODEC));
src->changeVScreen = 1; /* True ... inform decompresss the dest has changed */
/* set up the "vtable" of interface calls */
src->create = (DXL_XIMAGE_HANDLE (*)(void *)) createCodec;
src->recreate = (DXL_XIMAGE_HANDLE (*)(DXL_XIMAGE_HANDLE,void *,int,int,int,int)) reCreateCodec;
nImage->destroy = destroyCodec;
nImage->dx = decompress;
nImage->blit = NULL; /* there is no interleaved blitter for codecs */
src->bdPrefs = bitDepths; /* plug in the list of prefered bit depths */
nImage->addr = data;
nImage->dkFlags.inUse = 1;
duck_memcpy(&src->bihIn, bmiHeader,sizeof(DK_BITMAPINFOHEADER));
duck_memset(&src->bihOut, 0, sizeof(DK_BITMAPINFOHEADER));
src->w = (short ) (src->bihIn.biWidth);
src->h = (short ) (src->bihIn.biHeight);
src->imWidth = (short) src->w;
src->imHeight = (short) src->h;
fccHandler = src->bihIn.fccHandler;
if (fccHandler == 0)
{
src->hic=ICLocate(ICTYPE_VIDEO, fccHandler, (BITMAPINFOHEADER *) &src->bihIn, 0, ICMODE_DECOMPRESS);
}
else
{
src->hic=ICOpen(ICTYPE_VIDEO, fccHandler, ICMODE_DECOMPRESS);
}
{
ICINFO i;
memset(&i,0,sizeof(ICINFO));
if (ICGetInfo( src->hic, &i, sizeof(ICINFO) ))
{
char temp[5];
unsigned long biCompression = src->bihIn.biCompression;
fccHandler = src->bihIn.fccHandler = i.fccHandler;
fprintf(stderr, "Short Name : %s\n"
"Driver : %s\n"
"driver version = %d %d or as hex = %x\n"
"Description : %s\n"
"Codec biCompression = %s\n"
"Codec fccHandler = %s\n",
duckToNarrow( (char *) i.szName),
duckToNarrow( (char *) i.szDriver),
((i.dwVersion & 0x0000FFFF) >> 0 ),
((i.dwVersion & 0xFFFF0000) >> 16 ),
i.dwVersion,
duckToNarrow( (char *) i.szDescription),
MakeFourCCString(biCompression, temp),
MakeFourCCString(fccHandler, temp)
);
fflush(stderr);
}
}
if (src->hic == 0)
{
destroyCodec((DXL_XIMAGE_HANDLE ) src);
fprintf(stderr, "codec for fourCC = %c%c%c%c, %x won't open\n",
(fccHandler & 0xFF000000) >> 24,
(fccHandler & 0xFF0000) >> 16,
(fccHandler & 0xFF00) >> 8,
(fccHandler & 0xFF) >> 0,
fccHandler
);
fflush(stderr);
return 0;
}
return nImage;
}
/* in this "glue" case, just calls through to the create function */
#pragma warning(disable:4211) //nonstandard extension used : redefined extern to static
static DXL_XIMAGE_HANDLE createCodec(unsigned char *bmih)
{
return reCreateCodec(NULL, bmih ,0,(enum BITDEPTH ) 0,0,0);
}
#pragma warning(default:4211) //nonstandard extension used : redefined extern to static

View file

@ -0,0 +1,339 @@
everything : all
###### dxv standard project specs
PROJECT = dxv
# project name
# standard modules for this library
OBJS = \
$(OBJDIR)dxlcsize.$(OBJ) \
$(OBJDIR)dxv_init.$(OBJ) \
$(OBJDIR)dxv_initex.$(OBJ) \
$(OBJDIR)dxl_main.$(OBJ) \
$(OBJDIR)vscreen.$(OBJ) \
$(OBJDIR)ximage.$(OBJ) \
$(OBJDIR)ximgblit.$(OBJ) \
$(OBJDIR)getprefs.$(OBJ) \
$(OBJDIR)dxl_clip.$(OBJ) \
$(OBJDIR)dxl_bkgr.$(OBJ) \
$(OBJDIR)dxl_view.$(OBJ) \
$(OBJDIR)vgetview.$(OBJ) \
$(OBJDIR)vscerase.$(OBJ) \
$(OBJDIR)dxl_attr.$(OBJ) \
$(OBJDIR)dxl_reg.$(OBJ) \
$(OBJDIR)dxl_feat.$(OBJ) \
$(OBJDIR)genximg.$(OBJ) \
$(OBJDIR)svsbitdp.$(OBJ) \
$(OBJDIR)vscraddr.$(OBJ) \
$(OBJDIR)blitall.$(OBJ) \
$(OBJDIR)dxlvinfd.$(OBJ) \
$(OBJDIR)cpuid.$(OBJ) \
$(OBJDIR)count_tm.$(OBJ)
!ifndef NOCLUT
OBJS = $(OBJS) \
$(OBJDIR)dxl_clut.$(OBJ)
!endif
!ifndef NOLOGO
OBJS = $(OBJS) \
$(OBJDIR)on2logo.$(OBJ) \
$(OBJDIR)tmlogo55.$(OBJ) \
$(OBJDIR)tmlogo56.$(OBJ) \
$(OBJDIR)tmlogo24.$(OBJ) \
$(OBJDIR)ducklogo.$(OBJ)
!endif
MAJREV = 6 # major library revision
MINREV = 0 # minor library revision
PVER = 1 # minor.minor library revision
BVER = ".b1" # build version
# libraries on which this should be built
!if 0
$(LIBDIR)$(LIBPREFIX)tmrt$(LIBSUFFIX) \
$(LIBDIR)$(LIBPREFIX)tm1$(LIBSUFFIX) \
$(LIBDIR)$(LIBPREFIX)tm20$(LIBSUFFIX) \
$(LIBDIR)$(LIBPREFIX)vp3$(LIBSUFFIX) \
$(LIBDIR)$(LIBPREFIX)vp31d$(LIBSUFFIX)
!endif
!if 0
USER_LIBS = \
$(LIBDIR)$(LIBPREFIX)torq$(LIBSUFFIX)
!endif
#
# project sub options sent to compilers
#
!ifndef CENV
CENV = -DTORQB -DTM1B -DTM2B -DTMRTB
!endif
# add sub-options to c options (allows for environment override)
C_FLAGS = $(CENV)
c_flags = $(C_FLAGS)
# this proj library is to be built as a shared or master library
SHAREDLIB = 0
M_INCLUDES = -I$(INCDIR)/$(OS) -I$(INCDIR) -I. -I../generic $(M_INCLUDES)
# win95 specific modules
OBJS = $(OBJS) \
$(OBJDIR)dxv.$(OBJ) \
$(OBJDIR)dkprof.$(OBJ) \
$(OBJDIR)perf.$(OBJ) \
$(OBJDIR)pentium.$(OBJ) \
$(OBJDIR)$(PROJECT).res
# modules specifically sent to linker,
# others are provided in libraries
DLLOBJS = $(OBJDIR)dxl_main.obj \
$(OBJDIR)dxv_mem.$(OBJ) \
$(OBJDIR)dxv_mems.$(OBJ) \
$(OBJDIR)$(PROJECT).res \
$(OBJDIR)$(PROJECT).$(OBJ)
PROJLIBS = $(PROJLIBS)
#$(OBJDIR)sc_$(PROJECT).lib
THISFILE = makefile
SRCDIR = .
GENDIR = ..\generic
OBJDIR = obj\
LIBDIR = obj\
INCDIR = $(CORELIBS_INC)
ASMDIR = ..\X86\
MMXDIR = ..\mmx\
WASMDIR = ..\wX86\
OBJRELDIR = $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Release\
OBJDEBDIR = $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Debug\
LIBRELDIR = $(ROOT)Private\CoreLibs\Lib\$(OS)\Release
LIBDEBDIR = $(ROOT)Private\CoreLibs\Lib\$(OS)\Debug
OBJ = obj
MKDIR =
# tools
CC = cl
ASM = tasm /ml /m8 /dWINP /zd /I$(ASMDIR) /dWIN95
WASM = wasm /dWINP /dWIN95 /I=$(ASMDIR) /I=$(MMXDIR) -q
RC = rc
LIBNAME = $(OBJDIR)$(PROJECT).lib
SLIBNAME = $(OBJDIR)s_$(PROJECT).lib
EXENAME = $(OBJDIR)$(PROJECT).exe
###DEFNAME = $(SRCDIR)$(PROJECT).DEF
DEFNAME = $(PROJECT).DEF
LIBPREFIX = \s_
LIBSUFFIX = .lib
# Include Path Variable Extensible
include = $(SDK)/inc;$(include)
############################################################
# Global Flags (compiler / linker)
C_FLAGS = $(C_FLAGS) -Gy -W3 -nologo -DWIN32 -D_MBCS -D_AFXDLL -D_WINDOWS -DHIRES\
-DDOS32 -c $(M_INCLUDES:/=\)
#-WX
L_FLAGS = $(L_FLAGS) /SUBSYSTEM:windows /INCREMENTAL:no /MACHINE:I386
############################################################
# Locally Overridable Flags
!ifndef DLLNAME
DLLNAME = $(OBJDIR)$(PROJECT).dll
!endif
!ifndef c_thread
## SJL - NEED TO USE LIBCMT NOW
## c_thread = -MD
c_thread = -MT
!endif
!ifndef c_ndebugflags
c_ndebugflags = -DNDEBUG -Ob2 -Ot -O2 -G5
!endif
!ifndef c_debugflags
c_debugflags = -D_DEBUG -GX -Od -Z7
!endif
!ifndef l_ndebugflags
l_ndebugflags =
!endif
!ifndef l_debugflags
l_debugflags = -DEBUG -DEBUGTYPE:BOTH
!endif
# exe flags / objects
!ifndef l_exe_flags
l_exe_flags =
!endif
# DLL flags / objects
!ifndef l_dll_flags
l_dll_flags = -DLL -DEF:$(DEFNAME)
!endif
!ifndef DLLOBJS
DLLOBJS = $(OBJS)
!endif
# targets we will build
!ifndef targets
targets = $(SLIBNAME)
!ifdef SHAREDLIB
!if $(SHAREDLIB) == 1
targets = $(TARGETS) $(DLLNAME)
!endif
!endif
!endif
# versions we will build
!ifndef VERSIONS
VERSIONS = release.ver debug.ver
!endif
############################################################
# inference rules
# -mkdir $(OBJDIR:\= )
# -mkdir $(MKOBJDIR:\= )
# Target Directories
#$(OBJDIR:\= ) :
!if 0
$(OBJDIR:\= ) :
mkdir $*
cd $*
!endif
$(LIBDIR) :
# -mkdir $(LIBDIR)\..
-mkdir $(MKLIBDIR)
# Object files
{$(GENDIR)}.c{$(OBJDIR)}.obj:
$(CC) $(C_FLAGS) $< -Fo$@
{$(GENDIR)}.cpp{$(OBJDIR)}.obj:
$(CC) $(C_FLAGS) $< -Fo$@
{$(SRCDIR)}.c{$(OBJDIR)}.obj:
$(CC) $(C_FLAGS) $< -Fo$@
{$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
$(CC) $(C_FLAGS) $< -Fo$@
{$(WASMDIR)}.asm{$(OBJDIR)}.obj:
$(WASM) $< -fo=$@
editbin /NOLOGO /RELEASE $@
{$(ASMDIR)}.asm{$(OBJDIR)}.obj:
$(ASM) $< $@
editbin /NOLOGO /RELEASE $@
{$(SRCDIR)}.rc{$(OBJDIR)}.res:
$(RC) /fo$@ /dALG="$(CENV:-D= )" /dPROJ=$(PROJECT) /dMAJ=$(MAJREV) /dMIN=$(MINREV) /dPVER=$(PVER) /dBVER=$(BVER) $<
#
# building of targets
#
###$(SLIBNAME): $(OBJDIR:\= ) $(LIBDIR) $(OBJS)
$(SLIBNAME): $(OBJS)
LIB $(OBJS) /OUT:$@
!ifdef USER_LIBS
for %i in ($(USER_LIBS)) do LIB $(SLIBNAME) %i /OUT:$@
!endif
copy $(SLIBNAME) $(LIBDIR)
##$(DLLNAME): $(SLIBNAME) $(OBJDIR:\= ) $(LIBDIR) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(SLIBNAME) $(DLLOBJS)
$(DLLNAME): $(SLIBNAME) $(LIBDIR) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(SLIBNAME) $(DLLOBJS)
link $(L_FLAGS) $(l_dll_flags) /OUT:$(DLLNAME) $(DLLOBJS) $(SLIBNAME) /MAP:$(OBJDIR)$(PROJECT).map
copy $@ $(LIBDIR)
copy $(LIBNAME) $(LIBDIR)
$(EXENAME): $(OBJDIR:\= ) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(OBJS)
link $(L_FLAGS) $(l_exe_flags) /OUT:$(EXENAME) $(OBJS) /MAP:$(OBJDIR)$(PROJECT).map
#
# Goals
#
build_me: $(targets) $(PROJLIBS)
@echo Build Completed
#
# there should be a more elegant way to build the following directories
#
build_dirs:
@echo BUILDING DIRECTORIES
mkdir $(ROOT)Object
mkdir $(ROOT)Object\CoreLibs
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Release
mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Debug
release.ver:
set C_FLAGS=$(C_FLAGS) $(c_ndebugflags) $(c_thread) $(c_local)
set L_FLAGS=$(L_FLAGS) $(l_ndebugflags)
set OBJDIR=$(OBJRELDIR)
set LIBDIR=$(LIBRELDIR)
nmake /NOLOGO /C /S build_dirs
nmake /NOLOGO -f $(THISFILE) build_me
debug.ver:
@echo NOW DOING DEBUG VERSION
set C_FLAGS=$(C_FLAGS) $(c_debugflags) $(c_thread) $(c_local)
set L_FLAGS=$(L_FLAGS) $(l_debugflags)
set OBJDIR=$(OBJDEBDIR)
set LIBDIR=$(LIBDEBDIR)
nmake /NOLOGO /C /S build_dirs
nmake /NOLOGO -f $(THISFILE) build_me
all:: $(VERSIONS)
clean:
deltree /Y obj
deltree /Y obj.*
$(OBJDIR)sc_$(PROJECT).lib: $(LIBDIR)\sc_tm20.lib $(LIBDIR)\sc_torq.lib
LIB $(OBJS) /OUT:$@
LIB $@ $(LIBDIR)\s_tm1.lib /OUT:$@
LIB $@ $(LIBDIR)\sc_tm20.lib /OUT:$@
LIB $@ $(LIBDIR)\s_tmrt.lib /OUT:$@
LIB $@ $(LIBDIR)\sc_torq.lib /OUT:$@
copy $@ $(LIBDIR)

View file

@ -0,0 +1,15 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by dxv.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View file

@ -0,0 +1,22 @@
# win95 specific modules
OBJS = $(OBJS) \
$(OBJDIR)dxv.$(OBJ) \
$(OBJDIR)dkprof.$(OBJ) \
$(OBJDIR)perf.$(OBJ) \
$(OBJDIR)pentium.$(OBJ) \
$(OBJDIR)$(PROJECT).res
# modules specifically sent to linker,
# others are provided in libraries
DLLOBJS = $(OBJDIR)dxl_main.obj \
$(OBJDIR)dxv_mem.$(OBJ) \
$(OBJDIR)dxv_mems.$(OBJ) \
$(OBJDIR)$(PROJECT).res \
$(OBJDIR)$(PROJECT).$(OBJ)
PROJLIBS = $(PROJLIBS)
#$(OBJDIR)sc_$(PROJECT).lib

View file

@ -0,0 +1,229 @@
;/***********************************************\
;??? cpuid.asm
; checks for cpuid
; if an id is not found, the program assumes a x86
;\***********************************************/
; parts taken from intel's AP-485
;put checks for cmov and mmx support ????
.486
.MODEL flat, SYSCALL, os_dos
.CODE
IDEAL
NAME x86cpuid
MASM
PUBLIC getCPUID_
PUBLIC _getCPUID
INCLUDE proc.ash
EXTRN c cpuFeatures:DWORD
_486 EQU 4h
PENT EQU 50h
PENTMMX EQU 54h
PENTPRO EQU 61h
PENTII EQU 63h
AMD_K63D EQU 58h
AMD_K6 EQU 56h
AMD_K5 EQU 50h ; K5 has models 0 - 6
_6X86 EQU 52h
_6X86MX EQU 60h
.DATA
_vendor_id db "------------"
intel_id db "GenuineIntel"
amd_id db "AuthenticAMD"
cyrix_id db "CyrixInstead"
getCPUID_:
_getCPUID:
push esi ;safety sh*&
push edi
push ebp
push ebx
push ecx
push edx
;------------------------------------------------
; Intel486 processor check
; Checking for ability to set/clear ID flag (Bit 21) in EFLAGS
; which indicates the presence of a processor with the CPUID
; instruction.
;------------------------------------------------
.486
check_80486:
pushfd ; push original EFLAGS
pop eax ; get original EFLAGS
mov ebp,X86 ; rv
mov ecx, eax ; save original EFLAGS
xor eax, 200000h ; flip ID bit in EFLAGS
push eax ; save new EFLAGS value on stack
popfd ; replace current EFLAGS value
pushfd ; get new EFLAGS
pop eax ; store new EFLAGS in EAX
xor eax, ecx ; can not toggle ID bit,
je end_cpu_type486 ; processor=80486
;------------------------------------------------
; Execute CPUID instruction to not determine vendor, family,
; model, stepping and features. For the purpose of this
; code, only the initial set of CPUID information is saved.
;------------------------------------------------
; push ebx ; save registers
; push esi
; push edi
; push edx
; push ecx
; mov ebp,X86 ; rv
mov eax, 0 ; set up for CPUID instruction
CPU_ID ; get and save vendor ID
mov DWORD PTR _vendor_id, ebx
mov DWORD PTR _vendor_id[+4], edx
mov DWORD PTR _vendor_id[+8], ecx
cmp DWORD PTR intel_id, ebx
jne IsProc_AMD
cmp DWORD PTR intel_id[+4], edx
jne end_cpuid_type
cmp DWORD PTR intel_id[+8], ecx
jne end_cpuid_type ; if not equal, not an Intel processor
cmp eax, 1 ; make sure 1 is valid input for CPUID
jl end_cpuid_type ; if not, jump to end
mov eax, 1
CPU_ID ; get family/model/stepping/features
shr eax, 4 ; isolate family and model
mov ebp,PII ; assume PII
and eax,0ffh ;mask out type and reserved
nop
cmp eax,PENTII
jge end_cpuid_type
mov ebp,PPRO
cmp eax,PENTPRO
je end_cpuid_type
mov ebp,PMMX
cmp eax,PENTMMX
je end_cpuid_type
mov ebp,X86
; cmp eax,PENT
; jge end_cpuid_type
end_cpuid_type:
mov eax,ebp
mov [cpuFeatures],edx
pop edx ;safety sh*&
pop ecx
pop ebx
pop ebp
pop edi
pop esi
ret
end_cpu_type486:
mov eax,ebp
pop edx ;safety sh*&
pop ecx
pop ebx
pop ebp
pop edi
pop esi
ret
;------------------------------------------------
IsProc_AMD:
cmp DWORD PTR amd_id, ebx
jne IsProc_CYRIX
cmp DWORD PTR amd_id[+4], edx
jne end_cpuid_type
cmp DWORD PTR amd_id[+8], ecx
jne end_cpuid_type ; if not equal, not an AMD processor
cmp eax, 1 ; make sure 1 is valid input for CPUID
jl end_cpuid_type ; if not, jump to end
mov eax, 1
CPU_ID ; get family/model/stepping/features
shr eax, 4 ; isolate family and model
mov ebp,AMDK63D
and eax,0ffh ;mask out type and reserved
nop
cmp eax,AMD_K63D
jge end_cpuid_type
mov ebp,AMDK6
nop
cmp eax,AMD_K6
jge end_cpuid_type
mov ebp,X86
nop
cmp eax,AMD_K5
jge end_cpuid_type
mov ebp,X86
jmp end_cpuid_type
;------------------------------------------------
IsProc_CYRIX:
cmp DWORD PTR cyrix_id, ebx
jne end_cpuid_type
cmp DWORD PTR cyrix_id[+4], edx
jne end_cpuid_type
cmp DWORD PTR cyrix_id[+8], ecx
jne end_cpuid_type ; if not equal, not an CYRIX processor
cmp eax, 1 ; make sure 1 is valid input for CPUID
jl end_cpuid_type ; if not, jump to end
mov eax, 1
CPU_ID ; get family/model/stepping/features
shr eax, 4 ; isolate family and model
mov ebp,C6X86MX
and eax,0ffh ;mask out type and reserved
nop
cmp eax,_6X86MX
je end_cpuid_type
mov ebp,X86
jmp end_cpuid_type
;************************************************
END

View file

@ -0,0 +1,77 @@
; Pentium utilities. Timothy S. Murphy 1/11/97.
; This is a Borland i586 TASM source file.
; Works (at least) with Watcom C++ and Visual C++ using "cdecl" linkage.
.586
.MODEL flat, c, os_dos
.CODE
;------------------------------------------------
PUBLIC c pentiumKiloCycles, pentiumTime
pentiumKiloCycles:
push edx
; rdtsc ; get 64-bit cycle count in edx:eax
db 0Fh, 31h ; (tasm 4.0 doesn't have rdtsc opcode)
shrd eax, edx, 10 ; divide by 1024
pop edx
ret ; value in eax
pentiumTime:
push ebx
push edx
; rdtsc ; get 64-bit cycle count in edx:eax
db 0Fh, 31h ; (tasm 4.0 doesn't have rdtsc opcode)
shrd eax, edx, 10 ; divide by 1024
mov ebx, eax
mov eax, 12[esp]
shr eax, 1
lup: shr edx, 16
dec eax
nop
jns lup
; rdtsc ; get 64-bit cycle count in edx:eax
db 0Fh, 31h ; (tasm 4.0 doesn't have rdtsc opcode)
shrd eax, edx, 10 ; divide by 1024
sub eax, ebx
pop edx
pop ebx
ret ; value in eax
;------------------------------------------------
; void Get_scc(&preciseU32,&lessPreciseU32);
x86_Get_sccParams STRUC
dd 3 dup (?) ;3 pushed regs
dd ? ;return address
preciseU32 dd ?
lessPreciseU32 dd ?
x86_Get_sccParams ENDS
PUBLIC c Get_scc
Get_scc:
push edx
push esi
push edi
mov esi,[esp].preciseU32
mov edi,[esp].lessPreciseU32
; rdtsc ; get 64-bit cycle count in edx:eax
db 0Fh, 31h ; (tasm 4.0 doesn't have rdtsc opcode)
mov [edi],edx
mov [esi],eax
pop edi
pop esi
pop edx
ret ; value in eax
END

View file

@ -0,0 +1,183 @@
;/***********************************************\
;??? perf.asm
;\***********************************************/
.586
.MODEL flat, SYSCALL, os_dos
.CODE
IDEAL
NAME tsc
MASM
PUBLIC DUCK_sti_
PUBLIC _DUCK_sti
PUBLIC DUCK_cli_
PUBLIC _DUCK_cli
PUBLIC rdtsc_Start_
PUBLIC _rdtsc_Start
PUBLIC rdtsc_End_
PUBLIC _rdtsc_End
PUBLIC addTSC_
PUBLIC _addTSC
; typedef struct tsc_cnt {
; unsigned long low;
; unsigned long high;
; } *TSC_HANDLE, TSC;
DUCK_sti_:
_DUCK_sti:
sti
ret
DUCK_cli_:
_DUCK_cli:
cli
ret
;------------------------------------------------
; void rdtsc_Start(low, high)
;
rdtsc_StartParams STRUC
dd 3 dup (?) ;3 pushed regs
dd ? ;return address
low dd ?
high dd ?
rdtsc_StartParams ENDS
;------------------------------------------------
rdtsc_Start_:
_rdtsc_Start:
push ebx
push ecx
push edx
nop
mov ebx,[esp].low ;pointer to low
mov ecx,[esp].high ;pointer to high
; RDTSC
db 0fh, 31h
mov [ebx],eax ;return values
mov [ecx],edx
nop
pop edx
pop ecx
pop ebx
ret
;------------------------------------------------
; void rdtsc_End(unsigned long *)
;
rdtsc_EndParams STRUC
dd 6 dup (?) ;6 pushed regs
dd ? ;return address
elow dd ?
ehigh dd ?
rdtsc_EndParams ENDS
;------------------------------------------------
rdtsc_End_:
_rdtsc_End:
push esi
push edi
push ebp
push ebx
push ecx
push edx
mov edi,[esp].elow ;pointer to low var
mov esi,[esp].ehigh ;pointer to high var
; RDTSC
db 0fh, 31h
mov ebx,[edi] ;get start values
mov ecx,[esi]
sub eax,ebx
sbb edx,ecx
mov [edi],eax ;return values
mov [esi],edx
pop edx
pop ecx
pop ebx
pop ebp
pop edi
pop esi
ret
;------------------------------------------------
; adds time stamped counts and passes back average
;------------------------------------------------
; void addTSC(unsigned long *, unsigned long, unsigned long *);
;
addTSCParams STRUC
dd 6 dup (?) ;6 pushed regs
dd ? ;return address
dkTimes dd ?
dkCount dd ?
rv dd ?
addTSCParams ENDS
addTSC_:
_addTSC:
push esi
push edi
push ebp
push ebx
push ecx
push edx
xor ebp,ebp ;used for adc
mov eax,[esp].dkTimes ;pointer to array of TSC's
mov edi,[esp].dkCount ;array count
mov esi,[esp].rv ;pointer to result
xor edx,edx
mov ebx,[eax] ;get first TSC
mov ecx,[eax+4] ;get next TSC
add eax,8
adc edx,ebp
add ebx,ecx
add_loop:
dec edi
jz averageVal
mov ecx,[eax]
add eax,4
adc edx,ebp
add ebx,ecx
jmp add_loop
averageVal:
mov eax,ebx
mov ebx,[esp].dkCount ;array count
div ebx ;div edx:eax by ebx (eax=quo, edx=rem)
mov [esi],eax ;get average of counts
the_exit:
pop edx
pop ecx
pop ebx
pop ebp
pop edi
pop esi
ret
;************************************************
END

View file

@ -0,0 +1,22 @@
;/***********************************************\
;??? proc.ash
;\***********************************************/
CPU_ID MACRO
db 0fh ; Hardcoded CPUID instruction
db 0a2h
ENDM
;see proc.h
X86 EQU 0 ; /* 486, Pentium plain, or any other x86 compatible */
PMMX EQU 1 ; /* Pentium with MMX */
PPRO EQU 2 ; /* Pentium Pro */
PII EQU 3 ; /* Pentium II */
C6X86 EQU 4
C6X86MX EQU 5
AMDK63D EQU 6
AMDK6 EQU 7
AMDK5 EQU 8