moved source files to seperate directory
added 16bit C version
C version: cleanup
C version: much code merging for 16bit/32bit
C version: code optimization ( only calculate YUV values for one pixel once )
C version: corrected one logic mistake when dealing with pixels at the border of the image
This commit is contained in:
spacy51 2007-12-30 20:09:14 +00:00
parent 2c409572ea
commit d8552750ae
20 changed files with 23117 additions and 22989 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="VisualBoyAdvance"
ProjectGUID="{6D4C5EC8-933F-4C05-A1BF-498E658576DF}"
RootNamespace="VBA"
@ -1704,10 +1704,382 @@
</File>
</Filter>
<Filter
Name="HQ"
Name="hq"
>
<Filter
Name="H/LQ2x"
Name="c"
>
<File
RelativePath=".\src\hq\c\hq3x_pattern.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\c\hq4x_pattern.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\c\hq_base.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\c\hq_implementation.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\c\hq_shared.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="asm"
>
<File
RelativePath=".\src\hq\asm\hq3x32.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\hq3x32.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\hq3x_16.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\hq3x_32.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\hq4x_16.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\hq4x_32.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -i&quot;src/hq/asm/&quot; -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq\asm\macros.mac"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="old"
>
<File
RelativePath=".\src\hq2x.cpp"
@ -1726,439 +2098,6 @@
>
</File>
</Filter>
<Filter
Name="HQ34x_ASM"
>
<File
RelativePath=".\src\hq3x32.cpp"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq3x32.h"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq3x_16.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq3x_32.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x_16.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x_32.asm"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -g -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin32 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
Description="Assembling $(InputFileName)..."
CommandLine="nasm -O1 -isrc/ -fwin64 -Xvc -w-orphan-labels -o&quot;$(IntDir)\$(InputName).obj&quot; -- &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(IntDir)\$(InputName).obj&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\macros.mac"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="HQ34x_C"
>
<File
RelativePath=".\src\hq3x16c.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq3x32c.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq3x_pattern.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x16c.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x32c.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq4x_pattern.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq_shared32.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hq_shared32.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\hqxx.h"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCustomBuildTool"
/>
</FileConfiguration>
</File>
</Filter>
</Filter>
</Files>
<Globals>

View File

