XBRZ 1.2 added as a built in filter

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1233 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
squall-leonhart 2015-03-19 01:44:47 +00:00
parent e76cf5511d
commit 1ac06a6e66
16 changed files with 132 additions and 14 deletions

View File

@ -303,6 +303,8 @@ SET(SRC_FILTERS
src/filters/pixel.cpp
src/filters/scanline.cpp
src/filters/simpleFilter.cpp
src/filters/xbrzfilter.cpp
src/filters/xBRZ/xbrz.cpp
)
SET(SRC_HQ_C

View File

@ -765,6 +765,26 @@
</File>
</Filter>
</Filter>
<Filter
Name="xBRZ"
>
<File
RelativePath="..\..\src\filters\xbrz.cpp"
>
</File>
<File
RelativePath="..\..\src\filters\xBRZ\config.h"
>
</File>
<File
RelativePath="..\..\src\filters\xBRZ\xbrz.h"
>
</File>
<File
RelativePath="..\..\src\filters\xBRZ\xbrz.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Functionality"

View File

@ -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">
@ -183,6 +183,8 @@
<ClInclude Include="..\..\src\filters\hq2x.h" />
<ClInclude Include="..\..\src\filters\interp.h" />
<ClInclude Include="..\..\src\filters\lq2x.h" />
<ClInclude Include="..\..\src\filters\xBRZ\config.h" />
<ClInclude Include="..\..\src\filters\xBRZ\xbrz.h" />
<ClInclude Include="..\..\src\gba\armdis.h" />
<ClInclude Include="..\..\src\gba\Cheats.h" />
<ClInclude Include="..\..\src\gba\CheatSearch.h" />
@ -322,6 +324,8 @@
<ClCompile Include="..\..\src\win32\rpi.cpp" />
<ClCompile Include="..\..\src\filters\scanline.cpp" />
<ClCompile Include="..\..\src\filters\simpleFilter.cpp" />
<ClCompile Include="..\..\src\filters\xbrzfilter.cpp" />
<ClCompile Include="..\..\src\filters\xBRZ\xbrz.cpp" />
<ClCompile Include="..\..\src\filters\hq2x.cpp" />
<ClCompile Include="..\..\src\filters\hq\asm\hq3x32.cpp" />
<ClCompile Include="..\..\src\gba\armdis.cpp" />

View File

@ -29,6 +29,9 @@
<Filter Include="Pixel Filter\HQ\3x_4x_asm">
<UniqueIdentifier>{443f5282-9e21-46cb-b187-746986699f99}</UniqueIdentifier>
</Filter>
<Filter Include="Pixel Filter\xBRZ">
<UniqueIdentifier>{5ab58341-15e1-499c-9fee-7695e1a98161}</UniqueIdentifier>
</Filter>
<Filter Include="Functionality">
<UniqueIdentifier>{b9123fa0-e9e8-444a-a69c-82a2d3bee747}</UniqueIdentifier>
</Filter>
@ -397,6 +400,12 @@
<ClInclude Include="..\..\src\win32\GBTileView.h">
<Filter>MFC\GB</Filter>
</ClInclude>
<ClInclude Include="..\..\src\filters\xBRZ\xbrz.h">
<Filter>Pixel Filter\xBRZ</Filter>
</ClInclude>
<ClInclude Include="..\..\src\filters\xBRZ\config.h">
<Filter>Pixel Filter\xBRZ</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\win32\res\VBA.ico">
@ -562,6 +571,12 @@
<ClCompile Include="..\..\src\filters\hq\asm\hq3x32.cpp">
<Filter>Pixel Filter\HQ\3x_4x_asm</Filter>
</ClCompile>
<ClCompile Include="..\..\src\filters\xBRZ\xbrz.cpp">
<Filter>Pixel Filter\xBRZ</Filter>
</ClCompile>
<ClCompile Include="..\..\src\filters\xbrzfilter.cpp">
<Filter>Pixel Filter\xBRZ</Filter>
</ClCompile>
<ClCompile Include="..\..\src\gba\armdis.cpp">
<Filter>Functionality</Filter>
</ClCompile>

View File

@ -41,6 +41,7 @@ void hq2x (u8 *, u32, u8 *, u8 *, u32, int, int);
void hq2x32 (u8 *, u32, u8 *, u8 *, u32, int, int);
void lq2x (u8 *, u32, u8 *, u8 *, u32, int, int);
void lq2x32 (u8 *, u32, u8 *, u8 *, u32, int, int);
void xbrz2x32 (u8 *, u32, u8 *, u8 *, u32, int, int);
void SmartIB (u8 *, u32, int, int);
void SmartIB32 (u8 *, u32, int, int);
@ -68,7 +69,8 @@ static const astFilters[] =
{ N_("Scanlines"), 2, { Scanlines, Scanlines32 } },
{ N_("TV Mode"), 2, { ScanlinesTV, ScanlinesTV32 } },
{ N_("hq2x"), 2, { hq2x, hq2x32 } },
{ N_("lq2x"), 2, { lq2x, lq2x32 } }
{ N_("lq2x"), 2, { lq2x, lq2x32 } },
{ N_("xbrz2x"), 2, { 0, xbrz2x32 } }
};
struct {

View File

@ -45,7 +45,8 @@ enum EFilter
FilterScanlinesTV,
FilterHq2x,
FilterLq2x,
LastFilter = FilterLq2x
FilterxBRZ2x,
LastFilter = FilterxBRZ2x
};
enum EFilterIB

