diff --git a/Makefile b/Makefile index 90ba4945..8b70c763 100644 --- a/Makefile +++ b/Makefile @@ -872,6 +872,24 @@ ifeq ($(HAVE_ARMv6),1) CFLAGS += -DHAVE_ARMv6 endif +# threads (libretro-common rthreads), as the other libretro cores do (beetle-psx): +# on by default, off where there is no thread library, and on the MSVC builds +# (the ST-V threaded video needs MSVC 2015's thread-local storage, the +# buildbot's MSVC lanes are 2005 and 2010: nothing would use the threads) +HAVE_THREADS ?= 1 +ifneq (,$(filter $(platform), emscripten linux-portable ngc wii wiiu ps2 ps3 psl1ght psp1 ctr vita)) + HAVE_THREADS = 0 +endif +ifneq (,$(findstring msvc,$(platform))) + HAVE_THREADS = 0 +endif +ifeq ($(HAVE_THREADS),1) + # pthreads are in the C library on Darwin and Android, Windows uses its own threads + ifeq (,$(findstring msvc,$(platform))$(findstring android,$(platform))$(findstring ios,$(platform))$(findstring tvos,$(platform))$(filter osx win,$(platform))) + LIBS += -lpthread + endif +endif + # include the various .mak files ifneq (,$(filter $(INCLUDE_DRV),all)) include Makefile.common diff --git a/Makefile.common b/Makefile.common index eda6b7a9..70849af0 100644 --- a/Makefile.common +++ b/Makefile.common @@ -532,7 +532,7 @@ SOURCES_C += \ $(CORE_DIR)/vidhrdw/segavdp.c $(CORE_DIR)/vidhrdw/segac2_vidhrdw.c $(CORE_DIR)/machine/megadriv.c $(CORE_DIR)/drivers/segac2.c $(CORE_DIR)/drivers/megaplay.c $(CORE_DIR)/drivers/megatech.c $(CORE_DIR)/drivers/megadriv_acbl.c $(CORE_DIR)/drivers/megadriv_ybox.c $(CORE_DIR)/drivers/megadriv_sunmix.c \ $(CORE_DIR)/drivers/stv.c $(CORE_DIR)/drivers/stvhacks.c $(CORE_DIR)/machine/stvcd.c \ $(CORE_DIR)/machine/scudsp.c \ - $(CORE_DIR)/vidhrdw/stvvdp1_vidhrdw.c $(CORE_DIR)/vidhrdw/stvvdp2_vidhrdw.c \ + $(CORE_DIR)/vidhrdw/stvvid.c \ $(CORE_DIR)/vidhrdw/deniam_vidhrdw.c $(CORE_DIR)/drivers/deniam.c \ $(CORE_DIR)/machine/btime_machine.c $(CORE_DIR)/vidhrdw/btime_vidhrdw.c $(CORE_DIR)/drivers/btime.c \ $(CORE_DIR)/machine/decocass_machine.c $(CORE_DIR)/vidhrdw/decocass_vidhrdw.c $(CORE_DIR)/drivers/decocass.c \ @@ -2852,6 +2852,12 @@ SOURCES_C += \ # sljit: run-time code generator of the MIPS recompilers (empty where they are not supported) SOURCES_C += $(CORE_DIR)/lib/sljit/sljit_mame.c +# threads (libretro-common rthreads, set by the platform: see Makefile): the ST-V threaded video option +ifeq ($(HAVE_THREADS),1) +COREDEFINES += -DHAVE_THREADS +SOURCES_C += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.c +endif + ifeq ($(STATIC_LINKING),1) else SOURCES_C += \ diff --git a/jni/Android.mk b/jni/Android.mk index 4e65a9b2..3099ed9b 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -3,6 +3,9 @@ LOCAL_PATH := $(call my-dir) ROOT_DIR := $(LOCAL_PATH)/.. CORE_DIR := $(ROOT_DIR)/src +# threads: in bionic's C library +HAVE_THREADS := 1 + include $(ROOT_DIR)/Makefile.common COREFLAGS := $(DEFS) $(COREDEFINES) $(CPUDEFS) $(SOUNDDEFS) $(ASMDEFS) $(DBGDEFS) -ffast-math -funroll-loops -DANDROID -DHAVE_ZLIB $(INCFLAGS) diff --git a/metadata/mame2003-plus.xml b/metadata/mame2003-plus.xml index 1267a0e7..27c0fb1f 100644 --- a/metadata/mame2003-plus.xml +++ b/metadata/mame2003-plus.xml @@ -204980,7 +204980,7 @@ - + @@ -204993,7 +204993,7 @@ -