[Scummvm-git-logs] scummvm master -> d1488a13dc1b88e426b880a921a0012753861252

spleen1981 noreply at scummvm.org
Thu Nov 14 00:32:49 UTC 2024


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

Summary:
8438bfe648 LIBRETRO: JANITORIAL: fix some formatting
63ddb92608 LIBRETRO: drop unneeded function
62c9bd8c5a LIBRETRO: drop timing inaccuracies setting
e12e2f9c80 LIBRETRO: drop frameskip settings
d1488a13dc LIBRETRO: improve description of framerate cap setting


Commit: 8438bfe64845e01aa193c8f44328c6a4e0d16e90
    https://github.com/scummvm/scummvm/commit/8438bfe64845e01aa193c8f44328c6a4e0d16e90
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T01:30:45+01:00

Commit Message:
LIBRETRO: JANITORIAL: fix some formatting

Changed paths:
    backends/platform/libretro/include/libretro-core-options.h
    backends/platform/libretro/include/libretro-core.h
    backends/platform/libretro/include/libretro-defs.h
    backends/platform/libretro/include/libretro-graphics-opengl.h
    backends/platform/libretro/include/libretro-graphics-surface.h
    backends/platform/libretro/include/libretro-os.h
    backends/platform/libretro/src/libretro-core.cpp
    backends/platform/libretro/src/libretro-fs.cpp
    backends/platform/libretro/src/libretro-graphics-opengl.cpp
    backends/platform/libretro/src/libretro-graphics-surface.cpp
    backends/platform/libretro/src/libretro-options-widget.cpp
    backends/platform/libretro/src/libretro-os-base.cpp
    backends/platform/libretro/src/libretro-os-utils.cpp
    backends/platform/libretro/src/libretro-threads.cpp
    backends/platform/libretro/src/libretro-timer.cpp


diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index 258817bde3f..1ed20687f6c 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -649,7 +649,8 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 #ifdef USE_OPENGL
 			{"enabled", NULL},
 #endif
-			{NULL, NULL},		},
+			{NULL, NULL},
+		},
 #ifdef USE_OPENGL
 		"enabled"
 #else
@@ -667,7 +668,8 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 		{
 			{"0", "4:3"},
 			{"1", "16:9"},
-			{NULL, NULL},		},
+			{NULL, NULL},
+		},
 		"1"
 	},
 	{
@@ -682,7 +684,8 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 			{"480", "SD"},
 			{"720", "HD"},
 			{"1080", "FHD"},
-			{NULL, NULL},		},
+			{NULL, NULL},
+		},
 		"720"
 	},
 #endif
diff --git a/backends/platform/libretro/include/libretro-core.h b/backends/platform/libretro/include/libretro-core.h
index 2557d1ab757..45992863668 100644
--- a/backends/platform/libretro/include/libretro-core.h
+++ b/backends/platform/libretro/include/libretro-core.h
@@ -24,12 +24,12 @@ extern retro_log_printf_t retro_log_cb;
 extern retro_input_state_t retro_input_cb;
 
 bool retro_get_input_bitmask_supported(void);
-void retro_osd_notification(const char* msg);
+void retro_osd_notification(const char *msg);
 int retro_get_input_device(void);
-const char * retro_get_core_dir(void);
-const char * retro_get_system_dir(void);
-const char * retro_get_save_dir(void);
-const char * retro_get_playlist_dir(void);
+const char *retro_get_core_dir(void);
+const char *retro_get_system_dir(void);
+const char *retro_get_save_dir(void);
+const char *retro_get_playlist_dir(void);
 
 bool retro_setting_get_timing_inaccuracies_enabled(void);
 float retro_setting_get_frame_rate(void);
@@ -50,6 +50,6 @@ void retro_set_size(unsigned width, unsigned height);
 uint8 retro_get_video_hw_mode(void);
 #ifdef USE_OPENGL
 uintptr_t retro_get_hw_fb(void);
-void * retro_get_proc_address(const char * name);
+void *retro_get_proc_address(const char *name);
 #endif
 #endif // LIBRETRO_CORE_H
diff --git a/backends/platform/libretro/include/libretro-defs.h b/backends/platform/libretro/include/libretro-defs.h
index 7d7b9416517..52e75f99c49 100644
--- a/backends/platform/libretro/include/libretro-defs.h
+++ b/backends/platform/libretro/include/libretro-defs.h
@@ -26,10 +26,10 @@
 // System analog stick range is -0x8000 to 0x8000
 #define ANALOG_RANGE 0x8000
 
-#define DEFAULT_SAMPLE_RATE     	48000
-#define DEFAULT_REFRESH_RATE    	60
-#define FRAMESKIP_MAX           	DEFAULT_REFRESH_RATE / 2
-#define DEFAULT_SOUNDFONT_FILENAME	"Roland_SC-55.sf2"
+#define DEFAULT_SAMPLE_RATE         48000
+#define DEFAULT_REFRESH_RATE        60
+#define FRAMESKIP_MAX               DEFAULT_REFRESH_RATE / 2
+#define DEFAULT_SOUNDFONT_FILENAME  "Roland_SC-55.sf2"
 
 // Audio status
 #define AUDIO_STATUS_MUTE               (1 << 0)
@@ -37,8 +37,8 @@
 #define AUDIO_STATUS_BUFFER_ACTIVE      (1 << 2)
 #define AUDIO_STATUS_BUFFER_UNDERRUN    (1 << 3)
 #define AUDIO_STATUS_UPDATE_LATENCY     (1 << 4)
-#define AV_STATUS_UPDATE_AV_INFO	    (1 << 5)
-#define AV_STATUS_RESET_PENDING	        (1 << 6)
+#define AV_STATUS_UPDATE_AV_INFO        (1 << 5)
+#define AV_STATUS_RESET_PENDING         (1 << 6)
 #define AV_STATUS_UPDATE_GEOMETRY       (1 << 7)
 #define AV_STATUS_UPDATE_GUI            (1 << 8)
 
diff --git a/backends/platform/libretro/include/libretro-graphics-opengl.h b/backends/platform/libretro/include/libretro-graphics-opengl.h
index 3dcc533b225..5c0efcab762 100644
--- a/backends/platform/libretro/include/libretro-graphics-opengl.h
+++ b/backends/platform/libretro/include/libretro-graphics-opengl.h
@@ -22,24 +22,30 @@
 #include "backends/graphics/opengl/texture.h"
 
 namespace OpenGL {
-	class Surface;
+class Surface;
 }
 
 class LibretroOpenGLGraphics : public OpenGL::OpenGLGraphicsManager {
 public:
 	LibretroOpenGLGraphics(OpenGL::ContextType contextType);
-	bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override { return true; };
+	bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override {
+		return true;
+	};
 	void refreshScreen() override;
 	void setSystemMousePosition(const int x, const int y) override {};
 	void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) override;
 	void initSize(uint width, uint height, const Graphics::PixelFormat *format) override;
-	bool isOverlayInGUI(void){ return _overlayInGUI; }
+	bool isOverlayInGUI(void) {
+		return _overlayInGUI;
+	}
 	void setMousePosition(int x, int y);
 	void resetContext(OpenGL::ContextType contextType);
 	OSystem::TransactionError endGFXTransaction() override;
 	bool hasFeature(OSystem::Feature f) const override;
 protected:
-	bool gameNeedsAspectRatioCorrection() const override { return false; }
+	bool gameNeedsAspectRatioCorrection() const override {
+		return false;
+	}
 	void handleResizeImpl(const int width, const int height) override;
 private:
 	void overrideCursorScaling(void);
