CHANGED everything to use C/C++/MFC runtime DLLs + libpng/zlib DLL versions
ADDED workaround for missing crc32_combine function in default zlib DLL
This commit is contained in:
parent
54addad74b
commit
82b4889980
|
@ -39,17 +39,24 @@ They are built with the static C runtime (this is what the releases use).
|
||||||
# Visual C++ 2008 project files #
|
# 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===
|
===Win32/MFC===
|
||||||
The Windows MFC GUI version project files are located in trunk/project/vc2008_mfc (VBA2008.sln).
|
This is the full-featured Windows build using the MFC GUI.
|
||||||
In order to compile it, you have to compile or download a precompiled version of zlib and libpng first
|
The project files are located in trunk/project/vc2008_mfc (VBA2008.sln).
|
||||||
and set your compiler's INCLUDE and LIB path accordingly.
|
Before you can compile it, you have to take care of some prerequisites:
|
||||||
You also need Microsoft's DirectX SDK (At least for DirectInput).
|
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.
|
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.
|
Some pixel filters come with assembler code, which compatible to the NASM syntax.
|
||||||
Extract NASM somewhere and add it to your compiler's PATH environment variable.
|
Extract NASM somewhere and add it to your compiler's executable file paths.
|
||||||
All .asm files should be handled with the "nasm.rules" build rules file.
|
All .asm files will be handled with the "nasm.rules" build rules file which comes with this project file.
|
||||||
|
|
||||||
===Win32/Qt===
|
===Win32/Qt===
|
||||||
The MS Visual C++ 2008 Express-compatible project file can be found in trunk/project/vc2008_qt.
|
The MS Visual C++ 2008 Express-compatible project file can be found in trunk/project/vc2008_qt.
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
||||||
ConfigurationType="1"
|
ConfigurationType="1"
|
||||||
UseOfMFC="1"
|
UseOfMFC="2"
|
||||||
CharacterSet="0"
|
CharacterSet="0"
|
||||||
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
|
BuildLogFile="$(IntDir)\$(ProjectName)_BuildLog.htm"
|
||||||
>
|
>
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
SmallerTypeCheck="false"
|
SmallerTypeCheck="false"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="3"
|
||||||
StructMemberAlignment="0"
|
StructMemberAlignment="0"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableFunctionLevelLinking="false"
|
EnableFunctionLevelLinking="false"
|
||||||
|
@ -85,14 +85,14 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="nafxcwd.lib LIBCMTD.lib zlibd.lib libpngd.lib"
|
AdditionalDependencies="zlib1d.lib libpng13d.lib"
|
||||||
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
Version=""
|
Version=""
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
AdditionalLibraryDirectories=""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateManifest="true"
|
GenerateManifest="true"
|
||||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||||
IgnoreDefaultLibraryNames="nafxcwd.lib;LIBCMTD.lib"
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
OptimizeReferences="1"
|
OptimizeReferences="1"
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)_temp"
|
||||||
ConfigurationType="1"
|
ConfigurationType="1"
|
||||||
UseOfMFC="1"
|
UseOfMFC="2"
|
||||||
UseOfATL="0"
|
UseOfATL="0"
|
||||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
CharacterSet="0"
|
CharacterSet="0"
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
WholeProgramOptimization="true"
|
WholeProgramOptimization="true"
|
||||||
AdditionalIncludeDirectories=""..\..\..\dependencies\File_Extractor-0.4.3\fex";..\..\..\dependencies\msvc"
|
AdditionalIncludeDirectories=""..\..\..\dependencies\File_Extractor-0.4.3\fex";..\..\..\dependencies\msvc"
|
||||||
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="2"
|
||||||
BufferSecurityCheck="false"
|
BufferSecurityCheck="false"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
FloatingPointModel="2"
|
FloatingPointModel="2"
|
||||||
|
@ -193,17 +193,15 @@
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
RegisterOutput="false"
|
RegisterOutput="false"
|
||||||
IgnoreImportLibrary="false"
|
IgnoreImportLibrary="false"
|
||||||
AdditionalDependencies="nafxcw.lib zlib.lib libpng.lib LIBCMT.lib"
|
AdditionalDependencies="zlib1.lib libpng13.lib"
|
||||||
ShowProgress="0"
|
|
||||||
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
OutputFile="$(OutDir)\VisualBoyAdvance.exe"
|
||||||
Version=""
|
Version=""
|
||||||
LinkIncremental="0"
|
LinkIncremental="0"
|
||||||
SuppressStartupBanner="true"
|
SuppressStartupBanner="true"
|
||||||
AdditionalLibraryDirectories=""c:\Program Files\Microsoft DirectX SDK (November 2007)\lib\x86""
|
AdditionalLibraryDirectories=""
|
||||||
GenerateManifest="true"
|
GenerateManifest="true"
|
||||||
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
AdditionalManifestDependencies="type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"
|
||||||
IgnoreAllDefaultLibraries="false"
|
IgnoreDefaultLibraryNames=""
|
||||||
IgnoreDefaultLibraryNames="nafxcw.lib;LIBCMT.lib"
|
|
||||||
GenerateDebugInformation="false"
|
GenerateDebugInformation="false"
|
||||||
AssemblyDebug="2"
|
AssemblyDebug="2"
|
||||||
GenerateMapFile="false"
|
GenerateMapFile="false"
|
||||||
|
@ -454,14 +452,6 @@
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\memgzio.c"
|
RelativePath="..\..\src\memgzio.c"
|
||||||
>
|
>
|
||||||
<FileConfiguration
|
|
||||||
Name="Release|Win32"
|
|
||||||
>
|
|
||||||
<Tool
|
|
||||||
Name="VCCLCompilerTool"
|
|
||||||
CompileAs="1"
|
|
||||||
/>
|
|
||||||
</FileConfiguration>
|
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\src\win32\protect.c"
|
RelativePath="..\..\src\win32\protect.c"
|
||||||
|
|
|
@ -6,6 +6,94 @@
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include "protect.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)
|
char *unprotect_buffer(unsigned char *buffer, size_t buffer_len)
|
||||||
{
|
{
|
||||||
unsigned char *p = buffer, *end_p = p+buffer_len-1, previous = 0x11;
|
unsigned char *p = buffer, *end_p = p+buffer_len-1, previous = 0x11;
|
||||||
|
|
Loading…
Reference in New Issue