@ -10,6 +10,7 @@ Known preprocessor switches:
- FINAL_VERSION: Defined for release versions, disables additional GBA logging and completely disables GB logging. Increases the amount of CPU cycles being emulated in one go.
- BKPT_SUPPORT
- MMX: Enable MMX instruction set
- NO_ASM: Use C++ version of hq3x/4x filters
- NO_OGL: Exclude OpenGL code
- NO_D3D: Exclude Direct3D code
- NO_OAL: Exclude OpenAL code

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Util.h"
#include "../../Util.h"
#define __STDC_CONSTANT_MACROS
#include <stdint.h>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,7 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 1999 - 2003 Forgotten
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
Copyright (C) 2005 - 2006 VBA development team
Copyright (C) 2008 VBA-M development team
This program is free software; you can redistribute it and/or modify
@ -19,33 +17,50 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
hq filter by Maxim Stepin ( http://hiend3d.com )
*/
#include "System.h"
#if defined(_16BIT)
#define SIZE_PIXEL 2
#define COLORTYPE uint32_t
#elif defined(_32BIT)
#ifdef _16BIT
#ifdef _32BIT
#error _16BIT and _32BIT defined at the same time!
#endif
#endif
#ifdef _16BIT
#define SIZE_PIXEL 2 // 16bit = 2 bytes
#define COLORTYPE unsigned short
#define RGBtoYUV RGBtoYUV_16
#define Interp1 Interp1_16
#define Interp2 Interp2_16
#define Interp3 Interp3_16
#define Interp4 Interp4_16
#define Interp5 Interp5_16
#define Interp6 Interp6_16
#define Interp7 Interp7_16
#define Interp8 Interp8_16
#endif
#ifdef _32BIT
#define SIZE_PIXEL 4 // 32bit = 4 bytes
#define COLORTYPE unsigned int
#define RGBtoYUV RGBtoYUV_32
#define Interp1 Interp1_32
#define Interp2 Interp2_32
#define Interp3 Interp3_32
#define Interp4 Interp4_32
#define Interp5 Interp5_32
#define Interp6 Interp6_32
#define Interp7 Interp7_32
#define Interp8 Interp8_32
#endif
#define abs32(value) (value & 0x7FFFFFFF)
void Interp1(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
void Interp2(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
void Interp3(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
void Interp4(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
void Interp5(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
void Interp6(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
void Interp7(unsigned char * pc, COLORTYPE c1, COLORTYPE c2, COLORTYPE c3);
void Interp8(unsigned char * pc, COLORTYPE c1, COLORTYPE c2);
unsigned int RGBtoYUV(COLORTYPE c);
bool Diff(COLORTYPE c1, COLORTYPE c2);
#ifdef _HQ3X
#if defined(_HQ3X)
#define _MAGNIFICATION 3
#define PIXEL00_1M Interp1( pOut, c[5], c[1] );
@ -102,7 +117,11 @@ bool Diff(COLORTYPE c1, COLORTYPE c2);
#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] );
#define PIXEL22_C *((COLORTYPE*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
#elif defined(_HQ4X)
#endif // #ifdef _HQ3X
#ifdef _HQ4X
#define _MAGNIFICATION 4
@ -260,41 +279,41 @@ bool Diff(COLORTYPE c1, COLORTYPE c2);
#define PIXEL33_80 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9]);
#define PIXEL33_81 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6]);
#define PIXEL33_82 Interp8(pOut+dstPitch+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8]);
#endif
#endif // #ifdef _HQ4X
#if defined(_HQ3X)
#if defined(_16BIT)
void hq3x16(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
#elif defined(_32BIT)
void hq3x32_32(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
#endif
#elif defined(_HQ4X)
#if defined(_16BIT)
void hq4x16(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
#elif defined(_32BIT)
void hq4x32_32(unsigned char * pIn, unsigned int srcPitch,
unsigned char *,
unsigned char * pOut, unsigned int dstPitch,
int Xres, int Yres)
// function header
#ifdef _16BIT
#ifdef _HQ3X
void hq3x16(
#endif
#ifdef _HQ4X
void hq4x16(
#endif
#endif
#ifdef _32BIT
#ifdef _HQ3X
void hq3x32(
#endif
#ifdef _HQ4X
void hq4x32(
#endif
#endif
unsigned char *pIn, unsigned int srcPitch,
unsigned char *,
unsigned char *pOut, unsigned int dstPitch,
int Xres, int Yres )
{
unsigned int YUV1, YUV2;
int i, j, k;
unsigned int line;
COLORTYPE c[10];
unsigned int yuv[10]; // yuv[0] not used
// yuv[1-9] allows reusage of calculated YUV values
int x, y;
unsigned int linePlus, lineMinus;
COLORTYPE c[10]; // c[0] not used
// +----+----+----+
// | | | |
// | c1 | c2 | c3 |
@ -306,79 +325,110 @@ void hq4x32_32(unsigned char * pIn, unsigned int srcPitch,
// | c7 | c8 | c9 |
// +----+----+----+
for (j=0; j<Yres; j++)
for (y=0; y<Yres; y++)
{
if ( (j>0) || (j<Yres-1) ) line = srcPitch; else line = 0;
if( y == 0 ) {
linePlus = srcPitch;
lineMinus = 0;
} else if( y == ( Yres - 1 ) ) {
linePlus = 0;
lineMinus = srcPitch;
} else {
linePlus = srcPitch;
lineMinus = srcPitch;
}
for (i=0; i<Xres; i++)
for (x=0; x<Xres; x++)
{
c[2] = *((COLORTYPE*)(pIn - line));
c[2] = *((COLORTYPE*)(pIn - lineMinus));
c[5] = *((COLORTYPE*)(pIn ));
c[8] = *((COLORTYPE*)(pIn + line));
c[8] = *((COLORTYPE*)(pIn + linePlus ));
if (i>0)
if (x>0)
{
c[1] = *((COLORTYPE*)(pIn - line - SIZE_PIXEL));
// upper border possible:
c[1] = *((COLORTYPE*)(pIn - lineMinus - SIZE_PIXEL));
c[4] = *((COLORTYPE*)(pIn - SIZE_PIXEL));
c[7] = *((COLORTYPE*)(pIn + line - SIZE_PIXEL));
// lower border possible:
c[7] = *((COLORTYPE*)(pIn + linePlus - SIZE_PIXEL));
}
else
{
{ // left border
c[1] = c[2];
c[4] = c[5];
c[7] = c[8];
}
if (i<Xres-1)
if (x<Xres-1)
{
c[3] = *((COLORTYPE*)(pIn - line + SIZE_PIXEL));
// upper border possible:
c[3] = *((COLORTYPE*)(pIn - lineMinus + SIZE_PIXEL));
c[6] = *((COLORTYPE*)(pIn + SIZE_PIXEL));
c[9] = *((COLORTYPE*)(pIn + line + SIZE_PIXEL));
// lower border possible:
c[9] = *((COLORTYPE*)(pIn + linePlus + SIZE_PIXEL));
}
else
{
{ // right border
c[3] = c[2];
c[6] = c[5];
c[9] = c[8];
}
int pattern = 0;
int flag = 1;
unsigned int pattern = 0;
unsigned int flag = 1;
YUV1 = RGBtoYUV(c[5]);
yuv[5] = RGBtoYUV( c[5] );
for (k=1; k<=9; k++)
for( unsigned char k = 1; k <= 9; k++)
{
if (k==5) continue;
if( k == 5 ) continue;
if ( c[k] != c[5] )
if( c[k] != c[5] )
{
YUV2 = RGBtoYUV(c[k]);
if (
( abs32((YUV1 & 0x00FF0000) - (YUV2 & 0x00FF0000)) > 0x00300000 ) ||
( abs32((YUV1 & 0x0000FF00) - (YUV2 & 0x0000FF00)) > 0x00000700 ) ||
( abs32((YUV1 & 0x000000FF) - (YUV2 & 0x000000FF)) > 0x00000006 )
)
// pre-calculating the YUV-values for every pixel does
// not speed up the process
yuv[k] = RGBtoYUV( c[k] );
if( ( abs_32((yuv[5] & 0x00FF0000) - (yuv[k] & 0x00FF0000)) > 0x00300000 ) ||
( abs_32((yuv[5] & 0x0000FF00) - (yuv[k] & 0x0000FF00)) > 0x00000700 ) ||
( abs_32((yuv[5] & 0x000000FF) - (yuv[k] & 0x000000FF)) > 0x00000006 )
) {
pattern |= flag;
}
}
flag <<= 1;
}
#if defined(_HQ3X)
#ifdef _HQ3X
#include "hq3x_pattern.h"
#elif defined(_HQ4X)
#endif
#ifdef _HQ4X
#include "hq4x_pattern.h"
#endif
pIn += SIZE_PIXEL;
pOut += _MAGNIFICATION * SIZE_PIXEL;
}
pIn += srcPitch - (Xres * SIZE_PIXEL);
pOut += dstPitch-(_MAGNIFICATION * Xres * SIZE_PIXEL);
pOut += (_MAGNIFICATION-1) * dstPitch;
pIn += srcPitch - ( Xres * SIZE_PIXEL );
pOut += dstPitch - ( _MAGNIFICATION * Xres * SIZE_PIXEL );
pOut += ( _MAGNIFICATION - 1 ) * dstPitch;
}
}
#undef SIZE_PIXEL
#undef COLORTYPE
#undef abs32
#undef _MAGNIFICATION
#undef RGBtoYUV
#undef Interp1
#undef Interp2
#undef Interp3
#undef Interp4
#undef Interp5
#undef Interp6
#undef Interp7
#undef Interp8

View File

@ -1,9 +1,7 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 1999 - 2003 Forgotten
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
Copyright (C) 2005 - 2006 VBA development team
Copyright (C) 2008 VBA-M development team
This program is free software; you can redistribute it and/or modify
@ -19,10 +17,35 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
hq filter by Maxim Stepin ( http://hiend3d.com )
*/
#define _HQ3X
#include "hq_shared.h"
#define _16BIT
#include "hqxx.h"
#define _HQ3X
// hq3x, 16bit
#include "hq_base.h"
#undef _HQ3X
#define _HQ4X
// hq4x, 16bit
#include "hq_base.h"
#undef _HQ4X
#undef _16BIT
#undef _HQ3X
#define _32BIT
#define _HQ3X
// hq3x, 32bit
#include "hq_base.h"
#undef _HQ3X
#define _HQ4X
// hq4x, 32bit
#include "hq_base.h"
#undef _HQ4X
#undef _32BIT

392
trunk/src/hq/c/hq_shared.h Normal file
View File

@ -0,0 +1,392 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 2008 VBA-M development team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
hq filter by Maxim Stepin ( http://hiend3d.com )
*/
// we only need the 32bit version because our YUV format has 32bits
#define abs_32( value ) ( value & 0x7FFFFFFF )
inline bool Diff( unsigned int YUV1, unsigned int YUV2 )
{
if( YUV1 == YUV2 ) return false; // Save some processing power
return
( abs_32((YUV1 & 0x00FF0000) - (YUV2 & 0x00FF0000)) > 0x00300000 ) ||
( abs_32((YUV1 & 0x0000FF00) - (YUV2 & 0x0000FF00)) > 0x00000700 ) ||
( abs_32((YUV1 & 0x000000FF) - (YUV2 & 0x000000FF)) > 0x00000006 );
}
// ===============
// 32bit routines:
// ===============
// ( c1*3 + c2 ) / 4
// hq3x, hq4x
#define Interp1_32( pc, c1, c2 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 3 ) + \
( (c2) & 0x00FF00 ) \
) & 0x0003FC00 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 3 ) + \
( (c2) & 0xFF00FF ) \
) & 0x03FC03FC ) \
) >> 2 \
)
// ( c1*2 + c2 + c3 ) / 4
// hq3x, hq4x
#define Interp2_32( pc, c1, c2, c3 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 2 ) + \
( (c2) & 0x00FF00 ) + \
( (c3) & 0x00FF00 ) \
) & 0x0003FC00 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 2 ) + \
( (c2) & 0xFF00FF ) + \
( (c3) & 0xFF00FF ) \
) & 0x03FC03FC ) \
) >> 2 \
)
// ( c1*7 + c2 ) / 8
// hq3x, hq4x
#define Interp3_32( pc, c1, c2 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 7 ) + \
( (c2) & 0x00FF00 ) \
) & 0x0007F800 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 7 ) + \
( (c2) & 0xFF00FF ) \
) & 0x07F807F8 ) \
) >> 3 \
)
// ( c1*2 + (c2+c3)*7 ) / 16
// hq3x, not used by hq4x
#define Interp4_32( pc, c1, c2, c3 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( ( ( (c1) & 0x00FF00 ) * 2 ) + ( ( ( (c2) & 0x00FF00 ) + ( (c3) & 0x00FF00 ) ) * 7 ) ) & 0x000FF000 ) + \
( ( ( ( (c1) & 0xFF00FF ) * 2 ) + ( ( ( (c2) & 0xFF00FF ) + ( (c3) & 0xFF00FF ) ) * 7 ) ) & 0x0FF00FF0 ) \
) >> 4 \
)
// ( c1 + c2 ) / 2
// hq3x, hq4x
#define Interp5_32( pc, c1, c2 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( (c1) & 0x00FF00 ) + \
( (c2) & 0x00FF00 ) \
) & 0x0001FE00 ) \
+ \
( ( \
( (c1) & 0xFF00FF ) + \
( (c2) & 0xFF00FF ) \
) & 0x01FE01FE ) \
) >> 1 \
)
// ( c1*5 + c2*2 + c3 ) / 8
// hq4x
#define Interp6_32( pc, c1, c2, c3 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 5 ) + \
( ( (c2) & 0x00FF00 ) * 2 ) + \
( (c3) & 0x00FF00 ) \
) & 0x0007F800 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 5 ) + \
( ( (c2) & 0xFF00FF ) * 2 ) + \
( (c3) & 0xFF00FF ) \
) & 0x07F807F8 ) \
) >> 3 \
)
// ( c1*6 + c2 + c3 ) / 8
// hq4x
#define Interp7_32( pc, c1, c2, c3 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 6 ) + \
( (c2) & 0x00FF00 ) + \
( (c3) & 0x00FF00 ) \
) & 0x0007F800 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 6 ) + \
( (c2) & 0xFF00FF ) + \
( (c3) & 0xFF00FF ) \
) & 0x07F807F8 ) \
) >> 3 \
)
// ( c1*5 + c2*3 ) / 8
// hq4x
#define Interp8_32( pc, c1, c2 ) \
( \
*( (unsigned int *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x00FF00 ) * 5 ) + \
( ( (c2) & 0x00FF00 ) * 3 ) \
) & 0x0007F800 ) \
+ \
( ( \
( ( (c1) & 0xFF00FF ) * 5 ) + \
( ( (c2) & 0xFF00FF ) * 3 ) \
) & 0x07F807F8 ) \
) >> 3 \
)
// 32 bit input color
// 0x00YYUUVV return value
inline unsigned int RGBtoYUV_32( unsigned int c )
{
// Division through 3 slows down the emulation about 10% !!!
register unsigned char r, g, b;
r = ( c & 0x000000FF );
g = ( c & 0x0000FF00 ) >> 8;
b = ( c & 0x00FF0000 ) >> 16;
return ( (r + g + b) << 14 ) +
( ( r - b + 512 ) << 4 ) +
( ( 2*g - r - b ) >> 3 ) + 128;
// unoptimized:
//unsigned char r, g, b, Y, u, v;
//r = (c & 0x000000FF);
//g = (c & 0x0000FF00) >> 8;
//b = (c & 0x00FF0000) >> 16;
//Y = (r + g + b) >> 2;
//u = 128 + ((r - b) >> 2);
//v = 128 + ((-r + 2*g -b)>>3);
//return (Y<<16) + (u<<8) + v;
}
// ===============
// 16bit routines:
// ===============
// ( c1*3 + c2 ) / 4
// hq3x, hq4x
#define Interp1_16( pc, c1, c2 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 3 ) + \
( (c2) & 0x07E0 ) \
) & 0x00001F80 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 3 ) + \
( (c2) & 0xF81F ) \
) & 0x0003E07C ) \
) >> 2 \
)
// ( c1*2 + c2 + c3 ) / 4
// hq3x, hq4x
#define Interp2_16( pc, c1, c2, c3 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 2 ) + \
( (c2) & 0x07E0 ) + \
( (c3) & 0x07E0 ) \
) & 0x00001F80 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 2 ) + \
( (c2) & 0xF81F ) + \
( (c3) & 0xF81F ) \
) & 0x0003E07C ) \
) >> 2 \
)
// ( c1*7 + c2 ) / 8
// hq3x, hq4x
#define Interp3_16( pc, c1, c2 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 7 ) + \
( (c2) & 0x07E0 ) \
) & 0x00003F00 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 7 ) + \
( (c2) & 0xF81F ) \
) & 0x0007C0F8 ) \
) >> 3 \
)
// ( c1*2 + (c2+c3)*7 ) / 16
// hq3x, not used by hq4x
#define Interp4_16( pc, c1, c2, c3 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( ( ( (c1) & 0x07E0 ) * 2 ) + ( ( ( (c2) & 0x07E0 ) + ( (c3) & 0x07E0 ) ) * 7 ) ) & 0x00007E00 ) + \
( ( ( ( (c1) & 0xF81F ) * 2 ) + ( ( ( (c2) & 0xF81F ) + ( (c3) & 0xF81F ) ) * 7 ) ) & 0x000F81F0 ) \
) >> 4 \
)
// ( c1 + c2 ) / 2
// hq3x, hq4x
#define Interp5_16( pc, c1, c2 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( (c1) & 0x07E0 ) + \
( (c2) & 0x07E0 ) \
) & 0x00000FC0 ) \
+ \
( ( \
( (c1) & 0xF81F ) + \
( (c2) & 0xF81F ) \
) & 0x0001F03E ) \
) >> 1 \
)
// ( c1*5 + c2*2 + c3 ) / 8
// hq4x
#define Interp6_16( pc, c1, c2, c3 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 5 ) + \
( ( (c2) & 0x07E0 ) * 2 ) + \
( (c3) & 0x07E0 ) \
) & 0x00003F00 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 5 ) + \
( ( (c2) & 0xF81F ) * 2 ) + \
( (c3) & 0xF81F ) \
) & 0x0007C0F8 ) \
) >> 3 \
)
// ( c1*6 + c2 + c3 ) / 8
// hq4x
#define Interp7_16( pc, c1, c2, c3 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 6 ) + \
( (c2) & 0x07E0 ) + \
( (c3) & 0x07E0 ) \
) & 0x00003F00 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 6 ) + \
( (c2) & 0xF81F ) + \
( (c3) & 0xF81F ) \
) & 0x0007C0F8 ) \
) >> 3 \
)
// ( c1*5 + c2*3 ) / 8
// hq4x
#define Interp8_16( pc, c1, c2 ) \
( \
*( (unsigned short *)(pc) ) = \
( \
( ( \
( ( (c1) & 0x07E0 ) * 5 ) + \
( ( (c2) & 0x07E0 ) * 3 ) \
) & 0x00003F00 ) \
+ \
( ( \
( ( (c1) & 0xF81F ) * 5 ) + \
( ( (c2) & 0xF81F ) * 3 ) \
) & 0x0007C0F8 ) \
) >> 3 \
)
// 16 bit input color
// 0x00YYUUVV return value
inline unsigned int RGBtoYUV_16( unsigned short c )
{
// Division through 3 slows down the emulation about 10% !!!
register unsigned char r, g, b;
r = ( c & 0xF800 ) >> 8;
g = ( c & 0x07E0 ) >> 3;
b = ( c & 0x001F ) << 3;
return ( (r + g + b) << 14 ) +
( ( r - b + 512 ) << 4 ) +
( ( 2*g - r - b ) >> 3 ) + 128;
}

