From 0a20857a44233d2f5a4d0ba9406b5c4133fa9997 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 2 Oct 2012 23:59:19 +0200 Subject: [PATCH] (ARM) Add mrc ARM define for benchmark.c - Some Android build fixes - Removed doubly defined static inline function --- android/jni/Android.mk | 2 +- benchmark.c | 3 ++- console/griffin/griffin.c | 9 +++++++-- gfx/scaler/filter.c | 14 +------------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 92375d8519..75844db6f7 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -7,7 +7,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := retroarch LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c ../bifrost.c -LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_DYLIB -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 +LOCAL_CFLAGS = -DPERF_TEST -DANDROID -DHAVE_DYNAMIC -DHAVE_DYLIB -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lGLESv2 -llog diff --git a/benchmark.c b/benchmark.c index 42e68b0a7d..9b1ba28882 100644 --- a/benchmark.c +++ b/benchmark.c @@ -45,7 +45,8 @@ rarch_perf_tick_t rarch_get_perf_counter(void) asm volatile ("rdtsc" : "=a" (a), "=d" (d)); time = (rarch_perf_tick_t)a | ((rarch_perf_tick_t)d << 32); #endif - +#elif defined(__ARM_ARCH_6__) + asm volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(time) ); #elif defined(__CELLOS_LV2__) || defined(GEKKO) || defined(_XBOX360) time = __mftb(); #endif diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index de52cc18e0..78525360c3 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -99,8 +99,6 @@ VIDEO CONTEXT #include "../../gfx/context/xdk_ctx.c" #elif defined(HAVE_EGL) #include "../../gfx/context/egl_ctx.c" -#else -#include "../../gfx/context/null_ctx.c" #endif #endif @@ -135,6 +133,13 @@ VIDEO IMAGE VIDEO DRIVER ============================================================ */ +#if defined(ANDROID) +#include "../../gfx/scaler/scaler.c" +#include "../../gfx/scaler/pixconv.c" +#include "../../gfx/scaler/scaler_int.c" +#include "../../gfx/scaler/filter.c" +#endif + #if defined(HAVE_OPENGL) #include "../../gfx/math/matrix.c" #include "../../gfx/gl.c" diff --git a/gfx/scaler/filter.c b/gfx/scaler/filter.c index e235c6064f..c4bb12f606 100644 --- a/gfx/scaler/filter.c +++ b/gfx/scaler/filter.c @@ -16,6 +16,7 @@ #include "filter.h" #include "scaler_int.h" +#include "../../general.h" #include #include #include @@ -102,19 +103,6 @@ static inline double sinc(double phase) return sin(phase) / phase; } -static inline unsigned next_pow2(unsigned v) -{ - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - - return v; -} - static void gen_filter_sinc_sub(struct scaler_filter *filter, int len, int pos, int step, double phase_mul) { const int sinc_size = filter->filter_len;