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

spleen1981 noreply at scummvm.org
Thu Jun 22 23:38:58 UTC 2023


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:
c8e9853463 LIBRETRO: fix timing.fps
c8fff523d6 LIBRETRO: rework _nextSwitchTime slip
687f605815 LIBRETRO: fix delay thread switch function
84587e9762 LIBRETRO: reduce timer interval
dc8161ef4e LIBRETRO: update libretro-common


Commit: c8e9853463775ce7f334547cfbacf4058527ceea
    https://github.com/scummvm/scummvm/commit/c8e9853463775ce7f334547cfbacf4058527ceea
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-06-23T01:29:26+02:00

Commit Message:
LIBRETRO: fix timing.fps

Changed paths:
    backends/platform/libretro/src/libretro.cpp


diff --git a/backends/platform/libretro/src/libretro.cpp b/backends/platform/libretro/src/libretro.cpp
index 5e5970df4a2..d9b0d72d540 100644
--- a/backends/platform/libretro/src/libretro.cpp
+++ b/backends/platform/libretro/src/libretro.cpp
@@ -486,7 +486,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info) {
 	info->geometry.max_width = RES_W;
 	info->geometry.max_height = RES_H;
 	info->geometry.aspect_ratio = 4.0f / 3.0f;
-	info->timing.fps = REFRESH_RATE;
+	info->timing.fps = frame_rate;
 	info->timing.sample_rate = SAMPLE_RATE;
 }
 


Commit: c8fff523d636b89e61fbb75b18ced25fb5db2ce9
    https://github.com/scummvm/scummvm/commit/c8fff523d636b89e61fbb75b18ced25fb5db2ce9
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-06-23T01:29:41+02:00

Commit Message:
LIBRETRO: rework _nextSwitchTime slip

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


diff --git a/backends/platform/libretro/include/libretro-timer.h b/backends/platform/libretro/include/libretro-timer.h
index 7c3cfee6f2f..44cdb7b5308 100644
--- a/backends/platform/libretro/include/libretro-timer.h
+++ b/backends/platform/libretro/include/libretro-timer.h
@@ -18,8 +18,6 @@
 #ifndef LIBRETRO_TIMER_H
 #define LIBRETRO_TIMER_H
 
-#define EMU_THREAD_MIN_TIME 10
-
 #include "backends/timer/default/default-timer.h"
 #include "backends/platform/libretro/include/libretro-defs.h"
 
