From: twinaphex Date: Tue, 31 Dec 2013 03:55:09 +0000 (+0100) Subject: Fixed NEON GPU plugin for PC by using stdint.h types - use X-Git-Tag: r24l~913 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c82d5b4ba31ae828cae27962f1a4d328fd4ea4da;p=pcsx_rearmed.git Fixed NEON GPU plugin for PC by using stdint.h types - use NEON GPU plugin for non-ARM targets now --- diff --git a/Makefile b/Makefile index cc19e774..6187958a 100644 --- a/Makefile +++ b/Makefile @@ -107,9 +107,15 @@ endif # builtin gpu OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o ifeq "$(BUILTIN_GPU)" "neon" -OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o +ifeq "$(HAVE_NEON)" "1" plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c +OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o +else +plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP +plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c +OBJS += plugins/gpu_neon/psx_gpu_if.o +endif endif ifeq "$(BUILTIN_GPU)" "peops" # note: code is not safe for strict-aliasing? (Castlevania problems) diff --git a/Makefile.libretro b/Makefile.libretro index 8b4a61b6..d9ab7a08 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -25,10 +25,14 @@ ifeq ($(platform), unix) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC SHARED := -shared -Wl,--version-script=libretro/link.T + BUILTIN_GPU = neon + CFLAGS += -DNEON_PC else ifeq ($(platform), osx) TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC SHARED := -dynamiclib + BUILTIN_GPU = neon + CFLAGS += -DNEON_PC else ifeq ($(platform), ios) ARCH := arm TARGET := $(TARGET_NAME)_libretro_ios.dylib @@ -124,6 +128,8 @@ else LD_FLAGS := -fPIC SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=libretro/link.T CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__ + BUILTIN_GPU = neon + CFLAGS += -DNEON_PC endif CFLAGS += -fPIC diff --git a/frontend/libretro.c b/frontend/libretro.c index 23eecf6e..bce05e89 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -246,7 +246,7 @@ void retro_set_environment(retro_environment_t cb) #ifndef DRC_DISABLE { "rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif -#ifdef __ARM_NEON__ +#if defined(__ARM_NEON__) || defined(NEON_PC) { "neon_interlace_enable", "Enable interlacing mode(s); disabled|enabled" }, { "neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" }, { "neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" }, @@ -800,7 +800,7 @@ static void update_variables(bool in_flight) in_type1 = PSE_PAD_TYPE_ANALOGPAD; } -#ifdef __ARM_NEON__ +#if defined(__ARM_NEON__) || defined(NEON_PC) var.value = "NULL"; var.key = "neon_interlace_enable"; @@ -834,6 +834,7 @@ static void update_variables(bool in_flight) pl_rearmed_cbs.gpu_neon.enhancement_no_main = 1; } #endif + #ifndef DRC_DISABLE var.value = NULL; var.key = "rearmed_drc"; diff --git a/plugins/gpu_neon/psx_gpu/common.h b/plugins/gpu_neon/psx_gpu/common.h index d5cf3e91..6c2a99b5 100644 --- a/plugins/gpu_neon/psx_gpu/common.h +++ b/plugins/gpu_neon/psx_gpu/common.h @@ -1,6 +1,18 @@ #ifndef COMMON_H #define COMMON_H +#include + +#ifdef NEON_PC +typedef int8_t s8; +typedef uint8_t u8; +typedef int16_t s16; +typedef uint16_t u16; +typedef int32_t s32; +typedef uint32_t u32; +typedef int64_t s64; +typedef uint64_t u64; +#else typedef signed char s8; typedef unsigned char u8; typedef signed short s16; @@ -9,8 +21,8 @@ typedef signed int s32; typedef unsigned int u32; typedef signed long long int s64; typedef unsigned long long int u64; +#endif -#include #include #include #include diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index e113f064..24f663b8 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c @@ -4130,7 +4130,11 @@ void setup_sprite_untextured_simple(psx_gpu_struct *psx_gpu, s32 x, s32 y, num_width = width; vram_ptr = (void *)vram_ptr16; +#ifdef NEON_PC + if((int32_t)vram_ptr16 & 2) +#else if((long)vram_ptr16 & 2) +#endif { *vram_ptr16 = color_32bpp; vram_ptr = (void *)(vram_ptr16 + 1); diff --git a/plugins/gpu_neon/psx_gpu_if.c b/plugins/gpu_neon/psx_gpu_if.c index ad017614..86103f33 100644 --- a/plugins/gpu_neon/psx_gpu_if.c +++ b/plugins/gpu_neon/psx_gpu_if.c @@ -8,7 +8,7 @@ * See the COPYING file in the top-level directory. */ -#include +#include #include extern const unsigned char cmd_lengths[256];