diff --git a/backends/platform/libretro/include/libretro-graphics-surface.h b/backends/platform/libretro/include/libretro-graphics-surface.h
index 21b526aa3aa..d82c3a3be2e 100644
--- a/backends/platform/libretro/include/libretro-graphics-surface.h
+++ b/backends/platform/libretro/include/libretro-graphics-surface.h
@@ -72,10 +72,18 @@ public:
 	void setFeatureState(OSystem::Feature f, bool enable) override;
 	bool getFeatureState(OSystem::Feature f) const override;
 
-	int getDefaultGraphicsMode() const override { return 0; }
-	bool setGraphicsMode(int mode, uint flags = OSystem::kGfxModeNoFlags) override { return true; }
-	int getGraphicsMode() const override { return 0; }
-	Graphics::Surface *lockScreen() override { return &_gameScreen; }
+	int getDefaultGraphicsMode() const override {
+		return 0;
+	}
+	bool setGraphicsMode(int mode, uint flags = OSystem::kGfxModeNoFlags) override {
+		return true;
+	}
+	int getGraphicsMode() const override {
+		return 0;
+	}
+	Graphics::Surface *lockScreen() override {
+		return &_gameScreen;
+	}
 	void unlockScreen() override {}
 
 	int getScreenChangeID() const override;
@@ -88,7 +96,9 @@ public:
 
 	void realUpdateScreen(void);
 
-	bool gameNeedsAspectRatioCorrection() const override { return false; }
+	bool gameNeedsAspectRatioCorrection() const override {
+		return false;
+	}
 	void handleResizeImpl(const int width, const int height) override;
 	void setSystemMousePosition(const int x, const int y) override {}
 	void setMousePosition(int x, int y);
diff --git a/backends/platform/libretro/include/libretro-os.h b/backends/platform/libretro/include/libretro-os.h
index 32a1b052270..83571c16dbf 100644
--- a/backends/platform/libretro/include/libretro-os.h
+++ b/backends/platform/libretro/include/libretro-os.h
@@ -86,7 +86,6 @@ public:
 	void refreshScreen(void);
 	void destroy(void);
 	void quit() override {}
-
 	void resetGraphicsManager(void);
 	void getScreen(const Graphics::ManagedSurface *&screen);
 	int16 getScreenWidth(void);
@@ -108,7 +107,6 @@ public:
 	Common::MutexInternal *createMutex(void) override;
 	void requestQuit(void);
 	void resetQuit(void);
