static link to MFC, c runtime, zlib, libpng

This commit is contained in:
spacy51 2008-09-08 22:46:51 +00:00
parent 0caa163467
commit 49523c372c
2 changed files with 8 additions and 96 deletions

View File

@ -24,7 +24,7 @@
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
ConfigurationType="1"
UseOfMFC="2"
UseOfMFC="1"
CharacterSet="0"
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
>
@ -58,7 +58,7 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
SmallerTypeCheck="false"
RuntimeLibrary="3"
RuntimeLibrary="1"
StructMemberAlignment="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
@ -85,14 +85,14 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="zlib1d.lib libpng13d.lib"
AdditionalDependencies="nafxcwd.lib libcmtd.lib zlibd.lib libpngd.lib"
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
Version=""
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies="type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;x86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
IgnoreDefaultLibraryNames=""
IgnoreDefaultLibraryNames="nafxcwd.lib;libcmtd.lib"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="1"
@ -129,7 +129,7 @@
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
ConfigurationType="1"
UseOfMFC="2"
UseOfMFC="1"
UseOfATL="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="0"
@ -166,7 +166,7 @@
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;..\..\..\dependencies\File_Extractor-0.4.3\fex&quot;;..\..\..\dependencies\msvc"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
RuntimeLibrary="2"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="0"
FloatingPointModel="2"
@ -193,7 +193,7 @@
Name="VCLinkerTool"
RegisterOutput="false"
IgnoreImportLibrary="false"
AdditionalDependencies="zlib1.lib libpng13.lib"
AdditionalDependencies="nafxcw.lib libcmt.lib zlib.lib libpng.lib"
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
Version=""
LinkIncremental="0"
@ -201,7 +201,7 @@
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies="type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;x86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
IgnoreDefaultLibraryNames=""
IgnoreDefaultLibraryNames="nafxcw.lib;libcmt.lib"
GenerateDebugInformation="false"
AssemblyDebug="2"
GenerateMapFile="false"

View File

@ -6,94 +6,6 @@
#include <zlib.h>
#include "protect.h"
/* ========================================================================= */
// read below
static unsigned long gf2_matrix_times(mat, vec)
unsigned long *mat;
unsigned long vec;
{
unsigned long sum;
sum = 0;
while (vec) {
if (vec & 1)
sum ^= *mat;
vec >>= 1;
mat++;
}
return sum;
}
// read below
static void gf2_matrix_square(square, mat)
unsigned long *square;
unsigned long *mat;
{
int n;
for (n = 0; n < 32; n++)
square[n] = gf2_matrix_times(mat, mat[n]);
}
// This function is taken from zlib 1.2.3 (file: crc32.c)
// It is not exported by the DLL even though it is listed in zlib.h (bug?)
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off_t len2;
{
int n;
unsigned long row;
unsigned long even[32]; /* even-power-of-two zeros operator */
unsigned long odd[32]; /* odd-power-of-two zeros operator */
/* degenerate case */
if (len2 == 0)
return crc1;
/* put operator for one zero bit in odd */
odd[0] = 0xedb88320L; /* CRC-32 polynomial */
row = 1;
for (n = 1; n < 32; n++) {
odd[n] = row;
row <<= 1;
}
/* put operator for two zero bits in even */
gf2_matrix_square(even, odd);
/* put operator for four zero bits in odd */
gf2_matrix_square(odd, even);
/* apply len2 zeros to crc1 (first square will put the operator for one
zero byte, eight zero bits, in even) */
do {
/* apply zeros operator for this bit of len2 */
gf2_matrix_square(even, odd);
if (len2 & 1)
crc1 = gf2_matrix_times(even, crc1);
len2 >>= 1;
/* if no more bits set, then done */
if (len2 == 0)
break;
/* another iteration of the loop with odd and even swapped */
gf2_matrix_square(odd, even);
if (len2 & 1)
crc1 = gf2_matrix_times(odd, crc1);
len2 >>= 1;
/* if no more bits set, then done */
} while (len2 != 0);
/* return combined crc */
crc1 ^= crc2;
return crc1;
}
/* ========================================================================= */
char *unprotect_buffer(unsigned char *buffer, size_t buffer_len)
{
unsigned char *p = buffer, *end_p = p+buffer_len-1, previous = 0x11;