shuffles magic mush...... trunk MSVC2010 buildfix
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1071 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
9ad39de0b9
commit
05d20571f7
|
@ -192,18 +192,17 @@ SET(SRC_FEX
|
|||
fex/7z_C/7zBuf.c
|
||||
fex/7z_C/7zCrc.c
|
||||
fex/7z_C/7zCrcOpt.c
|
||||
fex/7z_C/7zDecode.c
|
||||
fex/7z_C/7zExtract.c
|
||||
fex/7z_C/7zHeader.c
|
||||
fex/7z_C/7zDec.c
|
||||
fex/7z_C/7zIn.c
|
||||
fex/7z_C/7zItem.c
|
||||
fex/7z_C/7zStream.c
|
||||
fex/7z_C/Bcj2.c
|
||||
fex/7z_C/Bra.c
|
||||
fex/7z_C/Bra86.c
|
||||
fex/7z_C/Bra.c
|
||||
fex/7z_C/CpuArch.c
|
||||
fex/7z_C/LzmaDec.c
|
||||
fex/7z_C/Lzma2Dec.c
|
||||
fex/7z_C/LzmaDec.c
|
||||
fex/7z_C/Ppmd7.c
|
||||
fex/7z_C/Ppmd7Dec.c
|
||||
fex/fex/Binary_Extractor.cpp
|
||||
fex/fex/blargg_common.cpp
|
||||
fex/fex/blargg_errors.cpp
|
||||
|
|
|
@ -74,7 +74,7 @@ static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
|
|||
|
||||
// Mac cross-compile compiler:
|
||||
// can't find register in class 'BREG' while reloading 'asm'
|
||||
// so use class 'r' and register var binding
|
||||
// so use class 'r' register var binding
|
||||
register _b asm("%bx");
|
||||
__asm__ __volatile__ (
|
||||
"cpuid"
|
||||
|
|
|
@ -165,22 +165,7 @@ static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT s
|
|||
p->processedPos += (UInt32)size;
|
||||
}
|
||||
|
||||
static
|
||||
void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)
|
||||
{
|
||||
p->needFlush = 1;
|
||||
p->remainLen = 0;
|
||||
p->tempBufSize = 0;
|
||||
|
||||
if (initDic)
|
||||
{
|
||||
p->processedPos = 0;
|
||||
p->checkDicSize = 0;
|
||||
p->needInitState = 1;
|
||||
}
|
||||
if (initState)
|
||||
p->needInitState = 1;
|
||||
}
|
||||
void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState);
|
||||
|
||||
SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
|
||||
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
|
||||
|
|
|
@ -682,7 +682,6 @@ static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
|
|||
p->needFlush = 0;
|
||||
}
|
||||
|
||||
static
|
||||
void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)
|
||||
{
|
||||
p->needFlush = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
LZMA SDK 4.65
|
||||
LZMA SDK 9.20
|
||||
-------------
|
||||
|
||||
LZMA SDK provides the documentation, samples, header files, libraries,
|
||||
|
@ -20,6 +20,10 @@ LICENSE
|
|||
|
||||
LZMA SDK is written and placed in the public domain by Igor Pavlov.
|
||||
|
||||
Some code in LZMA SDK is based on public domain code from another developers:
|
||||
1) PPMd var.H (2001): Dmitry Shkarin
|
||||
2) SHA-256: Wei Dai (Crypto++ library)
|
||||
|
||||
|
||||
LZMA SDK Contents
|
||||
-----------------
|
||||
|
@ -33,7 +37,7 @@ LZMA SDK includes:
|
|||
UNIX/Linux version
|
||||
------------------
|
||||
To compile C++ version of file->file LZMA encoding, go to directory
|
||||
C++/7zip/Compress/LZMA_Alone
|
||||
CPP/7zip/Bundles/LzmaCon
|
||||
and call make to recompile it:
|
||||
make -f makefile.gcc clean all
|
||||
|
||||
|
@ -49,6 +53,7 @@ lzma.txt - LZMA SDK description (this file)
|
|||
7zC.txt - 7z ANSI-C Decoder description
|
||||
methods.txt - Compression method IDs for .7z
|
||||
lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
|
||||
7zr.exe - 7-Zip with 7z/lzma/xz support.
|
||||
history.txt - history of the LZMA SDK
|
||||
|
||||
|
||||
|
@ -86,12 +91,6 @@ CPP/ -- CPP files
|
|||
|
||||
Compress - files related to compression/decompression
|
||||
|
||||
Copy - Copy coder
|
||||
RangeCoder - Range Coder (special code of compression/decompression)
|
||||
LZMA - LZMA compression/decompression on C++
|
||||
LZMA_Alone - file->file LZMA compression/decompression
|
||||
Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
|
||||
|
||||
Archive - files related to archiving
|
||||
|
||||
Common - common files for archive handling
|
||||
|
@ -100,6 +99,7 @@ CPP/ -- CPP files
|
|||
Bundles - Modules that are bundles of other modules
|
||||
|
||||
Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
|
||||
LzmaCon - lzma.exe: LZMA compression/decompression
|
||||
Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
|
||||
Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
|
||||
|
||||
|
@ -527,7 +527,8 @@ static ISzAlloc g_Alloc = { SzAlloc, SzFree };
|
|||
LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
|
||||
|
||||
|
||||
If callback function return some error code, LzmaEnc_Encode also returns that code.
|
||||
If callback function return some error code, LzmaEnc_Encode also returns that code
|
||||
or it can return the code like SZ_ERROR_READ, SZ_ERROR_WRITE or SZ_ERROR_PROGRESS.
|
||||
|
||||
|
||||
Single-call RAM->RAM Compression
|
||||
|
@ -549,8 +550,8 @@ Return code:
|
|||
|
||||
|
||||
|
||||
LZMA Defines
|
||||
------------
|
||||
Defines
|
||||
-------
|
||||
|
||||
_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
|
||||
|
||||
|
@ -562,6 +563,9 @@ _LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is
|
|||
_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
|
||||
|
||||
|
||||
_7ZIP_PPMD_SUPPPORT - Define it if you don't want to support PPMD method in AMSI-C .7z decoder.
|
||||
|
||||
|
||||
C++ LZMA Encoder/Decoder
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
C++ LZMA code use COM-like interfaces. So if you want to use it,
|
||||
|
|
|
@ -18,12 +18,10 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
|
@ -37,10 +35,6 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
|
@ -49,24 +43,19 @@
|
|||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)$(ProjectName)_BuildLog.htm</Path>
|
||||
</BuildLog>
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\dependencies\zlib;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\dependencies\zlib;$(ProjectDir);$(ProjectDir)7z_C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)$(ProjectName)_BuildLog.htm</Path>
|
||||
</BuildLog>
|
||||
<BuildLog />
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\dependencies\zlib;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -80,7 +69,7 @@
|
|||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -88,11 +77,8 @@
|
|||
<ClCompile Include="7z_C\7zBuf.c" />
|
||||
<ClCompile Include="7z_C\7zCrc.c" />
|
||||
<ClCompile Include="7z_C\7zCrcOpt.c" />
|
||||
<ClCompile Include="7z_C\7zDecode.c" />
|
||||
<ClCompile Include="7z_C\7zExtract.c" />
|
||||
<ClCompile Include="7z_C\7zHeader.c" />
|
||||
<ClCompile Include="7z_C\7zDec.c" />
|
||||
<ClCompile Include="7z_C\7zIn.c" />
|
||||
<ClCompile Include="7z_C\7zItem.c" />
|
||||
<ClCompile Include="7z_C\7zStream.c" />
|
||||
<ClCompile Include="7z_C\Bcj2.c" />
|
||||
<ClCompile Include="7z_C\Bra.c" />
|
||||
|
@ -100,6 +86,8 @@
|
|||
<ClCompile Include="7z_C\CpuArch.c" />
|
||||
<ClCompile Include="7z_C\Lzma2Dec.c" />
|
||||
<ClCompile Include="7z_C\LzmaDec.c" />
|
||||
<ClCompile Include="7z_C\Ppmd7.c" />
|
||||
<ClCompile Include="7z_C\Ppmd7Dec.c" />
|
||||
<ClCompile Include="fex\Binary_Extractor.cpp" />
|
||||
<ClCompile Include="fex\blargg_common.cpp" />
|
||||
<ClCompile Include="fex\blargg_errors.cpp" />
|
||||
|
@ -114,18 +102,17 @@
|
|||
<ClCompile Include="fex\Zlib_Inflater.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="7z_C\7z.h" />
|
||||
<ClInclude Include="7z_C\7zAlloc.h" />
|
||||
<ClInclude Include="7z_C\7zBuf.h" />
|
||||
<ClInclude Include="7z_C\7zCrc.h" />
|
||||
<ClInclude Include="7z_C\7zExtract.h" />
|
||||
<ClInclude Include="7z_C\7zHeader.h" />
|
||||
<ClInclude Include="7z_C\7zIn.h" />
|
||||
<ClInclude Include="7z_C\7zItem.h" />
|
||||
<ClInclude Include="7z_C\Bcj2.h" />
|
||||
<ClInclude Include="7z_C\Bra.h" />
|
||||
<ClInclude Include="7z_C\CpuArch.h" />
|
||||
<ClInclude Include="7z_C\Lzma2Dec.h" />
|
||||
<ClInclude Include="7z_C\LzmaDec.h" />
|
||||
<ClInclude Include="7z_C\Ppmd.h" />
|
||||
<ClInclude Include="7z_C\Ppmd7.h" />
|
||||
<ClInclude Include="7z_C\Types.h" />
|
||||
<ClInclude Include="fex\Binary_Extractor.h" />
|
||||
<ClInclude Include="fex\blargg_common.h" />
|
||||
|
@ -153,7 +140,7 @@
|
|||
<None Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\zlib\project\vs2010\zlib.vcxproj">
|
||||
<ProjectReference Include="..\..\dependencies\zlib\project\vs2010\zlib.vcxproj">
|
||||
<Project>{3e03c179-8251-46e4-81f4-466f114bac63}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="7z">
|
||||
<UniqueIdentifier>{4f3646e4-ddc5-4030-9ba1-7629a947e5db}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="fex">
|
||||
<UniqueIdentifier>{40ba751f-4ce2-4162-85a2-0c2ae2f33ae2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="7z_C">
|
||||
<UniqueIdentifier>{4f3646e4-ddc5-4030-9ba1-7629a947e5db}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="fex\Binary_Extractor.cpp">
|
||||
|
@ -46,52 +46,49 @@
|
|||
<Filter>fex</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zAlloc.c">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zBuf.c">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zCrc.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zExtract.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zHeader.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zIn.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zItem.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zStream.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Bcj2.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Bra86.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\LzmaDec.c">
|
||||
<Filter>7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\CpuArch.c">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zCrcOpt.c">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Lzma2Dec.c">
|
||||
<Filter>7z</Filter>
|
||||
<ClCompile Include="7z_C\7zDec.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zIn.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zStream.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Bcj2.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Bra.c">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\7zDecode.c">
|
||||
<Filter>7z</Filter>
|
||||
<ClCompile Include="7z_C\Bra86.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\CpuArch.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Lzma2Dec.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\LzmaDec.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Ppmd7.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="7z_C\Ppmd7Dec.c">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -140,44 +137,41 @@
|
|||
<ClInclude Include="fex\Zlib_Inflater.h">
|
||||
<Filter>fex</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7z.h">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zAlloc.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zBuf.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zCrc.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zExtract.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zHeader.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zIn.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\7zItem.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Bcj2.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Bra.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\CpuArch.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\LzmaDec.h">
|
||||
<Filter>7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Types.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Lzma2Dec.h">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\LzmaDec.h">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Ppmd7.h">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Ppmd.h">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="7z_C\Types.h">
|
||||
<Filter>7z_C</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -187,10 +181,10 @@
|
|||
<None Include="license.txt" />
|
||||
<None Include="readme.txt" />
|
||||
<None Include="7z_C\7zC.txt">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</None>
|
||||
<None Include="7z_C\lzma.txt">
|
||||
<Filter>7z</Filter>
|
||||
<Filter>7z_C</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -30,10 +30,10 @@ Global
|
|||
{823DDC98-42D5-4A38-88CF-9DC06C788AE4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{823DDC98-42D5-4A38-88CF-9DC06C788AE4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{823DDC98-42D5-4A38-88CF-9DC06C788AE4}.Release|Win32.Build.0 = Release|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.ActiveCfg = LIB Debug|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.Build.0 = LIB Debug|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.ActiveCfg = LIB Release|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.Build.0 = LIB Release|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0008960E-E0DD-41A6-8265-00B31DDB4C21}.Release|Win32.Build.0 = Release|Win32
|
||||
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7AEC599C-7C82-4F00-AA60-411E0A359CB0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
|
Binary file not shown.
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
|
@ -9,10 +9,6 @@
|
|||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Template|Win32">
|
||||
<Configuration>Template</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>VisualBoyAdvance-M</ProjectName>
|
||||
|
@ -22,16 +18,9 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>Static</UseOfMfc>
|
||||
<CharacterSet>NotSet</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="nasm.props" />
|
||||
|
@ -47,15 +36,6 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
<PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreBuildEventUseInBuild>
|
||||
<PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreLinkEventUseInBuild>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
|
||||
<PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PostBuildEventUseInBuild>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
<PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PreBuildEventUseInBuild>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
|
@ -63,20 +43,17 @@
|
|||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" />
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files (x86)\OpenAL 1.1 SDK\libs\Win32;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86;$(LibraryPath)</LibraryPath>
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">C:\Program Files (x86)\OpenAL 1.1 SDK\libs\Win32;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86;$(LibraryPath)</LibraryPath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Program Files (x86)\OpenAL 1.1 SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">C:\Program Files (x86)\OpenAL 1.1 SDK\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include;$(IncludePath)</IncludePath>
|
||||
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%programfiles%\OpenAL 1.1 SDK\include;$(DXSDK_DIR)\Include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%programfiles%\OpenAL 1.1 SDK\libs\Win32;$(DXSDK_DIR)\lib\x86;$(LibraryPath)</LibraryPath>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Platform)\$(Configuration)_temp\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)$(ProjectName)_BuildLog.htm</Path>
|
||||
</BuildLog>
|
||||
<BuildLog />
|
||||
<PreBuildEvent>
|
||||
<Command>SubWCRev.exe ..\.. svnrev_template.h ..\..\src\svnrev.h</Command>
|
||||
</PreBuildEvent>
|
||||
|
@ -93,43 +70,35 @@
|
|||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<SmallerTypeCheck>false</SmallerTypeCheck>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<StructMemberAlignment>Default</StructMemberAlignment>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<FunctionLevelLinking>false</FunctionLevelLinking>
|
||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<ResourceCompile />
|
||||
<Link>
|
||||
<AdditionalDependencies>nafxcwd.lib;libcmtd.lib;zlibd.lib;libpngd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)VisualBoyAdvance-M.exe</OutputFile>
|
||||
<Version>
|
||||
</Version>
|
||||
<AdditionalLibraryDirectories>..\..\..\dependencies\libpng\project\vs2010\Win32\LIB Debug;..\..\..\dependencies\zlib\project\vs2010\Win32\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>nafxcwd.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>false</OptimizeReferences>
|
||||
<EnableCOMDATFolding>false</EnableCOMDATFolding>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>nafxcwd.lib;libcmtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>nafxcwd.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)$(ProjectName)_BuildLog.htm</Path>
|
||||
</BuildLog>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<BuildLog />
|
||||
<PreBuildEvent>
|
||||
<Command>SubWCRev.exe ..\.. svnrev_template.h ..\..\src\svnrev.h</Command>
|
||||
</PreBuildEvent>
|
||||
|
@ -143,7 +112,6 @@
|
|||
/MP %(AdditionalOptions)</AdditionalOptions>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<AdditionalIncludeDirectories>..\..\fex;..\..\..\dependencies\libpng;..\..\..\dependencies\msvc;..\..\..\dependencies\SFML\include;..\..\..\dependencies\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;GBA_LOGGING;OEMRESOURCE;MMX;ASM;FINAL_VERSION;BKPT_SUPPORT;_CRT_SECURE_NO_DEPRECATE;HAS_FILE_EXTRACTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
|
@ -151,36 +119,37 @@
|
|||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<MultiProcessorCompilation>
|
||||
</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<ResourceCompile />
|
||||
<Link>
|
||||
<AdditionalDependencies>nafxcw.lib;libcmt.lib;zlib.lib;libpng.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>nafxcw.lib;libcmt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<Version>
|
||||
</Version>
|
||||
<AdditionalLibraryDirectories>..\..\..\dependencies\libpng\project\vs2010\Win32\LIB Release;..\..\..\dependencies\zlib\project\vs2010\Win32\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalManifestDependencies>%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>nafxcw.lib;libcmt.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<AssemblyDebug>false</AssemblyDebug>
|
||||
<IgnoreSpecificDefaultLibraries>nafxcw.lib;libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<MinimumRequiredVersion>5.0</MinimumRequiredVersion>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AssemblyDebug>
|
||||
</AssemblyDebug>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
</Link>
|
||||
<NASM>
|
||||
<Optimization>1</Optimization>
|
||||
</NASM>
|
||||
<BuildLog />
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)$(ProjectName)_BuildLog.htm</Path>
|
||||
</BuildLog>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\win32\resource.h" />
|
||||
|
@ -693,13 +662,13 @@
|
|||
<Project>{823ddc98-42d5-4a38-88cf-9dc06c788ae4}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\dependencies\zlib\project\vs2010\zlib.vcxproj">
|
||||
<Project>{3e03c179-8251-46e4-81f4-466f114bac63}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\fex\File_Extractor2010.vcxproj">
|
||||
<Project>{7aec599c-7c82-4f00-aa60-411e0a359cb0}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\dependencies\zlib\project\vs2010\zlib.vcxproj">
|
||||
<Project>{3e03c179-8251-46e4-81f4-466f114bac63}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -436,17 +436,12 @@ static bool utilIsImage(const char *file)
|
|||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
IMAGE_TYPE utilFindType(const char *file)
|
||||
{
|
||||
char buffer [2048];
|
||||
utilFindType(file, buffer);
|
||||
}
|
||||
|
||||
IMAGE_TYPE utilFindType(const char *file, char (&buffer)[2048])
|
||||
{
|
||||
#ifdef WIN32
|
||||
DWORD dwNum = MultiByteToWideChar (CP_ACP, 0, file, -1, NULL, 0);
|
||||
wchar_t *pwText;
|
||||
|
|
|
@ -23,7 +23,6 @@ bool utilIsGBImage(const char *);
|
|||
bool utilIsGzipFile(const char *);
|
||||
void utilStripDoubleExtension(const char *, char *);
|
||||
IMAGE_TYPE utilFindType(const char *);
|
||||
IMAGE_TYPE utilFindType(const char *, char (&)[2048]);
|
||||
u8 *utilLoad(const char *, bool (*)(const char*), u8 *, int &);
|
||||
|
||||
void utilPutDword(u8 *, u32);
|
||||
|
|
|
@ -700,13 +700,15 @@ long ZEXPORT memtell(file)
|
|||
|
||||
z_off_t ZEXPORT memgzseek(gzFile file, z_off_t off, int whence)
|
||||
{
|
||||
char buf[80];
|
||||
|
||||
if(whence != SEEK_CUR) {
|
||||
fputs("FIXME: memgzio does not support seeking\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// this is inefficient, but the best I can do without actually reading
|
||||
// the above code
|
||||
char buf[80];
|
||||
while(off > 0) {
|
||||
int r = memgzread(file, buf, off > 80 ? 80 : off);
|
||||
if(r <= 0)
|
||||
|
|
|
@ -27,11 +27,11 @@ bool genericflashcardEnable = false;
|
|||
int gbCgbMode = 0;
|
||||
|
||||
u16 gbColorFilter[32768];
|
||||
bool gbColorOption = false;
|
||||
int gbColorOption = 0;
|
||||
int gbPaletteOption = 0;
|
||||
int gbEmulatorType = 0;
|
||||
bool gbBorderOn = true;
|
||||
bool gbBorderAutomatic = false;
|
||||
int gbBorderOn = 0;
|
||||
int gbBorderAutomatic = 0;
|
||||
int gbBorderLineSkip = 160;
|
||||
int gbBorderRowSkip = 0;
|
||||
int gbBorderColumnSkip = 0;
|
||||
|
|
|
@ -25,11 +25,11 @@ extern u8 *gbMemoryMap[16];
|
|||
|
||||
extern int gbFrameSkip;
|
||||
extern u16 gbColorFilter[32768];
|
||||
extern bool gbColorOption;
|
||||
extern int gbColorOption;
|
||||
extern int gbPaletteOption;
|
||||
extern int gbEmulatorType;
|
||||
extern bool gbBorderOn;
|
||||
extern bool gbBorderAutomatic;
|
||||
extern int gbBorderOn;
|
||||
extern int gbBorderAutomatic;
|
||||
extern int gbCgbMode;
|
||||
extern int gbSgbMode;
|
||||
extern int gbWindowLine;
|
||||
|
|
|
@ -298,7 +298,7 @@ static void count(u32 opcode, int cond_res)
|
|||
#define EMIT0(op) #op"; "
|
||||
#define EMIT1(op,arg) #op" "arg"; "
|
||||
#define EMIT2(op,src,dest) #op" "src", "dest"; "
|
||||
#define CONST(val) "$"#val
|
||||
#define KONST(val) "$"#val
|
||||
#define ASMVAR(cvar) ASMVAR2 (__USER_LABEL_PREFIX__, cvar)
|
||||
#define ASMVAR2(prefix,cvar) STRING (prefix) cvar
|
||||
#define STRING(x) #x
|
||||
|
@ -331,7 +331,7 @@ static void count(u32 opcode, int cond_res)
|
|||
#define EMIT0(op) __asm op
|
||||
#define EMIT1(op,arg) __asm op arg
|
||||
#define EMIT2(op,src,dest) __asm op dest, src
|
||||
#define CONST(val) val
|
||||
#define KONST(val) val
|
||||
#define VAR(var) var
|
||||
#define VARL(var) dword ptr var
|
||||
#define REGREF1(index) reg[index]
|
||||
|
@ -350,15 +350,15 @@ static void count(u32 opcode, int cond_res)
|
|||
|
||||
// Helper macros for loading value / shift count
|
||||
#define VALUE_LOAD_IMM \
|
||||
EMIT2(and, CONST(0x0F), eax) \
|
||||
EMIT2(and, KONST(0x0F), eax) \
|
||||
EMIT2(mov, REGREF2(eax,4), eax) \
|
||||
EMIT2(shr, CONST(7), ecx) \
|
||||
EMIT2(and, CONST(0x1F), ecx)
|
||||
EMIT2(shr, KONST(7), ecx) \
|
||||
EMIT2(and, KONST(0x1F), ecx)
|
||||
#define VALUE_LOAD_REG \
|
||||
EMIT2(and, CONST(0x0F), eax) \
|
||||
EMIT2(and, KONST(0x0F), eax) \
|
||||
EMIT2(mov, REGREF2(eax,4), eax) \
|
||||
EMIT2(movzx, ch, ecx) \
|
||||
EMIT2(and, CONST(0x0F), ecx) \
|
||||
EMIT2(and, KONST(0x0F), ecx) \
|
||||
EMIT2(mov, REGREF2(ecx,4), ecx)
|
||||
|
||||
// Helper macros for setting flags
|
||||
|
@ -382,13 +382,13 @@ static void count(u32 opcode, int cond_res)
|
|||
ALU_HEADER \
|
||||
LOAD_C_FLAG \
|
||||
EMIT2(mov, ecx, edx) \
|
||||
EMIT2(shr, CONST(14), edx) \
|
||||
EMIT2(shr, KONST(14), edx) \
|
||||
EMIT2(mov, ecx, eax) \
|
||||
EMIT2(mov, ecx, esi) \
|
||||
EMIT2(shr, CONST(10), esi) \
|
||||
EMIT2(and, CONST(0x3C), edx) \
|
||||
EMIT2(shr, KONST(10), esi) \
|
||||
EMIT2(and, KONST(0x3C), edx) \
|
||||
EMIT2(mov, REGREF1(edx), edx) \
|
||||
EMIT2(and, CONST(0x3C), esi)
|
||||
EMIT2(and, KONST(0x3C), esi)
|
||||
|
||||
#define LOAD_C_FLAG_YES EMIT2(mov, VAR(C_FLAG), bl)
|
||||
#define LOAD_C_FLAG_NO /*nothing*/
|
||||
|
@ -416,14 +416,14 @@ static void count(u32 opcode, int cond_res)
|
|||
VALUE_LOAD_REG \
|
||||
EMIT2(test, cl, cl) \
|
||||
EMIT1(jz, LABELREF(0,f)) \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(je, LABELREF(1,f)) \
|
||||
EMIT1(ja, LABELREF(2,f)) \
|
||||
EMIT2(shl, cl, eax) \
|
||||
EMIT1(setc, bl) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(test, CONST(1), al) \
|
||||
EMIT2(test, KONST(1), al) \
|
||||
EMIT1(setnz, bl) \
|
||||
EMIT2(xor, eax, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
|
@ -433,7 +433,7 @@ static void count(u32 opcode, int cond_res)
|
|||
LABEL(0)
|
||||
#define VALUE_LSL_REG_NC \
|
||||
VALUE_LOAD_REG \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(jae, LABELREF(1,f)) \
|
||||
EMIT2(shl, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
|
@ -467,7 +467,7 @@ static void count(u32 opcode, int cond_res)
|
|||
VALUE_LOAD_REG \
|
||||
EMIT2(test, cl, cl) \
|
||||
EMIT1(jz, LABELREF(0,f)) \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(je, LABELREF(1,f)) \
|
||||
EMIT1(ja, LABELREF(2,f)) \
|
||||
EMIT2(shr, cl, eax) \
|
||||
|
@ -484,7 +484,7 @@ static void count(u32 opcode, int cond_res)
|
|||
LABEL(0)
|
||||
#define VALUE_LSR_REG_NC \
|
||||
VALUE_LOAD_REG \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(jae, LABELREF(1,f)) \
|
||||
EMIT2(shr, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
|
@ -500,7 +500,7 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT1(setc, bl) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(sar, CONST(31), eax) \
|
||||
EMIT2(sar, KONST(31), eax) \
|
||||
EMIT1(sets, bl) \
|
||||
LABEL(0)
|
||||
#define VALUE_ASR_IMM_NC \
|
||||
|
@ -509,7 +509,7 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT2(sar, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(sar, CONST(31), eax) \
|
||||
EMIT2(sar, KONST(31), eax) \
|
||||
LABEL(0)
|
||||
|
||||
// OP Rd,Rb,Rm ASR Rs
|
||||
|
@ -517,23 +517,23 @@ static void count(u32 opcode, int cond_res)
|
|||
VALUE_LOAD_REG \
|
||||
EMIT2(test, cl, cl) \
|
||||
EMIT1(jz, LABELREF(0,f)) \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(jae, LABELREF(1,f)) \
|
||||
EMIT2(sar, cl, eax) \
|
||||
EMIT1(setc, bl) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(sar, CONST(31), eax) \
|
||||
EMIT2(sar, KONST(31), eax) \
|
||||
EMIT1(sets, bl) \
|
||||
LABEL(0)
|
||||
#define VALUE_ASR_REG_NC \
|
||||
VALUE_LOAD_REG \
|
||||
EMIT2(cmp, CONST(0x20), cl) \
|
||||
EMIT2(cmp, KONST(0x20), cl) \
|
||||
EMIT1(jae, LABELREF(1,f)) \
|
||||
EMIT2(sar, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(sar, CONST(31), eax) \
|
||||
EMIT2(sar, KONST(31), eax) \
|
||||
LABEL(0)
|
||||
|
||||
// OP Rd,Rb,Rm ROR #
|
||||
|
@ -543,8 +543,8 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT2(ror, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(bt, CONST(0), ebx) \
|
||||
EMIT2(rcr, CONST(1), eax) \
|
||||
EMIT2(bt, KONST(0), ebx) \
|
||||
EMIT2(rcr, KONST(1), eax) \
|
||||
LABEL(0) \
|
||||
EMIT1(setc, bl)
|
||||
#define VALUE_ROR_IMM_NC \
|
||||
|
@ -553,14 +553,14 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT2(ror, cl, eax) \
|
||||
EMIT1(jmp, LABELREF(0,f)) \
|
||||
LABEL(1) \
|
||||
EMIT2(bt, CONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(rcr, CONST(1), eax) \
|
||||
EMIT2(bt, KONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(rcr, KONST(1), eax) \
|
||||
LABEL(0)
|
||||
|
||||
// OP Rd,Rb,Rm ROR Rs
|
||||
#define VALUE_ROR_REG_C \
|
||||
VALUE_LOAD_REG \
|
||||
EMIT2(bt, CONST(0), ebx) \
|
||||
EMIT2(bt, KONST(0), ebx) \
|
||||
EMIT2(ror, cl, eax) \
|
||||
EMIT1(setc, bl)
|
||||
#define VALUE_ROR_REG_NC \
|
||||
|
@ -572,7 +572,7 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT2(movzx, ch, ecx) \
|
||||
EMIT2(add, ecx, ecx) \
|
||||
EMIT2(movzx, al, eax) \
|
||||
EMIT2(bt, CONST(0), ebx) \
|
||||
EMIT2(bt, KONST(0), ebx) \
|
||||
EMIT2(ror, cl, eax) \
|
||||
EMIT1(setc, bl)
|
||||
#define VALUE_IMM_NC \
|
||||
|
@ -585,7 +585,7 @@ static void count(u32 opcode, int cond_res)
|
|||
|
||||
// Set condition codes iff the destination register is not R15 (PC)
|
||||
#define CHECK_PC(OP, SETCOND) \
|
||||
EMIT2(cmp, CONST(0x3C), esi) \
|
||||
EMIT2(cmp, KONST(0x3C), esi) \
|
||||
EMIT1(je, LABELREF(8,f)) \
|
||||
OP SETCOND \
|
||||
EMIT1(jmp, LABELREF(9,f)) \
|
||||
|
@ -614,18 +614,18 @@ static void count(u32 opcode, int cond_res)
|
|||
EMIT2(mov, edx, REGREF1(esi))
|
||||
#define OP_ADDS CHECK_PC(OP_ADD, SETCOND_ADD)
|
||||
#define OP_ADC \
|
||||
EMIT2(bt, CONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(bt, KONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(adc, eax, edx) \
|
||||
EMIT2(mov, edx, REGREF1(esi))
|
||||
#define OP_ADCS CHECK_PC(OP_ADC, SETCOND_ADD)
|
||||
#define OP_SBC \
|
||||
EMIT2(bt, CONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(bt, KONST(0), VARL(C_FLAG)) \
|
||||
EMIT0(cmc) \
|
||||
EMIT2(sbb, eax, edx) \
|
||||
EMIT2(mov, edx, REGREF1(esi))
|
||||
#define OP_SBCS CHECK_PC(OP_SBC, SETCOND_SUB)
|
||||
#define OP_RSC \
|
||||
EMIT2(bt, CONST(0), VARL(C_FLAG)) \
|
||||
EMIT2(bt, KONST(0), VARL(C_FLAG)) \
|
||||
EMIT0(cmc) \
|
||||
EMIT2(sbb, edx, eax) \
|
||||
EMIT2(mov, eax, REGREF1(esi))
|
||||
|
@ -678,7 +678,7 @@ static void count(u32 opcode, int cond_res)
|
|||
: "0" (offset), "c" (shift));
|
||||
|
||||
#define RRX_OFFSET \
|
||||
asm(EMIT2(btl,CONST(0),VAR(C_FLAG)) \
|
||||
asm(EMIT2(btl,KONST(0),VAR(C_FLAG)) \
|
||||
"rcr $1, %0" \
|
||||
: "=r" (offset) \
|
||||
: "0" (offset));
|
||||
|
|
|
@ -301,7 +301,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
#else
|
||||
#define EMIT1(op,arg) #op" "arg"; "
|
||||
#define EMIT2(op,src,dest) #op" "src", "dest"; "
|
||||
#define CONST(val) "$"#val
|
||||
#define KONST(val) "$"#val
|
||||
#define ASMVAR(cvar) ASMVAR2 (__USER_LABEL_PREFIX__, cvar)
|
||||
#define ASMVAR2(prefix,cvar) STRING (prefix) cvar
|
||||
#define STRING(x) #x
|
||||
|
@ -328,7 +328,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
: \
|
||||
: "r" (value), "r" (reg[dest].I):"1");
|
||||
#define ADC_RD_RS \
|
||||
asm (EMIT2(bt,CONST(0),VAR(C_FLAG)) \
|
||||
asm (EMIT2(bt,KONST(0),VAR(C_FLAG)) \
|
||||
"adc %1, %%ebx;"\
|
||||
EMIT1(setsb, VAR(N_FLAG)) \
|
||||
EMIT1(setzb, VAR(Z_FLAG)) \
|
||||
|
@ -346,7 +346,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
: "=m" (reg[(d)].I));
|
||||
#define MOV_RN_O8(d) \
|
||||
asm ("andl $0xFF, %%eax;"\
|
||||
EMIT2(movb,CONST(0),VAR(N_FLAG)) \
|
||||
EMIT2(movb,KONST(0),VAR(N_FLAG)) \
|
||||
"movl %%eax, %0;"\
|
||||
EMIT1(setzb, VAR(Z_FLAG)) \
|
||||
: "=m" (reg[(d)].I));
|
||||
|
@ -360,7 +360,7 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
: \
|
||||
: "m" (reg[(d)].I));
|
||||
#define SBC_RD_RS \
|
||||
asm volatile (EMIT2(bt,CONST(0),VAR(C_FLAG)) \
|
||||
asm volatile (EMIT2(bt,KONST(0),VAR(C_FLAG)) \
|
||||
"cmc;"\
|
||||
"sbb %1, %%ebx;"\
|
||||
EMIT1(setsb, VAR(N_FLAG)) \
|
||||
|
@ -465,9 +465,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
EMIT1(setcb, VAR(C_FLAG)) \
|
||||
EMIT1(setob, VAR(V_FLAG))
|
||||
#define ADD_RD_RS_O3_0(N) \
|
||||
EMIT2(movb,CONST(0),VAR(C_FLAG)) \
|
||||
EMIT2(movb,KONST(0),VAR(C_FLAG)) \
|
||||
"add $0,%%ecx;" \
|
||||
EMIT2(movb,CONST(0),VAR(V_FLAG))
|
||||
EMIT2(movb,KONST(0),VAR(V_FLAG))
|
||||
#define SUB_RD_RS_RN(N) \
|
||||
EMIT2(sub,VAR(reg)"+"#N"*4",ecx) \
|
||||
EMIT1(setncb, VAR(C_FLAG)) \
|
||||
|
@ -477,9 +477,9 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
|
|||
EMIT1(setncb, VAR(C_FLAG)) \
|
||||
EMIT1(setob, VAR(V_FLAG))
|
||||
#define SUB_RD_RS_O3_0(N) \
|
||||
EMIT2(movb,CONST(1),VAR(C_FLAG)) \
|
||||
EMIT2(movb,KONST(1),VAR(C_FLAG)) \
|
||||
"sub $0,%%ecx;" \
|
||||
EMIT2(movb,CONST(0),VAR(V_FLAG))
|
||||
EMIT2(movb,KONST(0),VAR(V_FLAG))
|
||||
#endif
|
||||
#else // !__GNUC__
|
||||
#define ADD_RD_RS_RN(N) \
|
||||
|
|
|
@ -1,7 +1,27 @@
|
|||
// This file was written by denopqrihg
|
||||
// with major changes by tjm
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int vbaid = 0;
|
||||
const char *MakeInstanceFilename(const char *Input)
|
||||
{
|
||||
if (vbaid == 0)
|
||||
return Input;
|
||||
|
||||
static char *result=NULL;
|
||||
if (result!=NULL)
|
||||
free(result);
|
||||
|
||||
result = (char *)malloc(strlen(Input)+3);
|
||||
char *p = strrchr((char *)Input, '.');
|
||||
sprintf(result, "%.*s-%d.%s", (int)(p-Input), Input, vbaid+1, p+1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef NO_LINK
|
||||
|
||||
// Joybus
|
||||
bool gba_joybus_enabled = false;
|
||||
|
||||
|
@ -11,8 +31,6 @@ bool gba_link_enabled = false;
|
|||
#define LOCAL_LINK_NAME "VBA link memory"
|
||||
#define IP_LINK_PORT 5738
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "../common/Port.h"
|
||||
#include "GBA.h"
|
||||
#include "GBALink.h"
|
||||
|
@ -144,7 +162,7 @@ sf::IPAddress joybusHostAddr = sf::IPAddress::LocalHost;
|
|||
u8 tspeed = 3;
|
||||
u8 transfer = 0;
|
||||
LINKDATA *linkmem = NULL;
|
||||
int linkid = 0, vbaid = 0;
|
||||
int linkid = 0;
|
||||
#if (defined __WIN32__ || defined _WIN32)
|
||||
HANDLE linksync[4];
|
||||
#else
|
||||
|
@ -214,21 +232,6 @@ int StartServer(void);
|
|||
|
||||
u16 StartRFU(u16);
|
||||
|
||||
const char *MakeInstanceFilename(const char *Input)
|
||||
{
|
||||
if (vbaid == 0)
|
||||
return Input;
|
||||
|
||||
static char *result=NULL;
|
||||
if (result!=NULL)
|
||||
free(result);
|
||||
|
||||
result = (char *)malloc(strlen(Input)+3);
|
||||
char *p = strrchr((char *)Input, '.');
|
||||
sprintf(result, "%.*s-%d.%s", (int)(p-Input), Input, vbaid+1, p+1);
|
||||
return result;
|
||||
}
|
||||
|
||||
void StartLink(u16 value)
|
||||
{
|
||||
if (ioMem == NULL)
|
||||
|
@ -1218,7 +1221,7 @@ void LinkServerThread(void *_sid){
|
|||
fdset.Add(lanlink.tcpsocket);
|
||||
if(lanlink.terminate){
|
||||
ReleaseSemaphore(linksync[vbaid], 1, NULL);
|
||||
return;
|
||||
goto CloseInfoDisplay;
|
||||
}
|
||||
if(fdset.Wait(0.1)==1){
|
||||
sf::Socket::Status st =
|
||||
|
@ -1247,6 +1250,8 @@ void LinkServerThread(void *_sid){
|
|||
ls.tcpsocket[i].Send(outbuffer, 4);
|
||||
}
|
||||
|
||||
CloseInfoDisplay:
|
||||
delete sid;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1300,7 +1305,8 @@ void lserver::Recv(void){
|
|||
fdset.Clear();
|
||||
for(i=0;i<lanlink.numslaves;i++) fdset.Add(tcpsocket[i+1]);
|
||||
// was linktimeout/1000 (i.e., drop ms part), but that's wrong
|
||||
if(fdset.Wait((float)linktimeout / 1000.0)==0){
|
||||
if (fdset.Wait((float)(linktimeout / 1000.)) == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
howmanytimes++;
|
||||
|
@ -1363,7 +1369,7 @@ bool lclient::Init(sf::IPAddress addr, ClientInfoDisplay *cid){
|
|||
lanlink.terminate = false;
|
||||
lanlink.thread = new sf::Thread(LinkClientThread, cid);
|
||||
lanlink.thread->Launch();
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LinkClientThread(void *_cid){
|
||||
|
@ -1378,7 +1384,8 @@ void LinkClientThread(void *_cid){
|
|||
// stupid SFML has no way of giving what sort of error occurred
|
||||
// so we'll just have to do a retry loop, I guess.
|
||||
cid->Ping();
|
||||
if(lanlink.terminate) return;
|
||||
if(lanlink.terminate)
|
||||
goto CloseInfoDisplay;
|
||||
// old code had broken sleep on socket, which isn't
|
||||
// even connected yet
|
||||
// corrected sleep on socket worked, but this is more sane
|
||||
|
@ -1401,7 +1408,7 @@ void LinkClientThread(void *_cid){
|
|||
cid->Ping();
|
||||
if(lanlink.terminate) {
|
||||
lanlink.tcpsocket.Close();
|
||||
return;
|
||||
goto CloseInfoDisplay;
|
||||
}
|
||||
}
|
||||
linkid = (int)READ16LE(&u16inbuffer[0]);
|
||||
|
@ -1420,7 +1427,7 @@ void LinkClientThread(void *_cid){
|
|||
cid->Ping();
|
||||
if(lanlink.terminate) {
|
||||
lanlink.tcpsocket.Close();
|
||||
return;
|
||||
goto CloseInfoDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1428,6 +1435,8 @@ void LinkClientThread(void *_cid){
|
|||
|
||||
cid->Connected();
|
||||
|
||||
CloseInfoDisplay:
|
||||
delete cid;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1468,7 +1477,8 @@ void lclient::Recv(void){
|
|||
// old code used socket # instead of mask again
|
||||
fdset.Add(lanlink.tcpsocket);
|
||||
// old code stripped off ms again
|
||||
if(fdset.Wait((float)linktimeout / 1000.0)==0){
|
||||
if (fdset.Wait((float)(linktimeout / 1000.)) == 0)
|
||||
{
|
||||
numtransfers = 0;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -51,16 +51,18 @@ enum
|
|||
JOY_CMD_WRITE = 0x15
|
||||
};
|
||||
|
||||
// Link implementation; only present if enabled
|
||||
extern const char *MakeInstanceFilename(const char *Input);
|
||||
|
||||
#ifndef NO_LINK
|
||||
// Link implementation
|
||||
#include <SFML/System.hpp>
|
||||
#include <SFML/Network.hpp>
|
||||
|
||||
class ServerInfoDisplay
|
||||
{
|
||||
public:
|
||||
virtual void ShowServerIP(sf::IPAddress addr) = 0;
|
||||
virtual void ShowConnect(int player) = 0;
|
||||
virtual void ShowServerIP(const sf::IPAddress& addr) = 0;
|
||||
virtual void ShowConnect(const int player) = 0;
|
||||
virtual void Ping() = 0;
|
||||
virtual void Connected() = 0;
|
||||
};
|
||||
|
@ -103,9 +105,9 @@ public:
|
|||
|
||||
class ClientInfoDisplay {
|
||||
public:
|
||||
virtual void ConnectStart(sf::IPAddress addr) = 0;
|
||||
virtual void ConnectStart(const sf::IPAddress& addr) = 0;
|
||||
virtual void Ping() = 0;
|
||||
virtual void ShowConnect(int player, int togo) = 0;
|
||||
virtual void ShowConnect(const int player, const int togo) = 0;
|
||||
virtual void Connected() = 0;
|
||||
};
|
||||
|
||||
|
@ -144,13 +146,13 @@ typedef struct {
|
|||
} LANLINKDATA;
|
||||
|
||||
extern bool gba_joybus_enabled;
|
||||
extern bool gba_link_enabled;
|
||||
|
||||
extern sf::IPAddress joybusHostAddr;
|
||||
extern void JoyBusConnect();
|
||||
extern void JoyBusShutdown();
|
||||
extern void JoyBusUpdate(int ticks);
|
||||
|
||||
extern bool gba_link_enabled;
|
||||
|
||||
extern bool InitLink();
|
||||
extern void CloseLink();
|
||||
extern void StartLink(u16);
|
||||
|
@ -161,7 +163,6 @@ extern void LinkChildStop();
|
|||
extern void LinkChildSend(u16);
|
||||
extern void CloseLanLink();
|
||||
extern void CleanLocalLink();
|
||||
extern const char *MakeInstanceFilename(const char *Input);
|
||||
extern LANLINKDATA lanlink;
|
||||
extern int vbaid;
|
||||
extern bool rfu_enabled;
|
||||
|
@ -173,15 +174,23 @@ extern int linkid;
|
|||
#else
|
||||
|
||||
// stubs to keep #ifdef's out of mainline
|
||||
#define StartLink(x)
|
||||
#define StartGPLink(x)
|
||||
#define LinkSSend(x)
|
||||
#define LinkUpdate(x)
|
||||
#define JoyBusUpdate(x)
|
||||
#define InitLink() false
|
||||
#define CloseLink()
|
||||
#define gba_link_enabled false
|
||||
#define gba_joybus_enabled false
|
||||
const bool gba_joybus_enabled = false;
|
||||
const bool gba_link_enabled = false;
|
||||
|
||||
inline void JoyBusConnect() { }
|
||||
inline void JoyBusShutdown() { }
|
||||
inline void JoyBusUpdate(int) { }
|
||||
|
||||
inline bool InitLink() { return true; }
|
||||
inline void CloseLink() { }
|
||||
inline void StartLink(u16) { }
|
||||
inline void StartGPLink(u16) { }
|
||||
inline void LinkSSend(u16) { }
|
||||
inline void LinkUpdate(int) { }
|
||||
inline void LinkChildStop() { }
|
||||
inline void LinkChildSend(u16) { }
|
||||
inline void CloseLanLink() { }
|
||||
inline void CleanLocalLink() { }
|
||||
#endif
|
||||
|
||||
#endif /* GBA_GBALINK_H */
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef NO_LINK
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "vba.h"
|
||||
#include "JoybusOptions.h"
|
||||
|
@ -74,3 +76,5 @@ void JoybusOptions::OnBnClickedOk()
|
|||
|
||||
OnOK();
|
||||
}
|
||||
|
||||
#endif // NO_LINK
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef NO_LINK
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "vba.h"
|
||||
#include "LinkOptions.h"
|
||||
|
@ -492,28 +494,55 @@ void LinkOptions::OnCancel()
|
|||
|
||||
class Win32ServerInfoDisplay : public ServerInfoDisplay
|
||||
{
|
||||
Win32ServerInfoDisplay(ServerWait _dlg) : dlg(_dlg) {}
|
||||
void ShowServerIP(sf::IPAddress addr) {
|
||||
dlg->m_serveraddress.Format("Server IP address is: %s", addr.ToString);
|
||||
public:
|
||||
Win32ServerInfoDisplay(ServerWait *_dlg)
|
||||
{
|
||||
dlg = _dlg;
|
||||
}
|
||||
void ShowConnect(int player) {
|
||||
dlg->m_plconn[i].Format("Player %d connected", player);
|
||||
dlg->UpdateData(false);
|
||||
}
|
||||
void Ping() { dlg->m_prgctrl.StepIt(); }
|
||||
void Connected() {
|
||||
MessageBox(NULL, "All players connected", "Link", MB_OK);
|
||||
|
||||
~Win32ServerInfoDisplay()
|
||||
{
|
||||
if (dlg)
|
||||
{
|
||||
// not connected
|
||||
MessageBox(NULL, "Failed to connect.", "Link", MB_OK);
|
||||
dlg->SendMessage(WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
delete dlg;
|
||||
dlg = NULL;
|
||||
}
|
||||
|
||||
void ShowServerIP(const sf::IPAddress& addr)
|
||||
{
|
||||
dlg->m_serveraddress.Format("Server IP address is: %s", addr.ToString());
|
||||
}
|
||||
|
||||
void ShowConnect(const int player)
|
||||
{
|
||||
dlg->m_plconn[0].Format("Player %d connected", player);
|
||||
dlg->UpdateData(false);
|
||||
}
|
||||
|
||||
void Ping()
|
||||
{
|
||||
dlg->m_prgctrl.StepIt();
|
||||
}
|
||||
|
||||
void Connected()
|
||||
{
|
||||
MessageBox(NULL, "All players connected", "Link", MB_OK);
|
||||
dlg->SendMessage(WM_CLOSE, 0, 0);
|
||||
delete dlg;
|
||||
dlg = NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
ServerWait dlg;
|
||||
}
|
||||
ServerWait *dlg;
|
||||
};
|
||||
|
||||
void LinkServer::OnServerStart()
|
||||
{
|
||||
int errorcode;
|
||||
ServerWait dlg;
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
lanlink.numslaves = m_numplayers+1;
|
||||
|
@ -522,13 +551,18 @@ void LinkServer::OnServerStart()
|
|||
lanlink.speed = m_speed==1 ? true : false;
|
||||
sf::IPAddress addr;
|
||||
|
||||
Win32ServerInfoDisplay dlginfo(dlg);
|
||||
if(!ls.Init(&dlginfo)){
|
||||
MessageBox("Error occured.\nPlease try again.", "Error", MB_OK);
|
||||
return;
|
||||
}
|
||||
// These must be created on the heap - referenced from the connection thread
|
||||
ServerWait *dlg = new ServerWait;
|
||||
// Owns the ServerWait*
|
||||
Win32ServerInfoDisplay *dlginfo = new Win32ServerInfoDisplay(dlg);
|
||||
|
||||
dlg.DoModal();
|
||||
// ls thread will own the dlginfo
|
||||
if (!ls.Init(dlginfo))
|
||||
{
|
||||
// Thread didn't get created
|
||||
delete dlginfo;
|
||||
MessageBox("Error occurred.\nPlease try again.", "Error", MB_OK);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -547,29 +581,59 @@ BOOL LinkClient::OnInitDialog()
|
|||
|
||||
class Win32ClientInfoDisplay : public ClientInfoDisplay
|
||||
{
|
||||
Win32ClientInfoDisplay(ServerWait _dlg) : dlg(_dlg) {}
|
||||
void ConnectStart(sf::IPAddress addr) {
|
||||
dlg->SetWindowText("Connecting...");
|
||||
public:
|
||||
Win32ClientInfoDisplay(ServerWait *_dlg)
|
||||
{
|
||||
dlg = _dlg;
|
||||
}
|
||||
void ShowConnect(int player, int togo) {
|
||||
dlg->m_serveraddress.Format("Connected as #%d", player);
|
||||
if(togo) dlg->m_plconn[0].Format("Waiting for %d players to join", togo);
|
||||
else dlg->m_plconn[0].Format("All players joined.");
|
||||
}
|
||||
void Ping() { dlg->m_prgctrl.StepIt(); }
|
||||
void Connected() {
|
||||
MessageBox(NULL, "Connected.", "Link", MB_OK);
|
||||
|
||||
~Win32ClientInfoDisplay()
|
||||
{
|
||||
if (dlg)
|
||||
{
|
||||
// not connected
|
||||
MessageBox(NULL, "Failed to connect.", "Link", MB_OK);
|
||||
dlg->SendMessage(WM_CLOSE, 0, 0);
|
||||
}
|
||||
|
||||
delete dlg;
|
||||
dlg = NULL;
|
||||
}
|
||||
|
||||
void ConnectStart(const sf::IPAddress& addr)
|
||||
{
|
||||
dlg->SetWindowText("Connecting...");
|
||||
}
|
||||
|
||||
void ShowConnect(const int player, const int togo)
|
||||
{
|
||||
dlg->m_serveraddress.Format("Connected as #%d", player);
|
||||
if (togo)
|
||||
dlg->m_plconn[0].Format("Waiting for %d players to join", togo);
|
||||
else
|
||||
dlg->m_plconn[0].Format("All players joined.");
|
||||
}
|
||||
|
||||
void Ping()
|
||||
{
|
||||
dlg->m_prgctrl.StepIt();
|
||||
}
|
||||
|
||||
void Connected()
|
||||
{
|
||||
MessageBox(NULL, "Connected.", "Link", MB_OK);
|
||||
dlg->SendMessage(WM_CLOSE, 0, 0);
|
||||
delete dlg;
|
||||
dlg = NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
ServerWait dlg;
|
||||
}
|
||||
ServerWait *dlg;
|
||||
};
|
||||
|
||||
void LinkClient::OnLinkConnect()
|
||||
{
|
||||
char ipaddress[31];
|
||||
int errorcode;
|
||||
ServerWait dlg;
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
|
@ -579,14 +643,23 @@ void LinkClient::OnLinkConnect()
|
|||
|
||||
m_serverip.GetWindowText(ipaddress, 30);
|
||||
|
||||
Win32ClientInfoDisplay dlginfo(dlg);
|
||||
if((errorcode=lc.Init(sf::IPAddress(std::string(ipaddress)), &dlginfo))!=0){
|
||||
char message[50];
|
||||
sprintf(message, "Error %d occured.\nPlease try again.", errorcode);
|
||||
MessageBox(message, "Error", MB_OK);
|
||||
return;
|
||||
// These must be created on the heap - referenced from the connection thread
|
||||
ServerWait *dlg = new ServerWait;
|
||||
// Owns the ServerWait*
|
||||
Win32ClientInfoDisplay *dlginfo = new Win32ClientInfoDisplay(dlg);
|
||||
|
||||
// lc thread will own the dlginfo
|
||||
if (!lc.Init(sf::IPAddress(std::string(ipaddress)), dlginfo))
|
||||
{
|
||||
// Thread didn't get created
|
||||
delete dlginfo;
|
||||
MessageBox("Error occurred.\nPlease try again.", "Error", MB_OK);
|
||||
}
|
||||
dlg.DoModal();
|
||||
else
|
||||
{
|
||||
dlg->DoModal();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -674,3 +747,5 @@ BOOL LinkServer::PreTranslateMessage(MSG* pMsg)
|
|||
|
||||
return CDialog::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
#endif // NO_LINK
|
||||
|
|
|
@ -1547,7 +1547,7 @@ void MainWnd::OnOptionsVideoFullscreenmaxscale()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_LINK
|
||||
void MainWnd::OnLinkOptions()
|
||||
{
|
||||
LinkOptions dlg;
|
||||
|
@ -1584,7 +1584,14 @@ void MainWnd::OnOptionsJoybus()
|
|||
JoybusOptions dlg;
|
||||
dlg.DoModal();
|
||||
}
|
||||
|
||||
#else
|
||||
void MainWnd::OnLinkOptions() { }
|
||||
void MainWnd::OnOptionsLinkRFU() { }
|
||||
void MainWnd::OnUpdateOptionsLinkEnable(CCmdUI*) { }
|
||||
void MainWnd::OnOptionsLinkEnable() { }
|
||||
void MainWnd::OnUpdateOptionsLinkRFU(CCmdUI*) { }
|
||||
void MainWnd::OnOptionsJoybus() { }
|
||||
#endif
|
||||
|
||||
void MainWnd::OnOptionsEmulatorGameoverrides()
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ void winlog(const char *msg, ...);
|
|||
|
||||
/* Link
|
||||
---------------------*/
|
||||
extern int InitLink(void);
|
||||
extern bool InitLink(void);
|
||||
extern void CloseLink(void);
|
||||
//extern int linkid;
|
||||
extern char inifile[];
|
||||
|
@ -1254,7 +1254,11 @@ BOOL VBA::OnIdle(LONG lCount)
|
|||
} else if(emulating && active && !paused) {
|
||||
for(int i = 0; i < 2; i++) {
|
||||
emulator.emuMain(emulator.emuCount);
|
||||
if(lanlink.connected&&linkid&&lc.numtransfers==0) lc.CheckConn();
|
||||
|
||||
#ifndef NO_LINK
|
||||
if (lanlink.connected && linkid && lc.numtransfers == 0)
|
||||
lc.CheckConn();
|
||||
#endif
|
||||
|
||||
if(rewindSaveNeeded && rewindMemory && emulator.emuWriteMemState) {
|
||||
rewindCount++;
|
||||
|
@ -1618,6 +1622,7 @@ void VBA::loadSettings()
|
|||
|
||||
updateThrottle( (unsigned short)regQueryDwordValue( "throttle", 0 ) );
|
||||
|
||||
#ifndef NO_LINK
|
||||
linktimeout = regQueryDwordValue("LinkTimeout", 1000);
|
||||
|
||||
rfu_enabled = regQueryDwordValue("RFU", false) ? true : false;
|
||||
|
@ -1630,6 +1635,7 @@ void VBA::loadSettings()
|
|||
}
|
||||
|
||||
lanlink.active = regQueryDwordValue("LAN", 0) ? true : false;
|
||||
#endif
|
||||
|
||||
Sm60FPS::bSaveMoreCPU = regQueryDwordValue("saveMoreCPU", 0);
|
||||
|
||||
|
@ -2553,11 +2559,15 @@ void VBA::saveSettings()
|
|||
regSetDwordValue("throttle", throttle);
|
||||
regSetStringValue("pluginName", pluginName);
|
||||
regSetDwordValue("saveMoreCPU", Sm60FPS::bSaveMoreCPU);
|
||||
|
||||
#ifndef NO_LINK
|
||||
regSetDwordValue("LinkTimeout", linktimeout);
|
||||
regSetDwordValue("RFU", rfu_enabled);
|
||||
regSetDwordValue("linkEnabled", gba_link_enabled);
|
||||
regSetDwordValue("joybusEnabled", gba_joybus_enabled);
|
||||
regSetStringValue("joybusHostAddr", joybusHostAddr.ToString().c_str());
|
||||
#endif
|
||||
|
||||
regSetDwordValue("lastFullscreen", lastFullscreen);
|
||||
regSetDwordValue("pauseWhenInactive", pauseWhenInactive);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// http://www.hiend3d.com/hq2x.html
|
||||
// Modified by suanyuan
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
#ifdef __MSW__
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#define HMODULE void *
|
||||
|
|
Loading…
Reference in New Issue