[Scummvm-git-logs] scummvm master -> 207a65c8eb9a186b74f4cd0283ca5b388e952815

spleen1981 noreply at scummvm.org
Mon Oct 28 23:31:37 UTC 2024


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
db6469306a LIBRETRO: add neon support
d7276b9e6b LIBRETRO: add readability test to isDirectory() and getParent()
207a65c8eb LIBRETRO: increase initial value of max w/h to max engines request


Commit: db6469306a5cb0cb2b95969525e58822051ef754
    https://github.com/scummvm/scummvm/commit/db6469306a5cb0cb2b95969525e58822051ef754
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-29T00:30:23+01:00

Commit Message:
LIBRETRO: add neon support

Changed paths:
    backends/platform/libretro/Makefile
    backends/platform/libretro/Makefile.common
    backends/platform/libretro/jni/Android.mk
    backends/platform/libretro/src/libretro-graphics-surface.cpp


diff --git a/backends/platform/libretro/Makefile b/backends/platform/libretro/Makefile
index 2d5d838dcc4..a29a5666ab4 100644
--- a/backends/platform/libretro/Makefile
+++ b/backends/platform/libretro/Makefile
@@ -46,6 +46,7 @@ ifeq ($(platform), rpi3_64)
    CFLAGS  += -fPIC -mcpu=cortex-a53 -mtune=cortex-a53 -fomit-frame-pointer -ffast-math
    CXXFLAGS = $(CFLAGS) -frtti -std=c++11
    HAVE_OPENGLES2 :=1
+   HAVE_NEON := 1
 
 # Raspberry Pi 4 (64 bit)
 else ifeq ($(platform), rpi4_64)
@@ -55,6 +56,7 @@ else ifeq ($(platform), rpi4_64)
    CFLAGS += -fPIC -mcpu=cortex-a72 -mtune=cortex-a72 -fomit-frame-pointer -ffast-math
    CXXFLAGS = $(CFLAGS) -frtti -std=c++11
    HAVE_OPENGLES2 := 1
+   HAVE_NEON := 1
 
 # iOS
 else ifneq (,$(findstring ios,$(platform)))
@@ -63,6 +65,7 @@ else ifneq (,$(findstring ios,$(platform)))
    LDFLAGS += -dynamiclib -fPIC
    MINVERSION :=
    HAVE_OPENGLES2 := 1
+   HAVE_NEON := 1
 
 ifeq ($(IOSSDK),)
    IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
@@ -71,8 +74,9 @@ ifeq ($(platform),ios-arm64)
    CC        = cc -arch arm64 -isysroot $(IOSSDK)
    CXX       = c++ -arch arm64 -isysroot $(IOSSDK)
 else
-   CC       = cc -arch armv7 -isysroot $(IOSSDK) -marm
+   CC       = cc -arch armv7 -isysroot $(IOSSDK)
    CXX      = c++ -arch armv7 -isysroot $(IOSSDK)
+   DEFINES  = -marm -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
 endif
 
 ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
@@ -89,6 +93,7 @@ else ifeq ($(platform), tvos-arm64)
    DEFINES += -fPIC -DHAVE_POSIX_MEMALIGN=1 -DIOS
    LDFLAGS += -dynamiclib -fPIC
    HAVE_OPENGLES2 := 1
+   HAVE_NEON := 1
 ifeq ($(IOSSDK),)
    IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
 endif
@@ -99,13 +104,15 @@ endif
 else ifeq ($(platform), qnx)
    TARGET  := $(TARGET_NAME)_libretro_$(platform).so
    DEFINES += -fPIC -DSYSTEM_NOT_SUPPORTING_D_TYPE -DDEFAULT_PERF_TUNER
+   DEFINES += -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
    LDFLAGS += -shared -Wl,--version-script=$(ROOT_PATH)/link.T -fPIC
    CC = qcc -Vgcc_ntoarmv7le
    CXX = QCC -Vgcc_ntoarmv7le
    LD = QCC -Vgcc_ntoarmv7le
    AR = qcc -Vgcc_ntoarmv7le -A
    RANLIB="${QNX_HOST}/usr/bin/ntoarmv7-ranlib"
-   HAVE_OPENGLES2 := 1
+   HAVE_OPENGLES2 := 1.
+   HAVE_NEON := 1
 
 # Genode
 else ifeq ($(platform), genode)
@@ -154,12 +161,13 @@ else ifeq ($(platform), libnx)
     TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
     AR = $(DEVKITPRO)/devkitA64/aarch64-none-elf/bin/ar$(EXE_EXT) rcs
     DEFINES := -DSWITCH=1 -U__linux__ -U__linux
