aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-09-23 19:29:03 +0300
committernotaz2011-09-23 19:29:03 +0300
commita80ae4a0353fce94df700ec84222d3c56c3d813a (patch)
treec6b2e473c33365cf8b33ab859681edf72ab06b01
parentaaac9c7e007b51aa74d18975f94bffdfed01c7e8 (diff)
downloadpcsx_rearmed-a80ae4a0353fce94df700ec84222d3c56c3d813a.tar.gz
pcsx_rearmed-a80ae4a0353fce94df700ec84222d3c56c3d813a.tar.bz2
pcsx_rearmed-a80ae4a0353fce94df700ec84222d3c56c3d813a.zip
support armv5 build
-rw-r--r--Makefile49
-rw-r--r--frontend/cspace.c7
-rw-r--r--frontend/cspace.h (renamed from frontend/arm_utils.h)0
-rw-r--r--frontend/cspace_neon.s (renamed from frontend/arm_utils.s)0
-rw-r--r--frontend/menu.c2
-rw-r--r--frontend/plat_dummy.c12
-rw-r--r--libpcsxcore/new_dynarec/emu_if.c4
-rw-r--r--libpcsxcore/new_dynarec/emu_if.h4
-rw-r--r--libpcsxcore/new_dynarec/linkage_arm.s9
-rw-r--r--plugins/dfsound/spu.c4
-rw-r--r--plugins/dfxvideo/draw_fb.c2
-rw-r--r--plugins/dfxvideo/soft.c2
-rw-r--r--plugins/gpu_neon/Makefile2
-rw-r--r--plugins/gpu_neon/vout_fb.c2
-rw-r--r--plugins/gpu_unai/Makefile2
-rw-r--r--plugins/gpu_unai/gpu.cpp2
16 files changed, 57 insertions, 46 deletions
diff --git a/Makefile b/Makefile
index 2b57053..5a7b278 100644
--- a/Makefile
+++ b/Makefile
@@ -3,26 +3,39 @@ AS = $(CROSS_COMPILE)as
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)
@@ -33,7 +46,7 @@ OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore
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
@@ -41,6 +54,7 @@ libpcsxcore/misc.o libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
# 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
@@ -58,7 +72,7 @@ OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
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"
@@ -109,8 +123,11 @@ else
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
@@ -136,7 +153,7 @@ frontend/revision.h: FORCE
$(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):
diff --git a/frontend/cspace.c b/frontend/cspace.c
new file mode 100644
index 0000000..f5f8d35
--- /dev/null
+++ b/frontend/cspace.c
@@ -0,0 +1,7 @@
+#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) {}
+
diff --git a/frontend/arm_utils.h b/frontend/cspace.h
index 644143b..644143b 100644
--- a/frontend/arm_utils.h
+++ b/frontend/cspace.h
diff --git a/frontend/arm_utils.s b/frontend/cspace_neon.s
index d131923..d131923 100644
--- a/frontend/arm_utils.s
+++ b/frontend/cspace_neon.s
diff --git a/frontend/menu.c b/frontend/menu.c
index cdba3ad..01b568e 100644
--- a/frontend/menu.c
+++ b/frontend/menu.c
@@ -22,7 +22,7 @@
#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"
diff --git a/frontend/plat_dummy.c b/frontend/plat_dummy.c
index 44ba4a8..bafb184 100644
--- a/frontend/plat_dummy.c
+++ b/frontend/plat_dummy.c
@@ -43,18 +43,6 @@ void plat_finish(void)
{
}
-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)
{
}
diff --git a/libpcsxcore/new_dynarec/emu_if.c b/libpcsxcore/new_dynarec/emu_if.c
index 5821650..8a068ea 100644
--- a/libpcsxcore/new_dynarec/emu_if.c
+++ b/libpcsxcore/new_dynarec/emu_if.c
@@ -161,12 +161,14 @@ static int ari64_init()
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;
return 0;
diff --git a/libpcsxcore/new_dynarec/emu_if.h b/libpcsxcore/new_dynarec/emu_if.h
index 128d431..8acd1f5 100644
--- a/libpcsxcore/new_dynarec/emu_if.h
+++ b/libpcsxcore/new_dynarec/emu_if.h
@@ -1,6 +1,10 @@
#include "new_dynarec.h"
#include "../r3000a.h"
+#ifndef __ARM_ARCH_7A__
+#define ARMv5_ONLY
+#endif
+
extern char invalid_code[0x100000];
/* weird stuff */
diff --git a/libpcsxcore/new_dynarec/linkage_arm.s b/libpcsxcore/new_dynarec/linkage_arm.s
index c545ed3..f5af0f5 100644
--- a/libpcsxcore/new_dynarec/linkage_arm.s
+++ b/libpcsxcore/new_dynarec/linkage_arm.s
@@ -19,15 +19,8 @@
* 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
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index 06cc476..f84ef77 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -37,7 +37,7 @@
#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
@@ -620,7 +620,7 @@ static int do_samples_noise(int ch, int ns, int ns_to)
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);
diff --git a/plugins/dfxvideo/draw_fb.c b/plugins/dfxvideo/draw_fb.c
index f40063e..7f80724 100644
--- a/plugins/dfxvideo/draw_fb.c
+++ b/plugins/dfxvideo/draw_fb.c
@@ -10,7 +10,7 @@
#include "gpu.h"
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/arm_utils.h"
+#include "../../frontend/cspace.h"
#include "../../frontend/pcnt.h"
// misc globals
diff --git a/plugins/dfxvideo/soft.c b/plugins/dfxvideo/soft.c
index 1b24624..160b0c4 100644
--- a/plugins/dfxvideo/soft.c
+++ b/plugins/dfxvideo/soft.c
@@ -1077,7 +1077,7 @@ static int left_B, delta_left_B, right_B, delta_right_B;
// 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;
diff --git a/plugins/gpu_neon/Makefile b/plugins/gpu_neon/Makefile
index 09c47d3..adb5097 100644
--- a/plugins/gpu_neon/Makefile
+++ b/plugins/gpu_neon/Makefile
@@ -10,7 +10,7 @@ SRC += gpu.c
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
diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c
index 6b687b3..bda8d4a 100644
--- a/plugins/gpu_neon/vout_fb.c
+++ b/plugins/gpu_neon/vout_fb.c
@@ -10,7 +10,7 @@
#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;
diff --git a/plugins/gpu_unai/Makefile b/plugins/gpu_unai/Makefile
index 026d950..80f82ae 100644
--- a/plugins/gpu_unai/Makefile
+++ b/plugins/gpu_unai/Makefile
@@ -16,7 +16,7 @@ LDFLAGS += -shared -Wl,-soname,$(TARGET)
all: $(TARGET)
-$(TARGET): gpu.cpp ../../frontend/arm_utils.s
+$(TARGET): gpu.cpp ../../frontend/cspace_neon.s
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
# $(TARGET): *.h
diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp
index 3342d1e..fa176d5 100644
--- a/plugins/gpu_unai/gpu.cpp
+++ b/plugins/gpu_unai/gpu.cpp
@@ -820,7 +820,7 @@ void GPU_updateLace(void)
#else
#include "../../frontend/plugin_lib.h"
-#include "../../frontend/arm_utils.h"
+#include "../../frontend/cspace.h"
extern "C" {