View File

@ -1,28 +0,0 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 1999 - 2003 Forgotten
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
Copyright (C) 2005 - 2006 VBA development team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _HQ3X
#define _32BIT
#include "hqxx.h"
#undef _32BIT
#undef _HQ3X

View File

@ -1,28 +0,0 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 1999 - 2003 Forgotten
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
Copyright (C) 2005 - 2006 VBA development team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _HQ4X
#define _16BIT
#include "hqxx.h"
#undef _16BIT
#undef _HQ4X

View File

@ -1,28 +0,0 @@
/*
VisualBoyAdvance - a Game Boy & Game Boy Advance emulator
Copyright (C) 1999 - 2003 Forgotten
Copyright (C) 2003 - 2004 Forgotten and the VBA development team
Copyright (C) 2005 - 2006 VBA development team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _HQ4X
#define _32BIT
#include "hqxx.h"
#undef _32BIT
#undef _HQ4X

View File

@ -1,101 +0,0 @@
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2005 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hq_shared32.h"
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
const uint64_t reg_blank = UINT64_C(0x0000000000000000);
const uint64_t const7 = UINT64_C(0x0000000700070007);
const uint64_t treshold = UINT64_C(0x0000000000300706);
void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2)
{
*((int*)pc) = (c1*3+c2)/4;
}
void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
{
*((int*)pc) = (c1*2+c2+c3)/4;
}
void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2)
{
*((int*)pc) = (c1*7+c2)/8;
*((int*)pc) = ((((c1 & 0x00FF00)*7 + (c2 & 0x00FF00) ) & 0x0007F800) +
(((c1 & 0xFF00FF)*7 + (c2 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
}
void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
{
*((int*)pc) = (c1*2+(c2+c3)*7)/16;
*((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*7 ) & 0x000FF000) +
(((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*7 ) & 0x0FF00FF0)) >> 4;
}
void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2)
{
*((int*)pc) = (c1+c2)/2;
}
void Interp6(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
{
*((int*)pc) = (c1*5+c2*2+c3)/8;
}
void Interp7(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3)
{
*((int*)pc) = (c1*6+c2+c3)/8;
}
void Interp8(unsigned char * pc, unsigned int c1, unsigned int c2)
{
*((int*)pc) = (c1*5+c2*3)/8;
}
bool Diff(unsigned int c1, unsigned int c2)
{
unsigned int
YUV1 = RGBtoYUV(c1),
YUV2 = RGBtoYUV(c2);
if (YUV1 == YUV2) return false; // Save some processing power
return
( abs32((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) ||
( abs32((YUV1 & Umask) - (YUV2 & Umask)) > trU ) ||
( abs32((YUV1 & Vmask) - (YUV2 & Vmask)) > trV );
}
unsigned int RGBtoYUV(unsigned int c)
{
// Division through 3 slows down the emulation about 10% !!!
unsigned char r, g, b, Y, u, v;
r = (c & 0x000000FF);
g = (c & 0x0000FF00) >> 8;
b = (c & 0x00FF0000) >> 16;
Y = (r + g + b) >> 2;
u = 128 + ((r - b) >> 2);
v = 128 + ((-r + 2*g -b)>>3);
return (Y<<16) + (u<<8) + v;
}

View File

@ -1,90 +0,0 @@
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2005 Forgotten and the VBA development team
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or(at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SIZE_PIXEL 4 // 32bit = 4 bytes
#define abs32(value) (value & 0x7FFFFFFF)
#define PIXEL00_1M Interp1( pOut, c[5], c[1] );
#define PIXEL00_1U Interp1( pOut, c[5], c[2] );
#define PIXEL00_1L Interp1( pOut, c[5], c[4] );
#define PIXEL00_2 Interp2( pOut, c[5], c[4], c[2] );
#define PIXEL00_4 Interp4( pOut, c[5], c[4], c[2] );
#define PIXEL00_5 Interp5( pOut, c[4], c[2] );
#define PIXEL00_C *((unsigned int*)(pOut)) = c[5];
#define PIXEL01_1 Interp1( pOut+SIZE_PIXEL, c[5], c[2] );
#define PIXEL01_3 Interp3( pOut+SIZE_PIXEL, c[5], c[2] );
#define PIXEL01_6 Interp1( pOut+SIZE_PIXEL, c[2], c[5] );
#define PIXEL01_C *((unsigned int*)(pOut+4)) = c[5];
#define PIXEL02_1M Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[3] );
#define PIXEL02_1U Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2] );
#define PIXEL02_1R Interp1( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
#define PIXEL02_2 Interp2( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
#define PIXEL02_4 Interp4( pOut+SIZE_PIXEL+SIZE_PIXEL, c[5], c[2], c[6] );
#define PIXEL02_5 Interp5( pOut+SIZE_PIXEL+SIZE_PIXEL, c[2], c[6] );
#define PIXEL02_C *((unsigned int*)(pOut+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
#define PIXEL10_1 Interp1( pOut+dstPitch, c[5], c[4] );
#define PIXEL10_3 Interp3( pOut+dstPitch, c[5], c[4] );
#define PIXEL10_6 Interp1( pOut+dstPitch, c[4], c[5] );
#define PIXEL10_C *((unsigned int*)(pOut+dstPitch)) = c[5];
#define PIXEL11 *((unsigned int*)(pOut+dstPitch+SIZE_PIXEL)) = c[5];
#define PIXEL12_1 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
#define PIXEL12_3 Interp3( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
#define PIXEL12_6 Interp1( pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[5] );
#define PIXEL12_C *((unsigned int*)(pOut+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
#define PIXEL20_1M Interp1( pOut+dstPitch+dstPitch, c[5], c[7] );
#define PIXEL20_1D Interp1( pOut+dstPitch+dstPitch, c[5], c[8] );
#define PIXEL20_1L Interp1( pOut+dstPitch+dstPitch, c[5], c[4] );
#define PIXEL20_2 Interp2( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
#define PIXEL20_4 Interp4( pOut+dstPitch+dstPitch, c[5], c[8], c[4] );
#define PIXEL20_5 Interp5( pOut+dstPitch+dstPitch, c[8], c[4] );
#define PIXEL20_C *((unsigned int*)(pOut+dstPitch+dstPitch)) = c[5];
#define PIXEL21_1 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
#define PIXEL21_3 Interp3( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[5], c[8] );
#define PIXEL21_6 Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL, c[8], c[5] );
#define PIXEL21_C *((unsigned int*)(pOut+dstPitch+dstPitch+SIZE_PIXEL)) = c[5];
#define PIXEL22_1M Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[9] );
#define PIXEL22_1D Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[8] );
#define PIXEL22_1R Interp1( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6] );
#define PIXEL22_2 Interp2( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
#define PIXEL22_4 Interp4( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[5], c[6], c[8] );
#define PIXEL22_5 Interp5( pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL, c[6], c[8] );
#define PIXEL22_C *((unsigned int*)(pOut+dstPitch+dstPitch+SIZE_PIXEL+SIZE_PIXEL)) = c[5];
const int Ymask = 0x00FF0000;
const int Umask = 0x0000FF00;
const int Vmask = 0x000000FF;
const int trY = 0x00300000;
const int trU = 0x00000700;
const int trV = 0x00000006;
void Interp1(unsigned char * pc, unsigned int c1, unsigned int c2);
void Interp2(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3);
void Interp3(unsigned char * pc, unsigned int c1, unsigned int c2);
void Interp4(unsigned char * pc, unsigned int c1, unsigned int c2, unsigned int c3);
void Interp5(unsigned char * pc, unsigned int c1, unsigned int c2);
bool Diff(unsigned int c1, unsigned int c2);
unsigned int RGBtoYUV(unsigned int c);

View File

@ -86,18 +86,10 @@ extern void Simple3x16(u8*,u32,u8*,u8*,u32,int,int);
extern void Simple3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void Simple4x16(u8*,u32,u8*,u8*,u32,int,int);
extern void Simple4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
#ifdef MMX
extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int);
#else
extern void hq3x32_32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32_32(u8*,u32,u8*,u8*,u32,int,int);
#define hq3x32 hq3x32_32
#define hq4x32 hq4x32_32
#endif
extern void SmartIB(u8*,u32,int,int);
extern void SmartIB32(u8*,u32,int,int);
@ -693,6 +685,8 @@ void VBA::updateFilter()
// HQ3X asm wants 16 bit input. When we switch
// away from 16 bits we need to restore the driver values
// This hack is also necessary for Kega Fusion filter plugins
if ( b16to32Video )
{
b16to32Video = false;
@ -881,12 +875,16 @@ void VBA::updateFilter()
case FILTER_HQ3X:
filterFunction = hq3x32;
filterMagnification = 3;
#ifndef NO_ASM
b16to32Video=true;
#endif
break;
case FILTER_HQ4X:
filterFunction = hq4x32;
filterMagnification = 4;
#ifndef NO_ASM
b16to32Video=true;
#endif
break;
}
}