-    DEFINES   += -g -O3 -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec
+    DEFINES   += -g -O3 -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -ffast-math -mcpu=cortex-a57+crc+fp+simd -march=armv8-a -mtune=cortex-a57 -mtp=soft
     DEFINES += $(INCDIRS)
-    DEFINES += -D__SWITCH__ -DHAVE_LIBNX -march=armv8-a -mtune=cortex-a57 -mtp=soft
+    DEFINES += -D__SWITCH__ -DHAVE_LIBNX -D__arm64__ -D__ARM_NEON__
     CXXFLAGS := $(ASFLAGS) -std=gnu++11 -fpermissive
     STATIC_LINKING = 1
     HAVE_OPENGL := 1
+    HAVE_NEON := 1
 
 # Nintendo Wii U
 else ifeq ($(platform), wiiu)
@@ -202,13 +210,14 @@ else ifeq ($(platform), vita)
    CC = arm-vita-eabi-gcc$(EXE_EXT)
    CXX = arm-vita-eabi-g++$(EXE_EXT)
    AR = arm-vita-eabi-ar$(EXE_EXT) rcs
-   DEFINES += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
+   DEFINES += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -mfpu=neon -marm
    DEFINES += -fno-optimize-sibling-calls -mlong-calls -mword-relocations
    DEFINES += -DVITA -DREDUCE_MEMORY_USAGE -DUNCACHED_PLUGINS -DPSP2 -DSYSTEM_NOT_SUPPORTING_D_TYPE
    USE_LIBCO = 0
    LITE := 1
    STATIC_LINKING = 1
    HAVE_OPENGLES2 := 1
+   HAVE_NEON := 1
 
 # GCW0
 else ifeq ($(platform), gcw0)
@@ -287,7 +296,7 @@ else ifneq (,$(findstring cortexa9,$(platform)))
 endif
 ifneq (,$(findstring neon,$(platform)))
    DEFINES += -mfpu=neon
-   HAVE_NEON = 1
+   HAVE_NEON := 1
 endif
 ifneq (,$(findstring softfloat,$(platform)))
    DEFINES += -mfloat-abi=softfp
@@ -302,7 +311,7 @@ else ifneq (,$(findstring armv8,$(platform)))
    DEFINES += -fPIC -D_ARM_ASSEM_ -DARM -marm -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -march=armv8-a+crc -DDEFAULT_PERF_TUNER
    LDFLAGS += -shared -Wl,--version-script=$(ROOT_PATH)/link.T -fPIC
    CFLAGS   += -fPIC
-   HAVE_NEON = 1
+   HAVE_NEON := 1
    HAVE_OPENGLES2 := 1
 
 # Odroid Go Advance
@@ -314,7 +323,7 @@ else ifneq (,$(findstring oga_a35_neon_hardfloat,$(platform)))
    USE_THEORADEC = 0
    USE_TREMOR = 1
    USE_MT32EMU = 0
-   HAVE_NEON = 1
+   HAVE_NEON := 1
    HAVE_OPENGLES2 := 1
 
 # Emscripten
diff --git a/backends/platform/libretro/Makefile.common b/backends/platform/libretro/Makefile.common
index 4c3bdfa6e0f..5d093ec15b2 100644
--- a/backends/platform/libretro/Makefile.common
+++ b/backends/platform/libretro/Makefile.common
@@ -150,6 +150,11 @@ else
    $(info No support for OpenGL/OpenGLES2 requested)
 endif
 
+ifeq ($(HAVE_NEON), 1)
+   SCUMMVM_NEON := 1
+   DEFINES += -DSCUMMVM_NEON
+endif
+
 ######################################################################
 # Libretro settings
 ######################################################################
diff --git a/backends/platform/libretro/jni/Android.mk b/backends/platform/libretro/jni/Android.mk
index f901a7fdb10..7e6ed1f0c0d 100644
--- a/backends/platform/libretro/jni/Android.mk
+++ b/backends/platform/libretro/jni/Android.mk
@@ -11,6 +11,10 @@ ifneq (,$(findstring 64,$(TARGET_ARCH_ABI)))
   TARGET_64BIT := 1
 endif
 
+ifneq (,$(findstring arm64,$(TARGET_ARCH_ABI)))
+  HAVE_NEON := 1
+endif
+
 include $(ROOT_PATH)/Makefile.common
 
 include $(addprefix $(SCUMMVM_PATH)/, $(addsuffix /module.mk,$(MODULES)))
