diff options
author | twinaphex | 2013-12-31 04:55:09 +0100 |
---|---|---|
committer | twinaphex | 2013-12-31 04:55:09 +0100 |
commit | c82d5b4ba31ae828cae27962f1a4d328fd4ea4da (patch) | |
tree | e8dd125d73ddadf480e591855daca56518467561 | |
parent | 4bfc6b97e6eef32b184403362b49f4aa919b2dcf (diff) | |
download | pcsx_rearmed-c82d5b4ba31ae828cae27962f1a4d328fd4ea4da.tar.gz pcsx_rearmed-c82d5b4ba31ae828cae27962f1a4d328fd4ea4da.tar.bz2 pcsx_rearmed-c82d5b4ba31ae828cae27962f1a4d328fd4ea4da.zip |
Fixed NEON GPU plugin for PC by using stdint.h types - use
NEON GPU plugin for non-ARM targets now
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | Makefile.libretro | 6 | ||||
-rw-r--r-- | frontend/libretro.c | 5 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu/common.h | 14 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu/psx_gpu.c | 4 | ||||
-rw-r--r-- | plugins/gpu_neon/psx_gpu_if.c | 2 |
6 files changed, 34 insertions, 5 deletions
@@ -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 8b4a61b..d9ab7a0 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 23eecf6..bce05e8 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 d5cf3e9..6c2a99b 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 <stdint.h> + +#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 <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index e113f06..24f663b 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 ad01761..86103f3 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 <stdio.h> +#include <stdint.h> #include <sys/mman.h> extern const unsigned char cmd_lengths[256]; |