[Scummvm-git-logs] scummvm master -> ebf098dc1d6a950dd669e27180ba834bf0dba363
spleen1981
noreply at scummvm.org
Mon Apr 6 12:14:11 UTC 2026
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
f2dfcb196c LIBRETRO: allow selecting the pointer device in core options
6b679b88b1 LIBRETRO: merge retropad only mode to new pointer setting and rework defaults
eb28a37e5f LIBRETRO: add scummvm_pointer_device it translation
d06eb241bb LIBRETRO: improve pointer controls and add right mouse click
dd9af4c5d4 LIBRETRO: Add Libretro MIDI Out plugin
f4ae6f9c4c LIBRETRO: add missing retro_log_cb test
ebf098dc1d LIBRETRO: fix wrong placed declarations
Commit: f2dfcb196c05b43e00300f70ee885c7857b3f4a1
https://github.com/scummvm/scummvm/commit/f2dfcb196c05b43e00300f70ee885c7857b3f4a1
Author: Rob Loach (RobLoach at users.noreply.github.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: allow selecting the pointer device in core options
Changed paths:
backends/platform/libretro/README.md
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-os-inputs.cpp
diff --git a/backends/platform/libretro/README.md b/backends/platform/libretro/README.md
index 7d9451c881b..262aa6e8279 100644
--- a/backends/platform/libretro/README.md
+++ b/backends/platform/libretro/README.md
@@ -59,6 +59,7 @@ Operation status will be shown in the same dialog, while details will be given i
## Core options
### Cursor Movement
+ - **Pointer Device**: allows switching which device to use to move the cursor.
- **Exclusive cursor control with RetroPad**: allows the use of RetroPad only to control mouse cursor, excluding the other inputs (e.g. physical mouse, touch screen).
- **Gamepad Cursor Speed**: sets the mouse cursor speed multiplier when moving the cursor with the RetroPad left analog stick or D-Pad. The default value of '1.0' is optimised for games that have a native resolution of '320x200' or '320x240'. When running 'high definition' games with a resolution of '640x400' or '640x480', a Gamepad Cursor Speed of '2.0' is recommended.
- **Gamepad Cursor Acceleration**: the amount of time (In seconds) it takes for the cursor to reach full speed
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index 34293babe4c..e2c83b653d5 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -96,6 +96,21 @@ struct retro_core_option_v2_category option_cats_us[] = {
};
struct retro_core_option_v2_definition option_defs_us[] = {
+ {
+ "scummvm_pointer_device",
+ "Cursor > Pointer Device",
+ "Pointer Device",
+ "Select which device to control the pointer.",
+ NULL,
+ "cursor",
+ {
+ {"default", "Default"},
+ {"pointer", "Pointer"},
+ {"mouse", "Mouse"},
+ {NULL, NULL},
+ },
+ "default"
+ },
{
"scummvm_gamepad_cursor_only",
"Cursor > Exclusive cursor control with RetroPad",
diff --git a/backends/platform/libretro/include/libretro-core.h b/backends/platform/libretro/include/libretro-core.h
index f782e70efac..62c86a80b97 100644
--- a/backends/platform/libretro/include/libretro-core.h
+++ b/backends/platform/libretro/include/libretro-core.h
@@ -41,6 +41,15 @@ int retro_setting_get_mouse_fine_control_speed_reduction(void);
bool retro_setting_get_gamepad_cursor_only(void);
float retro_setting_get_gamepad_cursor_speed(void);
float retro_setting_get_gamepad_acceleration_time(void);
+
+/**
+ * Retrieves the desired mouse pointer device.
+ *
+ * @return An integer representing which input device to use for the pointer:
+ * - RETRO_DEVICE_MOUSE
+ * - RETRO_DEVICE_POINTER
+ */
+int retro_setting_get_pointer_device(void);
int retro_setting_get_gui_res_w(void);
int retro_setting_get_gui_res_h(void);
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 0371b91d82f..5de5d4cc649 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -75,6 +75,7 @@ static bool gamepad_cursor_only = false;
static float mouse_speed = 1.0f;
static float gamepad_acceleration_time = 0.2f;
static int mouse_fine_control_speed_reduction = 4;
+static int pointer_device = RETRO_DEVICE_NONE; // default pointer/mouse device
char cmd_params[20][200];
char cmd_params_num;
@@ -260,6 +261,16 @@ static void update_variables(void) {
struct retro_variable var;
updating_variables = true;
+ var.key = "scummvm_pointer_device";
+ var.value = NULL;
+ pointer_device = RETRO_DEVICE_NONE;
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
+ if (strcmp(var.value, "mouse") == 0)
+ pointer_device = RETRO_DEVICE_MOUSE;
+ else if (strcmp(var.value, "pointer") == 0)
+ pointer_device = RETRO_DEVICE_POINTER;
+ }
+
var.key = "scummvm_gamepad_cursor_only";
var.value = NULL;
gamepad_cursor_only = false;
@@ -593,6 +604,17 @@ float retro_setting_get_gamepad_acceleration_time(void) {
return gamepad_acceleration_time;
}
+int retro_setting_get_pointer_device(void) {
+ if (pointer_device == RETRO_DEVICE_NONE) {
+#if defined(WIIU) || defined(__SWITCH__)
+ return RETRO_DEVICE_POINTER;
+#else
+ return RETRO_DEVICE_MOUSE;
+#endif
+ }
+ return pointer_device;
+}
+
float retro_setting_get_frame_rate(void) {
return frame_rate;
}
diff --git a/backends/platform/libretro/src/libretro-os-inputs.cpp b/backends/platform/libretro/src/libretro-os-inputs.cpp
index c4815db8bf9..14ec97ad52e 100644
--- a/backends/platform/libretro/src/libretro-os-inputs.cpp
+++ b/backends/platform/libretro/src/libretro-os-inputs.cpp
@@ -213,50 +213,50 @@ void OSystem_libretro::processInputs(void) {
if (retro_setting_get_gamepad_cursor_only())
return;
-#if defined(WIIU) || defined(__SWITCH__)
- int p_x = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X);
- int p_y = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y);
- int p_press = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_PRESSED);
- int px = (int)((p_x + 0x7fff) * getScreenWidth() / 0xffff);
- int py = (int)((p_y + 0x7fff) * getScreenHeight() / 0xffff);
-
- static int ptrhold = 0;
-
- if (p_press)
- ptrhold++;
- else
- ptrhold = 0;
-
- if (ptrhold > 0) {
- _mouseX = px;
- _mouseY = py;
-
- Common::Event ev;
- ev.type = Common::EVENT_MOUSEMOVE;
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- _events.push_back(ev);
- setMousePosition(_mouseX, _mouseY);
- }
+ if (retro_setting_get_pointer_device() == RETRO_DEVICE_POINTER) {
+ int p_x = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X);
+ int p_y = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y);
+ int p_press = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_PRESSED);
+ int px = (int)((p_x + 0x7fff) * getScreenWidth() / 0xffff);
+ int py = (int)((p_y + 0x7fff) * getScreenHeight() / 0xffff);
+
+ static int ptrhold = 0;
+
+ if (p_press)
+ ptrhold++;
+ else
+ ptrhold = 0;
+
+ if (ptrhold > 0) {
+ _mouseX = px;
+ _mouseY = py;
+
+ Common::Event ev;
+ ev.type = Common::EVENT_MOUSEMOVE;
+ ev.mouse.x = _mouseX;
+ ev.mouse.y = _mouseY;
+ _events.push_back(ev);
+ setMousePosition(_mouseX, _mouseY);
+ }
- if (ptrhold > 10 && _ptrmouseButton == 0) {
- _ptrmouseButton = 1;
- Common::Event ev;
- ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- _events.push_back(ev);
- } else if (ptrhold == 0 && _ptrmouseButton == 1) {
- _ptrmouseButton = 0;
- Common::Event ev;
- ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- _events.push_back(ev);
+ if (ptrhold > 10 && _ptrmouseButton == 0) {
+ _ptrmouseButton = 1;
+ Common::Event ev;
+ ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
+ ev.mouse.x = _mouseX;
+ ev.mouse.y = _mouseY;
+ _events.push_back(ev);
+ } else if (ptrhold == 0 && _ptrmouseButton == 1) {
+ _ptrmouseButton = 0;
+ Common::Event ev;
+ ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
+ ev.mouse.x = _mouseX;
+ ev.mouse.y = _mouseY;
+ _events.push_back(ev);
+ }
+ return;
}
-#endif
-
// Process input from physical mouse
x = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
y = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
Commit: 6b679b88b17ea847854ad46270aaf36f00cd35e0
https://github.com/scummvm/scummvm/commit/6b679b88b17ea847854ad46270aaf36f00cd35e0
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: merge retropad only mode to new pointer setting and rework defaults
Changed paths:
backends/platform/libretro/README.md
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-os-inputs.cpp
diff --git a/backends/platform/libretro/README.md b/backends/platform/libretro/README.md
index 262aa6e8279..66c97187201 100644
--- a/backends/platform/libretro/README.md
+++ b/backends/platform/libretro/README.md
@@ -60,7 +60,6 @@ Operation status will be shown in the same dialog, while details will be given i
## Core options
### Cursor Movement
- **Pointer Device**: allows switching which device to use to move the cursor.
- - **Exclusive cursor control with RetroPad**: allows the use of RetroPad only to control mouse cursor, excluding the other inputs (e.g. physical mouse, touch screen).
- **Gamepad Cursor Speed**: sets the mouse cursor speed multiplier when moving the cursor with the RetroPad left analog stick or D-Pad. The default value of '1.0' is optimised for games that have a native resolution of '320x200' or '320x240'. When running 'high definition' games with a resolution of '640x400' or '640x480', a Gamepad Cursor Speed of '2.0' is recommended.
- **Gamepad Cursor Acceleration**: the amount of time (In seconds) it takes for the cursor to reach full speed
- **Analog Cursor Response**: determines how the speed of the cursor varies when tilting the RetroPad left analog stick. 'Linear': Speed is directly proportional to analog stick displacement. This is standard behaviour with which most users will be familiar. 'Quadratic': Speed increases quadratically with analog stick displacement. This allows for greater precision when making small movements without sacrificing maximum speed at full analog range. This mode may require practice for effective use.
diff --git a/backends/platform/libretro/include/libretro-core-options-intl.h b/backends/platform/libretro/include/libretro-core-options-intl.h
index b5ef01b7388..af8159b060f 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -94,20 +94,6 @@ struct retro_core_option_v2_category option_cats_it[] = {
};
struct retro_core_option_v2_definition option_defs_it[] = {
- {
- "scummvm_gamepad_cursor_only",
- "Cursore > Controllo esclusivo del cursore con RetroPad",
- "Controllo esclusivo del cursore con RetroPad",
- "Consente di usare solo RetroPad per il controllo del cursore del mouse, escludento gli altri input (es. mouse fisico, touch screen).",
- NULL,
- "cursor",
- {
- {"disabled", NULL},
- {"enabled", NULL},
- {NULL, NULL},
- },
- "disabled"
- },
{
"scummvm_gamepad_cursor_speed",
"Cursore > Velocità del cursore",
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index e2c83b653d5..8f4de73269e 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -104,26 +104,16 @@ struct retro_core_option_v2_definition option_defs_us[] = {
NULL,
"cursor",
{
- {"default", "Default"},
- {"pointer", "Pointer"},
- {"mouse", "Mouse"},
+ {"retropad", "RetroPad only"},
+ {"mouse", "RetroPad + RetroMouse"},
+ {"pointer", "RetroPad + Pointer"},
{NULL, NULL},
},
- "default"
- },
- {
- "scummvm_gamepad_cursor_only",
- "Cursor > Exclusive cursor control with RetroPad",
- "Exclusive cursor control with RetroPad",
- "Allows the use of RetroPad only to control mouse cursor, excluding the other inputs (e.g. physical mouse, touch screen).",
- NULL,
- "cursor",
- {
- {"disabled", NULL},
- {"enabled", NULL},
- {NULL, NULL},
- },
- "disabled"
+#if defined(WIIU) || defined(__SWITCH__)
+ "pointer"
+#else
+ "mouse"
+#endif
},
{
"scummvm_gamepad_cursor_speed",
diff --git a/backends/platform/libretro/include/libretro-core.h b/backends/platform/libretro/include/libretro-core.h
index 62c86a80b97..f6452dcefa5 100644
--- a/backends/platform/libretro/include/libretro-core.h
+++ b/backends/platform/libretro/include/libretro-core.h
@@ -38,7 +38,6 @@ int retro_setting_get_analog_deadzone(void);
bool retro_setting_get_analog_response_is_quadratic(void);
float retro_setting_get_mouse_speed(void);
int retro_setting_get_mouse_fine_control_speed_reduction(void);
-bool retro_setting_get_gamepad_cursor_only(void);
float retro_setting_get_gamepad_cursor_speed(void);
float retro_setting_get_gamepad_acceleration_time(void);
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 5de5d4cc649..114d94d7657 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -70,12 +70,11 @@ static int analog_deadzone = (int)(0.15f * ANALOG_RANGE);
static float gamepad_cursor_speed = 1.0f;
static bool analog_response_is_quadratic = false;
-static bool gamepad_cursor_only = false;
static float mouse_speed = 1.0f;
static float gamepad_acceleration_time = 0.2f;
static int mouse_fine_control_speed_reduction = 4;
-static int pointer_device = RETRO_DEVICE_NONE; // default pointer/mouse device
+static int pointer_device = RETRO_DEVICE_JOYPAD; // default pointer/mouse device
char cmd_params[20][200];
char cmd_params_num;
@@ -263,20 +262,14 @@ static void update_variables(void) {
var.key = "scummvm_pointer_device";
var.value = NULL;
- pointer_device = RETRO_DEVICE_NONE;
+ pointer_device = RETRO_DEVICE_JOYPAD;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
if (strcmp(var.value, "mouse") == 0)
pointer_device = RETRO_DEVICE_MOUSE;
else if (strcmp(var.value, "pointer") == 0)
pointer_device = RETRO_DEVICE_POINTER;
- }
-
- var.key = "scummvm_gamepad_cursor_only";
- var.value = NULL;
- gamepad_cursor_only = false;
- if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
- if (strcmp(var.value, "enabled") == 0)
- gamepad_cursor_only = true;
+ /* else if (strcmp(var.value, "retropad") == 0)
+ pointer_device = RETRO_DEVICE_JOYPAD; */
}
var.key = "scummvm_gamepad_cursor_speed";
@@ -576,10 +569,6 @@ static bool retro_update_options_display(void) {
return updated;
}
-bool retro_setting_get_gamepad_cursor_only(void) {
- return gamepad_cursor_only;
-}
-
int retro_setting_get_analog_deadzone(void) {
return analog_deadzone;
}
@@ -605,13 +594,6 @@ float retro_setting_get_gamepad_acceleration_time(void) {
}
int retro_setting_get_pointer_device(void) {
- if (pointer_device == RETRO_DEVICE_NONE) {
-#if defined(WIIU) || defined(__SWITCH__)
- return RETRO_DEVICE_POINTER;
-#else
- return RETRO_DEVICE_MOUSE;
-#endif
- }
return pointer_device;
}
diff --git a/backends/platform/libretro/src/libretro-os-inputs.cpp b/backends/platform/libretro/src/libretro-os-inputs.cpp
index 14ec97ad52e..5e845895279 100644
--- a/backends/platform/libretro/src/libretro-os-inputs.cpp
+++ b/backends/platform/libretro/src/libretro-os-inputs.cpp
@@ -210,9 +210,6 @@ void OSystem_libretro::processInputs(void) {
}
}
- if (retro_setting_get_gamepad_cursor_only())
- return;
-
if (retro_setting_get_pointer_device() == RETRO_DEVICE_POINTER) {
int p_x = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X);
int p_y = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y);
@@ -254,62 +251,61 @@ void OSystem_libretro::processInputs(void) {
ev.mouse.y = _mouseY;
_events.push_back(ev);
}
- return;
- }
-
- // Process input from physical mouse
- x = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
- y = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
-
- // > X Axis
- if (x != 0) {
- _cursorStatus |= (CURSOR_STATUS_DOING_MOUSE | CURSOR_STATUS_DOING_X);
- if (x > 0) {
- // Reset accumulator when changing direction
- _mouseXAcc = (_mouseXAcc < 0.0) ? 0.0 : _mouseXAcc;
- }
- if (x < 0) {
- // Reset accumulator when changing direction
- _mouseXAcc = (_mouseXAcc > 0.0) ? 0.0 : _mouseXAcc;
+ } else if (retro_setting_get_pointer_device() == RETRO_DEVICE_MOUSE) {
+ // Process input from physical mouse
+ x = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
+ y = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
+
+ // > X Axis
+ if (x != 0) {
+ _cursorStatus |= (CURSOR_STATUS_DOING_MOUSE | CURSOR_STATUS_DOING_X);
+ if (x > 0) {
+ // Reset accumulator when changing direction
+ _mouseXAcc = (_mouseXAcc < 0.0) ? 0.0 : _mouseXAcc;
+ }
+ if (x < 0) {
+ // Reset accumulator when changing direction
+ _mouseXAcc = (_mouseXAcc > 0.0) ? 0.0 : _mouseXAcc;
+ }
+ deltaAcc = (float)x * retro_setting_get_mouse_speed();
+ updateMouseXY(deltaAcc, &_mouseXAcc, 1);
}
- deltaAcc = (float)x * retro_setting_get_mouse_speed();
- updateMouseXY(deltaAcc, &_mouseXAcc, 1);
- }
- // > Y Axis
- if (y != 0) {
- _cursorStatus |= (CURSOR_STATUS_DOING_MOUSE | CURSOR_STATUS_DOING_Y);
- if (y > 0) {
- // Reset accumulator when changing direction
- _mouseYAcc = (_mouseYAcc < 0.0) ? 0.0 : _mouseYAcc;
- }
- if (y < 0) {
- // Reset accumulator when changing direction
- _mouseYAcc = (_mouseYAcc > 0.0) ? 0.0 : _mouseYAcc;
+ // > Y Axis
+ if (y != 0) {
+ _cursorStatus |= (CURSOR_STATUS_DOING_MOUSE | CURSOR_STATUS_DOING_Y);
+ if (y > 0) {
+ // Reset accumulator when changing direction
+ _mouseYAcc = (_mouseYAcc < 0.0) ? 0.0 : _mouseYAcc;
+ }
+ if (y < 0) {
+ // Reset accumulator when changing direction
+ _mouseYAcc = (_mouseYAcc > 0.0) ? 0.0 : _mouseYAcc;
+ }
+ deltaAcc = (float)y * retro_setting_get_mouse_speed();
+ updateMouseXY(deltaAcc, &_mouseYAcc, 0);
}
- deltaAcc = (float)y * retro_setting_get_mouse_speed();
- updateMouseXY(deltaAcc, &_mouseYAcc, 0);
- }
- if (_cursorStatus & CURSOR_STATUS_DOING_MOUSE) {
- Common::Event ev;
- ev.type = Common::EVENT_MOUSEMOVE;
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- ev.relMouse.x = _cursorStatus & CURSOR_STATUS_DOING_X ? _relMouseX : 0;
- ev.relMouse.y = _cursorStatus & CURSOR_STATUS_DOING_Y ? _relMouseY : 0;
- _events.push_back(ev);
- setMousePosition(_mouseX, _mouseY);
- }
-
- for (int i = 0; i < 2; i++) {
- Common::Event ev;
- bool down = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, retroButtons[i]);
- if (down != _mouseButtons[i]) {
- _mouseButtons[i] = down;
- ev.type = eventID[i][down ? 0 : 1];
+ if (_cursorStatus & CURSOR_STATUS_DOING_MOUSE) {
+ Common::Event ev;
+ ev.type = Common::EVENT_MOUSEMOVE;
ev.mouse.x = _mouseX;
ev.mouse.y = _mouseY;
+ ev.relMouse.x = _cursorStatus & CURSOR_STATUS_DOING_X ? _relMouseX : 0;
+ ev.relMouse.y = _cursorStatus & CURSOR_STATUS_DOING_Y ? _relMouseY : 0;
_events.push_back(ev);
+ setMousePosition(_mouseX, _mouseY);
+ }
+
+ for (int i = 0; i < 2; i++) {
+ Common::Event ev;
+ bool down = retro_input_cb(0, RETRO_DEVICE_MOUSE, 0, retroButtons[i]);
+ if (down != _mouseButtons[i]) {
+ _mouseButtons[i] = down;
+ ev.type = eventID[i][down ? 0 : 1];
+ ev.mouse.x = _mouseX;
+ ev.mouse.y = _mouseY;
+ _events.push_back(ev);
+ }
}
}
}
Commit: eb28a37e5f941d3404dca96fd0cba6eaf890f909
https://github.com/scummvm/scummvm/commit/eb28a37e5f941d3404dca96fd0cba6eaf890f909
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: add scummvm_pointer_device it translation
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 af8159b060f..ac8bfeffe87 100644
--- a/backends/platform/libretro/include/libretro-core-options-intl.h
+++ b/backends/platform/libretro/include/libretro-core-options-intl.h
@@ -94,6 +94,19 @@ struct retro_core_option_v2_category option_cats_it[] = {
};
struct retro_core_option_v2_definition option_defs_it[] = {
+ {
+ "scummvm_pointer_device",
+ "Cursore > Dispositivo di Puntamento",
+ "Dispositivo di Puntamento",
+ "Selezione del dispositivo che controlla il cursore.",
+ NULL,
+ NULL,
+ {
+ {"retropad", "solo RetroPad"},
+ {NULL, NULL},
+ },
+ NULL
+ },
{
"scummvm_gamepad_cursor_speed",
"Cursore > Velocità del cursore",
diff --git a/backends/platform/libretro/include/libretro-core-options.h b/backends/platform/libretro/include/libretro-core-options.h
index 8f4de73269e..dfb9ee36448 100644
--- a/backends/platform/libretro/include/libretro-core-options.h
+++ b/backends/platform/libretro/include/libretro-core-options.h
@@ -100,7 +100,7 @@ struct retro_core_option_v2_definition option_defs_us[] = {
"scummvm_pointer_device",
"Cursor > Pointer Device",
"Pointer Device",
- "Select which device to control the pointer.",
+ "Select which device controls the cursor.",
NULL,
"cursor",
{
Commit: d06eb241bbad0459ef33c669a1fb1ca91e8b703a
https://github.com/scummvm/scummvm/commit/d06eb241bbad0459ef33c669a1fb1ca91e8b703a
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: improve pointer controls and add right mouse click
Changed paths:
backends/platform/libretro/src/libretro-os-inputs.cpp
diff --git a/backends/platform/libretro/src/libretro-os-inputs.cpp b/backends/platform/libretro/src/libretro-os-inputs.cpp
index 5e845895279..f9572d0b68e 100644
--- a/backends/platform/libretro/src/libretro-os-inputs.cpp
+++ b/backends/platform/libretro/src/libretro-os-inputs.cpp
@@ -211,20 +211,56 @@ void OSystem_libretro::processInputs(void) {
}
if (retro_setting_get_pointer_device() == RETRO_DEVICE_POINTER) {
- int p_x = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X);
- int p_y = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y);
+ int p_x = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X);
+ int p_y = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y);
int p_press = retro_input_cb(0, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_PRESSED);
- int px = (int)((p_x + 0x7fff) * getScreenWidth() / 0xffff);
+
+ int px = (int)((p_x + 0x7fff) * getScreenWidth() / 0xffff);
int py = (int)((p_y + 0x7fff) * getScreenHeight() / 0xffff);
- static int ptrhold = 0;
+ // Thresholds (frame-based)
+ static const int TAP_MAX_FRAMES = (20 * retro_setting_get_frame_rate()) / 60;
+ static const int LONG_MIN_FRAMES = (40 * retro_setting_get_frame_rate()) / 60;
+ static const int MOVE_THRESHOLD_PX = 8;
+
+ // Gesture state
+ static bool wasPressed = false;
+ static int holdFrames = 0;
+ static bool dragging = false;
+ static bool longClickFired = false;
+ static int startX = 0;
+ static int startY = 0;
+ static int lastX = 0;
+ static int lastY = 0;
+ static int pendingButton = 0; // 0 none, 1 left, 2 right
+ static int pendingX = 0, pendingY = 0;
+ static int pendingDelay = 0; // frame countdown until UP
+
+ // check if UP is pending
+ if (pendingButton != 0) {
+ if (pendingDelay > 0) {
+ pendingDelay--;
+ } else {
+ Common::Event ev;
+ ev.type = eventID[pendingButton - 1][1];
+ ev.mouse.x = pendingX;
+ ev.mouse.y = pendingY;
+ _events.push_back(ev);
+ pendingButton = 0;
+ }
+ }
+
+ // DOWN edge: start tracking
+ if (p_press && !wasPressed) {
+ wasPressed = true;
+ holdFrames = 0;
+ dragging = false;
+ longClickFired = false;
- if (p_press)
- ptrhold++;
- else
- ptrhold = 0;
+ startX = lastX = px;
+ startY = lastY = py;
- if (ptrhold > 0) {
+ // Move cursor immediately to touch point
_mouseX = px;
_mouseY = py;
@@ -232,24 +268,79 @@ void OSystem_libretro::processInputs(void) {
ev.type = Common::EVENT_MOUSEMOVE;
ev.mouse.x = _mouseX;
ev.mouse.y = _mouseY;
+ ev.relMouse.x = 0;
+ ev.relMouse.y = 0;
_events.push_back(ev);
setMousePosition(_mouseX, _mouseY);
}
- if (ptrhold > 10 && _ptrmouseButton == 0) {
- _ptrmouseButton = 1;
- Common::Event ev;
- ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- _events.push_back(ev);
- } else if (ptrhold == 0 && _ptrmouseButton == 1) {
- _ptrmouseButton = 0;
- Common::Event ev;
- ev.type = eventID[0][_ptrmouseButton ? 0 : 1];
- ev.mouse.x = _mouseX;
- ev.mouse.y = _mouseY;
- _events.push_back(ev);
+ // PRESSED: track move + possibly long click
+ if (p_press && wasPressed) {
+ holdFrames++;
+
+ // Determine if we've moved too much (drag)
+ if (!dragging && (abs(px - startX) > MOVE_THRESHOLD_PX || abs(py - startY) > MOVE_THRESHOLD_PX))
+ dragging = true;
+
+ // Always move cursor while pressed
+ if (px != lastX || py != lastY) {
+ _mouseX = px;
+ _mouseY = py;
+
+ Common::Event ev;
+ ev.type = Common::EVENT_MOUSEMOVE;
+ ev.mouse.x = _mouseX;
+ ev.mouse.y = _mouseY;
+ ev.relMouse.x = px - lastX;
+ ev.relMouse.y = py - lastY;
+ _events.push_back(ev);
+ setMousePosition(_mouseX, _mouseY);
+
+ lastX = px;
+ lastY = py;
+ }
+
+ // Long press triggers RIGHT click automatically BEFORE release
+ if (!longClickFired && !dragging && holdFrames >= LONG_MIN_FRAMES) {
+ Common::Event ev;
+ ev.type = eventID[1][0];
+ ev.mouse.x = startX;
+ ev.mouse.y = startY;
+ _events.push_back(ev);
+
+ pendingButton = 2;
+ pendingX = startX;
+ pendingY = startY;
+ pendingDelay = 1;
+
+ longClickFired = true;
+
+ // After long click, remain pressed behaves like drag/move (no more clicks)
+ dragging = true;
+ }
+ }
+
+ // UP edge: decide tap click (LEFT) only if long didn't fire and no drag
+ if (!p_press && wasPressed) {
+ wasPressed = false;
+ if (!longClickFired && !dragging) {
+ if ((abs(px - startX) <= MOVE_THRESHOLD_PX && abs(py - startY) <= MOVE_THRESHOLD_PX) && holdFrames <= TAP_MAX_FRAMES) {
+ Common::Event ev;
+ ev.type = eventID[0][0];
+ ev.mouse.x = startX;
+ ev.mouse.y = startY;
+ _events.push_back(ev);
+
+ pendingButton = 1;
+ pendingX = startX;
+ pendingY = startY;
+ pendingDelay = 1;
+ }
+ }
+
+ holdFrames = 0;
+ dragging = false;
+ longClickFired = false;
}
} else if (retro_setting_get_pointer_device() == RETRO_DEVICE_MOUSE) {
// Process input from physical mouse
Commit: dd9af4c5d4c9730df6e77b913937023718249913
https://github.com/scummvm/scummvm/commit/dd9af4c5d4c9730df6e77b913937023718249913
Author: ma-moon (100507036+ma-moon at users.noreply.github.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: Add Libretro MIDI Out plugin
Changed paths:
A backends/platform/libretro/src/libretro-midi.cpp
backends/platform/libretro/Makefile.common
backends/platform/libretro/include/libretro-core.h
backends/platform/libretro/include/libretro-defs.h
backends/platform/libretro/src/libretro-core.cpp
base/plugins.cpp
diff --git a/backends/platform/libretro/Makefile.common b/backends/platform/libretro/Makefile.common
index 7f533ae2748..206442a575f 100644
--- a/backends/platform/libretro/Makefile.common
+++ b/backends/platform/libretro/Makefile.common
@@ -250,7 +250,8 @@ LIBRETRO_OBJS := $(CORE_PATH)/libretro-core.o \
$(CORE_PATH)/libretro-timer.o \
$(CORE_PATH)/libretro-mapper.o \
$(CORE_PATH)/libretro-options-widget.o \
- $(CORE_PATH)/libretro-graphics-surface.o
+ $(CORE_PATH)/libretro-graphics-surface.o \
+ $(CORE_PATH)/libretro-midi.o
ifeq ($(or $(HAVE_OPENGL), $(HAVE_OPENGLES2)), 1)
LIBRETRO_OBJS += $(CORE_PATH)/libretro-graphics-opengl.o
diff --git a/backends/platform/libretro/include/libretro-core.h b/backends/platform/libretro/include/libretro-core.h
index f6452dcefa5..c1e8bbdc083 100644
--- a/backends/platform/libretro/include/libretro-core.h
+++ b/backends/platform/libretro/include/libretro-core.h
@@ -22,6 +22,7 @@
extern retro_log_printf_t retro_log_cb;
extern retro_input_state_t retro_input_cb;
+extern struct retro_midi_interface *retro_midi_interface;
bool retro_get_input_bitmask_supported(void);
void retro_osd_notification(const char *msg);
@@ -59,4 +60,11 @@ uint8 retro_get_video_hw_mode(void);
uintptr_t retro_get_hw_fb(void);
void *retro_get_proc_address(const char *name);
#endif
+
+typedef struct {
+ uint8 byte;
+ uint32 delta_us;
+} retro_midi_event_t;
+void retro_midi_queue_push(uint8 byte, uint32 delta_us);
+
#endif // LIBRETRO_CORE_H
diff --git a/backends/platform/libretro/include/libretro-defs.h b/backends/platform/libretro/include/libretro-defs.h
index 85d96a03dc8..c2659bb38e3 100644
--- a/backends/platform/libretro/include/libretro-defs.h
+++ b/backends/platform/libretro/include/libretro-defs.h
@@ -53,6 +53,8 @@
#define TEST_GAME_KO_NOT_FOUND 3
#define TEST_GAME_KO_MULTIPLE_RESULTS 4
+#define MIDI_QUEUE_SIZE 2048 /* MUST be power of two */
+
#ifndef F_OK
#define F_OK 0
#endif
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 114d94d7657..9b0d1e6d2a3 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -65,6 +65,9 @@ static retro_environment_t environ_cb = NULL;
static retro_input_poll_t poll_cb = NULL;
static int retro_input_device = RETRO_DEVICE_JOYPAD;
+// MIDI interface
+struct retro_midi_interface *retro_midi_interface = nullptr;
+
// Default deadzone: 15%
static int analog_deadzone = (int)(0.15f * ANALOG_RANGE);
@@ -103,6 +106,10 @@ static bool updating_variables = false;
#ifdef USE_OPENGL
static struct retro_hw_render_callback hw_render;
+static retro_midi_event_t midi_queue[MIDI_QUEUE_SIZE];
+static volatile uint32 midi_head = 0; /* producer writes */
+static volatile uint32 midi_tail = 0; /* consumer writes */
+
static void context_reset(void) {
retro_log_cb(RETRO_LOG_DEBUG, "HW context reset\n");
if (retro_emu_thread_started())
@@ -855,6 +862,41 @@ const char *retro_get_playlist_dir(void) {
return playlistdir;
}
+void retro_midi_queue_push(uint8 byte, uint32 delta_us) {
+ uint32 next = (midi_head + 1) & (MIDI_QUEUE_SIZE - 1);
+
+ if (next == midi_tail) {
+ /* Queue full â drop event (acceptable for MIDI) */
+ return;
+ }
+
+ midi_queue[midi_head].byte = byte;
+ midi_queue[midi_head].delta_us = delta_us;
+ midi_head = next;
+}
+
+static void retro_midi_queue_drain(void) {
+ if (!retro_midi_interface)
+ return;
+ if (!retro_midi_interface->output_enabled)
+ return;
+ if (!retro_midi_interface->output_enabled())
+ return;
+
+ bool did_write = false;
+
+ while (midi_tail != midi_head) {
+ retro_midi_event_t ev = midi_queue[midi_tail];
+ midi_tail = (midi_tail + 1) & (MIDI_QUEUE_SIZE - 1);
+
+ retro_midi_interface->write(ev.byte, ev.delta_us);
+ did_write = true;
+ }
+
+ if (did_write)
+ retro_midi_interface->flush();
+}
+
void retro_init(void) {
struct retro_log_callback log;
if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
@@ -884,6 +926,18 @@ void retro_init(void) {
if (environ_cb(RETRO_ENVIRONMENT_GET_INPUT_BITMASKS, NULL))
input_bitmask_supported = true;
+ // Initialize MIDI interface
+ static struct retro_midi_interface midi_interface;
+ if (environ_cb(RETRO_ENVIRONMENT_GET_MIDI_INTERFACE, &midi_interface)) {
+ retro_midi_interface = &midi_interface;
+ if (retro_log_cb)
+ retro_log_cb(RETRO_LOG_INFO, "MIDI interface initialized\n");
+ } else {
+ retro_midi_interface = nullptr;
+ if (retro_log_cb)
+ retro_log_cb(RETRO_LOG_INFO, "MIDI interface unavailable\n");
+ }
+
g_system = new OSystem_libretro();
}
@@ -1101,6 +1155,8 @@ void retro_run(void) {
poll_cb();
LIBRETRO_G_SYSTEM->processInputs();
}
+
+ retro_midi_queue_drain();
}
void retro_unload_game(void) {
diff --git a/backends/platform/libretro/src/libretro-midi.cpp b/backends/platform/libretro/src/libretro-midi.cpp
new file mode 100644
index 00000000000..543f84fb527
--- /dev/null
+++ b/backends/platform/libretro/src/libretro-midi.cpp
@@ -0,0 +1,237 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Libretro MIDI output driver
+ * Based on the ScummVM CoreMIDI and STMIDI drivers
+ * Implements RETRO_ENVIRONMENT_GET_MIDI_INTERFACE for MIDI Out support
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include <libretro.h>
+#include "common/scummsys.h"
+#include "audio/mpu401.h"
+#include "common/error.h"
+#include "common/util.h"
+#include "common/system.h"
+#include "audio/musicplugin.h"
+#include "backends/platform/libretro/include/libretro-defs.h"
+#include "backends/platform/libretro/include/libretro-core.h"
+
+// External libretro MIDI interface
+extern struct retro_midi_interface *retro_midi_interface;
+
+class MidiDriver_Libretro : public MidiDriver_MPU401 {
+public:
+ MidiDriver_Libretro() : _isOpen(false), _lastWriteUs(0) { }
+ int open();
+ bool isOpen() const {
+ return _isOpen;
+ }
+ void close();
+ void send(uint32 b) override;
+ void sysEx(const byte *msg, uint16 length) override;
+
+private:
+ bool _isOpen;
+ uint64 _lastWriteUs;
+ uint32 calcDeltaUs();
+ inline bool outputAvailable() const {
+ return retro_midi_interface && retro_midi_interface->output_enabled();
+ }
+
+};
+
+uint32 MidiDriver_Libretro::calcDeltaUs() {
+ uint64 nowUs = (uint64)g_system->getMillis() * 1000ULL;
+ uint32 delta = 0;
+ if (_lastWriteUs && nowUs >= _lastWriteUs) {
+ uint64 d = nowUs - _lastWriteUs;
+ delta = (d > 0xFFFFFFFFULL) ? 0xFFFFFFFFU : (uint32)d;
+ }
+ _lastWriteUs = nowUs;
+ return delta;
+}
+
+
+int MidiDriver_Libretro::open() {
+ if (_isOpen)
+ return MERR_ALREADY_OPEN;
+
+ if (!retro_midi_interface) {
+ return MERR_DEVICE_NOT_AVAILABLE;
+ }
+
+ if (!retro_midi_interface->output_enabled()) {
+ return MERR_DEVICE_NOT_AVAILABLE;
+ }
+
+ _isOpen = true;
+ _lastWriteUs = 0;
+ return 0;
+}
+
+void MidiDriver_Libretro::close() {
+ if (_isOpen && outputAvailable())
+ stopAllNotes(true);
+ MidiDriver_MPU401::close();
+ _isOpen = false;
+}
+
+void MidiDriver_Libretro::send(uint32 b) {
+ midiDriverCommonSend(b);
+
+ if (!_isOpen)
+ return;
+ if (!outputAvailable())
+ return;
+
+ byte status = (byte)(b & 0xFF);
+ byte d1 = (byte)((b >> 8) & 0xFF);
+ byte d2 = (byte)((b >> 16) & 0xFF);
+
+ // to be handled by sysEx()
+ if (status == 0xF0)
+ return;
+
+ // Realtime messages: 1 byte (F8..FF)
+ if (status >= 0xF8) {
+ retro_midi_queue_push(status, calcDeltaUs());
+ return;
+ }
+
+ // System Common
+ switch (status) {
+ case 0xF1: // MTC quarter frame (2 bytes total)
+ retro_midi_queue_push(status, calcDeltaUs());
+ retro_midi_queue_push(d1, calcDeltaUs());
+ return;
+ case 0xF2: // Song Position Pointer (3 bytes total)
+ retro_midi_queue_push(status, calcDeltaUs());
+ retro_midi_queue_push(d1, calcDeltaUs());
+ retro_midi_queue_push(d2, calcDeltaUs());
+ return;
+ case 0xF3: // Song Select (2 bytes total)
+ retro_midi_queue_push(status, calcDeltaUs());
+ retro_midi_queue_push(d1, calcDeltaUs());
+ return;
+ case 0xF6: // Tune request (1 byte)
+ case 0xF7: // EOX
+ retro_midi_queue_push(status, calcDeltaUs());
+ return;
+ default:
+ break;
+ }
+
+ // Channel voice
+ retro_midi_queue_push(status, calcDeltaUs());
+ switch (status & 0xF0) {
+ case 0xC0: // Program change: 1 data
+ case 0xD0: // Channel pressure: 1 data
+ retro_midi_queue_push(d1, calcDeltaUs());
+ break;
+ case 0x80:
+ case 0x90:
+ case 0xA0:
+ case 0xB0:
+ case 0xE0:
+ retro_midi_queue_push(d1, calcDeltaUs());
+ retro_midi_queue_push(d2, calcDeltaUs());
+ break;
+ default:
+ break;
+ }
+}
+
+void MidiDriver_Libretro::sysEx(const byte *msg, uint16 length) {
+ midiDriverCommonSysEx(msg, length);
+
+ if (!_isOpen)
+ return;
+ if (!outputAvailable())
+ return;
+ if (!msg || length == 0)
+ return;
+
+ // Per MidiDriver_BASE info: SysEx max 268 bytes
+ if (length > 268)
+ length = 268;
+
+ // Send SysEx start
+ retro_midi_queue_push(0xF0, calcDeltaUs());
+
+ // Send SysEx data (excluding F0 start and F7 end)
+ for (uint16 i = 0; i < length; i++) {
+ retro_midi_queue_push(msg[i], calcDeltaUs());
+ }
+
+ // Send SysEx end
+ retro_midi_queue_push(0xF7, calcDeltaUs());
+}
+
+// Plugin interface
+
+class LibretroMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "Libretro MIDI Out";
+ }
+
+ const char *getId() const {
+ return "libretro_midi";
+ }
+
+ MusicDevices getDevices() const;
+ Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
+ bool checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const override;
+};
+
+MusicDevices LibretroMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // Return GM device as default
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+Common::Error LibretroMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
+ *mididriver = new MidiDriver_Libretro();
+
+ return Common::kNoError;
+}
+
+bool LibretroMusicPlugin::checkDevice(MidiDriver::DeviceHandle hdl, int checkFlags, bool quiet) const {
+ if (!retro_midi_interface || !retro_midi_interface->output_enabled()) {
+ if (!quiet)
+ warning("Libretro MIDI: interface not available or output disabled");
+ return false;
+ }
+
+ // Allow auto selection if available
+ if (checkFlags & MDCK_AUTO)
+ return true;
+
+ // For explicit selection, handle should normally be non-zero
+ return hdl != 0;
+}
+
+REGISTER_PLUGIN_STATIC(LIBRETRO_MIDI, PLUGIN_TYPE_MUSIC, LibretroMusicPlugin);
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 7d8d93fc1c1..5bdf09c5691 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -101,6 +101,9 @@ public:
// static/dynamic plugin, like it's done for the engines
LINK_PLUGIN(AUTO)
LINK_PLUGIN(NULL)
+ #if defined(__LIBRETRO__)
+ LINK_PLUGIN(LIBRETRO_MIDI)
+ #else
#if defined(WIN32)
LINK_PLUGIN(WINDOWS)
#endif
@@ -131,6 +134,7 @@ public:
#if defined(MACOSX) || defined(IPHONE) && !defined(IPHONE_TVOS)
LINK_PLUGIN(COREMIDI)
#endif
+ #endif
#ifdef USE_FLUIDSYNTH
LINK_PLUGIN(FLUIDSYNTH)
#endif
Commit: f4ae6f9c4c07f2a8f6cc3e1a4c03d690e85e810d
https://github.com/scummvm/scummvm/commit/f4ae6f9c4c07f2a8f6cc3e1a4c03d690e85e810d
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: add missing retro_log_cb test
Changed paths:
backends/platform/libretro/src/libretro-core.cpp
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 9b0d1e6d2a3..b2932c3a20b 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -904,7 +904,8 @@ void retro_init(void) {
else
retro_log_cb = NULL;
- retro_log_cb(RETRO_LOG_DEBUG, "ScummVM core version: %s\n", __GIT_VERSION);
+ if (retro_log_cb)
+ retro_log_cb(RETRO_LOG_DEBUG, "ScummVM core version: %s\n", __GIT_VERSION);
update_variables();
max_width = gui_width > max_width ? gui_width : max_width;
Commit: ebf098dc1d6a950dd669e27180ba834bf0dba363
https://github.com/scummvm/scummvm/commit/ebf098dc1d6a950dd669e27180ba834bf0dba363
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2026-04-06T14:13:56+02:00
Commit Message:
LIBRETRO: fix wrong placed declarations
Changed paths:
backends/platform/libretro/src/libretro-core.cpp
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index b2932c3a20b..2a59b2a8553 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -106,10 +106,6 @@ static bool updating_variables = false;
#ifdef USE_OPENGL
static struct retro_hw_render_callback hw_render;
-static retro_midi_event_t midi_queue[MIDI_QUEUE_SIZE];
-static volatile uint32 midi_head = 0; /* producer writes */
-static volatile uint32 midi_tail = 0; /* consumer writes */
-
static void context_reset(void) {
retro_log_cb(RETRO_LOG_DEBUG, "HW context reset\n");
if (retro_emu_thread_started())
@@ -139,6 +135,10 @@ static void retro_gui_res_reset() {
}
#endif
+static retro_midi_event_t midi_queue[MIDI_QUEUE_SIZE];
+static volatile uint32 midi_head = 0; /* producer writes */
+static volatile uint32 midi_tail = 0; /* consumer writes */
+
static void setup_hw_rendering(void) {
enum retro_pixel_format pixel_fmt;
More information about the Scummvm-git-logs
mailing list