CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
+ARM926 ?= 0
+ARM_CORTEXA8 ?= 1
+USE_OSS ?= 1
+#USE_ALSA = 1
+#DRC_DBG = 1
+#PCNT = 1
+TARGET = pcsx
+
+-include Makefile.local
+
ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
-CFLAGS += -Wall -ggdb -Ifrontend
+CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
LDFLAGS += -lz -lpthread -ldl -lpng -lbz2
-ifeq "$(ARCH)" "arm"
-CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp -ffast-math
-ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
-endif
ifndef DEBUG
CFLAGS += -O2 -DNDEBUG
endif
CFLAGS += $(EXTRA_CFLAGS)
-USE_OSS ?= 1
-#USE_ALSA = 1
-#DRC_DBG = 1
-#PCNT = 1
-TARGET = pcsx
+ifeq "$(ARCH)" "arm"
+ifeq "$(ARM_CORTEXA8)" "1"
+CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
+ASFLAGS += -mcpu=cortex-a8 -mfpu=neon
+endif
+ifeq "$(ARM926)" "1"
+CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
+ASFLAGS += -mcpu=arm926ej-s
+endif
+endif
--include Makefile.local
+# detect armv7 and NEON from the specified CPU
+HAVE_NEON = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_NEON__ 1' && echo 1)
+HAVE_ARMV7 = $(shell $(CC) -E -dD $(CFLAGS) frontend/config.h | grep -q '__ARM_ARCH_7A__ 1' && echo 1)
all: $(TARGET)
libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \
libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \
libpcsxcore/sio.o libpcsxcore/socket.o libpcsxcore/spu.o
-ifeq "$(ARCH)" "arm"
+ifeq "$(HAVE_NEON)" "1"
OBJS += libpcsxcore/gte_neon.o
endif
libpcsxcore/cdrom.o libpcsxcore/misc.o: CFLAGS += -Wno-pointer-sign
# dynarec
ifndef NO_NEW_DRC
+libpcsxcore/new_dynarec/linkage_arm.o: ASFLAGS += --defsym HAVE_ARMV7=$(HAVE_ARMV7)
OBJS += libpcsxcore/new_dynarec/new_dynarec.o libpcsxcore/new_dynarec/linkage_arm.o
OBJS += libpcsxcore/new_dynarec/pcsxmem.o
endif
plugins/dfsound/registers.o plugins/dfsound/spu.o
plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \
plugins/dfsound/xa.c
-ifeq "$(ARCH)" "arm"
+ifeq "$(HAVE_NEON)" "1"
OBJS += plugins/dfsound/arm_utils.o
endif
ifeq "$(USE_OSS)" "1"
OBJS += frontend/plat_dummy.o
endif
endif # !USE_GTK
-ifeq "$(ARCH)" "arm"
-OBJS += frontend/arm_utils.o
+
+ifeq "$(HAVE_NEON)" "1"
+OBJS += frontend/cspace_neon.o
+else
+OBJS += frontend/cspace.o
endif
ifdef X11
frontend/%.o: CFLAGS += -DX11
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
-PLUGINS = plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
+PLUGINS ?= plugins/spunull/spunull.so plugins/gpu_unai/gpuPCSX4ALL.so \
plugins/gpu-gles/gpuGLES.so plugins/gpu_neon/gpu_neon.so
$(PLUGINS):
--- /dev/null
+#include "cspace.h"
+
+// TODO?
+void bgr555_to_rgb565(void *dst, const void *src, int bytes) {}
+void bgr888_to_rgb888(void *dst, const void *src, int bytes) {}
+void bgr888_to_rgb565(void *dst, const void *src, int bytes) {}
+
#include "omap.h"
#include "pandora.h"
#include "pcnt.h"
-#include "arm_utils.h"
+#include "cspace.h"
#include "common/plat.h"
#include "common/input.h"
#include "linux/in_evdev.h"
{
}
-void bgr555_to_rgb565(void *d, void *s, int len)
-{
-}
-
-void bgr888_to_rgb888(void *d, void *s, int len)
-{
-}
-
-void bgr888_to_rgb565(void *d, void *s, int len)
-{
-}
-
void in_update_analogs(void)
{
}
for (i = 0; i < ARRAY_SIZE(gte_handlers); i++)
if (psxCP2[i] != psxNULL)
gte_handlers[i] = psxCP2[i];
-#if defined(__arm__) && !defined(DRC_DBG)
+#ifndef DRC_DBG
+#ifdef __ARM_NEON__
gte_handlers[0x01] = gteRTPS_neon;
gte_handlers[0x30] = gteRTPT_neon;
gte_handlers[0x12] = gteMVMVA_neon;
gte_handlers[0x06] = gteNCLIP_neon;
+#endif
#endif
psxH_ptr = psxH;
#include "new_dynarec.h"
#include "../r3000a.h"
+#ifndef __ARM_ARCH_7A__
+#define ARMv5_ONLY
+#endif
+
extern char invalid_code[0x100000];
/* weird stuff */
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-.equiv HAVE_ARMV7, 1
+/* .equiv HAVE_ARMV7, 1 */
-.if HAVE_ARMV7
- .cpu cortex-a8
- .fpu vfp
-.else
- .cpu arm9tdmi
- .fpu softvfp
-.endif
.global rdram
rdram = 0x80000000
.global dynarec_local
#define N_(x) (x)
#endif
-#ifdef __arm__
+#ifdef __ARM_ARCH_7A__
#define ssat32_to_16(v) \
asm("ssat %0,#16,%1" : "=r" (v) : "r" (v))
#else
return -1;
}
-#ifdef __arm__
+#ifdef __ARM_ARCH_7A__
// asm code
extern void mix_chan(int start, int count, int lv, int rv);
extern void mix_chan_rvb(int start, int count, int lv, int rv);
#include "gpu.h"
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/arm_utils.h"
+#include "../../frontend/cspace.h"
#include "../../frontend/pcnt.h"
// misc globals
// USE_NASM
static inline int shl10idiv(int x, int y)
{
-#ifdef __arm__
+#ifdef __ARM_ARCH_7A__
// rearmed: let's use VFP divider instead
float r = 1024.0f * (float)x / (float)y;
return (int)r;
ifeq "$(ARCH)" "arm"
TARGET = gpu_neon.so
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
-SRC += vout_fb.c ../../frontend/arm_utils.s
+SRC += vout_fb.c ../../frontend/cspace_neon.s
else
TARGET = gpu_neon.so.x86
CFLAGS += `sdl-config --cflags` -m32
#include "gpu.h"
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/arm_utils.h"
+#include "../../frontend/cspace.h"
static const struct rearmed_cbs *cbs;
static void *screen_buf;
all: $(TARGET)
-$(TARGET): gpu.cpp ../../frontend/arm_utils.s
+$(TARGET): gpu.cpp ../../frontend/cspace_neon.s
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
# $(TARGET): *.h
#else
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/arm_utils.h"
+#include "../../frontend/cspace.h"
extern "C" {