LDFLAGS += -fsanitize=address
#LDFLAGS += -static-libasan
endif
+ifneq ($(NO_FSECTIONS), 1)
+CFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS += -Wl,--gc-sections
+endif
CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \
-DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \
-DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \
endif
libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
+ifeq "$(USE_ASYNC_CDROM)" "1"
+libpcsxcore/cdrom-async.o: CFLAGS += -DUSE_ASYNC_CDROM
+frontend/libretro.o: CFLAGS += -DUSE_ASYNC_CDROM
+frontend/menu.o: CFLAGS += -DUSE_ASYNC_CDROM
+USE_RTHREADS := 1
+endif
+
# dynarec
ifeq "$(DYNAREC)" "lightrec"
CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \
frontend/libpicofe/linux/plat.o: CFLAGS += -DPANDORA
USE_PLUGIN_LIB = 1
USE_FRONTEND = 1
-CFLAGS += -gdwarf-3 -ffunction-sections -fdata-sections
-LDFLAGS += -Wl,--gc-sections
+CFLAGS += -gdwarf-3
endif
ifeq "$(PLATFORM)" "caanoo"
OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o
OBJS += deps/libretro-common/vfs/vfs_implementation_cdrom.o
CFLAGS += -DHAVE_CDROM
endif
-ifeq "$(USE_ASYNC_CDROM)" "1"
-CFLAGS += -DUSE_ASYNC_CDROM
-USE_RTHREADS := 1
-endif
ifeq "$(USE_LIBRETRO_VFS)" "1"
OBJS += deps/libretro-common/compat/compat_posix_string.o
OBJS += deps/libretro-common/compat/fopen_utf8.o
frontend/menu.o frontend/main.o: frontend/revision.h
frontend/plat_sdl.o frontend/libretro.o: frontend/revision.h
+CFLAGS += $(CFLAGS_LAST)
+
frontend/libpicofe/%.c:
@echo "libpicofe module is missing, please run:"
@echo "git submodule init && git submodule update"
check_define()
{
- $CC -E -dD $CFLAGS include/arm_features.h | grep -q "$1" || return 1
+ $CC -E -dD $CFLAGS include/arm_features.h | grep -v '#undef' | grep -q "$1" || return 1
return 0
}
check_define_val()
{
- $CC -E -dD $CFLAGS include/arm_features.h | grep "$1" | awk '{print $3}'
+ $CC -E -dD $CFLAGS include/arm_features.h | grep -v '#undef' | grep "$1" | awk '{print $3}'
return 0
}
# setting options to "yes" or "no" will make that choice default,
# "" means "autodetect".
-platform_list="generic pandora maemo caanoo libretro"
+platform_list="generic pandora maemo caanoo"
platform="generic"
builtin_gpu_list="neon peops unai unai_old"
dynarec_list="ari64 lightrec none"
builtin_gpu=""
-sound_driver_list="oss alsa pulseaudio sdl libretro"
+sound_driver_list="oss alsa pulseaudio sdl"
sound_drivers=""
plugins="plugins/spunull/spunull.so \
plugins/dfxvideo/gpu_peops.so plugins/gpu_unai_old/gpu_unai_old.so plugins/gpu_unai/gpu_unai.so"
have_gles=""
have_c64x_dsp=""
dynarec=""
+multithreading="yes"
need_sdl="no"
need_xlib="no"
need_libpicofe="yes"
optimize_cortexa8="yes"
have_arm_neon="yes"
need_xlib="yes"
+ multithreading="no"
;;
maemo)
drc_cache_base="yes"
optimize_cortexa8="yes"
have_arm_neon="yes"
+ multithreading="no"
;;
caanoo)
sound_drivers="oss"
drc_cache_base="yes"
optimize_arm926ej="yes"
need_warm="yes"
- ;;
- libretro)
- sound_drivers="libretro"
- need_libpicofe="no"
+ multithreading="no"
;;
*)
fail "unsupported platform: $platform"
;;
--disable-neon) have_arm_neon="no"
;;
+ --enable-threads) multithreading="yes"
+ ;;
+ --disable-threads) multithreading="no"
+ ;;
--dynarec=*) dynarec="$optarg"
;;
--disable-dynarec) dynarec="no"
echo " available: $sound_driver_list"
echo " --enable-neon"
echo " --disable-neon enable/disable ARM NEON optimizations [guessed]"
+ echo " --enable-threads"
+ echo " --disable-threads enable/disable multithreaded features [guessed]"
echo " --dynarec=NAME select dynamic recompiler [guessed]"
echo " available: $dynarec_list"
echo "influential environment variables:"
maemo)
CFLAGS="$CFLAGS -DMAEMO -DMAEMO_CHANGES"
;;
-libretro)
- CFLAGS="$CFLAGS -fPIC"
- MAIN_LDFLAGS="$MAIN_LDFLAGS -shared -Wl,--no-undefined"
- ;;
esac
# header/library presence tests
if [ "$platform" = "generic" ]; then
echo "OpenGL ES output $have_gles"
fi
+echo "multithreading $multithreading"
echo "# Automatically generated by configure" > $config_mak
printf "# Configured with:" >> $config_mak
echo "PLUGIN_CFLAGS += $PLUGIN_CFLAGS" >> $config_mak
echo >> $config_mak
-if [ "$platform" = "libretro" ]; then
- echo "TARGET = libretro.so" >> $config_mak
-fi
echo "ARCH = $ARCH" >> $config_mak
echo "PLATFORM = $platform" >> $config_mak
echo "BUILTIN_GPU = $builtin_gpu" >> $config_mak
if [ "$have_c64x_dsp" = "yes" ]; then
echo "HAVE_C64_TOOLS = 1" >> $config_mak
fi
+if [ "$multithreading" = "yes" ]; then
+ echo "USE_ASYNC_CDROM = 1" >> $config_mak
+ echo "NDRC_THREAD = 1" >> $config_mak
+fi
# use pandora's skin (for now)
test -e skin || ln -s frontend/pandora/skin skin
#if !defined(_WIN32) && !defined(NO_DYLIB)
#include <dlfcn.h>
#endif
+#ifdef HAVE_CPU_FEATURES
+#include "features/features_cpu.h"
+#endif
#include "main.h"
#include "plugin.h"
int emu_core_init(void)
{
SysPrintf("Starting PCSX-ReARMed " REV "%s\n", get_build_info());
+#ifdef HAVE_CPU_FEATURES
+ SysPrintf("%d cpu core(s) detected\n", cpu_features_get_core_amount());
+#endif
#ifndef NO_FRONTEND
check_profile();
static int config_save_counter, region, in_type_sel1, in_type_sel2;
static int psx_clock;
static int memcard1_sel = -1, memcard2_sel = -1;
+static int cd_buf_count;
extern int g_autostateld_opt;
static int menu_iopts[8];
int g_opts, g_scaler, g_gamma = 100;
CE_INTVAL(memcard1_sel),
CE_INTVAL(memcard2_sel),
CE_INTVAL(g_autostateld_opt),
+ CE_INTVAL(cd_buf_count),
CE_INTVAL_N("adev0_is_nublike", in_adev_is_nublike[0]),
CE_INTVAL_N("adev1_is_nublike", in_adev_is_nublike[1]),
CE_INTVAL_V(frameskip, 4),
return -1;
}
+ cd_buf_count = cdra_get_buf_count();
+
for (i = 0; i < ARRAY_SIZE(config_data); i++) {
fprintf(f, "%s = ", config_data[i].name);
switch (config_data[i].len) {
}
keys_load_all(cfg);
+ cdra_set_buf_count(cd_buf_count);
ret = 0;
fail_read:
free(cfg);
mee_enum_h ("GPU l-list slow walking",0, menu_iopts[AMO_GPUL], men_autooo, h_cfg_gpul),
mee_enum_h ("Fractional framerate", 0, menu_iopts[AMO_FFPS], men_autooo, h_cfg_ffps),
mee_onoff_h ("Turbo CD-ROM ", 0, menu_iopts[AMO_TCD], 1, h_cfg_tcd),
+#ifdef USE_ASYNC_CDROM
+ mee_range ("CD-ROM read-ahead", 0, cd_buf_count, 0, 1024),
+#endif
#if !defined(DRC_DISABLE) || defined(LIGHTREC)
mee_onoff_h ("Disable dynarec (slow!)",0, menu_iopts[AMO_CPU], 1, h_cfg_nodrc),
#endif
*opts[i].opt = *opts[i].mopt;
Config.GpuListWalking = menu_iopts[AMO_GPUL] - 1;
Config.FractionalFramerate = menu_iopts[AMO_FFPS] - 1;
+ cdra_set_buf_count(cd_buf_count);
return 0;
}
cdra_start_thread();
}
+int cdra_get_buf_count(void)
+{
+ return acdrom.buf_cnt;
+}
#else
// phys. CD-ROM without a cache is unusable so not implemented
int cdra_check_eject(int *inserted) { return 0; }
void cdra_stop_thread(void) {}
void cdra_set_buf_count(int newcount) {}
+int cdra_get_buf_count(void) { return 0; }
#endif
int cdra_check_eject(int *inserted);
void cdra_stop_thread(void);
void cdra_set_buf_count(int count);
+int cdra_get_buf_count(void);
void *cdra_getBuffer(void);