diff --git a/backends/platform/libretro/src/libretro-graphics-surface.cpp b/backends/platform/libretro/src/libretro-graphics-surface.cpp
index d30ca7d5c27..6ea71a01237 100644
--- a/backends/platform/libretro/src/libretro-graphics-surface.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-surface.cpp
@@ -204,7 +204,11 @@ void LibretroGraphics::grabPalette(byte *colors, uint start, uint num) const {
 }
 
 bool LibretroGraphics::hasFeature(OSystem::Feature f) const {
-	return (f == OSystem::kFeatureCursorPalette) || (f == OSystem::kFeatureCursorAlpha);
+	return (f == OSystem::kFeatureCursorPalette) ||
+#ifdef SCUMMVM_NEON
+		(f == OSystem::kFeatureCpuNEON) ||
+#endif
+		(f == OSystem::kFeatureCursorAlpha);
 }
 
 void LibretroGraphics::setFeatureState(OSystem::Feature f, bool enable) {


Commit: d7276b9e6b4baa25e69ebf67b60870b11b768cf5
    https://github.com/scummvm/scummvm/commit/d7276b9e6b4baa25e69ebf67b60870b11b768cf5
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-29T00:30:46+01:00

Commit Message:
LIBRETRO: add readability test to isDirectory() and getParent()

Changed paths:
    backends/platform/libretro/include/libretro-fs.h
    backends/platform/libretro/src/libretro-fs.cpp
    backends/platform/libretro/src/libretro-os-utils.cpp


diff --git a/backends/platform/libretro/include/libretro-fs.h b/backends/platform/libretro/include/libretro-fs.h
index 07ce51eea68..7541d540ee8 100644
--- a/backends/platform/libretro/include/libretro-fs.h
+++ b/backends/platform/libretro/include/libretro-fs.h
@@ -40,6 +40,8 @@ protected:
 	Common::String _path;
 	bool _isDirectory;
 	bool _isValid;
+	bool _isReadable;
+	bool _isWritable;
 
 	virtual AbstractFSNode *makeNode(const Common::String &path) const {
 		return new LibRetroFilesystemNode(path);
@@ -71,13 +73,13 @@ public:
 		return _path;
 	}
 	virtual bool isDirectory() const {
-		return _isDirectory;
+		return _isDirectory && _isReadable;
 	}
 	virtual bool isReadable() const {
-		return access(_path.c_str(), R_OK) == 0;
+		return _isReadable;
 	}
 	virtual bool isWritable() const {
-		return access(_path.c_str(), W_OK) == 0;
+		return _isWritable;
 	}
 
 	virtual AbstractFSNode *getChild(const Common::String &n) const;
diff --git a/backends/platform/libretro/src/libretro-fs.cpp b/backends/platform/libretro/src/libretro-fs.cpp
index 150844a74a7..bcd8d4827ac 100644
--- a/backends/platform/libretro/src/libretro-fs.cpp
+++ b/backends/platform/libretro/src/libretro-fs.cpp
@@ -45,6 +45,8 @@ void LibRetroFilesystemNode::setFlags() {
 
 	_isValid = path_is_valid(fspath);
 	_isDirectory = path_is_directory(fspath);
+	_isReadable = access(fspath, R_OK) == 0;
+	_isWritable = access(_path.c_str(), W_OK) == 0;
 }
 
 LibRetroFilesystemNode::LibRetroFilesystemNode(const Common::String &p) {
@@ -154,7 +156,12 @@ AbstractFSNode *LibRetroFilesystemNode::getParent() const {
 		return 0;
 	}
 
-	return makeNode(Common::String(start, end));
+	AbstractFSNode * parent = makeNode(Common::String(start, end));
+
+	if (parent->isDirectory() == false)
+		return 0;
+
+	return parent;
 }
 
 Common::SeekableReadStream *LibRetroFilesystemNode::createReadStream() {
diff --git a/backends/platform/libretro/src/libretro-os-utils.cpp b/backends/platform/libretro/src/libretro-os-utils.cpp
index 93fbc9adcb6..e192d2a4211 100644
--- a/backends/platform/libretro/src/libretro-os-utils.cpp
+++ b/backends/platform/libretro/src/libretro-os-utils.cpp
@@ -170,7 +170,7 @@ bool OSystem_libretro::checkPathSetting(const char *setting, Common::String cons
 	Common::String setPath;
 	if (ConfMan.hasKey(setting))
 		setPath = Common::Path::fromConfig(ConfMan.get(setting)).toString();
-	if (setPath.empty() || ! (isDirectory ? (LibRetroFilesystemNode(setPath).isDirectory() && LibRetroFilesystemNode(setPath).isReadable()) : LibRetroFilesystemNode(setPath).exists()))
+	if (setPath.empty() || ! (isDirectory ? LibRetroFilesystemNode(setPath).isDirectory() : LibRetroFilesystemNode(setPath).exists()))
 		ConfMan.removeKey(setting, Common::ConfigManager::kApplicationDomain);
 	if (! ConfMan.hasKey(setting))
 		if (defaultPath.empty())
@@ -183,7 +183,7 @@ bool OSystem_libretro::checkPathSetting(const char *setting, Common::String cons
 void OSystem_libretro::setLibretroDir(const char * path, Common::String &var) {
 	var = Common::String(path ? path : "");
 	if (! var.empty())
-		if (! (LibRetroFilesystemNode(var).isDirectory() && LibRetroFilesystemNode(var).isReadable()))
+		if (! LibRetroFilesystemNode(var).isDirectory())
 			var.clear();
 	return;
 }
@@ -195,13 +195,13 @@ void OSystem_libretro::applyBackendSettings() {
 	Common::String s_extraDir(s_systemDir + "/" + SCUMMVM_SYSTEM_SUBDIR + "/" + SCUMMVM_EXTRA_SUBDIR);
 	Common::String s_soundfontPath(s_extraDir + "/" + DEFAULT_SOUNDFONT_FILENAME);
 
-	if (! (LibRetroFilesystemNode(s_themeDir).isDirectory() && LibRetroFilesystemNode(s_themeDir).isReadable()))
+	if (! LibRetroFilesystemNode(s_themeDir).isDirectory())
 		s_themeDir.clear();
-	if (! (LibRetroFilesystemNode(s_extraDir).isDirectory() && LibRetroFilesystemNode(s_extraDir).isReadable()))
+	if (! LibRetroFilesystemNode(s_extraDir).isDirectory())
 		s_extraDir.clear();
 	if (! LibRetroFilesystemNode(s_soundfontPath).exists())
 		s_soundfontPath.clear();
-	if (s_homeDir.empty() || ! (LibRetroFilesystemNode(s_homeDir).isDirectory() && LibRetroFilesystemNode(s_homeDir).isReadable()))
+	if (s_homeDir.empty() || ! LibRetroFilesystemNode(s_homeDir).isDirectory())
 		s_homeDir = s_systemDir;
 
 	//Register default paths


Commit: 207a65c8eb9a186b74f4cd0283ca5b388e952815
    https://github.com/scummvm/scummvm/commit/207a65c8eb9a186b74f4cd0283ca5b388e952815
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-10-29T00:31:16+01:00

Commit Message:
LIBRETRO: increase initial value of max w/h to max engines request

Changed paths:
    backends/platform/libretro/include/portdefs.h
    backends/platform/libretro/src/libretro-core.cpp


diff --git a/backends/platform/libretro/include/portdefs.h b/backends/platform/libretro/include/portdefs.h
index 8ad8b823305..4e6592fed83 100644
--- a/backends/platform/libretro/include/portdefs.h
+++ b/backends/platform/libretro/include/portdefs.h
@@ -41,9 +41,13 @@
 #if defined(DINGUX) || defined(_3DS)
 #define RES_W_OVERLAY 320
 #define RES_H_OVERLAY 200
+#define RES_INIT_MAX_W 320
+#define RES_INIT_MAX_H 200
 #else
-#define RES_W_OVERLAY 640
-#define RES_H_OVERLAY 400
+#define RES_W_OVERLAY 1280
+#define RES_H_OVERLAY 720
+#define RES_INIT_MAX_W 1280 /* crab engine */
+#define RES_INIT_MAX_H 768 /* e.g. director engine */
 #endif
 
 // HACK: With MinGW, GRIM engine seems to crash when using setjmp and longjmp if not using builtin versions
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index bc89c5c4381..bba39ca94a8 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -85,8 +85,8 @@ static uint8 video_hw_mode = 0;
 
 static unsigned base_width = RES_W_OVERLAY;
 static unsigned base_height = RES_H_OVERLAY;
-static unsigned max_width = RES_W_OVERLAY;
-static unsigned max_height = RES_H_OVERLAY;
+static unsigned max_width = RES_INIT_MAX_W;
+static unsigned max_height = RES_INIT_MAX_H;
 
 static uint32 current_frame = 0;
 static uint8 frameskip_no;




More information about the Scummvm-git-logs mailing list