From fc59c1e152591ed782e9a806d81d28dabe505707 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Wed, 29 Jan 2025 21:16:28 +0100 Subject: [PATCH 1/2] feat: add dolphin-rpi --- Config.in | 1 + configs/recalbox-rpi5_64_defconfig | 1 + .../dolphin-rpi/0001-change-name-rpi.patch | 51 +++++++++++++++++++ .../dolphin-rpi/0002-change-name-nogui.patch | 11 ++++ package/dolphin-rpi/Config.in | 25 +++++++++ package/dolphin-rpi/dolphin-rpi.mk | 24 +++++++++ package/libcubeb/Config.in | 5 ++ package/libcubeb/libcubeb.mk | 16 ++++++ .../systems/gamecube/system.ini | 14 +++++ .../configgen/configgen/emulatorlauncher.py | 4 ++ .../generators/dolphin/dolphinGenerator.py | 8 ++- projects/configgen/configgen/recalboxFiles.py | 1 + .../tests/generators/dolphinGenerator_test.py | 4 +- 13 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 package/dolphin-rpi/0001-change-name-rpi.patch create mode 100644 package/dolphin-rpi/0002-change-name-nogui.patch create mode 100644 package/dolphin-rpi/Config.in create mode 100644 package/dolphin-rpi/dolphin-rpi.mk create mode 100644 package/libcubeb/Config.in create mode 100644 package/libcubeb/libcubeb.mk diff --git a/Config.in b/Config.in index 5189d608e4..56d657bdd0 100644 --- a/Config.in +++ b/Config.in @@ -139,6 +139,7 @@ menu "Emulators" source "$BR2_EXTERNAL_RECALBOX_PATH/package/amiberry/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/amiberry33/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/dolphin-emu/Config.in" + source "$BR2_EXTERNAL_RECALBOX_PATH/package/dolphin-rpi/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/dosbox/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/gsplus/Config.in" source "$BR2_EXTERNAL_RECALBOX_PATH/package/hypseus/Config.in" diff --git a/configs/recalbox-rpi5_64_defconfig b/configs/recalbox-rpi5_64_defconfig index d71761c904..861a57adeb 100644 --- a/configs/recalbox-rpi5_64_defconfig +++ b/configs/recalbox-rpi5_64_defconfig @@ -365,3 +365,4 @@ BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="$(BR2_EXTERNAL_RECALBOX_PATH)/board/recal BR2_PACKAGE_XPADNEO=y BR2_PACKAGE_VVVVVV=y BR2_PACKAGE_LIBRETRO_TAMALIBRETRO=y +BR2_PACKAGE_DOLPHIN_RPI=y diff --git a/package/dolphin-rpi/0001-change-name-rpi.patch b/package/dolphin-rpi/0001-change-name-rpi.patch new file mode 100644 index 0000000000..1e3f312731 --- /dev/null +++ b/package/dolphin-rpi/0001-change-name-rpi.patch @@ -0,0 +1,51 @@ +--- a/CMakeLists.txt 2025-01-24 00:37:23.000000000 +0100 ++++ b/CMakeLists.txt 2025-01-29 21:00:22.775509884 +0100 +@@ -9,7 +9,7 @@ + # features can be used, not the minimum required version to run. + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE string "") + +-project(dolphin-emu) ++project(dolphin-rpi) + option(USE_EGL "Enables EGL OpenGL Interface" OFF) + option(TRY_X11 "Enables X11 Support" ON) + option(USE_SHARED_ENET "Use shared libenet if found rather than Dolphin's soon-to-compatibly-diverge version" OFF) +@@ -86,10 +86,10 @@ + # Set up paths + set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir") + if(HAIKU) +- set(datadir ${CMAKE_INSTALL_PREFIX}/data/dolphin-emu CACHE PATH "datadir") ++ set(datadir ${CMAKE_INSTALL_PREFIX}/data/dolphin-rpi CACHE PATH "datadir") + set(mandir ${CMAKE_INSTALL_PREFIX}/documentation/man CACHE PATH "mandir") + else() +- set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir") ++ set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-rpi CACHE PATH "datadir") + set(mandir ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "mandir") + endif() + add_definitions(-DDATA_DIR="${datadir}/") +@@ -837,20 +837,20 @@ + if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD") + # Install the application icon and menu item + install(FILES Data/dolphin-emu.svg +- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps) ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/dolphin-rpi.svg) + install(FILES Data/dolphin-emu.png +- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps) ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps/dolphin-rpi.png) + install(FILES Data/dolphin-emu.desktop +- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/dolphin-rpi.desktop) + # Install manpages + install(FILES Data/dolphin-emu.6 +- DESTINATION ${mandir}/man6) ++ DESTINATION ${mandir}/man6/dolphin-rpi.6) + install(FILES Data/dolphin-emu-nogui.6 +- DESTINATION ${mandir}/man6) ++ DESTINATION ${mandir}/man6/dolphin-rpi-nogui.6) + endif() + + # packaging information +-set(CPACK_PACKAGE_NAME "dolphin-emu") ++set(CPACK_PACKAGE_NAME "dolphin-rpi") + set(CPACK_PACKAGE_VENDOR "Dolphin Team") + set(CPACK_PACKAGE_VERSION_MAJOR ${DOLPHIN_VERSION_MAJOR}) + set(CPACK_PACKAGE_VERSION_MINOR ${DOLPHIN_VERSION_MINOR}) diff --git a/package/dolphin-rpi/0002-change-name-nogui.patch b/package/dolphin-rpi/0002-change-name-nogui.patch new file mode 100644 index 0000000000..610107e375 --- /dev/null +++ b/package/dolphin-rpi/0002-change-name-nogui.patch @@ -0,0 +1,11 @@ +--- a/Source/Core/DolphinNoGUI/CMakeLists.txt 2025-01-29 21:01:21.530982918 +0100 ++++ b/Source/Core/DolphinNoGUI/CMakeLists.txt 2025-01-29 21:01:38.522830544 +0100 +@@ -5,7 +5,7 @@ + set(NOGUI_SRCS MainNoGUI.cpp) + + add_executable(dolphin-nogui ${NOGUI_SRCS}) +-set_target_properties(dolphin-nogui PROPERTIES OUTPUT_NAME dolphin-emu-nogui) ++set_target_properties(dolphin-nogui PROPERTIES OUTPUT_NAME dolphin-rpi-nogui) + + target_link_libraries(dolphin-nogui PRIVATE + core diff --git a/package/dolphin-rpi/Config.in b/package/dolphin-rpi/Config.in new file mode 100644 index 0000000000..349a9992a2 --- /dev/null +++ b/package/dolphin-rpi/Config.in @@ -0,0 +1,25 @@ +config BR2_PACKAGE_DOLPHIN_RPI + bool "dolphin-rpi" + depends on BR2_x86_64 || BR2_aarch64 + select BR2_PACKAGE_LIBEVDEV + select BR2_PACKAGE_FFMPEG + select BR2_PACKAGE_ZLIB + select BR2_PACKAGE_LIBPNG + select BR2_PACKAGE_LZO + select BR2_PACKAGE_LIBUSB + select BR2_PACKAGE_LIBCURL + select BR2_PACKAGE_BLUEZ5_UTILS + select BR2_PACKAGE_CAIRO_SCRIPT + select BR2_PACKAGE_CAIRO + select BR2_PACKAGE_HIDAPI + select BR2_PACKAGE_LIBCUBEB + select BR2_PACKAGE_XORG7 if (BR2_PACKAGE_RECALBOX_VIDEO_XORG_SERVER || BR2_PACKAGE_RECALBOX_VIDEO_XWAYLAND) + select BR2_PACKAGE_XLIB_LIBXI if (BR2_PACKAGE_RECALBOX_VIDEO_XORG_SERVER || BR2_PACKAGE_RECALBOX_VIDEO_XWAYLAND) + select BR2_PACKAGE_HICOLOR_ICON_THEME if BR2_PACKAGE_XORG7 + select BR2_PACKAGE_SFML if BR2_PACKAGE_XORG7 + help + A Nintendo GameCube/Wii emulator. + https://github.com/dolphin-emu/dolphin + +comment "Dolphin needs x86_64, XORG7 or aarch64" + depends on (!BR2_x86_64 || !BR2_PACKAGE_XORG7) && !BR2_aarch64 diff --git a/package/dolphin-rpi/dolphin-rpi.mk b/package/dolphin-rpi/dolphin-rpi.mk new file mode 100644 index 0000000000..f6036e9708 --- /dev/null +++ b/package/dolphin-rpi/dolphin-rpi.mk @@ -0,0 +1,24 @@ +################################################################################ +# +# DOLPHIN_RPI +# +################################################################################ + +# Commit of 2025/11/28 +DOLPHIN_RPI_SITE = https://github.com/gvx64/dolphin-rpi.git +DOLPHIN_RPI_VERSION = b56b3b4d007b47f1a136741c1b779c75e7e78ec9 +DOLPHIN_RPI_LICENSE = GPL-2.0+ +DOLPHIN_RPI_LICENSE_FILES = license.txt +DOLPHIN_RPI_DEPENDENCIES = libevdev ffmpeg zlib libpng lzo libusb libcurl bluez5_utils hidapi xz host-xz zstd enet sfml libcubeb libegl +DOLPHIN_RPI_SUPPORTS_IN_SOURCE_BUILD = NO +DOLPHIN_RPI_SITE_METHOD = git +DOLPHIN_RPI_GIT_SUBMODULES = NO + +DOLPHIN_RPI_CONF_OPTS += -DDISTRIBUTOR='Recalbox' +DOLPHIN_RPI_CONF_OPTS += -DENABLE_HEADLESS=ON +DOLPHIN_RPI_CONF_OPTS += -DENABLE_PULSEAUDIO=ON +DOLPHIN_RPI_CONF_OPTS += -DENABLE_ANALYTICS=OFF +DOLPHIN_RPI_CONF_OPTS += -DTRY_X11=ON +DOLPHIN_RPI_CONF_OPTS += -DUSE_EGL=ON + +$(eval $(cmake-package)) diff --git a/package/libcubeb/Config.in b/package/libcubeb/Config.in new file mode 100644 index 0000000000..a20218b3e8 --- /dev/null +++ b/package/libcubeb/Config.in @@ -0,0 +1,5 @@ +config BR2_PACKAGE_LIBCUBEB + bool "libcubeb" + help + Cross platform audio library + https://github.com/mozilla/cubeb diff --git a/package/libcubeb/libcubeb.mk b/package/libcubeb/libcubeb.mk new file mode 100644 index 0000000000..7c4b153764 --- /dev/null +++ b/package/libcubeb/libcubeb.mk @@ -0,0 +1,16 @@ +################################################################################ +# +# LIBCUBEB +# +################################################################################ + +# Commit of 2025/10/03 +LIBCUBEB_SITE = https://github.com/mozilla/cubeb.git +LIBCUBEB_VERSION = 9a9d034c51859a045a34f201334f612c51e6c19d +LIBCUBEB_LICENSE = ISC +LIBCUBEB_LICENSE_FILES = LICENSE +LIBCUBEB_SUPPORTS_IN_SOURCE_BUILD = NO +LIBCUBEB_SITE_METHOD = git +LIBCUBEB_GIT_SUBMODULES = NO + +$(eval $(cmake-package)) diff --git a/package/recalbox-romfs2/systems/gamecube/system.ini b/package/recalbox-romfs2/systems/gamecube/system.ini index 08ed459fef..f162acc250 100644 --- a/package/recalbox-romfs2/systems/gamecube/system.ini +++ b/package/recalbox-romfs2/systems/gamecube/system.ini @@ -64,3 +64,17 @@ netplay = 0 softpatching = 0 compatibility = good speed = good + +[core.2] +package = BR2_PACKAGE_DOLPHIN_EMU +priority = 3 +emulator = "dolphin" +core = "dolphin-rpi" +extensions = ".ciso .gc .gcm .gcz .iso .m3u .rvz .wia" +netplay = 0 +softpatching = 0 +compatibility = good +speed = good +speed.rpi4_64 = low +video.backend.rpi4_64 = wayland +video.backend.rpi5_64 = wayland diff --git a/projects/configgen/configgen/emulatorlauncher.py b/projects/configgen/configgen/emulatorlauncher.py index 5d234092d5..6ee623b1d8 100644 --- a/projects/configgen/configgen/emulatorlauncher.py +++ b/projects/configgen/configgen/emulatorlauncher.py @@ -25,6 +25,10 @@ def getGenerator(emulator): module = __import__("configgen.generators.dolphin.dolphinGenerator", fromlist=["DolphinGenerator"]) generatorClass = getattr(module, "DolphinGenerator") return generatorClass() + elif emulator == "dolphin-rpi": + module = __import__("configgen.generators.dolphin.dolphinGenerator", fromlist=["DolphinGenerator"]) + generatorClass = getattr(module, "DolphinGenerator") + return generatorClass() elif emulator == "ppsspp": module = __import__("configgen.generators.ppsspp.ppssppGenerator", fromlist=["PPSSPPGenerator"]) generatorClass = getattr(module, "PPSSPPGenerator") diff --git a/projects/configgen/configgen/generators/dolphin/dolphinGenerator.py b/projects/configgen/configgen/generators/dolphin/dolphinGenerator.py index 13f79067f6..5628b0d880 100644 --- a/projects/configgen/configgen/generators/dolphin/dolphinGenerator.py +++ b/projects/configgen/configgen/generators/dolphin/dolphinGenerator.py @@ -5,6 +5,7 @@ from configgen.Emulator import Emulator from configgen.controllers.controller import ControllerPerPlayer from configgen.generators.Generator import Generator from configgen.settings.keyValueSettings import keyValueSettings +from configgen.utils.Vulkan import Vulkan class DolphinGenerator(Generator): @@ -256,7 +257,12 @@ class DolphinGenerator(Generator): self.mainConfiguration(system, args) self.gfxConfiguration(system) - commandArray = [recalboxFiles.recalboxBins[system.Emulator], "-e", args.rom] + if Vulkan.vulkanAvailable(): + video_driver = "Vulkan" + else: + video_driver = "OGL" + + commandArray = [recalboxFiles.recalboxBins[system.Core], "-v", video_driver, "-e", args.rom] if system.HasArgs: commandArray.extend(system.Args) return Command(videomode=system.VideoMode, array=commandArray, env={"XDG_CONFIG_HOME":recalboxFiles.CONF, "XDG_DATA_HOME":recalboxFiles.SAVES}) diff --git a/projects/configgen/configgen/recalboxFiles.py b/projects/configgen/configgen/recalboxFiles.py index d15e979094..63d95513f5 100644 --- a/projects/configgen/configgen/recalboxFiles.py +++ b/projects/configgen/configgen/recalboxFiles.py @@ -28,6 +28,7 @@ recalboxBins =\ 'beebem' : '/usr/bin/Beebem', 'daphne' : '/usr/bin/hypseus', 'dolphin' : '/usr/bin/dolphin-emu-nogui', + 'dolphin-rpi' : '/usr/bin/dolphin-rpi-nogui', 'dosbox' : '/usr/bin/dosbox', 'duckstation' : '/usr/bin/duckstation', 'fba2x' : '/usr/bin/fba2x', diff --git a/projects/configgen/tests/generators/dolphinGenerator_test.py b/projects/configgen/tests/generators/dolphinGenerator_test.py index b60574fd3f..ed1a8733ff 100644 --- a/projects/configgen/tests/generators/dolphinGenerator_test.py +++ b/projects/configgen/tests/generators/dolphinGenerator_test.py @@ -38,7 +38,7 @@ def test_simple_generate_wii(emulator, system_wii, mocker, controller_configurat mocker.patch("configgen.generators.dolphin.dolphinControllers.EvdevGetJoystickName", return_value="Sony PLAYSTATION(R)3 Controller") command = emulator.generate(system_wii, controller_configuration, keyValueSettings("", False), Arguments('path/to/test')) assert command.videomode == '1920x1080' - assert command.array == ['/usr/bin/dolphin-emu-nogui', '-e', 'path/to/test'] + assert command.array == ['/usr/bin/dolphin-emu-nogui', '-v', 'OGL', '-e', 'path/to/test'] @pytest.mark.usefixtures("controller_configuration") @@ -46,4 +46,4 @@ def test_simple_generate_gamecube(emulator, system_gamecube, mocker, controller_ mocker.patch("configgen.generators.dolphin.dolphinControllers.EvdevGetJoystickName", return_value="Sony PLAYSTATION(R)3 Controller") command = emulator.generate(system_gamecube, controller_configuration, keyValueSettings("", False), Arguments('path/to/test')) assert command.videomode == '1920x1080' - assert command.array == ['/usr/bin/dolphin-emu-nogui', '-e', 'path/to/test'] + assert command.array == ['/usr/bin/dolphin-emu-nogui', '-v', 'OGL', '-e', 'path/to/test'] -- GitLab From 50db78d11933b8a3ba50dc0d712801ffc4004551 Mon Sep 17 00:00:00 2001 From: Adrien Beudin Date: Sun, 16 Mar 2025 21:15:11 +0100 Subject: [PATCH 2/2] fix add libftm --- package/dolphin-rpi/dolphin-rpi.mk | 6 ++++-- package/libftm/libftm.mk | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 package/libftm/libftm.mk diff --git a/package/dolphin-rpi/dolphin-rpi.mk b/package/dolphin-rpi/dolphin-rpi.mk index f6036e9708..aa6edb11b0 100644 --- a/package/dolphin-rpi/dolphin-rpi.mk +++ b/package/dolphin-rpi/dolphin-rpi.mk @@ -9,10 +9,10 @@ DOLPHIN_RPI_SITE = https://github.com/gvx64/dolphin-rpi.git DOLPHIN_RPI_VERSION = b56b3b4d007b47f1a136741c1b779c75e7e78ec9 DOLPHIN_RPI_LICENSE = GPL-2.0+ DOLPHIN_RPI_LICENSE_FILES = license.txt -DOLPHIN_RPI_DEPENDENCIES = libevdev ffmpeg zlib libpng lzo libusb libcurl bluez5_utils hidapi xz host-xz zstd enet sfml libcubeb libegl +DOLPHIN_RPI_DEPENDENCIES = libevdev ffmpeg zlib libpng lzo libusb libcurl bluez5_utils hidapi xz host-xz zstd enet sfml libcubeb libegl libftm minizip DOLPHIN_RPI_SUPPORTS_IN_SOURCE_BUILD = NO DOLPHIN_RPI_SITE_METHOD = git -DOLPHIN_RPI_GIT_SUBMODULES = NO +DOLPHIN_RPI_GIT_SUBMODULES = YES DOLPHIN_RPI_CONF_OPTS += -DDISTRIBUTOR='Recalbox' DOLPHIN_RPI_CONF_OPTS += -DENABLE_HEADLESS=ON @@ -20,5 +20,7 @@ DOLPHIN_RPI_CONF_OPTS += -DENABLE_PULSEAUDIO=ON DOLPHIN_RPI_CONF_OPTS += -DENABLE_ANALYTICS=OFF DOLPHIN_RPI_CONF_OPTS += -DTRY_X11=ON DOLPHIN_RPI_CONF_OPTS += -DUSE_EGL=ON +#DOLPHIN_RPI_CONF_OPTS += -DCMAKE_C_COMPILER=gcc-11 +#DOLPHIN_RPI_CONF_OPTS += -DCMAKE_CXX_COMPILER=g++-11 $(eval $(cmake-package)) diff --git a/package/libftm/libftm.mk b/package/libftm/libftm.mk new file mode 100644 index 0000000000..8c883481f1 --- /dev/null +++ b/package/libftm/libftm.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# LIBFTM +# +################################################################################ + +# Commit of 2025/11/28 +LIBFTM_SITE = https://github.com/fmtlib/fmt.git +LIBFTM_VERSION = 123913715afeb8a437e6388b4473fcc4753e1c9a +LIBFTM_LICENSE = +LIBFTM_LICENSE_FILES = LICENSE +LIBFTM_DEPENDENCIES = +LIBFTM_SITE_METHOD = git +LIBFTM_GIT_SUBMODULES = NO + +LIBFTM_INSTALL_STAGING = YES + +$(eval $(cmake-package)) -- GitLab