diff --git a/src/filters/interframe.cpp b/src/filters/interframe.cpp index 6243db21..f79607ea 100644 --- a/src/filters/interframe.cpp +++ b/src/filters/interframe.cpp @@ -2,6 +2,8 @@ #include #include +#include "interframe.hpp" + #ifdef MMX extern "C" bool cpu_mmx; #endif @@ -16,7 +18,6 @@ static u8 *frm1 = NULL; static u8 *frm2 = NULL; static u8 *frm3 = NULL; -extern int RGB_LOW_BITS_MASK; extern u32 qRGB_COLOR_MASK[2]; static void Init() diff --git a/src/filters/interframe.hpp b/src/filters/interframe.hpp new file mode 100644 index 00000000..a0142c3e --- /dev/null +++ b/src/filters/interframe.hpp @@ -0,0 +1,31 @@ +/// Interframe blending filters + +#ifndef INTERFRAME_HPP +#define INTERFRAME_HPP + +extern int RGB_LOW_BITS_MASK; + +static void Init(); + +// call ifc to ignore previous frame / when starting new +void InterframeCleanup(); + +// all 4 are MMX-accelerated if enabled +void SmartIB(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +void SmartIB32(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +void MotionBlurIB(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +void MotionBlurIB32(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); + +#ifdef MMX +static void SmartIB_MMX(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +static void SmartIB32_MMX(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +static void MotionBlurIB_MMX(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +static void MotionBlurIB32_MMX(u8 *srcPtr, u32 srcPitch, int width, int starty, int height); +#endif + +//Options for if starty is 0 +void SmartIB(u8 *srcPtr, u32 srcPitch, int width, int height); +void SmartIB32(u8 *srcPtr, u32 srcPitch, int width, int height); +void MotionBlurIB(u8 *srcPtr, u32 srcPitch, int width, int height); +void MotionBlurIB32(u8 *srcPtr, u32 srcPitch, int width, int height); +#endif //INTERFRAME_HPP diff --git a/src/gtk/filters.cpp b/src/gtk/filters.cpp index fae36529..dca99caf 100644 --- a/src/gtk/filters.cpp +++ b/src/gtk/filters.cpp @@ -18,6 +18,7 @@ #include "filters.h" #include "intl.h" +#include "../filters/interframe.hpp" void _2xSaI (u8 *, u32, u8 *, u8 *, u32, int, int); void _2xSaI32 (u8 *, u32, u8 *, u8 *, u32, int, int); @@ -42,11 +43,6 @@ 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 SmartIB (u8 *, u32, int, int); -void SmartIB32 (u8 *, u32, int, int); -void MotionBlurIB (u8 *, u32, int, int); -void MotionBlurIB32(u8 *, u32, int, int); - namespace VBA { diff --git a/src/sdl/filters.cpp b/src/sdl/filters.cpp index 503f8b0a..c39aa02e 100644 --- a/src/sdl/filters.cpp +++ b/src/sdl/filters.cpp @@ -18,6 +18,8 @@ #include "filters.h" +#include "../filters/interframe.hpp" + // // Screen filters // @@ -147,15 +149,6 @@ FilterFunc initFilter(const Filter f, const int colorDepth, const int srcWidth) return func; } - // - // Interframe blending filters - // - -extern void SmartIB(u8*,u32,int,int); -extern void SmartIB32(u8*,u32,int,int); -extern void MotionBlurIB(u8*,u32,int,int); -extern void MotionBlurIB32(u8*,u32,int,int); - struct IFBFilterDesc { char name[30]; IFBFilterFunc func16; diff --git a/src/win32/VBA.cpp b/src/win32/VBA.cpp index 0977987e..329b4d5c 100644 --- a/src/win32/VBA.cpp +++ b/src/win32/VBA.cpp @@ -38,6 +38,8 @@ #include "../version.h" +#include "../filters/interframe.hpp" + /* Link ---------------------*/ #include "../gba/GBALink.h" @@ -78,11 +80,6 @@ extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int); extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int); #endif -extern void SmartIB(u8*,u32,int,int); -extern void SmartIB32(u8*,u32,int,int); -extern void MotionBlurIB(u8*,u32,int,int); -extern void MotionBlurIB32(u8*,u32,int,int); - extern IDisplay *newGDIDisplay(); extern IDisplay *newDirectDrawDisplay(); #ifndef NO_OGL diff --git a/src/wx/filters.h b/src/wx/filters.h index fe8bd5d8..8f8405fc 100644 --- a/src/wx/filters.h +++ b/src/wx/filters.h @@ -6,6 +6,10 @@ // most 16-bit filters require space in src rounded up to u32 // those that take delta take 1 src line of pixels, rounded up to u32 size // initial value appears to be all-0xff + +#include "../filters/interframe.hpp" + + void Pixelate32(u8 *src, u32 spitch, u8 *, u8 *dst, u32 dstp, int w, int h); void Pixelate(u8 *src, u32 spitch, u8 *delta, u8 *dst, u32 dstp, int w, int h); // next 3*2 use Init_2xSaI(555|565) and do not take into account @@ -62,16 +66,4 @@ void hq4x32(u8 *src, u32 spitch, u8 *, u8 *dst, u32 dstp, int w, int h); void hq4x32_32(u8 *src, u32 spitch, u8 *, u8 *dst, u32 dstp, int w, int h); void hq4x16(u8 *src, u32 spitch, u8 *, u8 *dst, u32 dstp, int w, int h); -// call ifc to ignore previous frame / when starting new -void InterframeCleanup(); -// all 4 are MMX-accelerated if enabled -void SmartIB(u8 *src, u32 spitch, int width, int height); -void SmartIB32(u8 *src, u32 spitch, int width, int height); -void MotionBlurIB(u8 *src, u32 spitch, int width, int height); -void MotionBlurIB32(u8 *src, u32 spitch, int width, int height); -void SmartIB(u8 *src, u32 spitch, int width, int starty, int height); -void SmartIB32(u8 *src, u32 spitch, int width, int starty, int height); -void MotionBlurIB(u8 *src, u32 spitch, int width, int starty, int height); -void MotionBlurIB32(u8 *src, u32 spitch, int width, int starty, int height); - #endif /* FILTERS_H */