diff --git a/backends/platform/libretro/src/libretro-timer.cpp b/backends/platform/libretro/src/libretro-timer.cpp
index 9e98c860666..a4017d013eb 100644
--- a/backends/platform/libretro/src/libretro-timer.cpp
+++ b/backends/platform/libretro/src/libretro-timer.cpp
@@ -33,11 +33,7 @@ void LibretroTimerManager::switchThread(void) {
 	_nextSwitchTime =  g_system->getMillis() + _interval;
 	retro_switch_to_main_thread();
 	_spentOnMainThread = g_system->getMillis() - _nextSwitchTime + _interval;
-
-	if (_interval - _spentOnMainThread < EMU_THREAD_MIN_TIME) {
-		_nextSwitchTime = _nextSwitchTime + _spentOnMainThread + EMU_THREAD_MIN_TIME;
-		_spentOnMainThread = _interval - EMU_THREAD_MIN_TIME;
-	}
+	_nextSwitchTime += _interval <= _spentOnMainThread ? _spentOnMainThread + _interval : 0;
 }
 
 void LibretroTimerManager::checkThread(void) {


Commit: 687f605815539ee7e7792901c84d657d372d3edb
    https://github.com/scummvm/scummvm/commit/687f605815539ee7e7792901c84d657d372d3edb
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-06-23T01:30:02+02:00

Commit Message:
LIBRETRO: fix delay thread switch function

Changed paths:
    backends/platform/libretro/src/libretro-os-events.cpp


diff --git a/backends/platform/libretro/src/libretro-os-events.cpp b/backends/platform/libretro/src/libretro-os-events.cpp
index 385535ced23..c0d9f82cc29 100644
--- a/backends/platform/libretro/src/libretro-os-events.cpp
+++ b/backends/platform/libretro/src/libretro-os-events.cpp
@@ -78,7 +78,7 @@ void OSystem_libretro::delayMillis(uint 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();
+				((LibretroTimerManager *)_timerManager)->checkThread();
 			else
 				usleep(1000);
 
@@ -91,7 +91,7 @@ void OSystem_libretro::delayMillis(uint msecs) {
 			/* if remaining delay is lower than last amount of time spent on main thread, burn it in emu thread
 			to avoid exceeding requested delay */
 			if (msecs - elapsed_time >= ((LibretroTimerManager *)_timerManager)->spentOnMainThread() && !((LibretroTimerManager *)_timerManager)->timeToNextSwitch())
-				((LibretroTimerManager *)_timerManager)->switchThread();
+				((LibretroTimerManager *)_timerManager)->checkThread();
 			else
 				usleep(1000);
 			elapsed_time = getMillis() - start_time;


Commit: 84587e9762132acf4e333b5366c97069116e3727
    https://github.com/scummvm/scummvm/commit/84587e9762132acf4e333b5366c97069116e3727
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-06-23T01:30:13+02:00

Commit Message:
LIBRETRO: reduce timer interval

Changed paths:
    backends/platform/libretro/src/libretro-timer.cpp


diff --git a/backends/platform/libretro/src/libretro-timer.cpp b/backends/platform/libretro/src/libretro-timer.cpp
index a4017d013eb..cc96effc213 100644
--- a/backends/platform/libretro/src/libretro-timer.cpp
+++ b/backends/platform/libretro/src/libretro-timer.cpp
@@ -25,7 +25,7 @@
 LibretroTimerManager::LibretroTimerManager(uint32 refresh_rate) {
 	if (! refresh_rate > 0)
 		refresh_rate = REFRESH_RATE;
-	_interval = 1000 / refresh_rate;
+	_interval = 1000 / refresh_rate / 2;
 	_nextSwitchTime = _interval + g_system->getMillis();
 }
 


Commit: dc8161ef4ebdd07bf53d43b78d38552dad13a4c3
    https://github.com/scummvm/scummvm/commit/dc8161ef4ebdd07bf53d43b78d38552dad13a4c3
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-06-23T01:30:47+02:00

Commit Message:
LIBRETRO: update libretro-common

Changed paths:
    backends/platform/libretro/dependencies.mk


diff --git a/backends/platform/libretro/dependencies.mk b/backends/platform/libretro/dependencies.mk
index d3394a2cb0a..9951009aec2 100644
--- a/backends/platform/libretro/dependencies.mk
+++ b/backends/platform/libretro/dependencies.mk
@@ -11,7 +11,7 @@ DEPS_COMMIT_libretro-deps   := c8638d7d317c397c19aa4551038bf648a467ffe6
 
 DEPS_FOLDER_libretro-common := libretro-common
 DEPS_URL_libretro-common    := https://github.com/libretro/libretro-common
-DEPS_COMMIT_libretro-common := d5b04aed7438c559554d3c27a67e3efec559797b
+DEPS_COMMIT_libretro-common := 86d5e4128c072255c123d535cae97789023ee54b
 
 submodule_test  = $(if $(shell result=$$($(SCRIPTS_PATH)/configure_submodules.sh $(DEPS_URL_$(1)) $(DEPS_COMMIT_$(1)) $(DEPS_PATH) $(DEBUG_ALLOW_DIRTY_SUBMODULES) $(DEPS_FOLDER_$(1))) ; { [ -z $$result ] || [ ! $$result = 0 ] ; } && printf error),$(1))
 $(info Configuring submodules...)




More information about the Scummvm-git-logs mailing list