-
 	void setMousePosition(int x, int y);
 
 	/* Utils */
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index c9bb1e2e90d..d0d120dba87 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -1106,10 +1106,10 @@ void retro_run(void) {
 	retro_update_options_display();
 
 #ifdef USE_HIGHRES
-		if (av_status & AV_STATUS_UPDATE_GUI) {
-			retro_gui_res_reset();
-			av_status &= ~AV_STATUS_UPDATE_GUI;
-		}
+	if (av_status & AV_STATUS_UPDATE_GUI) {
+		retro_gui_res_reset();
+		av_status &= ~AV_STATUS_UPDATE_GUI;
+	}
 #endif
 
 	if (av_status & (AV_STATUS_UPDATE_AV_INFO | AV_STATUS_UPDATE_GEOMETRY)) {
diff --git a/backends/platform/libretro/src/libretro-fs.cpp b/backends/platform/libretro/src/libretro-fs.cpp
index bcd8d4827ac..8518e847c32 100644
--- a/backends/platform/libretro/src/libretro-fs.cpp
+++ b/backends/platform/libretro/src/libretro-fs.cpp
@@ -65,8 +65,8 @@ LibRetroFilesystemNode::LibRetroFilesystemNode(const Common::String &p) {
 	} else
 		_path = p;
 
-	char portable_path[_path.size()+1];
-	strcpy(portable_path,_path.c_str());
+	char portable_path[_path.size() + 1];
+	strcpy(portable_path, _path.c_str());
 	pathname_make_slashes_portable(portable_path);
 
 	// Normalize the path (that is, remove unneeded slashes etc.)
@@ -156,7 +156,7 @@ AbstractFSNode *LibRetroFilesystemNode::getParent() const {
 		return 0;
 	}
 
-	AbstractFSNode * parent = makeNode(Common::String(start, end));
+	AbstractFSNode *parent = makeNode(Common::String(start, end));
 
 	if (parent->isDirectory() == false)
 		return 0;
@@ -169,8 +169,7 @@ Common::SeekableReadStream *LibRetroFilesystemNode::createReadStream() {
 }
 
 Common::SeekableWriteStream *LibRetroFilesystemNode::createWriteStream(bool atomic) {
-	return StdioStream::makeFromPath(getPath(), atomic ?
-			StdioStream::WriteMode_WriteAtomic : StdioStream::WriteMode_Write);
+	return StdioStream::makeFromPath(getPath(), atomic ? StdioStream::WriteMode_WriteAtomic : StdioStream::WriteMode_Write);
 }
 
 bool LibRetroFilesystemNode::createDirectory() {
diff --git a/backends/platform/libretro/src/libretro-graphics-opengl.cpp b/backends/platform/libretro/src/libretro-graphics-opengl.cpp
index ec2669f01a5..1e591bfdc47 100644
--- a/backends/platform/libretro/src/libretro-graphics-opengl.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-opengl.cpp
@@ -30,11 +30,11 @@ LibretroOpenGLGraphics::LibretroOpenGLGraphics(OpenGL::ContextType contextType)
 	resetContext(contextType);
 }
 
-void LibretroOpenGLGraphics::refreshScreen(){
+void LibretroOpenGLGraphics::refreshScreen() {
 	dynamic_cast<LibretroTimerManager *>(LIBRETRO_G_SYSTEM->getTimerManager())->checkThread(THREAD_SWITCH_UPDATE);
 }
 
-void LibretroOpenGLGraphics::setMousePosition(int x, int y){
+void LibretroOpenGLGraphics::setMousePosition(int x, int y) {
 	OpenGL::OpenGLGraphicsManager::setMousePosition(x, y);
 }
 
@@ -51,10 +51,10 @@ void LibretroOpenGLGraphics::setMouseCursor(const void *buf, uint w, uint h, int
 
 }
 
-void LibretroOpenGLGraphics::overrideCursorScaling(){
+void LibretroOpenGLGraphics::overrideCursorScaling() {
 	OpenGL::OpenGLGraphicsManager::recalculateCursorScaling();
 
-	if (_cursor){
+	if (_cursor) {
 		const frac_t screenScaleFactor = (_cursorDontScale || ! _overlayVisible) ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
 
 		_cursorHotspotXScaled = fracToInt(_cursorHotspotX * screenScaleFactor);
@@ -68,7 +68,7 @@ void LibretroOpenGLGraphics::overrideCursorScaling(){
 void LibretroOpenGLGraphics::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
 	bool force_gui_redraw = false;
 	/* Override for ScummVM Launcher */
-	if (nullptr == ConfMan.getActiveDomain()){
+	if (nullptr == ConfMan.getActiveDomain()) {
 		/* 0 w/h is used to notify libretro gui res settings is changed */
 		force_gui_redraw = (width == 0);
 		width = retro_setting_get_gui_res_w();
@@ -102,21 +102,21 @@ void LibretroOpenGLGraphics::handleResizeImpl(const int width, const int height)
 bool LibretroOpenGLGraphics::hasFeature(OSystem::Feature f) const {
 	return
 #ifdef SCUMMVM_NEON
-		(f == OSystem::kFeatureCpuNEON) ||
+	    (f == OSystem::kFeatureCpuNEON) ||
 #endif
-		OpenGL::OpenGLGraphicsManager::hasFeature(f);
+	    OpenGL::OpenGLGraphicsManager::hasFeature(f);
 }
 
-void LibretroHWFramebuffer::activateInternal(){
+void LibretroHWFramebuffer::activateInternal() {
 	GL_CALL(glBindFramebuffer(GL_FRAMEBUFFER, retro_get_hw_fb()));
 }
 
 void LibretroOpenGLGraphics::resetContext(OpenGL::ContextType contextType) {
 	const Graphics::PixelFormat rgba8888 =
 #ifdef SCUMM_LITTLE_ENDIAN
-									   Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+	    Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
 #else
-									   Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+	    Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
 #endif
 	notifyContextDestroy();
 	notifyContextCreate(contextType, new LibretroHWFramebuffer(), rgba8888, rgba8888);
diff --git a/backends/platform/libretro/src/libretro-graphics-surface.cpp b/backends/platform/libretro/src/libretro-graphics-surface.cpp
index 9fd41742729..a807ce83836 100644
--- a/backends/platform/libretro/src/libretro-graphics-surface.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-surface.cpp
@@ -34,7 +34,7 @@ LibretroGraphics::LibretroGraphics() : _cursorPaletteEnabled(false),
 	_screenUpdatePending(false),
 	_gamePalette(256),
 	_cursorPalette(256),
-	_screenChangeID(1 << (sizeof(int) * 8 - 2)){}
+	_screenChangeID(1 << (sizeof(int) * 8 - 2)) {}
 
 LibretroGraphics::~LibretroGraphics() {
 	_gameScreen.free();
@@ -74,7 +74,7 @@ void LibretroGraphics::initSize(uint width, uint height, const Graphics::PixelFo
 	Graphics::PixelFormat actFormat = format ? *format : Graphics::PixelFormat::createFormatCLUT8();
 	bool force_gui_redraw = false;
 	/* Override for ScummVM Launcher */
-	if (nullptr == ConfMan.getActiveDomain()){
+	if (nullptr == ConfMan.getActiveDomain()) {
 		/* 0 w/h is used to notify libretro gui res settings is changed */
 		force_gui_redraw = (width == 0);
 		width = retro_setting_get_gui_res_w();
@@ -126,14 +126,14 @@ void LibretroGraphics::updateScreen() {
 }
 
 void LibretroGraphics::realUpdateScreen(void) {
-	const Graphics::Surface &srcSurface = (_overlayVisible) ? _overlay : _gameScreen;
+	const Graphics::Surface &srcSurface = _overlayVisible ? _overlay : _gameScreen;
 
 	if (srcSurface.w && srcSurface.h)
-		_screen.blitFrom(srcSurface, Common::Rect(srcSurface.w,srcSurface.h),Common::Rect(_screen.w,_screen.h),&_gamePalette);
+		_screen.blitFrom(srcSurface, Common::Rect(srcSurface.w, srcSurface.h), Common::Rect(_screen.w, _screen.h), &_gamePalette);
 
 	if (_cursorVisible && _cursor.w && _cursor.h) {
 		Common::Point topLeft(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled);
-		_screen.transBlitFrom(_cursor, Common::Rect( _cursor.w, _cursor.h), Common::Rect(topLeft, topLeft + Common::Point(_cursorWidthScaled, _cursorHeightScaled)),  _cursorKeyColor, false, 0, 0xff, nullptr, false,  _cursorPaletteEnabled ? &_cursorPalette : &_gamePalette);
+		_screen.transBlitFrom(_cursor, Common::Rect(_cursor.w, _cursor.h), Common::Rect(topLeft, topLeft + Common::Point(_cursorWidthScaled, _cursorHeightScaled)),  _cursorKeyColor, false, 0, 0xff, nullptr, false,  _cursorPaletteEnabled ? &_cursorPalette : &_gamePalette);
 	}
 	_screenUpdatePending = false;
 }
@@ -168,7 +168,7 @@ void LibretroGraphics::warpMouse(int x, int y) {
 	WindowedGraphicsManager::warpMouse(x, y);
 }
 
-void LibretroGraphics::overrideCursorScaling(){
+void LibretroGraphics::overrideCursorScaling() {
 	const frac_t screenScaleFactor = (_cursorDontScale || ! _overlayVisible) ? intToFrac(1) : intToFrac(getWindowHeight()) / 200; /* hard coded as base resolution 320x200 is hard coded upstream */
 
 	_cursorHotspotXScaled = fracToInt(_cursorHotspotX * screenScaleFactor);
@@ -231,9 +231,9 @@ void LibretroGraphics::grabPalette(byte *colors, uint start, uint num) const {
 bool LibretroGraphics::hasFeature(OSystem::Feature f) const {
 	return (f == OSystem::kFeatureCursorPalette) ||
 #ifdef SCUMMVM_NEON
-		(f == OSystem::kFeatureCpuNEON) ||
+	       (f == OSystem::kFeatureCpuNEON) ||
 #endif
-		(f == OSystem::kFeatureCursorAlpha);
+	       (f == OSystem::kFeatureCursorAlpha);
 }
 
 void LibretroGraphics::setFeatureState(OSystem::Feature f, bool enable) {
@@ -245,7 +245,7 @@ bool LibretroGraphics::getFeatureState(OSystem::Feature f) const {
 	return (f == OSystem::kFeatureCursorPalette) ? _cursorPaletteEnabled : false;
 }
 
-void LibretroGraphics::setMousePosition(int x, int y){
+void LibretroGraphics::setMousePosition(int x, int y) {
 	WindowedGraphicsManager::setMousePosition(x, y);
 }
 
diff --git a/backends/platform/libretro/src/libretro-options-widget.cpp b/backends/platform/libretro/src/libretro-options-widget.cpp
index 7e3a1c1faff..39ad3905c03 100644
--- a/backends/platform/libretro/src/libretro-options-widget.cpp
+++ b/backends/platform/libretro/src/libretro-options-widget.cpp
@@ -218,7 +218,7 @@ bool LibretroOptionsWidget::generatePlaylist(Common::String playlistPath) {
 	filestream_close(playlistFile);
 
 	Common::String response;
-	if (success){
+	if (success) {
 		response = _("Done");
 		if (!cleanSuccess)
 			response += " (" +  _("cleaning failed") + ")";
diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index 17565096d84..d9e7625f438 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -94,8 +94,8 @@ void OSystem_libretro::engineInit() {
 
 	/* See LibretroPalette::set workaround */
 	/*if (retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_REQUEST_SW){
-		dynamic_cast<LibretroGraphics *>(_graphicsManager)->_mousePalette.reset();
-		dynamic_cast<LibretroGraphics *>(_graphicsManager)->_gamePalette.reset();
+	    dynamic_cast<LibretroGraphics *>(_graphicsManager)->_mousePalette.reset();
+	    dynamic_cast<LibretroGraphics *>(_graphicsManager)->_gamePalette.reset();
 	}*/
 }
 
@@ -136,11 +136,11 @@ void OSystem_libretro::resetGraphicsContext(void) {
 }
 #endif
 
-int16 OSystem_libretro::getScreenWidth(void){
+int16 OSystem_libretro::getScreenWidth(void) {
 	return dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowWidth();
 }
 
-int16 OSystem_libretro::getScreenHeight(void){
+int16 OSystem_libretro::getScreenHeight(void) {
 	return dynamic_cast<WindowedGraphicsManager *>(_graphicsManager)->getWindowHeight();
 }
 
diff --git a/backends/platform/libretro/src/libretro-os-utils.cpp b/backends/platform/libretro/src/libretro-os-utils.cpp
index e192d2a4211..726397ca297 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).exists()))
+	if (setPath.empty() || !(isDirectory ? LibRetroFilesystemNode(setPath).isDirectory() : LibRetroFilesystemNode(setPath).exists()))
 		ConfMan.removeKey(setting, Common::ConfigManager::kApplicationDomain);
 	if (! ConfMan.hasKey(setting))
 		if (defaultPath.empty())
@@ -180,7 +180,7 @@ bool OSystem_libretro::checkPathSetting(const char *setting, Common::String cons
 	return true;
 }
 
-void OSystem_libretro::setLibretroDir(const char * path, Common::String &var) {
+void OSystem_libretro::setLibretroDir(const char *path, Common::String &var) {
 	var = Common::String(path ? path : "");
 	if (! var.empty())
 		if (! LibRetroFilesystemNode(var).isDirectory())
@@ -229,61 +229,61 @@ void OSystem_libretro::applyBackendSettings() {
 	checkPathSetting("iconspath", "");
 }
 
-static const char * const helpTabs[] = {
-_s("Libretro playlist"),
-"",
-_s(
-"## Libretro playlists for ScummVM core\n"
-"Playlists used in Libretro frontends (e.g. Retroarch) are plain text lists used to directly launch a game with a specific core from the user interface. Those lists are structured to pass to the core the path of a specific content file to be loaded (e.g. ROM).\n"
-"\n"
-"ScummVM core can accept as content the path to any of the files inside a valid game folder, the detection system will try to autodetect the game from the content file parent folder and run the game with default ScummVM options.\n"
-"\n"
-"The core also supports dedicated per game **hook** plain text files with **." CORE_EXTENSIONS "** extension, which can be used as target in the playlist to specify one of the following ScummVM identifiers:\n"
-"\n"
-"  - **game ID**: this is a unique identifier for any game supported by ScummVM. In this case hook files must be placed inside each game folder, and there is no need to add the game from within ScummVM. Game will be launched with default ScummVM options.\n"
-"\n"
-"  - **target**: this is the game identifier from ScummVM configuration file (e.g. 'scummvm.ini'). In this case the game must be added from ScummVM GUI first, and the hook files can be placed anywhere, as the path for the game files is already part of the target configuration. The game will be launched with the options set in ScummVM\n"
-"\n"
-"## Creating ScummVM core playlist\n"
-"ScummVM core playlist can be created in the following ways:\n"
-"\n"
-"  1. Manually (hook files to be created manually - optional)\n"
-"\n"
-"  2. Automatically from Retroarch scanner (hook files not used)\n"
-"\n"
-"  3. Automatically from ScummVM GUI (hook files created automatically)\n"
-"\n"
-"First two methods are not covered here, as outside of ScummVM scope. Detailed info can be found in [Libretro documentation](https://docs.libretro.com/guides/roms-playlists-thumbnails/).\n"
-"Note that Retroarch scanner is based on a third party database instead of ScummVM game detection system, hence it is not guaranteed to work properly.\n"
-"\n"
-"Third method is covered in the following subheading.\n"
-"\n"
-"## ScummVM Playlist Generator\n"
-"ScummVM core includes a tool to generate a Libretro playlist and needed hook files based on current ScummVM games list.\n"
-"\n"
-" - Load the core from RetroArch and start it to reach the ScummVM GUI (i.e. the Launcher)\n"
-"\n"
-" - Add games to the list as required using the GUI buttons ('Mass Add' available).\n"
-"\n"
-" - Select **Global Options** and then the **Backend** tab.\n"
-"\n"
-" - Check or select the path of frontend playlists. A '" CORE_NAME ".lpl' file will be created or overwritten in there.\n"
-"\n"
-" - Check the 'Hooks location' setting, to have one '." CORE_EXTENSIONS "' in each game folder or all of them in a '" COMMON_HOOKS_FOLDER "' folder in the 'save' path.\n"
-"\n"
-" - Check the 'Playlist version' setting. JSON format should be selected, 6-lines format is deprecated and provided for backwards compatibility only.\n"
-"\n"
-" - Select the 'Clear existing hooks' checkbox to remove any existing '." CORE_EXTENSIONS "' file in the working folders.\n"
-"\n"
-" - Press the 'Generate playlist' button.\n"
-"\n"
-"Operation status will be shown in the same dialog, while details will be given in frontend logs."
-),
-
-0 // End of list
+static const char *const helpTabs[] = {
+	_s("Libretro playlist"),
+	"",
+	_s(
+	    "## Libretro playlists for ScummVM core\n"
+	    "Playlists used in Libretro frontends (e.g. Retroarch) are plain text lists used to directly launch a game with a specific core from the user interface. Those lists are structured to pass to the core the path of a specific content file to be loaded (e.g. ROM).\n"
+	    "\n"
+	    "ScummVM core can accept as content the path to any of the files inside a valid game folder, the detection system will try to autodetect the game from the content file parent folder and run the game with default ScummVM options.\n"
+	    "\n"
+	    "The core also supports dedicated per game **hook** plain text files with **." CORE_EXTENSIONS "** extension, which can be used as target in the playlist to specify one of the following ScummVM identifiers:\n"
+	    "\n"
+	    "  - **game ID**: this is a unique identifier for any game supported by ScummVM. In this case hook files must be placed inside each game folder, and there is no need to add the game from within ScummVM. Game will be launched with default ScummVM options.\n"
+	    "\n"
+	    "  - **target**: this is the game identifier from ScummVM configuration file (e.g. 'scummvm.ini'). In this case the game must be added from ScummVM GUI first, and the hook files can be placed anywhere, as the path for the game files is already part of the target configuration. The game will be launched with the options set in ScummVM\n"
+	    "\n"
+	    "## Creating ScummVM core playlist\n"
+	    "ScummVM core playlist can be created in the following ways:\n"
+	    "\n"
+	    "  1. Manually (hook files to be created manually - optional)\n"
+	    "\n"
+	    "  2. Automatically from Retroarch scanner (hook files not used)\n"
+	    "\n"
+	    "  3. Automatically from ScummVM GUI (hook files created automatically)\n"
+	    "\n"
+	    "First two methods are not covered here, as outside of ScummVM scope. Detailed info can be found in [Libretro documentation](https://docs.libretro.com/guides/roms-playlists-thumbnails/).\n"
+	    "Note that Retroarch scanner is based on a third party database instead of ScummVM game detection system, hence it is not guaranteed to work properly.\n"
+	    "\n"
+	    "Third method is covered in the following subheading.\n"
+	    "\n"
+	    "## ScummVM Playlist Generator\n"
+	    "ScummVM core includes a tool to generate a Libretro playlist and needed hook files based on current ScummVM games list.\n"
+	    "\n"
+	    " - Load the core from RetroArch and start it to reach the ScummVM GUI (i.e. the Launcher)\n"
+	    "\n"
+	    " - Add games to the list as required using the GUI buttons ('Mass Add' available).\n"
+	    "\n"
+	    " - Select **Global Options** and then the **Backend** tab.\n"
+	    "\n"
+	    " - Check or select the path of frontend playlists. A '" CORE_NAME ".lpl' file will be created or overwritten in there.\n"
+	    "\n"
+	    " - Check the 'Hooks location' setting, to have one '." CORE_EXTENSIONS "' in each game folder or all of them in a '" COMMON_HOOKS_FOLDER "' folder in the 'save' path.\n"
+	    "\n"
+	    " - Check the 'Playlist version' setting. JSON format should be selected, 6-lines format is deprecated and provided for backwards compatibility only.\n"
+	    "\n"
+	    " - Select the 'Clear existing hooks' checkbox to remove any existing '." CORE_EXTENSIONS "' file in the working folders.\n"
+	    "\n"
+	    " - Press the 'Generate playlist' button.\n"
+	    "\n"
+	    "Operation status will be shown in the same dialog, while details will be given in frontend logs."
+	),
+
+	0 // End of list
 };
 
-const char * const *OSystem_libretro::buildHelpDialogData() {
+const char *const *OSystem_libretro::buildHelpDialogData() {
 	return helpTabs;
 }
 
diff --git a/backends/platform/libretro/src/libretro-threads.cpp b/backends/platform/libretro/src/libretro-threads.cpp
index 158eaf1ea94..e0bd61b2821 100644
--- a/backends/platform/libretro/src/libretro-threads.cpp
+++ b/backends/platform/libretro/src/libretro-threads.cpp
@@ -171,6 +171,6 @@ int retro_get_scummvm_res() {
 	return scummvm_res;
 }
 
-bool retro_emu_thread_started(void){
+bool retro_emu_thread_started(void) {
 	return (bool)(status & EMU_STARTED);
 }
diff --git a/backends/platform/libretro/src/libretro-timer.cpp b/backends/platform/libretro/src/libretro-timer.cpp
index 3fb387fb805..d2a6f2e03bc 100644
--- a/backends/platform/libretro/src/libretro-timer.cpp
+++ b/backends/platform/libretro/src/libretro-timer.cpp
@@ -55,7 +55,7 @@ uint32 LibretroTimerManager::spentOnMainThread(void) {
 	return _spentOnMainThread;
 }
 
-uint8 LibretroTimerManager::getThreadSwitchCaller(void){
+uint8 LibretroTimerManager::getThreadSwitchCaller(void) {
 	return _threadSwitchCaller;
 }
 #endif


Commit: 63ddb92608a13f17ff8e5aa80c08e6effa386ca7
    https://github.com/scummvm/scummvm/commit/63ddb92608a13f17ff8e5aa80c08e6effa386ca7
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T01:31:05+01:00

Commit Message:
LIBRETRO: drop unneeded function

Changed paths:
    backends/platform/libretro/include/libretro-graphics-opengl.h


diff --git a/backends/platform/libretro/include/libretro-graphics-opengl.h b/backends/platform/libretro/include/libretro-graphics-opengl.h
index 5c0efcab762..fbe502065b4 100644
--- a/backends/platform/libretro/include/libretro-graphics-opengl.h
+++ b/backends/platform/libretro/include/libretro-graphics-opengl.h
@@ -35,9 +35,6 @@ public:
 	void setSystemMousePosition(const int x, const int y) override {};
 	void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) override;
 	void initSize(uint width, uint height, const Graphics::PixelFormat *format) override;
-	bool isOverlayInGUI(void) {
-		return _overlayInGUI;
-	}
 	void setMousePosition(int x, int y);
 	void resetContext(OpenGL::ContextType contextType);
 	OSystem::TransactionError endGFXTransaction() override;


Commit: 62c9bd8c5a3562aa7b2b4463f31b37060e19b88e
    https://github.com/scummvm/scummvm/commit/62c9bd8c5a3562aa7b2b4463f31b37060e19b88e
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T01:31:20+01:00

Commit Message:
LIBRETRO: drop timing inaccuracies setting
Frame rate setting can be used to improve performance on lower end devices instead

Changed paths:
    backends/platform/libretro/include/libretro-core-options-intl.h
    backends/platform/libretro/include/libretro-core-options.h
    backends/platform/libretro/include/libretro-core.h
    backends/platform/libretro/src/libretro-core.cpp
    backends/platform/libretro/src/libretro-graphics-surface.cpp
    backends/platform/libretro/src/libretro-os-events.cpp


diff --git a/backends/platform/libretro/include/libretro-core-options-intl.h b/backends/platform/libretro/include/libretro-core-options-intl.h
index 779dcf78e4b..d2ee7a4df48 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -233,19 +233,6 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		},
 		NULL
 	},
-	{
-		"scummvm_allow_timing_inaccuracies",
-		"Timing > Consenti inaccuratezze di timing",
-		"Consenti inaccuratezze di timing",
-		"Consente inaccuratezze di timing che riducono significativamente le richeste di CPU. Anche se la maggior parte delle inaccuratezze sono impercettibili, in alcuni casi potrebbe introdurre problemi di sincronizzazione audio, quindi questa opzione andrebbe abilitata solo se il raggiungimento della piena velocità non è possibile in altro modo.",
-		NULL,
-		NULL,
-		{
-			{NULL, NULL},
-		},
-		NULL
-	},
-
 	{
 		"scummvm_framerate",
 		"Timing > Tetto frequenza dei fotogrammi",
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index 1ed20687f6c..1c43887b121 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -301,20 +301,6 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 		},
 		"0"
 	},
-	{
-		"scummvm_allow_timing_inaccuracies",
-		"Timing > Allow Timing Inaccuracies",
-		"Allow Timing Inaccuracies",
-		"Allow timing inaccuracies that reduces CPU requirements. Though most timing deviations are imperceptible, in some cases it may introduce audio sync/timing issues, hence this option should be enabled only if full speed cannot be reached otherwise.",
-		NULL,
-		"timing",
-		{
-			{"disabled", NULL},
-			{"enabled", NULL},
-			{NULL, NULL},
-		},
-		"disabled"
-	},
 	{
 		"scummvm_framerate",
 		"Timing > Frame rate cap",
diff --git a/backends/platform/libretro/include/libretro-core.h b/backends/platform/libretro/include/libretro-core.h
index 45992863668..f782e70efac 100644
--- a/backends/platform/libretro/include/libretro-core.h
+++ b/backends/platform/libretro/include/libretro-core.h
@@ -31,7 +31,6 @@ const char *retro_get_system_dir(void);
 const char *retro_get_save_dir(void);
 const char *retro_get_playlist_dir(void);
 
-bool retro_setting_get_timing_inaccuracies_enabled(void);
 float retro_setting_get_frame_rate(void);
 uint16 retro_setting_get_sample_rate(void);
 uint16 retro_setting_get_audio_samples_buffer_size(void);
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index d0d120dba87..18e53ab5144 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -76,8 +76,6 @@ static float mouse_speed = 1.0f;
 static float gamepad_acceleration_time = 0.2f;
 static int mouse_fine_control_speed_reduction = 4;
 
-static bool timing_inaccuracies_enabled = false;
-
 char cmd_params[20][200];
 char cmd_params_num;
 
@@ -337,14 +335,6 @@ static void update_variables(void) {
 		mouse_fine_control_speed_reduction = (int)atoi(var.value);
 	}
 
-	var.key = "scummvm_allow_timing_inaccuracies";
-	var.value = NULL;
-	timing_inaccuracies_enabled = false;
-	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
-		if (strcmp(var.value, "enabled") == 0)
-			timing_inaccuracies_enabled = true;
-	}
-
 	var.key = "scummvm_framerate";
 	var.value = NULL;
 	float old_frame_rate = frame_rate;
@@ -640,10 +630,6 @@ static bool retro_update_options_display(void) {
 	return updated;
 }
 
-bool retro_setting_get_timing_inaccuracies_enabled() {
-	return timing_inaccuracies_enabled;
-}
-
 bool retro_setting_get_gamepad_cursor_only(void) {
 	return gamepad_cursor_only;
 }
diff --git a/backends/platform/libretro/src/libretro-graphics-surface.cpp b/backends/platform/libretro/src/libretro-graphics-surface.cpp
index a807ce83836..f7f1eabccbd 100644
--- a/backends/platform/libretro/src/libretro-graphics-surface.cpp
+++ b/backends/platform/libretro/src/libretro-graphics-surface.cpp
@@ -121,8 +121,7 @@ void LibretroGraphics::copyRectToScreen(const void *buf, int pitch, int x, int y
 
 void LibretroGraphics::updateScreen() {
 	_screenUpdatePending = true;
-	if (! retro_setting_get_timing_inaccuracies_enabled() && !_overlayInGUI)
-		dynamic_cast<LibretroTimerManager *>(LIBRETRO_G_SYSTEM->getTimerManager())->checkThread(THREAD_SWITCH_UPDATE);
+	dynamic_cast<LibretroTimerManager *>(LIBRETRO_G_SYSTEM->getTimerManager())->checkThread(THREAD_SWITCH_UPDATE);
 }
 
 void LibretroGraphics::realUpdateScreen(void) {
diff --git a/backends/platform/libretro/src/libretro-os-events.cpp b/backends/platform/libretro/src/libretro-os-events.cpp
index b03959268af..11cc9de9c5f 100644
--- a/backends/platform/libretro/src/libretro-os-events.cpp
+++ b/backends/platform/libretro/src/libretro-os-events.cpp
@@ -49,23 +49,12 @@ void OSystem_libretro::delayMillis(uint msecs) {
 	uint32 start_time = getMillis();
 	uint32 elapsed_time = 0;
 
-	if (retro_setting_get_timing_inaccuracies_enabled()) {
-		while (elapsed_time < msecs) {
-			/* When remaining delay would take us past the next thread switch time, we switch immediately
-			in order to burn as much as possible delay time in the main RetroArch thread as soon as possible. */
-			if (msecs - elapsed_time >= ((LibretroTimerManager *)_timerManager)->timeToNextSwitch())
-				((LibretroTimerManager *)_timerManager)->switchThread(THREAD_SWITCH_DELAY);
-			else
-				usleep(1000);
-			elapsed_time = getMillis() - start_time;
-		}
-	} else {
-		while (elapsed_time < msecs) {
-			if (!((LibretroTimerManager *)_timerManager)->checkThread(THREAD_SWITCH_DELAY))
-				usleep(1000);
-			elapsed_time = getMillis() - start_time;
-		}
+	while (elapsed_time < msecs) {
+		if (!((LibretroTimerManager *)_timerManager)->checkThread(THREAD_SWITCH_DELAY))
+			usleep(1000);
+		elapsed_time = getMillis() - start_time;
 	}
+
 }
 
 Common::MutexInternal *OSystem_libretro::createMutex(void) {


Commit: e12e2f9c80d11138919d1d20d1c68b52592af6fd
    https://github.com/scummvm/scummvm/commit/e12e2f9c80d11138919d1d20d1c68b52592af6fd
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T01:31:33+01:00

Commit Message:
LIBRETRO: drop frameskip settings
Frame rate setting can be used to improve performance on lower end devices instead

Changed paths:
    backends/platform/libretro/include/libretro-core-options-intl.h
    backends/platform/libretro/include/libretro-core-options.h
    backends/platform/libretro/include/libretro-defs.h
    backends/platform/libretro/src/libretro-core.cpp


diff --git a/backends/platform/libretro/include/libretro-core-options-intl.h b/backends/platform/libretro/include/libretro-core-options-intl.h
index d2ee7a4df48..c0019550d51 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -80,11 +80,6 @@ struct retro_core_option_v2_category option_cats_it[] = {
 		"Cursore",
 		"Impostazioni relative al movimento del cursore"
 	},
-	{
-		"frameskip",
-		"Salto dei fotogrammi",
-		"Impostazioni per il salto dei fotogrammi"
-	},
 	{
 		"timing",
 		NULL,
@@ -187,52 +182,6 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		},
 		NULL
 	},
-	{
-		"scummvm_frameskip_type",
-		"Frameskip > Salto dei fotogrammi",
-		"Salto dei fotogrammi",
-		"Salto dei fotogrammi per evitare buffer under-run audio (crackling). Migliora le prestazioni a discapito della fluidità video. 'Auto' salta i fotogrammi su indicazione del frontend, 'Soglia' usa l'impostazione di 'Soglia minima buffer audio (%)', 'Fisso' usa l'impostazione 'Salto dei fotogrammi fisso'.",
-		NULL,
-		NULL,
-		{
-			{ "disabled", NULL },
-			{ "fixed", "Fisso" },
-			{ "auto", "Auto" },
-			{ "manual", "Soglia" },
-			{ NULL, NULL },
-		},
-		NULL
-	},
-	{
-		"scummvm_frameskip_threshold",
-		"Frameskip > Soglia minima buffer audio (%)",
-		"Soglia minima buffer audio (%)",
-		"Quando 'Salto dei fotogrammi' è impostato su 'Soglia', specifica la soglia minima del buffer audio al di sotto della quale il fotogramma viene saltato. Valori più alti riducono il rischio di crackling al costo di un salto di fotogrammi più frequente.",
-		NULL,
-		NULL,
-		{
-			{ NULL, NULL },
-		},
-		NULL
-	},
-	{
-		"scummvm_frameskip_no",
-		"Frameskip > Salto dei fotogrammi fisso",
-		"Salto dei fotogrammi fisso",
-		"Quando la modalità di 'Salto dei fotogrammi' è 'Fisso', o il frontend non supporta una delle altre modalità selezionate, salta costantemente X fotogrammi ogni X+1.",
-		NULL,
-		NULL,
-		{
-			{ "0", "Nessun fotogramma saltato" },
-			{ "1", "Salto di 1 fotogramma su 2" },
-			{ "2", "Salto di 2 fotogrammi su 3" },
-			{ "3", "Salto di 3 fotogrammi su 4" },
-			{ "4", "Salto di 4 fotogrammi su 5" },
-			{ "5", "Salto di 5 fotogrammi su 6" },
-			{ NULL, NULL },
-		},
-		NULL
-	},
 	{
 		"scummvm_framerate",
 		"Timing > Tetto frequenza dei fotogrammi",
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index 1c43887b121..a2b9fb19435 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -82,11 +82,6 @@ struct retro_core_option_v2_category option_cats_us[] = {
 		"Cursor Movement",
 		"Configure cursor movement settings"
 	},
-	{
-		"frameskip",
-		"Frameskip",
-		"Configure frameskip settings"
-	},
 	{
 		"timing",
 		"Timing",
@@ -239,68 +234,6 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 		},
 		"4"
 	},
-	{
-		"scummvm_frameskip_type",
-		"Frameskip > Frameskip Mode",
-		"Frameskip Mode",
-		"Skip frames to avoid audio buffer under-run (crackling). Improves performance at the expense of visual smoothness. 'Auto' skips frames when advised by the frontend. 'Threshold' uses the 'Frameskip Threshold (%)' setting. 'Fixed' uses the 'Fixed Frameskip' setting.",
-		NULL,
-		"frameskip",
-		{
-			{ "disabled", NULL },
-			{ "fixed", "Fixed" },
-			{ "auto", "Auto" },
-			{ "manual", "Threshold" },
-			{ NULL, NULL },
-		},
-		"auto"
-	},
-	{
-		"scummvm_frameskip_threshold",
-		"Frameskip > Frameskip Threshold (%)",
-		"Frameskip Threshold (%)",
-		"When 'Frameskip' is set to 'Threshold', specifies the audio buffer occupancy threshold (percentage) below which frames will be skipped. Higher values reduce the risk of crackling by causing frames to be dropped more frequently.",
-		NULL,
-		"frameskip",
-		{
-			{ "15", NULL },
-			{ "18", NULL },
-			{ "21", NULL },
-			{ "24", NULL },
-			{ "27", NULL },
-			{ "30", NULL },
-			{ "33", NULL },
-			{ "36", NULL },
-			{ "39", NULL },
-			{ "42", NULL },
-			{ "45", NULL },
-			{ "48", NULL },
-			{ "51", NULL },
-			{ "54", NULL },
-			{ "57", NULL },
-			{ "60", NULL },
-			{ NULL, NULL },
-		},
-		"33"
-	},
-	{
-		"scummvm_frameskip_no",
-		"Frameskip > Fixed Frameskip",
-		"Fixed Frameskip",
-		"When 'Frameskip' is set to 'Fixed', or if the frontend doesn't support the alternative 'Frameskip' mode, skip rendering at a fixed rate of X frames out of X+1",
-		NULL,
-		"frameskip",
-		{
-			{ "0", "No skipping" },
-			{ "1", "Skip rendering of 1 frames out of 2" },
-			{ "2", "Skip rendering of 2 frames out of 3" },
-			{ "3", "Skip rendering of 3 frames out of 4" },
-			{ "4", "Skip rendering of 4 frames out of 5" },
-			{ "5", "Skip rendering of 5 frames out of 6" },
-			{ NULL, NULL },
-		},
-		"0"
-	},
 	{
 		"scummvm_framerate",
 		"Timing > Frame rate cap",
diff --git a/backends/platform/libretro/include/libretro-defs.h b/backends/platform/libretro/include/libretro-defs.h
index 52e75f99c49..85d96a03dc8 100644
--- a/backends/platform/libretro/include/libretro-defs.h
+++ b/backends/platform/libretro/include/libretro-defs.h
@@ -33,14 +33,11 @@
 
 // Audio status
 #define AUDIO_STATUS_MUTE               (1 << 0)
-#define AUDIO_STATUS_BUFFER_SUPPORT     (1 << 1)
-#define AUDIO_STATUS_BUFFER_ACTIVE      (1 << 2)
-#define AUDIO_STATUS_BUFFER_UNDERRUN    (1 << 3)
-#define AUDIO_STATUS_UPDATE_LATENCY     (1 << 4)
-#define AV_STATUS_UPDATE_AV_INFO        (1 << 5)
-#define AV_STATUS_RESET_PENDING         (1 << 6)
-#define AV_STATUS_UPDATE_GEOMETRY       (1 << 7)
-#define AV_STATUS_UPDATE_GUI            (1 << 8)
+#define AUDIO_STATUS_UPDATE_LATENCY     (1 << 1)
+#define AV_STATUS_UPDATE_AV_INFO        (1 << 2)
+#define AV_STATUS_RESET_PENDING         (1 << 3)
+#define AV_STATUS_UPDATE_GEOMETRY       (1 << 4)
+#define AV_STATUS_UPDATE_GUI            (1 << 5)
 
 // Video status
 #define VIDEO_GRAPHIC_MODE_REQUEST_SW     (1 << 0)
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 18e53ab5144..3274d2c287b 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -88,17 +88,8 @@ static unsigned gui_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;
-static uint8 frameskip_type;
-static uint8 frameskip_threshold;
-static uint32 frameskip_counter = 0;
-
 static uint16 av_status = AUDIO_STATUS_MUTE;
 
-static unsigned retro_audio_buff_occupancy = 0;
-static uint8 retro_audio_buff_underrun_threshold = 25;
-
 static float frame_rate = 0;
 static uint16 sample_rate = 0;
 static float audio_samples_per_frame   = 0.0f; // length in samples per frame
@@ -107,9 +98,6 @@ static float audio_samples_accumulator = 0.0f;
 static int16 *audio_sample_buffer = NULL; // pointer to output buffer
 
 static bool input_bitmask_supported = false;
-static bool updating_variables = false;
-static int opt_frameskip_threshold_display = 0;
-static int opt_frameskip_no_display = 0;
 
 #ifdef USE_OPENGL
 static struct retro_hw_render_callback hw_render;
@@ -256,20 +244,6 @@ static void audio_run(void) {
 	}
 }
 
-static void retro_audio_buff_status_cb(bool active, unsigned occupancy, bool underrun_likely) {
-	if (active)
-		av_status |= AUDIO_STATUS_BUFFER_ACTIVE;
-	else
-		av_status &= ~AUDIO_STATUS_BUFFER_ACTIVE;
-
-	if (occupancy < retro_audio_buff_underrun_threshold)
-		av_status |= AUDIO_STATUS_BUFFER_UNDERRUN;
-	else if (occupancy > (retro_audio_buff_underrun_threshold << 2))
-		av_status &= ~AUDIO_STATUS_BUFFER_UNDERRUN;
-
-	retro_audio_buff_occupancy = occupancy;
-}
-
 void retro_osd_notification(const char *msg) {
 	if (!msg || *msg == '\0')
 		return;
@@ -283,7 +257,6 @@ void retro_osd_notification(const char *msg) {
 
 static void update_variables(void) {
 	struct retro_variable var;
-	updating_variables = true;
 
 	var.key = "scummvm_gamepad_cursor_only";
 	var.value = NULL;
@@ -359,36 +332,6 @@ static void update_variables(void) {
 	} else
 		sample_rate = DEFAULT_SAMPLE_RATE;
 
-	var.key = "scummvm_frameskip_threshold";
-	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
-		frameskip_threshold = (uint8)strtol(var.value, NULL, 10);
-	}
-
-	var.key = "scummvm_frameskip_no";
-	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
-		frameskip_no = (uint8)strtol(var.value, NULL, 10) + 1;
-	}
-
-	var.key = "scummvm_frameskip_type";
-	var.value = NULL;
-	uint8 old_frameskip_type = frameskip_type;
-	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
-		opt_frameskip_threshold_display = 0;
-		opt_frameskip_no_display = 0;
-
-		if (strcmp(var.value, "disabled") == 0)
-			frameskip_type = 0;
-		else if (strcmp(var.value, "fixed") == 0) {
-			frameskip_type = 1;
-			opt_frameskip_no_display = 1;
-		} else if (strcmp(var.value, "auto") == 0)
-			frameskip_type = 2;
-		else if (strcmp(var.value, "manual") == 0) {
-			frameskip_type = 3;
-			opt_frameskip_threshold_display = 1;
-		}
-	}
-
 	var.key = "scummvm_mapper_up";
 	var.value = NULL;
 	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
@@ -575,21 +518,11 @@ static void update_variables(void) {
 	}
 #endif
 
-	if (!(av_status & AUDIO_STATUS_BUFFER_SUPPORT)) {
-		if (frameskip_type > 1) {
-			retro_log_cb(RETRO_LOG_WARN, "Selected frameskip mode not available.\n");
-			retro_osd_notification("Selected frameskip mode not available");
-			frameskip_type = 0;
-		}
-	}
-
-	if (old_frameskip_type != frameskip_type || old_frame_rate != frame_rate || old_sample_rate != sample_rate) {
+	if (old_frame_rate != frame_rate || old_sample_rate != sample_rate) {
 		av_status |= AUDIO_STATUS_UPDATE_LATENCY;
-		if (old_frame_rate != frame_rate || old_sample_rate != sample_rate) {
-			audio_buffer_init(sample_rate, (uint16) frame_rate);
-			if (g_system)
-				av_status |= (AV_STATUS_UPDATE_AV_INFO & AV_STATUS_RESET_PENDING);
-		}
+		audio_buffer_init(sample_rate, (uint16) frame_rate);
+		if (g_system)
+			av_status |= (AV_STATUS_UPDATE_AV_INFO & AV_STATUS_RESET_PENDING);
 	}
 
 	if (video_hw_mode & VIDEO_GRAPHIC_MODE_RESET_PENDING) {
@@ -600,34 +533,6 @@ static void update_variables(void) {
 		retro_osd_notification("Core reload is needed to apply HW acceleration setting change.");
 		video_hw_mode &= ~VIDEO_GRAPHIC_MODE_RESET_PENDING;
 	}
-
-	updating_variables = false;
-}
-
-static void retro_set_options_display(void) {
-	struct retro_core_option_display option_display;
-
-	option_display.visible = opt_frameskip_threshold_display;
-	option_display.key = "scummvm_frameskip_threshold";
-	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
-
-	option_display.visible = opt_frameskip_no_display;
-	option_display.key = "scummvm_frameskip_no";
-	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
-}
-
-static bool retro_update_options_display(void) {
-	if (updating_variables)
-		return false;
-
-	/* Core options */
-	bool updated = false;
-	if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) {
-		update_variables();
-		LIBRETRO_G_SYSTEM->refreshRetroSettings();
-		retro_set_options_display();
-	}
-	return updated;
 }
 
 bool retro_setting_get_gamepad_cursor_only(void) {
@@ -827,10 +732,6 @@ void retro_set_environment(retro_environment_t cb) {
 	environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &tmp);
 	libretro_fill_options_mapper_data(environ_cb);
 	libretro_set_core_options(environ_cb, &has_categories);
-
-	/* Core option display callback */
-	struct retro_core_options_update_display_callback update_display_callback = {retro_update_options_display};
-	environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK, &update_display_callback);
 }
 
 unsigned retro_api_version(void) {
@@ -917,16 +818,10 @@ void retro_init(void) {
 
 	retro_log_cb(RETRO_LOG_DEBUG, "ScummVM core version: %s\n", __GIT_VERSION);
 
-	struct retro_audio_buffer_status_callback buf_status_cb;
-	buf_status_cb.callback = retro_audio_buff_status_cb;
-	av_status = environ_cb(RETRO_ENVIRONMENT_SET_AUDIO_BUFFER_STATUS_CALLBACK, &buf_status_cb) ? (av_status | AUDIO_STATUS_BUFFER_SUPPORT) : (av_status & ~AUDIO_STATUS_BUFFER_SUPPORT);
-
 	update_variables();
 	max_width = gui_width > max_width ? gui_width : max_width;
 	max_height = gui_height > max_height ? gui_height : max_height;
 
-	retro_set_options_display();
-
 	init_command_params();
 
 	setup_hw_rendering();
@@ -1087,10 +982,6 @@ bool retro_load_game_special(unsigned game_type, const struct retro_game_info *i
 }
 
 void retro_run(void) {
-	/* Settings change is covered by RETRO_ENVIRONMENT_SET_CORE_OPTIONS_UPDATE_DISPLAY_CALLBACK
-	except in case of core options reset to defaults, for which the following call is needed*/
-	retro_update_options_display();
-
 #ifdef USE_HIGHRES
 	if (av_status & AV_STATUS_UPDATE_GUI) {
 		retro_gui_res_reset();
@@ -1116,8 +1007,6 @@ void retro_run(void) {
 		audio_latency = (uint32)((8.0f * frame_time_msec) + 0.5f);
 		audio_latency = (audio_latency + 0x1F) & ~0x1F;
 
-		retro_audio_buff_underrun_threshold = frame_time_msec * 100 / audio_latency;
-
 		/* This can only be called from within retro_run() */
 		environ_cb(RETRO_ENVIRONMENT_SET_MINIMUM_AUDIO_LATENCY, &audio_latency);
 		av_status &= ~AUDIO_STATUS_UPDATE_LATENCY;
@@ -1133,32 +1022,7 @@ void retro_run(void) {
 	int audio_video_enable = 0;
 	environ_cb(RETRO_ENVIRONMENT_GET_AUDIO_VIDEO_ENABLE, &audio_video_enable);
 
-	bool skip_frame = false;
-
 	if (g_system) {
-
-		/* Determine frameskip need based on settings */
-		if (frameskip_type == 2)
-			skip_frame = ((av_status & (AUDIO_STATUS_BUFFER_UNDERRUN | AUDIO_STATUS_BUFFER_ACTIVE)) == (AUDIO_STATUS_BUFFER_UNDERRUN | AUDIO_STATUS_BUFFER_ACTIVE));
-		else if (frameskip_type == 1)
-			skip_frame = !(current_frame % frameskip_no == 0);
-		else if (frameskip_type == 3)
-			skip_frame = (retro_audio_buff_occupancy < frameskip_threshold);
-
-		/* No frame skipping if
-		- no incoming audio (e.g. GUI)
-		- doing a THREAD_SWITCH_UPDATE loop */
-		skip_frame = skip_frame && !(av_status & AUDIO_STATUS_MUTE);
-
-		/* Reset frameskip counter if not flagged */
-		if ((!skip_frame && frameskip_counter) || frameskip_counter >= FRAMESKIP_MAX) {
-			retro_log_cb(RETRO_LOG_DEBUG, "%d frame(s) skipped (%ld)\n", frameskip_counter, current_frame);
-			skip_frame = false;
-			frameskip_counter = 0;
-			/* Keep on skipping frames if flagged */
-		} else if (skip_frame)
-			frameskip_counter++;
-
 		/* Switch to ScummVM thread */
 		retro_switch_to_emu_thread();
 
@@ -1172,7 +1036,7 @@ void retro_run(void) {
 			audio_run();
 
 		/* Retrieve video */
-		if (!skip_frame && (audio_video_enable & 1)) {
+		if (audio_video_enable & 1) {
 			if (video_hw_mode & VIDEO_GRAPHIC_MODE_REQUEST_SW) {
 				const Graphics::ManagedSurface *screen;
 				LIBRETRO_G_SYSTEM->getScreen(screen);
@@ -1181,7 +1045,6 @@ void retro_run(void) {
 				video_cb(RETRO_HW_FRAME_BUFFER_VALID, LIBRETRO_G_SYSTEM->getScreenWidth(),  LIBRETRO_G_SYSTEM->getScreenHeight(), 0);
 
 		}
-		current_frame++;
 
 		poll_cb();
 		LIBRETRO_G_SYSTEM->processInputs();


Commit: d1488a13dc1b88e426b880a921a0012753861252
    https://github.com/scummvm/scummvm/commit/d1488a13dc1b88e426b880a921a0012753861252
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-11-14T01:31:49+01:00

Commit Message:
LIBRETRO: improve description of framerate cap setting

Changed paths:
    backends/platform/libretro/include/libretro-core-options-intl.h
    backends/platform/libretro/include/libretro-core-options.h


diff --git a/backends/platform/libretro/include/libretro-core-options-intl.h b/backends/platform/libretro/include/libretro-core-options-intl.h
index c0019550d51..1e9b80c4f32 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -186,7 +186,7 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		"scummvm_framerate",
 		"Timing > Tetto frequenza dei fotogrammi",
 		"Tetto frequenza dei fotogrammi",
-		"Imposta il limite superiore della frequenza dei fotogrammi. Il cambio di questa impostazione causerà il reset del core.",
+		"Imposta il limite superiore della frequenza dei fotogrammi. La riduzione del limite migliorara le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
 		NULL,
 		NULL,
 		{
@@ -198,7 +198,7 @@ struct retro_core_option_v2_definition option_defs_it[] = {
 		"scummvm_samplerate",
 		"Timing > Frequenza di campionamento",
 		"Frequenza di campionamento",
-		"Imposta la frequenza di campionamento. Il cambio di questa impostazione causerà il reset del core.",
+		"Imposta la frequenza di campionamento. La riduzione della frequenza migliorara leggermente le prestazioni sui dispositivi di fascia bassa. Il cambio di questa impostazione causerà il reset del core.",
 		NULL,
 		NULL,
 		{
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index a2b9fb19435..0c959b78da8 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -238,7 +238,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 		"scummvm_framerate",
 		"Timing > Frame rate cap",
 		"Frame rate cap",
-		"Set core frame rate upper limit. Changing this setting will reset the core.",
+		"Set core frame rate upper limit. Reducing the limit will improve the performance on lower end devices. Changing this setting will reset the core.",
 		NULL,
 		"timing",
 		{
@@ -255,7 +255,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
 		"scummvm_samplerate",
 		"Timing > Sample rate",
 		"Sample rate",
-		"Set core sample rate. Changing this setting will reset the core.",
+		"Set core sample rate. Reducing the rate will slightly improve the performance on lower end devices. Changing this setting will reset the core.",
 		NULL,
 		"timing",
 		{




More information about the Scummvm-git-logs mailing list