View File

@ -56,6 +56,10 @@ extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x32_32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32_32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz2x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz5x32(u8*,u32,u8*,u8*,u32,int,int);
struct FilterDesc {
char name[30];
@ -79,10 +83,14 @@ const FilterDesc Filters[] = {
{ "TV Mode", 2, ScanlinesTV, 0, ScanlinesTV32 },
{ "lq2x", 2, lq2x, 0, lq2x32 },
{ "hq2x", 2, hq2x, 0, hq2x32 },
{ "xbrz2x", 2, 0, 0, xbrz2x32 },
{ "Stretch 3x", 3, sdlStretch3x, sdlStretch3x, sdlStretch3x },
{ "hq3x", 3, hq3x16, 0, hq3x32_32 },
{ "xbrz3x", 3, 0, 0, xbrz3x32 },
{ "Stretch 4x", 4, sdlStretch4x, sdlStretch4x, sdlStretch4x },
{ "hq4x", 4, hq4x16, 0, hq4x32_32 }
{ "hq4x", 4, hq4x16, 0, hq4x32_32 },
{ "xbrz4x", 4, 0, 0, xbrz4x32 },
{ "xbrz5x", 5, 0, 0, xbrz5x32 }
};
int getFilterEnlargeFactor(const Filter f)

View File

@ -28,7 +28,7 @@
// List of available filters
enum Filter { kStretch1x, kStretch2x, k2xSaI, kSuper2xSaI, kSuperEagle, kPixelate,
kAdMame2x, kBilinear, kBilinearPlus, kScanlines, kScanlinesTV,
klq2x, khq2x, kStretch3x, khq3x, kStretch4x, khq4x, kInvalidFilter };
klq2x, khq2x, xbrz2x, kStretch3x, khq3x, xbrz3x, kStretch4x, khq4x, xbrz4x, xbrz5x, kInvalidFilter };
// Function pointer type for a filter function
typedef void(*FilterFunc)(u8*, u32, u8*, u8*, u32, int, int);

View File

@ -98,9 +98,10 @@ skipBios=0
# Filter to use:
# 0 = Stretch 1x (no filter), 1 = Stretch 2x, 2 = 2xSaI, 3 = Super 2xSaI,
# 4 = Super Eagle, 5 = Pixelate, 6 = Motion Blur, 7 = AdvanceMAME Scale2x,
# 8 = Bilinear, 9 = Bilinear Plus, 10 = Scanlines, 11 = TV Mode, 12 = lq2x,
# 13 = hq2x, 14 = Stretch 3x, 15 = hq3x, 16 = Stretch 4x, 17 = hq4x
# 4 = Super Eagle, 5 = Pixelate, 6 = AdvanceMAME Scale2x, 7 = Bilinear,
# 8 = Bilinear Plus, 9 = Scanlines, 10 = TV Mode, 11 = lq2x, 12 = hq2x,
# 13 = xbrz2x, 14 = Stretch 3x, 15 = hq3x, 16 = xbrz3x, 17 = Stretch 4x,
# 18 = hq4x, 19 = xbrz4x, 20 = xbrz5x
filter=1
# Disable status messages. 0=false, any other value means true

