From 619458b482b4191007346b841b2c8cfb62a28361 Mon Sep 17 00:00:00 2001 From: Bkg2k Date: Wed, 23 Dec 2020 12:36:56 +0100 Subject: [PATCH] chore(project-cd): add launch_cdrom and udev rules --- CHANGELOG.md | 1 + RELEASE-NOTES.md | 2 ++ .../udev/rules.d/99-cdrom_autolaunch.rules | 2 ++ .../x86/fsoverlay/usr/bin/launch_cdrom | 29 +++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 board/recalbox/fsoverlay/etc/udev/rules.d/99-cdrom_autolaunch.rules create mode 100755 board/recalbox/x86/fsoverlay/usr/bin/launch_cdrom diff --git a/CHANGELOG.md b/CHANGELOG.md index e5f627de40..2b222d0fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -947,6 +947,7 @@ All notable changes to this project have been documented in this file since 8.1. - Bump FBNeo - Fix videosnaps on x64 gpus - Bump Retroarch +- Improved retroarch support cd ## [6.1] - Replacement of the neogeo intro video diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7ee62a4f8c..3f039e40e8 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1082,6 +1082,8 @@ as release notes for end user on a Recalbox upgrade. - Bump FBNeo to include latest fixes - Bump Retroarch to 1.8.1 to include latest fixes & optimizations - Bump Doplhin-emu on 5.0-11288 add automatic configuration and netplay compatibility +- Improved retroarch support cd + ### Fixes - Fix Reicast on XU4 and PC platforms and fix wrong flycast entry on Rpi diff --git a/board/recalbox/fsoverlay/etc/udev/rules.d/99-cdrom_autolaunch.rules b/board/recalbox/fsoverlay/etc/udev/rules.d/99-cdrom_autolaunch.rules new file mode 100644 index 0000000000..ddb6850383 --- /dev/null +++ b/board/recalbox/fsoverlay/etc/udev/rules.d/99-cdrom_autolaunch.rules @@ -0,0 +1,2 @@ +KERNEL=="sr[0-9]*", DRIVERS=="sr", SUBSYSTEM=="block", ACTION=="change", ENV{ID_FS_TYPE}=="iso9660", RUN+="/bin/sh -c '/usr/bin/launch_cdrom'" +KERNEL=="sr[0-9]*", DRIVERS=="sr", SUBSYSTEM=="block", ACTION=="change", ENV{DISK_EJECT_REQUEST}=="1", RUN+="/bin/rm -f /tmp/cd.conf" \ No newline at end of file diff --git a/board/recalbox/x86/fsoverlay/usr/bin/launch_cdrom b/board/recalbox/x86/fsoverlay/usr/bin/launch_cdrom new file mode 100755 index 0000000000..83aaf06e1d --- /dev/null +++ b/board/recalbox/x86/fsoverlay/usr/bin/launch_cdrom @@ -0,0 +1,29 @@ +#!/bin/bash + +mount -o remount, rw / + +cdRomLecteur=$(ls /dev/cdrom) ## detect if cdromLecteur exist +hexDumpCdrom=$(hexdump -C /dev/cdrom |head -n 10) ## scan cdrom for identification + +playstationGame=($(echo "${hexDumpCdrom}" | grep "Sony")) +dreamcastGame=($(echo "${hexDumpCdrom}" |grep "SEGA SEGAKATANA")) +saturnGame=($(echo "${hexDumpCdrom}" |grep "SEGA SEGASATURN")) +segaCdGame=($(echo "${hexDumpCdrom}" | grep "SEGA MEGADRIVE")) +panasonicGame=($(echo "${hexDumpCdrom}" | grep "The 3DO")) +pcengineCdGame=($(echo "${hexDumpCdrom}" | grep "PCE")) + +if [ "$cdRomLecteur" ] ; then ## detect platform + if [ "$playstationGame" ]; then + echo "system = psx" >> /tmp/cd.conf + elif [ "$dreamcastGame" ]; then + echo "system = dreamcast" >> /tmp/cd.conf + elif [ "$saturnGame" ]; then + echo "system = saturn" >> /tmp/cd.conf + elif [ "$segaCdGame" ]; then + echo "system = segacd" >> /tmp/cd.conf + elif [ "$panasonicGame" ]; then + echo "system = 3do" >> /tmp/cd.conf + elif [ "$pcengineCdGame" ]; then + echo "system = pcenginecd" >> /tmp/cd.conf + fi +fi \ No newline at end of file -- GitLab