# Makefile for PCSX ReARMed
+# default stuff goes here, so that config can override
TARGET = pcsx
-
-# default CFLAGS go here, so that config can override them
CFLAGS += -Wall -ggdb -Ifrontend -ffast-math
LDLIBS += -lpthread -ldl -lpng -lz -lm
ifndef DEBUG
CFLAGS += -O2 -DNDEBUG
endif
+CXXFLAGS += $(CFLAGS)
#DRC_DBG = 1
#PCNT = 1
endif
-include Makefile.local
+CC_LINK = $(CC)
+
# core
OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/debug.o \
libpcsxcore/decode_xa.o libpcsxcore/disr3000a.o libpcsxcore/mdec.o \
ifeq "$(ARCH)" "arm"
OBJS += plugins/dfsound/arm_utils.o
endif
-ifeq "$(USE_OSS)" "1"
+ifeq "$(SOUND_DRIVER)" "oss"
plugins/dfsound/%.o: CFLAGS += -DUSEOSS
OBJS += plugins/dfsound/oss.o
endif
-ifeq "$(USE_ALSA)" "1"
+ifeq "$(SOUND_DRIVER)" "alsa"
plugins/dfsound/%.o: CFLAGS += -DUSEALSA
OBJS += plugins/dfsound/alsa.o
LDLIBS += -lasound
endif
-ifeq "$(USE_NO_SOUND)" "1"
+ifeq "$(SOUND_DRIVER)" "none"
OBJS += plugins/dfsound/nullsnd.o
endif
-# gpu
-OBJS += plugins/gpulib/gpu.o
+# builtin gpu
+OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o
ifeq "$(HAVE_NEON)" "1"
OBJS += plugins/gpulib/cspace_neon.o
+else
+OBJS += plugins/gpulib/cspace.o
+endif
+ifeq "$(BUILTIN_GPU)" "neon"
OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
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
-else
-OBJS += plugins/gpulib/cspace.o
+endif
+ifeq "$(BUILTIN_GPU)" "peops"
# note: code is not safe for strict-aliasing? (Castlevania problems)
plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing
plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
OBJS += plugins/dfxvideo/gpulib_if.o
endif
-ifdef X11
-LDLIBS += -lX11 `sdl-config --libs`
-OBJS += plugins/gpulib/vout_sdl.o
-plugins/gpulib/vout_sdl.o: CFLAGS += `sdl-config --cflags`
-else
-OBJS += plugins/gpulib/vout_pl.o
+ifeq "$(BUILTIN_GPU)" "unai"
+OBJS += plugins/gpulib/cspace.o
+OBJS += plugins/gpu_unai/gpulib_if.o
+ifeq "$(ARCH)" "arm"
+OBJS += plugins/gpu_unai/gpu_arm.o
+endif
+plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED
+CC_LINK = $(CXX)
endif
# cdrcimg
target_: $(TARGET)
$(TARGET): $(OBJS)
- $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) -Wl,-Map=$@.map
+ $(CC_LINK) -o $@ $^ $(LDFLAGS) $(LDLIBS) -Wl,-Map=$@.map
clean: $(PLAT_CLEAN) clean_plugins
$(RM) $(TARGET) $(OBJS) $(TARGET).map
platform_list="generic pandora maemo caanoo libretro"
platform="generic"
+builtin_gpu_list="peops unai neon"
+builtin_gpu=""
sound_driver_list="oss alsa libretro none"
sound_driver="alsa"
plugins="plugins/spunull/spunull.so \
;;
--platform=*) set_platform "$optarg"
;;
+ --gpu=*) builtin_gpu="$optarg"
+ ;;
--sound-driver=*) sound_driver="$optarg"
;;
--enable-neon) have_arm_neon="yes"
echo " --help print this message"
echo " --platform=NAME target platform [$platform]"
echo " available: $platform_list"
+ echo " --gpu=NAME builtin gpu plugin [guessed]"
+ echo " available: $builtin_gpu_list"
echo " --sound-driver=NAME sound output driver [$sound_driver]"
echo " available: $sound_driver_list"
echo " --enable-neon"
exit 1
fi
+if [ "x$builtin_gpu" != "x" ]; then
+ case "$builtin_gpu" in
+ peops|unai|neon)
+ ;;
+ *)
+ echo "unsupported builtin gpu plugin: $builtin_gpu"
+ exit 1
+ ;;
+ esac
+fi
+
case "$sound_driver" in
oss|alsa|libretro|none)
;;
fi
fi
+ if [ "x$builtin_gpu" = "x" ]; then
+ if [ "$have_arm_neon" = "yes" ]; then
+ builtin_gpu="neon"
+ elif [ "$have_armv7" != "yes" ]; then
+ # pre-ARMv7 hardware is usually not fast enough for peops
+ builtin_gpu="unai"
+ else
+ builtin_gpu="peops"
+ fi
+ fi
+
# set mfpu and mfloat-abi if they are not set
if [ "$have_arm_neon" = "yes" ]; then
echo "$CFLAGS" | grep -q -- '-mfpu=' || CFLAGS="$CFLAGS -mfpu=neon"
enable_dynarec="no"
fi
+if [ "x$builtin_gpu" = "x" ]; then
+ builtin_gpu="peops"
+fi
+
if [ "$ARCH" = "x86_64" ]; then
# currently we are full of 32bit assumptions,
# at least savestate compatibility will break without these
plugins="$plugins plugins/gpu-gles/gpu_gles.so"
fi
+if [ "$have_arm_neon" = "yes" -a "$builtin_gpu" != "neon" ]; then
+ plugins="$plugins plugins/gpu_neon/gpu_neon.so"
+fi
+
# short plugin list for display
for p in $plugins; do
p1=`basename $p`
echo "architecture $ARCH"
echo "platform $platform"
+echo "built-in GPU $builtin_gpu"
echo "sound driver $sound_driver"
echo "plugins $plugins_short"
echo "C compiler $CC"
fi
echo "ARCH = $ARCH" >> $config_mak
echo "PLATFORM = $platform" >> $config_mak
-case "$sound_driver" in
-oss)
- echo "USE_OSS = 1" >> $config_mak
- ;;
-alsa)
- echo "USE_ALSA = 1" >> $config_mak
- ;;
-none)
- echo "USE_NO_SOUND = 1" >> $config_mak
- ;;
-esac
+echo "BUILTIN_GPU = $builtin_gpu" >> $config_mak
+echo "SOUND_DRIVER = $sound_driver" >> $config_mak
if [ "$ARCH" = "arm" ]; then
echo "PLUGINS = $plugins" >> $config_mak
else
strcpy(Config.Pad1, "builtin_pad");
strcpy(Config.Pad2, "builtin_pad");
strcpy(Config.Net, "Disabled");
-#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX */
- strcpy(Config.Gpu, "gpu_unai.so");
-#endif
snprintf(Config.PatchesDir, sizeof(Config.PatchesDir), "." PATCHES_DIR);
}