Skip to content

Commit

Permalink
Update zlib to 1.2.8. Fix x64 compiling.
Browse files Browse the repository at this point in the history
  • Loading branch information
loveemu committed Feb 11, 2014
1 parent a76f703 commit 3178b6a
Show file tree
Hide file tree
Showing 11 changed files with 1,471 additions and 614 deletions.
14 changes: 7 additions & 7 deletions src/Mp2kDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void Mp2kDriver::FindDriverParams(const uint8_t * rom, size_t rom_size, std::map
uint32_t sub_selectsong = GSF_INVALID_OFFSET;
if (params.count("sub_selectsong") == 0)
{
sub_selectsong = find_m4a_selectsong(rom, rom_size);
sub_selectsong = find_m4a_selectsong(rom, (uint32_t) rom_size);
if (sub_selectsong == GSF_INVALID_OFFSET)
{
return;
Expand All @@ -94,7 +94,7 @@ void Mp2kDriver::FindDriverParams(const uint8_t * rom, size_t rom_size, std::map
uint32_t array_songs = GSF_INVALID_OFFSET;
if (params.count("_array_songs") == 0)
{
array_songs = find_m4a_songtable(rom, rom_size, sub_selectsong);
array_songs = find_m4a_songtable(rom, (uint32_t) rom_size, sub_selectsong);
if (array_songs != GSF_INVALID_OFFSET)
{
params["_array_songs"] = VgmDriverParam(gba_offset_to_address(array_songs), true);
Expand All @@ -116,7 +116,7 @@ void Mp2kDriver::FindDriverParams(const uint8_t * rom, size_t rom_size, std::map
uint32_t sub_main = GSF_INVALID_OFFSET;
if (params.count("sub_main") == 0)
{
sub_main = find_m4a_main(rom, rom_size, sub_selectsong);
sub_main = find_m4a_main(rom, (uint32_t) rom_size, sub_selectsong);
if (sub_main == GSF_INVALID_OFFSET)
{
return;
Expand All @@ -143,7 +143,7 @@ void Mp2kDriver::FindDriverParams(const uint8_t * rom, size_t rom_size, std::map
uint32_t sub_init = GSF_INVALID_OFFSET;
if (params.count("sub_init") == 0)
{
sub_init = find_m4a_init(rom, rom_size, sub_main);
sub_init = find_m4a_init(rom, (uint32_t) rom_size, sub_main);
if (sub_init == GSF_INVALID_OFFSET)
{
return;
Expand All @@ -170,7 +170,7 @@ void Mp2kDriver::FindDriverParams(const uint8_t * rom, size_t rom_size, std::map
uint32_t sub_vsync = GSF_INVALID_OFFSET;
if (params.count("sub_vsync") == 0)
{
sub_vsync = find_m4a_vsync(rom, rom_size, sub_init);
sub_vsync = find_m4a_vsync(rom, (uint32_t) rom_size, sub_init);
if (sub_vsync == GSF_INVALID_OFFSET)
{
return;
Expand Down Expand Up @@ -272,7 +272,7 @@ int Mp2kDriver::GetSongCount(const uint8_t * rom, size_t rom_size, const std::ma
return 0;
}
array_songs = gba_address_to_offset(array_songs);
return m4a_get_song_count(rom, rom_size, array_songs);
return m4a_get_song_count(rom, (uint32_t) rom_size, array_songs);
}

// Return offset of song index variable in relocatable driver block.
Expand Down Expand Up @@ -330,7 +330,7 @@ bool Mp2kDriver::IsSongDuplicate(const uint8_t * rom, size_t rom_size, const std
return false;
}
array_songs = gba_address_to_offset(array_songs);
return m4a_is_song_duplicate(rom, rom_size, array_songs, song);
return m4a_is_song_duplicate(rom, (uint32_t) rom_size, array_songs, song);
}

uint32_t Mp2kDriver::find_m4a_selectsong(const uint8_t * rom, uint32_t rom_size)
Expand Down
2 changes: 1 addition & 1 deletion src/VgmDriverParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class VgmDriverParam

if (size > data.size())
{
size = data.size();
size = (uint32_t) data.size();
}

memcpy(buf, data.c_str(), size);
Expand Down
Binary file removed src/lib/Win32/zlib.lib
Binary file not shown.
Binary file added src/lib/Win32/zlibstat.lib
Binary file not shown.
Binary file added src/lib/x64/zlibstat.lib
Binary file not shown.
6 changes: 5 additions & 1 deletion src/saptapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#define APP_DESC "Automated GSF ripper tool"
#define APP_AUTHOR "Caitsith2, revised by loveemu <http://github.com/loveemu/saptapper>"

#ifdef _WIN32
#define ZLIB_WINAPI
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -20,7 +24,7 @@
#include <sstream>
#include <map>

#include "zlib.h"
#include <zlib.h>

#include "saptapper.h"
#include "BytePattern.h"
Expand Down
76 changes: 62 additions & 14 deletions src/saptapper.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,25 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LibraryPath>$(ProjectDir)lib\Win32;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)zlib;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>$(ProjectDir)lib\x64;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)zlib;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LibraryPath>$(ProjectDir)lib\Win32;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)zlib;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(ProjectDir)lib\x64;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)zlib;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand All @@ -85,14 +93,16 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)zlib</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlib.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)lib\Win32</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlibstat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
Expand All @@ -103,14 +113,16 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)zlib</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlib.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)lib\x64</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlibstat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
Expand All @@ -123,7 +135,8 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)zlib</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -132,8 +145,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlib.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)lib\Win32</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlibstat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -145,7 +159,8 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)zlib</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
Expand All @@ -154,8 +169,9 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlib.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)lib\x64</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;zlibstat.lib;setargv.obj;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -192,7 +208,7 @@ objcopy -O binary $(IntDir)%(Filename).gba
if errorlevel 1 goto END
bin\bincrop -o $(IntDir)%(Filename).bin $(IntDir)%(Filename).gba __DRIVER_START__ ___DRIVER_END___
if errorlevel 1 goto END
bin\bin2c -n driver_block -o %(Outputs) $(IntDir)%(Filename).bin
bin\bin2c -n driver_block -o %(RelativeDir)%(Filename).h $(IntDir)%(Filename).bin
if errorlevel 1 goto END
:END
</Command>
Expand All @@ -207,10 +223,42 @@ objcopy -O binary $(IntDir)%(Filename).gba
if errorlevel 1 goto END
bin\bincrop -o $(IntDir)%(Filename).bin $(IntDir)%(Filename).gba __DRIVER_START__ ___DRIVER_END___
if errorlevel 1 goto END
bin\bin2c -n driver_block -o %(Outputs) $(IntDir)%(Filename).bin
bin\bin2c -n driver_block -o %(RelativeDir)%(Filename).h $(IntDir)%(Filename).bin
if errorlevel 1 goto END
:END
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cd C:\devkitadv-r5-beta-3
if errorlevel 1 goto END
call cmd-rc.bat
if errorlevel 1 goto END
cd $(ProjectDir)
gcc -o $(IntDir)%(Filename).gba %(FullPath)
if errorlevel 1 goto END
objcopy -O binary $(IntDir)%(Filename).gba
if errorlevel 1 goto END
bin\bincrop -o $(IntDir)%(Filename).bin $(IntDir)%(Filename).gba __DRIVER_START__ ___DRIVER_END___
if errorlevel 1 goto END
bin\bin2c -n driver_block -o %(RelativeDir)%(Filename).h $(IntDir)%(Filename).bin
if errorlevel 1 goto END
:END
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cd C:\devkitadv-r5-beta-3
if errorlevel 1 goto END
call cmd-rc.bat
if errorlevel 1 goto END
cd $(ProjectDir)
gcc -o $(IntDir)%(Filename).gba %(FullPath)
if errorlevel 1 goto END
objcopy -O binary $(IntDir)%(Filename).gba
if errorlevel 1 goto END
bin\bincrop -o $(IntDir)%(Filename).bin $(IntDir)%(Filename).gba __DRIVER_START__ ___DRIVER_END___
if errorlevel 1 goto END
bin\bin2c -n driver_block -o %(RelativeDir)%(Filename).h $(IntDir)%(Filename).bin
if errorlevel 1 goto END
:END
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(RelativeDir)%(Filename).h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(RelativeDir)%(Filename).h</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
Loading

0 comments on commit 3178b6a

Please sign in to comment.