View File

@ -151,6 +151,10 @@ struct {
{ "OptionsFilterScanlines", ID_OPTIONS_FILTER_SCANLINES },
{ "OptionsFilterHq2x", ID_OPTIONS_FILTER_HQ2X },
{ "OptionsFilterLq2x", ID_OPTIONS_FILTER_LQ2X },
{ "OptionsFilterxBRZ2x", ID_OPTIONS_FILTER_XBRZ2X },
{ "OptionsFilterxBRZ3x", ID_OPTIONS_FILTER_XBRZ3X },
{ "OptionsFilterxBRZ4x", ID_OPTIONS_FILTER_XBRZ4X },
{ "OptionsFilterxBRZ5x", ID_OPTIONS_FILTER_XBRZ5X },
{ "OptionsFilterIFBNone", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE },
{ "OptionsFilterIFBMotionBlur", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_MOTIONBLUR },
{ "OptionsFilterIFBSmart", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART },

View File

@ -352,6 +352,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_BILINEAR, ID_OPTIONS_FILTER_BILINEARPLUS, OnOptionsFilter)
ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_SCANLINES, ID_OPTIONS_FILTER_SCANLINES, OnOptionsFilter)
ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_HQ2X, ID_OPTIONS_FILTER_LQ2X, OnOptionsFilter)
ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_XBRZ2X, ID_OPTIONS_FILTER_XBRZ5X, OnOptionsFilter)
ON_COMMAND_EX(ID_OPTIONS_FILTER_PLUGIN, OnOptionsFilter)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_FILTER_PLUGIN, OnUpdateOptionsFilter)
ON_COMMAND_EX(ID_OPTIONS_FILTER_HQ3X, OnOptionsFilter)
@ -364,6 +365,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_BILINEAR, ID_OPTIONS_FILTER_BILINEARPLUS, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_SCANLINES, ID_OPTIONS_FILTER_SCANLINES, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_HQ2X, ID_OPTIONS_FILTER_LQ2X, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_XBRZ2X, ID_OPTIONS_FILTER_XBRZ5X, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_FILTER_SIMPLE3X, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_FILTER_SIMPLE4X, OnUpdateOptionsFilter)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_FILTER_HQ3X, OnUpdateOptionsFilter)

View File

@ -1246,6 +1246,18 @@ BOOL MainWnd::OnOptionsFilter(UINT nID)
case ID_OPTIONS_FILTER_HQ4X:
theApp.filterType = FILTER_HQ4X;
break;
case ID_OPTIONS_FILTER_XBRZ2X:
theApp.filterType = FILTER_XBRZ2X;
break;
case ID_OPTIONS_FILTER_XBRZ3X:
theApp.filterType = FILTER_XBRZ3X;
break;
case ID_OPTIONS_FILTER_XBRZ4X:
theApp.filterType = FILTER_XBRZ4X;
break;
case ID_OPTIONS_FILTER_XBRZ5X:
theApp.filterType = FILTER_XBRZ5X;
break;
default:
return FALSE;
}
@ -1313,6 +1325,18 @@ void MainWnd::OnUpdateOptionsFilter(CCmdUI *pCmdUI)
case ID_OPTIONS_FILTER_HQ4X:
pCmdUI->SetCheck(theApp.filterType == FILTER_HQ4X);
break;
case ID_OPTIONS_FILTER_XBRZ2X:
pCmdUI->SetCheck(theApp.filterType == FILTER_XBRZ2X);
break;
case ID_OPTIONS_FILTER_XBRZ3X:
pCmdUI->SetCheck(theApp.filterType == FILTER_XBRZ3X);
break;
case ID_OPTIONS_FILTER_XBRZ4X:
pCmdUI->SetCheck(theApp.filterType == FILTER_XBRZ4X);
break;
case ID_OPTIONS_FILTER_XBRZ5X:
pCmdUI->SetCheck(theApp.filterType == FILTER_XBRZ5X);
break;
}
}

View File

