-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (C) 2021-2024 Shanti Gilbert (https://github.com/shantigilbert) | ||
# Copyright (C) 2024 ROCKNIX (https://github.com/ROCKNIX) | ||
|
||
PKG_NAME="retrorun" | ||
PKG_VERSION="95ac0bf3a921beefee8b3bbf2faf89eef18f9b3a" | ||
PKG_LICENSE="GPLv2" | ||
PKG_SITE="https://github.com/navy1978/retrorun" | ||
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.zip" | ||
PKG_DEPENDS_TARGET="toolchain librga libdrm" | ||
PKG_TOOLCHAIN="make" | ||
|
||
pre_configure_target() { | ||
PKG_MAKE_OPTS_TARGET=" config=release ARCH=" | ||
} | ||
|
||
makeinstall_target() { | ||
mkdir -p $INSTALL/usr/bin | ||
cp retrorun $INSTALL/usr/bin | ||
} |
62 changes: 62 additions & 0 deletions
62
packages/emulators/libretro/retrorun/patches/001-fix-joystick-discovery.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- retrorun-95ac0bf3a921beefee8b3bbf2faf89eef18f9b3a/src/go2/input.cpp.orig 2024-04-11 22:22:16.000000000 +0000 | ||
+++ retrorun-95ac0bf3a921beefee8b3bbf2faf89eef18f9b3a/src/go2/input.cpp 2024-11-25 20:43:30.141283197 +0000 | ||
@@ -34,16 +34,15 @@ | ||
#include <dirent.h> | ||
#include <stdbool.h> | ||
#include <pthread.h> | ||
+#include <glob.h> | ||
|
||
-#include <libevdev-1.0/libevdev/libevdev.h> | ||
+#include <libevdev/libevdev.h> | ||
#include <linux/limits.h> | ||
|
||
#define BATTERY_BUFFER_SIZE (128) | ||
#define BRIGHTNESS_BUFFER_SIZE (128) | ||
// joypad | ||
-static const char *EVDEV_NAME = "/dev/input/by-path/platform-odroidgo2-joypad-event-joystick"; | ||
-static const char *EVDEV_NAME_2 = "/dev/input/by-path/platform-odroidgo3-joypad-event-joystick"; | ||
-static const char* EVDEV_NAME_3 = "/dev/input/by-path/platform-singleadc-joypad-event-joystick"; | ||
+static const char *EVDEV_WILDCARD = "/dev/input/by-path/platform-*-joypad-event-joystick"; | ||
// battery | ||
static const char *BATTERY_STATUS_NAME = "/sys/class/power_supply/battery/status"; | ||
static const char *BATTERY_CAPACITY_NAME = "/sys/class/power_supply/battery/capacity"; | ||
@@ -431,6 +430,7 @@ | ||
{ | ||
|
||
int rc = 1; | ||
+ glob_t globbuf; | ||
|
||
go2_input_t *result = (go2_input_t *)malloc(sizeof(*result)); | ||
if (!result) | ||
@@ -443,18 +443,12 @@ | ||
|
||
result->device = device; | ||
|
||
- result->fd = open(EVDEV_NAME, O_RDONLY); | ||
- if (result->fd < 0) | ||
- { | ||
- if (isRG503()){ | ||
- result->fd = open(EVDEV_NAME_3, O_RDONLY); | ||
- }else{ | ||
- result->fd = open(EVDEV_NAME_2, O_RDONLY); | ||
- } | ||
- if (result->fd < 0) | ||
- { | ||
- printf("Joystick: No gamepad found.\n"); | ||
- } | ||
+ rc = glob(EVDEV_WILDCARD, 0, NULL, &globbuf); | ||
+ if (rc != 0) { | ||
+ printf("Joystick: Failed to find device %s %d\n", EVDEV_WILDCARD, rc); | ||
+ result->fd = -1; | ||
+ } else { | ||
+ result->fd = open(*globbuf.gl_pathv, O_RDONLY); | ||
} | ||
|
||
if (result->fd > -1) | ||
@@ -663,4 +657,4 @@ | ||
go2_thumb_t go2_input_state_thumbstick_get(go2_input_state_t *state, go2_input_thumbstick_t thumbstick) | ||
{ | ||
return state->thumbs[thumbstick]; | ||
-} | ||
\ No newline at end of file | ||
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters