From 75696f29c6ef4cbf16dbc947d658dc3220b0ab24 Mon Sep 17 00:00:00 2001 From: intact Date: Tue, 4 Aug 2015 01:37:14 +0200 Subject: [PATCH] xBRZ 1.4 filter update --- src/filters/xBRZ/config.h | 14 ++-- src/filters/xBRZ/xbrz.cpp | 152 +++++++++++++++++++++++++++++------ src/filters/xBRZ/xbrz.h | 7 +- src/filters/xbrzfilter.cpp | 5 ++ src/sdl/filters.cpp | 4 +- src/sdl/filters.h | 2 +- src/sdl/vbam.cfg-example | 2 +- src/win32/Commands.cpp | 1 + src/win32/MainWnd.cpp | 4 +- src/win32/MainWndOptions.cpp | 6 ++ src/win32/VBA.cpp | 5 ++ src/win32/VBA.h | 4 +- src/win32/VBA.rc | 4 + src/win32/resource.h | 3 +- 14 files changed, 173 insertions(+), 40 deletions(-) diff --git a/src/filters/xBRZ/config.h b/src/filters/xBRZ/config.h index 687bb7fb..96b168af 100644 --- a/src/filters/xBRZ/config.h +++ b/src/filters/xBRZ/config.h @@ -23,18 +23,18 @@ namespace xbrz struct ScalerCfg { ScalerCfg() : - luminanceWeight_(1), - equalColorTolerance_(30), + luminanceWeight(1), + equalColorTolerance(30), dominantDirectionThreshold(3.6), steepDirectionThreshold(2.2), - newTestAttribute_(0) {} + newTestAttribute(0) {} - double luminanceWeight_; - double equalColorTolerance_; + double luminanceWeight; + double equalColorTolerance; double dominantDirectionThreshold; double steepDirectionThreshold; - double newTestAttribute_; //unused; test new parameters + double newTestAttribute; //unused; test new parameters }; } -#endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/src/filters/xBRZ/xbrz.cpp b/src/filters/xBRZ/xbrz.cpp index db96694a..7f15a3e0 100644 --- a/src/filters/xBRZ/xbrz.cpp +++ b/src/filters/xBRZ/xbrz.cpp @@ -44,19 +44,19 @@ inline uint32_t makePixel(unsigned char a, unsigned char r, unsigned char g, uns template FORCE_INLINE -unsigned char calcBlend(unsigned char colFront, unsigned char colBack) +unsigned char calcColor(unsigned char colFront, unsigned char colBack) { - return (colFront * M + colBack * (N - M)) / N; + return (colFront * M + colBack * (N - M)) / N; } template inline -uint32_t alphaGradRGB(uint32_t pixFront, uint32_t pixBack) //blend front color with opacity M / N over opaque background: http://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending +uint32_t gradientRGB(uint32_t pixFront, uint32_t pixBack) //blend front color with opacity M / N over opaque background: http://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending { //~ static_assert(0 < M && M < N && N <= 1000, ""); - return makePixel(calcBlend(getRed (pixFront), getRed (pixBack)), - calcBlend(getGreen(pixFront), getGreen(pixBack)), - calcBlend(getBlue (pixFront), getBlue (pixBack))); + return makePixel(calcColor(getRed (pixFront), getRed (pixBack)), + calcColor(getGreen(pixFront), getGreen(pixBack)), + calcColor(getBlue (pixFront), getBlue (pixBack))); } FORCE_INLINE @@ -66,7 +66,7 @@ unsigned char calcColor(unsigned char colFront, unsigned char colBack, const uns } template inline -uint32_t alphaGradARGB(uint32_t pixFront, uint32_t pixBack) //find intermediate color between two colors with alpha channels (=> NO alpha blending!!!) +uint32_t gradientARGB(uint32_t pixFront, uint32_t pixBack) //find intermediate color between two colors with alpha channels (=> NO alpha blending!!!) { //~ static_assert(0 < M && M < N && N <= 1000, ""); @@ -284,14 +284,14 @@ template FORCE_INLINE double dist(uint32_t pix1, uint32_t pix2, const xbrz::ScalerCfg& cfg) { - return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_); + return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight); } template FORCE_INLINE bool eq(uint32_t pix1, uint32_t pix2, const xbrz::ScalerCfg& cfg) { - return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight_) < cfg.equalColorTolerance_; + return ColorDistance::dist(pix1, pix2, cfg.luminanceWeight) < cfg.equalColorTolerance; } /* @@ -398,9 +398,9 @@ template <> inline unsigned char rotateBlendInfo(unsigned char b) { ret #ifndef NDEBUG +#ifdef _MSC_VER int debugPixelX = -1; int debugPixelY = 12; -#ifdef _MSC_VER __declspec(thread) bool breakIntoDebugger = false; #endif #endif @@ -754,9 +754,9 @@ struct Scaler3x : public ColorGradient template static void blendLineDiagonal(uint32_t col, OutputMatrix& out) { - alphaGrad<1, 8>(out.template ref<1, 2>(), col); + alphaGrad<1, 8>(out.template ref<1, 2>(), col); //conflict with other rotations for this odd scale alphaGrad<1, 8>(out.template ref<2, 1>(), col); - alphaGrad<7, 8>(out.template ref<2, 2>(), col); + alphaGrad<7, 8>(out.template ref<2, 2>(), col); // } template @@ -812,7 +812,9 @@ struct Scaler4x : public ColorGradient alphaGrad<3, 4>(out.template ref<1, 3>(), col); alphaGrad<1, 4>(out.template ref<3, 0>(), col); alphaGrad<1, 4>(out.template ref<0, 3>(), col); + alphaGrad<1, 3>(out.template ref<2, 2>(), col); //[!] fixes 1/4 used in xBR + out.template ref<3, 3>() = col; out.template ref<3, 2>() = col; out.template ref<2, 3>() = col; @@ -889,23 +891,22 @@ struct Scaler5x : public ColorGradient alphaGrad<1, 4>(out.template ref(), col); alphaGrad<3, 4>(out.template ref(), col); + alphaGrad<2, 3>(out.template ref<3, 3>(), col); + out.template ref<2, scale - 1>() = col; out.template ref<3, scale - 1>() = col; + out.template ref<4, scale - 1>() = col; out.template ref() = col; out.template ref() = col; - - out.template ref<4, scale - 1>() = col; - - alphaGrad<2, 3>(out.template ref<3, 3>(), col); } template static void blendLineDiagonal(uint32_t col, OutputMatrix& out) { - alphaGrad<1, 8>(out.template ref(), col); + alphaGrad<1, 8>(out.template ref(), col); //conflict with other rotations for this odd scale alphaGrad<1, 8>(out.template ref(), col); - alphaGrad<1, 8>(out.template ref(), col); + alphaGrad<1, 8>(out.template ref(), col); // alphaGrad<7, 8>(out.template ref<4, 3>(), col); alphaGrad<7, 8>(out.template ref<3, 4>(), col); @@ -925,6 +926,105 @@ struct Scaler5x : public ColorGradient } }; + +template +struct Scaler6x : public ColorGradient +{ + static const int scale = 6; + + template //bring template function into scope for GCC + static void alphaGrad(uint32_t& pixBack, uint32_t pixFront) { ColorGradient::template alphaGrad(pixBack, pixFront); } + + + template + static void blendLineShallow(uint32_t col, OutputMatrix& out) + { + alphaGrad<1, 4>(out.template ref(), col); + alphaGrad<1, 4>(out.template ref(), col); + alphaGrad<1, 4>(out.template ref(), col); + + alphaGrad<3, 4>(out.template ref(), col); + alphaGrad<3, 4>(out.template ref(), col); + alphaGrad<3, 4>(out.template ref(), col); + + out.template ref() = col; + out.template ref() = col; + out.template ref() = col; + out.template ref() = col; + + out.template ref() = col; + out.template ref() = col; + } + + template + static void blendLineSteep(uint32_t col, OutputMatrix& out) + { + alphaGrad<1, 4>(out.template ref<0, scale - 1>(), col); + alphaGrad<1, 4>(out.template ref<2, scale - 2>(), col); + alphaGrad<1, 4>(out.template ref<4, scale - 3>(), col); + + alphaGrad<3, 4>(out.template ref<1, scale - 1>(), col); + alphaGrad<3, 4>(out.template ref<3, scale - 2>(), col); + alphaGrad<3, 4>(out.template ref<5, scale - 3>(), col); + + out.template ref<2, scale - 1>() = col; + out.template ref<3, scale - 1>() = col; + out.template ref<4, scale - 1>() = col; + out.template ref<5, scale - 1>() = col; + + out.template ref<4, scale - 2>() = col; + out.template ref<5, scale - 2>() = col; + } + + template + static void blendLineSteepAndShallow(uint32_t col, OutputMatrix& out) + { + alphaGrad<1, 4>(out.template ref<0, scale - 1>(), col); + alphaGrad<1, 4>(out.template ref<2, scale - 2>(), col); + alphaGrad<3, 4>(out.template ref<1, scale - 1>(), col); + alphaGrad<3, 4>(out.template ref<3, scale - 2>(), col); + + alphaGrad<1, 4>(out.template ref(), col); + alphaGrad<1, 4>(out.template ref(), col); + alphaGrad<3, 4>(out.template ref(), col); + alphaGrad<3, 4>(out.template ref(), col); + + out.template ref<2, scale - 1>() = col; + out.template ref<3, scale - 1>() = col; + out.template ref<4, scale - 1>() = col; + out.template ref<5, scale - 1>() = col; + + out.template ref<4, scale - 2>() = col; + out.template ref<5, scale - 2>() = col; + + out.template ref() = col; + out.template ref() = col; + } + + template + static void blendLineDiagonal(uint32_t col, OutputMatrix& out) + { + alphaGrad<1, 2>(out.template ref(), col); + alphaGrad<1, 2>(out.template ref(), col); + alphaGrad<1, 2>(out.template ref(), col); + + out.template ref() = col; + out.template ref() = col; + out.template ref() = col; + } + + template + static void blendCorner(uint32_t col, OutputMatrix& out) + { + //model a round corner + alphaGrad<97, 100>(out.template ref<5, 5>(), col); //exact: 0.9711013910 + alphaGrad<42, 100>(out.template ref<4, 5>(), col); //0.4236372243 + alphaGrad<42, 100>(out.template ref<5, 4>(), col); //0.4236372243 + alphaGrad< 6, 100>(out.template ref<5, 3>(), col); //0.05652034508 + alphaGrad< 6, 100>(out.template ref<3, 5>(), col); //0.05652034508 + } +}; + //------------------------------------------------------------------------------------ struct ColorDistanceRGB @@ -950,16 +1050,18 @@ struct ColorDistanceARGB 1. if a1 = a2, distance should be: a1 * distYCbCr() 2. if a1 = 0, distance should be: a2 * distYCbCr(black, white) = a2 * 255 - 3. if a1 = 1, distance should be: 255 * (1 - a2) + a2 * distYCbCr() + 3. if a1 = 1, ??? maybe: 255 * (1 - a2) + a2 * distYCbCr() */ - //return std::min(a1, a2) * distYCbCrBuffer.dist(pix1, pix2) + 255 * abs(a1 - a2); + //return std::min(a1, a2) * distYCbCrBuffer.dist(pix1, pix2) + 255 * abs(a1 - a2); //=> following code is 15% faster: const double d = distYCbCrBuffer.dist(pix1, pix2); if (a1 < a2) return a1 * d + 255 * (a2 - a1); else return a2 * d + 255 * (a1 - a2); + + //alternative? return std::sqrt(a1 * a2 * square(distYCbCrBuffer.dist(pix1, pix2)) + square(255 * (a1 - a2))); } }; @@ -969,7 +1071,7 @@ struct ColorGradientRGB template static void alphaGrad(uint32_t& pixBack, uint32_t pixFront) { - pixBack = alphaGradRGB(pixFront, pixBack); + pixBack = gradientRGB(pixFront, pixBack); } }; @@ -978,7 +1080,7 @@ struct ColorGradientARGB template static void alphaGrad(uint32_t& pixBack, uint32_t pixFront) { - pixBack = alphaGradARGB(pixFront, pixBack); + pixBack = gradientARGB(pixFront, pixBack); } }; } @@ -989,7 +1091,7 @@ void xbrz::scale(size_t factor, const uint32_t* src, int srcWidth, int srcHeight if (srcPitch % static_cast(sizeof(uint32_t)) != 0 || trgPitch % static_cast(sizeof(uint32_t)) != 0 || srcPitch < srcWidth * static_cast(sizeof(uint32_t)) || - trgPitch < srcWidth * factor * static_cast(sizeof(uint32_t))) + trgPitch < srcWidth * static_cast(factor) * static_cast(sizeof(uint32_t))) { assert(false); return; @@ -1011,6 +1113,8 @@ void xbrz::scale(size_t factor, const uint32_t* src, int srcWidth, int srcHeight return scaleImage, ColorDistanceARGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); case 5: return scaleImage, ColorDistanceARGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); + case 6: + return scaleImage, ColorDistanceARGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); } break; @@ -1025,6 +1129,8 @@ void xbrz::scale(size_t factor, const uint32_t* src, int srcWidth, int srcHeight return scaleImage, ColorDistanceRGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); case 5: return scaleImage, ColorDistanceRGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); + case 6: + return scaleImage, ColorDistanceRGB>(src, srcWidth, srcHeight, srcPPitch, trg, trgWidth, cfg, yFirst, yLast); } break; } diff --git a/src/filters/xBRZ/xbrz.h b/src/filters/xBRZ/xbrz.h index 2e6d0735..896574aa 100644 --- a/src/filters/xBRZ/xbrz.h +++ b/src/filters/xBRZ/xbrz.h @@ -35,12 +35,13 @@ http://board.byuu.org/viewtopic.php?f=10&t=2248 - support multithreading - support 64-bit architectures - support processing image slices +- support scaling up to 6xBRZ */ enum ColorFormat //from high bits -> low bits, 8 bit per channel { - ARGB, //including alpha channel, BGRA byte order on little-endian machines RGB, //8 bit for each red, green, blue, upper 8 bits unused + ARGB, //including alpha channel, BGRA byte order on little-endian machines }; /* @@ -52,9 +53,9 @@ enum ColorFormat //from high bits -> low bits, 8 bit per channel in the target image data if you are using multiple threads for processing each enlarged slice! THREAD-SAFETY: - parts of the same image may be scaled by multiple threads as long as the [yFirst, yLast) ranges do not overlap! - - there is a minor inefficiency for the first row of a slice, so avoid processing single rows only; suggestion: process 6 rows at least + - there is a minor inefficiency for the first row of a slice, so avoid processing single rows only; suggestion: process 8-16 rows at least */ -void scale(size_t factor, //valid range: 2 - 5 +void scale(size_t factor, //valid range: 2 - 6 const uint32_t* src, int srcWidth, int srcHeight, int srcPitch, uint32_t* trg, int trgPitch, ColorFormat colFmt, diff --git a/src/filters/xbrzfilter.cpp b/src/filters/xbrzfilter.cpp index 63d4cfa5..fe97feea 100644 --- a/src/filters/xbrzfilter.cpp +++ b/src/filters/xbrzfilter.cpp @@ -21,3 +21,8 @@ void xbrz5x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32 dst { xbrz::scale(5, (const uint32_t *)srcPtr, width, height, srcPitch, (uint32_t *)dstPtr, dstPitch, xbrz::RGB); } + +void xbrz6x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32 dstPitch, int width, int height) +{ + xbrz::scale(6, (const uint32_t *)srcPtr, width, height, srcPitch, (uint32_t *)dstPtr, dstPitch, xbrz::RGB); +} diff --git a/src/sdl/filters.cpp b/src/sdl/filters.cpp index cac589c3..066c38b5 100644 --- a/src/sdl/filters.cpp +++ b/src/sdl/filters.cpp @@ -64,6 +64,7 @@ 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 xbrz6x32(u8*,u32,u8*,u8*,u32,int,int); struct FilterDesc { char name[30]; @@ -94,7 +95,8 @@ const FilterDesc Filters[] = { { "Stretch 4x", 4, sdlStretch4x, sdlStretch4x, sdlStretch4x }, { "hq4x", 4, hq4x16, 0, hq4x32_32 }, { "xbrz4x", 4, 0, 0, xbrz4x32 }, - { "xbrz5x", 5, 0, 0, xbrz5x32 } + { "xbrz5x", 5, 0, 0, xbrz5x32 }, + { "xbrz6x", 6, 0, 0, xbrz6x32 } }; int getFilterEnlargeFactor(const int f) diff --git a/src/sdl/filters.h b/src/sdl/filters.h index 2024aa7d..8c0f8b36 100644 --- a/src/sdl/filters.h +++ b/src/sdl/filters.h @@ -28,7 +28,7 @@ // List of available filters enum Filter { kStretch1x, kStretch2x, k2xSaI, kSuper2xSaI, kSuperEagle, kPixelate, kAdMame2x, kBilinear, kBilinearPlus, kScanlines, kScanlinesTV, - klq2x, khq2x, xbrz2x, kStretch3x, khq3x, xbrz3x, kStretch4x, khq4x, xbrz4x, xbrz5x, kInvalidFilter }; + klq2x, khq2x, xbrz2x, kStretch3x, khq3x, xbrz3x, kStretch4x, khq4x, xbrz4x, xbrz5x, xbrz6x, kInvalidFilter }; // Function pointer type for a filter function typedef void(*FilterFunc)(u8*, u32, u8*, u8*, u32, int, int); diff --git a/src/sdl/vbam.cfg-example b/src/sdl/vbam.cfg-example index 89770cae..2164f6c7 100644 --- a/src/sdl/vbam.cfg-example +++ b/src/sdl/vbam.cfg-example @@ -101,7 +101,7 @@ skipBios=0 # 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 +# 18 = hq4x, 19 = xbrz4x, 20 = xbrz5x, 21 = xbrz6x filter=1 # Disable status messages. 0=false, any other value means true diff --git a/src/win32/Commands.cpp b/src/win32/Commands.cpp index e7dc93a2..e20ae884 100644 --- a/src/win32/Commands.cpp +++ b/src/win32/Commands.cpp @@ -157,6 +157,7 @@ struct { { "OptionsFilterxBRZ3x", ID_OPTIONS_FILTER_XBRZ3X }, { "OptionsFilterxBRZ4x", ID_OPTIONS_FILTER_XBRZ4X }, { "OptionsFilterxBRZ5x", ID_OPTIONS_FILTER_XBRZ5X }, + { "OptionsFilterxBRZ6x", ID_OPTIONS_FILTER_XBRZ6X }, { "OptionsFilterIFBNone", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE }, { "OptionsFilterIFBMotionBlur", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_MOTIONBLUR }, { "OptionsFilterIFBSmart", ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART }, diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index e384d88d..4c85ba11 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -347,7 +347,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_RANGE(ID_OPTIONS_FILTER_XBRZ2X, ID_OPTIONS_FILTER_XBRZ6X, 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) @@ -360,7 +360,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_RANGE(ID_OPTIONS_FILTER_XBRZ2X, ID_OPTIONS_FILTER_XBRZ6X, 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) diff --git a/src/win32/MainWndOptions.cpp b/src/win32/MainWndOptions.cpp index cf27cfef..284c94e4 100644 --- a/src/win32/MainWndOptions.cpp +++ b/src/win32/MainWndOptions.cpp @@ -1237,6 +1237,9 @@ BOOL MainWnd::OnOptionsFilter(UINT nID) case ID_OPTIONS_FILTER_XBRZ5X: filter = FILTER_XBRZ5X; break; + case ID_OPTIONS_FILTER_XBRZ6X: + filter = FILTER_XBRZ6X; + break; default: return FALSE; } @@ -1316,6 +1319,9 @@ void MainWnd::OnUpdateOptionsFilter(CCmdUI *pCmdUI) case ID_OPTIONS_FILTER_XBRZ5X: pCmdUI->SetCheck(filter == FILTER_XBRZ5X); break; + case ID_OPTIONS_FILTER_XBRZ6X: + pCmdUI->SetCheck(filter == FILTER_XBRZ6X); + break; } } diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index d57fe3fd..fc5baf1a 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -82,6 +82,7 @@ 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 xbrz6x32(u8*,u32,u8*,u8*,u32,int,int); extern void SmartIB(u8*,u32,int,int); extern void SmartIB32(u8*,u32,int,int); @@ -812,6 +813,10 @@ void VBA::updateFilter() filterFunction = xbrz5x32; filterMagnification = 5; break; + case FILTER_XBRZ6X: + filterFunction = xbrz6x32; + filterMagnification = 6; + break; } } } diff --git a/src/win32/VBA.h b/src/win32/VBA.h index 7e2afb15..2dbde545 100644 --- a/src/win32/VBA.h +++ b/src/win32/VBA.h @@ -40,7 +40,9 @@ enum pixelFilterType FILTER_XBRZ5X, - FILTER_LAST = FILTER_XBRZ5X + FILTER_XBRZ6X, + + FILTER_LAST = FILTER_XBRZ6X }; enum AUDIO_API { diff --git a/src/win32/VBA.rc b/src/win32/VBA.rc index d078b3f2..0452555f 100644 --- a/src/win32/VBA.rc +++ b/src/win32/VBA.rc @@ -1734,6 +1734,10 @@ BEGIN BEGIN MENUITEM "&xBRZ5x", ID_OPTIONS_FILTER_XBRZ5X END + POPUP "&6X" + BEGIN + MENUITEM "&xBRZ6x", ID_OPTIONS_FILTER_XBRZ6X + END END MENUITEM SEPARATOR MENUITEM "&Use Filter Plugin", ID_OPTIONS_FILTER_PLUGIN diff --git a/src/win32/resource.h b/src/win32/resource.h index 242cefae..eae315e6 100644 --- a/src/win32/resource.h +++ b/src/win32/resource.h @@ -1017,13 +1017,14 @@ #define ID_OPTIONS_FILTER_XBRZ3X 40378 #define ID_OPTIONS_FILTER_XBRZ4X 40379 #define ID_OPTIONS_FILTER_XBRZ5X 40380 +#define ID_OPTIONS_FILTER_XBRZ6X 40381 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 167 -#define _APS_NEXT_COMMAND_VALUE 40381 +#define _APS_NEXT_COMMAND_VALUE 40382 #define _APS_NEXT_CONTROL_VALUE 1437 #define _APS_NEXT_SYMED_VALUE 103 #endif