diff --git a/doc/DevInfo.txt b/doc/DevInfo.txt index 361cf78c..b5aa032d 100644 --- a/doc/DevInfo.txt +++ b/doc/DevInfo.txt @@ -39,17 +39,24 @@ They are built with the static C runtime (this is what the releases use). # Visual C++ 2008 project files # ################################# -There are two solution files for Visual C++ 2008: +Using Microsoft Visual C++ 2008, you can build the Win32/MFC and the Win32/Qt build. +Refer to the instructions below for further assistance: ===Win32/MFC=== -The Windows MFC GUI version project files are located in trunk/project/vc2008_mfc (VBA2008.sln). -In order to compile it, you have to compile or download a precompiled version of zlib and libpng first -and set your compiler's INCLUDE and LIB path accordingly. -You also need Microsoft's DirectX SDK (At least for DirectInput). +This is the full-featured Windows build using the MFC GUI. +The project files are located in trunk/project/vc2008_mfc (VBA2008.sln). +Before you can compile it, you have to take care of some prerequisites: +Download the zlib & libpng sources from the internet and extract them both to the same folder. +Rename them so you have a folder called libpng and another one called zlib in the same loaction. +Open libpng/projects/visualc71/libpng.sln. Let the assistant convert them if necessary. +Build the "DLL Release" & "DLL Debug" configurations. +Set up your operating system's PATH variable to point to the created zlib & libpng DLLs. +Set up your compiler's LIB & INCLUDE paths to point to the created lib files and the source files. +You also have to install Microsoft's DirectX SDK for DirectInput & XAudio2. If you want to enable OpenAL sound output, install the OpenAL SDK. If you do not want it, #define NO_OAL. -Some pixel filters come with assembler code compatible with NASM syntax. -Extract NASM somewhere and add it to your compiler's PATH environment variable. -All .asm files should be handled with the "nasm.rules" build rules file. +Some pixel filters come with assembler code, which compatible to the NASM syntax. +Extract NASM somewhere and add it to your compiler's executable file paths. +All .asm files will be handled with the "nasm.rules" build rules file which comes with this project file. ===Win32/Qt=== The MS Visual C++ 2008 Express-compatible project file can be found in trunk/project/vc2008_qt. diff --git a/project/vc2008_mfc/VBA2008.vcproj b/project/vc2008_mfc/VBA2008.vcproj index 34a97268..6c07343d 100644 --- a/project/vc2008_mfc/VBA2008.vcproj +++ b/project/vc2008_mfc/VBA2008.vcproj @@ -24,7 +24,7 @@ OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp" ConfigurationType="1" - UseOfMFC="1" + UseOfMFC="2" CharacterSet="0" BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm" > @@ -58,7 +58,7 @@ MinimalRebuild="true" BasicRuntimeChecks="3" SmallerTypeCheck="false" - RuntimeLibrary="1" + RuntimeLibrary="3" StructMemberAlignment="0" BufferSecurityCheck="false" EnableFunctionLevelLinking="false" @@ -85,14 +85,14 @@ /> - - - #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;