Skip to content

Commit

Permalink
Merge pull request #13243 from Swordfish90/master
Browse files Browse the repository at this point in the history
Fix Libretro core ashmem crashes with targetSdk 29.
  • Loading branch information
hrydgard authored Aug 3, 2020
2 parents af4822d + cbdb9cc commit 74a9edd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 2 additions & 6 deletions libretro/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ SOURCES_CXX += $(NATIVEDIR)/math/dataconv.cpp \
$(COREDIR)/Util/PPGeDraw.cpp \
$(COREDIR)/Util/AudioFormat.cpp \
$(COREDIR)/Util/PortManager.cpp \
$(EXTDIR)/disarm.cpp \
$(CORE_DIR)/UI/TextureUtil.cpp \
$(CORE_DIR)/UI/GameInfoCache.cpp

Expand All @@ -509,6 +508,7 @@ ifeq ($(WITH_DYNAREC),1)
$(COREDIR)/MIPS/ARM/ArmJit.cpp \
$(COREDIR)/MIPS/ARM/ArmRegCache.cpp \
$(COREDIR)/MIPS/ARM/ArmRegCacheFPU.cpp \
$(EXTDIR)/disarm.cpp \
$(GPUCOMMONDIR)/VertexDecoderArm.cpp

ifeq ($(HAVE_NEON),1)
Expand Down Expand Up @@ -545,6 +545,7 @@ ifeq ($(WITH_DYNAREC),1)
SOURCES_CXX += \
$(COREDIR)/MIPS/ARM/ArmCompVFPUNEON.cpp \
$(COREDIR)/MIPS/ARM/ArmCompVFPUNEONUtil.cpp \
$(COREDIR)/Util/AudioFormatNEON.cpp \
$(COMMONDIR)/ColorConvNEON.cpp \
$(GPUDIR)/Common/TextureDecoderNEON.cpp

Expand Down Expand Up @@ -591,11 +592,6 @@ endif
SOURCES_C += $(NATIVEDIR)/math/fast/fast_matrix_sse.c
endif
endif
SOURCES_CXX += \
$(COMMONDIR)/ArmEmitter.cpp \
$(COMMONDIR)/Arm64Emitter.cpp \
$(COREDIR)/Util/DisArm64.cpp

#UDIS86
# Compiled and linked even on ARM for now

Expand Down
1 change: 1 addition & 0 deletions libretro/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COREFLAGS :=
CORE_DIR := ../..
FFMPEGDIR := $(CORE_DIR)/ffmpeg
FFMPEGLIBS += libavformat libavcodec libavutil libswresample libswscale
WITH_DYNAREC := 1

ifeq ($(TARGET_ARCH),arm64)
COREFLAGS += -DARM64 -D_ARCH_64
Expand Down
14 changes: 14 additions & 0 deletions libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <thread>
#include <atomic>
#include <vector>
#include <stdlib.h>

#include "base/timeutil.h"
#include "Common/ChunkFile.h"
Expand Down Expand Up @@ -32,6 +33,10 @@
#include "libretro/libretro.h"
#include "libretro/LibretroGraphicsContext.h"

#if PPSSPP_PLATFORM(ANDROID)
#include <sys/system_properties.h>
#endif

#define DIR_SEP "/"
#ifdef _WIN32
#define DIR_SEP_CHRS "/\\"
Expand Down Expand Up @@ -857,6 +862,15 @@ int System_GetPropertyInt(SystemProperty prop)
{
case SYSPROP_AUDIO_SAMPLE_RATE:
return SAMPLERATE;
#if PPSSPP_PLATFORM(ANDROID)
case SYSPROP_SYSTEMVERSION: {
char sdk[PROP_VALUE_MAX] = {0};
if (__system_property_get("ro.build.version.sdk", sdk) != 0) {
return atoi(sdk);
}
return -1;
}
#endif
default:
break;
}
Expand Down

0 comments on commit 74a9edd

Please sign in to comment.