[Scummvm-git-logs] scummvm master -> 5e808c17bee68ee051721e759a50cb17759a9bc4

spleen1981 noreply at scummvm.org
Wed Apr 19 10:45:53 UTC 2023


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

Summary:
f404d025ac LIBRETRO: add scummvm_main return code log
5e808c17be LIBRETRO: BUILD: add LITE flag for PSVita


Commit: f404d025ac089921a3347c3704190b70298edf0c
    https://github.com/scummvm/scummvm/commit/f404d025ac089921a3347c3704190b70298edf0c
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-04-19T12:45:22+02:00

Commit Message:
LIBRETRO: add scummvm_main return code log

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


diff --git a/backends/platform/libretro/include/libretro-threads.h b/backends/platform/libretro/include/libretro-threads.h
index 80344c2986d..e7451e3ffc6 100644
--- a/backends/platform/libretro/include/libretro-threads.h
+++ b/backends/platform/libretro/include/libretro-threads.h
@@ -54,5 +54,8 @@ bool retro_emu_thread_initialized(void);
  */
 bool retro_emu_thread_exited(void);
 
+/* Returns scummvm_main return code or -1 if not available */
+int retro_get_scummvm_res(void);
+
 #endif
 
diff --git a/backends/platform/libretro/src/libretro-threads.cpp b/backends/platform/libretro/src/libretro-threads.cpp
index d457121d8ab..dc1997ccc9e 100644
--- a/backends/platform/libretro/src/libretro-threads.cpp
+++ b/backends/platform/libretro/src/libretro-threads.cpp
@@ -23,6 +23,7 @@
 #define MAIN_WAITING   (1 << 1)
 #define EMU_EXITED     (1 << 2)
 static uint8_t status = EMU_WAITING | MAIN_WAITING;
+static int scummvm_res = -1;
 
 #ifdef USE_LIBCO
 #include <libco.h>
@@ -75,7 +76,7 @@ static int retro_run_emulator(void) {
 static void retro_wrap_emulator(void) {
 
 	status &= ~EMU_EXITED;
-	retro_run_emulator();
+	scummvm_res = retro_run_emulator();
 	status |= EMU_EXITED;
 
 	retro_exit_to_main_thread();
@@ -174,3 +175,7 @@ void retro_deinit_emu_thread() {
 		retro_switch_to_main_thread();
 	retro_free_emu_thread();
 }
+
+int retro_get_scummvm_res() {
+	return scummvm_res;
+}
diff --git a/backends/platform/libretro/src/libretro.cpp b/backends/platform/libretro/src/libretro.cpp
index da5e4519f79..c8027cc4915 100644
--- a/backends/platform/libretro/src/libretro.cpp
+++ b/backends/platform/libretro/src/libretro.cpp
@@ -27,6 +27,7 @@
 #include "common/scummsys.h"
 #include "common/str.h"
 #include "common/fs.h"
+#include "common/error.h"
 #include "streams/file_stream.h"
 #include "graphics/surface.h"
 #ifdef _WIN32
@@ -805,6 +806,13 @@ void retro_unload_game(void) {
 		retro_switch_to_emu_thread();
 	}
 	retro_deinit_emu_thread();
+
+	if (retro_get_scummvm_res() == Common::kNoError)
+		log_cb(RETRO_LOG_INFO, "ScummVM exited successfully.\n");
+	else if (retro_get_scummvm_res() < Common::kNoError)
+		log_cb(RETRO_LOG_WARN, "ScummVM not initialized correctly.\n", frameskip_counter, current_frame);
+	else
+		log_cb(RETRO_LOG_ERROR, "ScummVM exited with error %d.\n", retro_get_scummvm_res());
 	// g_system->destroy(); //TODO: This call causes "pure virtual method called" after frontend "Unloading core symbols". Check if needed at all.
 }
 


Commit: 5e808c17bee68ee051721e759a50cb17759a9bc4
    https://github.com/scummvm/scummvm/commit/5e808c17bee68ee051721e759a50cb17759a9bc4
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-04-19T12:45:22+02:00

Commit Message:
LIBRETRO: BUILD: add LITE flag for PSVita

Changed paths:
    backends/platform/libretro/Makefile


diff --git a/backends/platform/libretro/Makefile b/backends/platform/libretro/Makefile
index c09ea54c3f4..e5042c64005 100644
--- a/backends/platform/libretro/Makefile
+++ b/backends/platform/libretro/Makefile
@@ -190,6 +190,7 @@ else ifeq ($(platform), vita)
    CXX = arm-vita-eabi-g++$(EXE_EXT)
    AR = arm-vita-eabi-ar$(EXE_EXT) rcs
    DEFINES += -DVITA
+   LITE := 1
    STATIC_LINKING = 1
 
 # GCW0




More information about the Scummvm-git-logs mailing list