@ -77,6 +77,10 @@ extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int);
#endif
extern void xbrz2x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz3x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void xbrz5x32(u8*,u32,u8*,u8*,u32,int,int);
extern void SmartIB(u8*,u32,int,int);
extern void SmartIB32(u8*,u32,int,int);
@ -807,6 +811,22 @@ void VBA::updateFilter()
#endif
break;
#endif
case FILTER_XBRZ2X:
filterFunction = xbrz2x32;
filterMagnification = 2;
break;
case FILTER_XBRZ3X:
filterFunction = xbrz3x32;
filterMagnification = 3;
break;
case FILTER_XBRZ4X:
filterFunction = xbrz4x32;
filterMagnification = 4;
break;
case FILTER_XBRZ5X:
filterFunction = xbrz5x32;
filterMagnification = 5;
break;
}
}
}
@ -1482,8 +1502,8 @@ void VBA::loadSettings()
filterType = regQueryDwordValue("filter", 0);
if(filterType < 0 || filterType > 17)
filterType = 0;
if(filterType < FILTER_NONE || filterType > FILTER_LAST)
filterType = FILTER_NONE;
filterMT = ( 1 == regQueryDwordValue("filterEnableMultiThreading", 0) );

View File

@ -31,11 +31,15 @@ enum pixelFilterType
FILTER_SIMPLE2X, FILTER_PIXELATE, FILTER_TVMODE, FILTER_SCANLINES,
FILTER_PLUGIN,
FILTER_BILINEAR, FILTER_BILINEARPLUS, FILTER_MAMESCALE2X,
FILTER_2XSAI, FILTER_SUPER2XSAI, FILTER_SUPEREAGLE, FILTER_LQ2X, FILTER_HQ2X,
FILTER_2XSAI, FILTER_SUPER2XSAI, FILTER_SUPEREAGLE, FILTER_LQ2X, FILTER_HQ2X, FILTER_XBRZ2X,
FILTER_SIMPLE3X, FILTER_HQ3X,
FILTER_SIMPLE3X, FILTER_HQ3X, FILTER_XBRZ3X,
FILTER_SIMPLE4X, FILTER_HQ4X
FILTER_SIMPLE4X, FILTER_HQ4X, FILTER_XBRZ4X,
FILTER_XBRZ5X,
FILTER_LAST = FILTER_XBRZ5X
};
enum AUDIO_API {

View File

@ -1786,18 +1786,25 @@ BEGIN
MENUITEM "Super &Eagle", ID_OPTIONS_FILTER_SUPEREAGLE
MENUITEM "&LQ2x", ID_OPTIONS_FILTER_LQ2X
MENUITEM "&HQ2x", ID_OPTIONS_FILTER_HQ2X
MENUITEM "&xBRZ2x", ID_OPTIONS_FILTER_XBRZ2X
END
POPUP "&3X"
BEGIN
MENUITEM "&Simple 3x", ID_OPTIONS_FILTER_SIMPLE3X
MENUITEM SEPARATOR
MENUITEM "&HQ3x", ID_OPTIONS_FILTER_HQ3X
MENUITEM "&xBRZ3x", ID_OPTIONS_FILTER_XBRZ3X
END
POPUP "&4X"
BEGIN
MENUITEM "&Simple 4x", ID_OPTIONS_FILTER_SIMPLE4X
MENUITEM SEPARATOR
MENUITEM "&HQ4x", ID_OPTIONS_FILTER_HQ4X
MENUITEM "&xBRZ4x", ID_OPTIONS_FILTER_XBRZ4X
END
POPUP "&5X"
BEGIN
MENUITEM "&xBRZ5x", ID_OPTIONS_FILTER_XBRZ5X
END
END
MENUITEM SEPARATOR

View File

@ -883,13 +883,17 @@
#define ID_OPTIONS_EMULATOR_DIRECTORIES 40374
#define ID_Menu40375 40375
#define ID_OPTIONS_JOYBUS 40376
#define ID_OPTIONS_FILTER_XBRZ2X 40377
#define ID_OPTIONS_FILTER_XBRZ3X 40378
#define ID_OPTIONS_FILTER_XBRZ4X 40379
#define ID_OPTIONS_FILTER_XBRZ5X 40380
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 166
#define _APS_NEXT_COMMAND_VALUE 40377
#define _APS_NEXT_COMMAND_VALUE 40381
#define _APS_NEXT_CONTROL_VALUE 1299
#define _APS_NEXT_SYMED_VALUE 103
#endif