diff options
Diffstat (limited to 'emulators/Ymir')
13 files changed, 319 insertions, 0 deletions
diff --git a/emulators/Ymir/Makefile b/emulators/Ymir/Makefile new file mode 100644 index 000000000000..b6cfa0301e45 --- /dev/null +++ b/emulators/Ymir/Makefile @@ -0,0 +1,93 @@ +PORTNAME= Ymir +DISTVERSIONPREFIX= v +DISTVERSION= 0.1.7 +CATEGORIES= emulators + +MAINTAINER= bsdcode@disroot.org +COMMENT= Sega Saturn emulator +WWW= https://github.com/StrikerX3/Ymir/ + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +ONLY_FOR_ARCHS= aarch64 amd64 +ONLY_FOR_ARCHS_REASON= upstream only supports aarch64 and amd64 + +BUILD_DEPENDS= cereal>0:devel/cereal \ + concurrentqueue>0:devel/concurrentqueue \ + cxxopts>0:devel/cxxopts \ + glslangValidator:graphics/glslang \ + glslc:graphics/shaderc \ + stb>0:devel/stb \ + tomlplusplus>0:devel/tomlplusplus \ + vulkan-headers>0:graphics/vulkan-headers +LIB_DEPENDS= libchdr.so:devel/libchdr \ + libfmt.so:devel/libfmt \ + libglfw.so:graphics/glfw \ + libimgui.so:x11-toolkits/imgui \ + liblz4.so:archivers/liblz4 \ + librtmidi.so:audio/rtmidi \ + libvulkan.so:graphics/vulkan-loader \ + libxxhash.so:devel/xxhash + +FLAVORS= gtk3 gtk4 +FLAVOR?= ${FLAVORS:[1]} +gtk4_PKGNAMESUFFIX= -gtk4 +_gtk3_BR_DEPENDS= zenity:x11/zenity +_gtk4_BR_DEPENDS= zenity:x11/zenity4 +${FLAVOR}_BUILD_DEPENDS= ${_${FLAVOR}_BR_DEPENDS} +${FLAVOR}_RUN_DEPENDS= ${_${FLAVOR}_BR_DEPENDS} + +USES= cmake compiler:c++20-lang desktop-file-utils gl \ + llvm${_LLVM_${ARCH}} pkgconfig sdl xorg +_LLVM_aarch64= :min=21 +USE_GITHUB= yes +GH_ACCOUNT= StrikerX3 +GH_TUPLE= StrikerX3:mio:c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa:mio/vendor/mio +USE_GL= glut +USE_SDL= sdl3 +USE_XORG= xi xmu + +CMAKE_OFF= Ymir_DEV_BUILD \ + Ymir_ENABLE_IMGUI_DEMO \ + Ymir_ENABLE_SANDBOX \ + Ymir_ENABLE_TESTS \ + Ymir_INCLUDE_PACKAGING \ + Ymir_SHARED_LIBS + +CFLAGS+= -I${LOCALBASE}/include/concurrentqueue/moodycamel \ + -I${LOCALBASE}/include/stb \ + -I${WRKSRC}/vendor/imgui/ymir + +PLIST_FILES= bin/ymir-sdl3 \ + share/applications/io.github.strikerx3.ymir.desktop \ + share/icons/hicolor/256x256/apps/ymir.png \ + share/metainfo/io.github.strikerx3.ymir.xml + +OPTIONS_DEFINE= LTO YMDASM +OPTIONS_DEFAULT= LTO + +YMDASM_DESC= Include Ymir disassembly tool + +LTO_CMAKE_BOOL= Ymir_ENABLE_IPO + +YMDASM_CMAKE_BOOL= Ymir_ENABLE_YMDASM +YMDASM_PLIST_FILES= bin/ymdasm + +post-install: + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/apps/ymir-sdl3/ymir-sdl3-${DISTVERSION} \ + ${STAGEDIR}${PREFIX}/bin/ymir-sdl3 + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/io.github.strikerx3.ymir.desktop \ + ${STAGEDIR}${DESKTOPDIR} + ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps \ + ${STAGEDIR}${PREFIX}/share/metainfo + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/ymir.png \ + ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps + ${INSTALL_DATA} ${WRKSRC}/apps/ymir-sdl3/res/io.github.strikerx3.ymir.xml \ + ${STAGEDIR}${PREFIX}/share/metainfo + +post-install-YMDASM-on: + ${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/apps/ymdasm/ymdasm-${DISTVERSION} \ + ${STAGEDIR}${PREFIX}/bin/ymdasm + +.include <bsd.port.mk> diff --git a/emulators/Ymir/distinfo b/emulators/Ymir/distinfo new file mode 100644 index 000000000000..78b5b3eb2cee --- /dev/null +++ b/emulators/Ymir/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1754870707 +SHA256 (StrikerX3-Ymir-v0.1.7_GH0.tar.gz) = 8453407de50a4abef05c985f4eabf32b5185bf5a651583d250f820ff60bae93a +SIZE (StrikerX3-Ymir-v0.1.7_GH0.tar.gz) = 5431708 +SHA256 (StrikerX3-mio-c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa_GH0.tar.gz) = 384d3a3ee249ebda0766fa5dc9f8bc5a871c8b2e3d3eedf46f330e6350058738 +SIZE (StrikerX3-mio-c9dbe3a6f74b2c2c4a6c9621005c3df213a33eaa_GH0.tar.gz) = 34871 diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt b/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt new file mode 100644 index 000000000000..e18e7f768ee3 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_CMakeLists.txt @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/CMakeLists.txt +@@ -256,7 +256,7 @@ target_link_libraries(ymir-sdl3 PRIVATE + fmt + cxxopts + imgui::imgui +- tomlplusplus::tomlplusplus ++# tomlplusplus::tomlplusplus + cereal::cereal + lz4::lz4 + stb::stb diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp new file mode 100644 index 000000000000..fc08ed1ec905 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_app.cpp @@ -0,0 +1,13 @@ +--- apps/ymir-sdl3/src/app/app.cpp.orig 2025-08-11 00:12:19 UTC ++++ apps/ymir-sdl3/src/app/app.cpp +@@ -114,8 +114,8 @@ + #include <SDL3/SDL_messagebox.h> + #include <SDL3/SDL_misc.h> + +-#include <backends/imgui_impl_sdl3.h> +-#include <backends/imgui_impl_sdlrenderer3.h> ++#include <imgui_impl_sdl3.h> ++#include <imgui_impl_sdlrenderer3.h> + + #include <imgui.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp new file mode 100644 index 000000000000..1111d91b86b1 --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_cartridge__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/cartridge_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/cartridge_settings_view.cpp +@@ -13,7 +13,7 @@ + #include <util/file_loader.hpp> + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <fmt/std.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp new file mode 100644 index 000000000000..1c363ec3b61f --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_general__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/general_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/general_settings_view.cpp +@@ -5,7 +5,7 @@ + + #include <app/ui/widgets/common_widgets.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <util/math.hpp> + #include <util/sdl_file_dialog.hpp> diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp new file mode 100644 index 000000000000..b54026493c5c --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_ipl__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/ipl_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/ipl_settings_view.cpp +@@ -4,7 +4,7 @@ + + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <SDL3/SDL_misc.h> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp new file mode 100644 index 000000000000..dfde2460d6de --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_system__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/system_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/system_settings_view.cpp +@@ -11,7 +11,7 @@ + #include <util/regions.hpp> + #include <util/sdl_file_dialog.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <ymir/util/size_ops.hpp> + diff --git a/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp new file mode 100644 index 000000000000..65fa660f361e --- /dev/null +++ b/emulators/Ymir/files/patch-apps_ymir-sdl3_src_app_ui_views_settings_tweaks__settings__view.cpp @@ -0,0 +1,11 @@ +--- apps/ymir-sdl3/src/app/ui/views/settings/tweaks_settings_view.cpp.orig 2025-07-20 22:35:27 UTC ++++ apps/ymir-sdl3/src/app/ui/views/settings/tweaks_settings_view.cpp +@@ -4,7 +4,7 @@ + + #include <app/events/emu_event_factory.hpp> + +-#include <misc/cpp/imgui_stdlib.h> ++#include <imgui_stdlib.h> + + #include <SDL3/SDL_clipboard.h> + diff --git a/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt b/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt new file mode 100644 index 000000000000..2c971a407b7a --- /dev/null +++ b/emulators/Ymir/files/patch-libs_ymir-core_CMakeLists.txt @@ -0,0 +1,13 @@ +--- libs/ymir-core/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ libs/ymir-core/CMakeLists.txt +@@ -239,7 +239,10 @@ target_compile_features(ymir-core PUBLIC cxx_std_20) + target_compile_features(ymir-core PUBLIC cxx_std_20) + + ## Add dependencies ++find_package(Threads REQUIRED) ++ + target_link_libraries(ymir-core PUBLIC ++ Threads::Threads + fmt + mio + concurrentqueue diff --git a/emulators/Ymir/files/patch-vendor_CMakeLists.txt b/emulators/Ymir/files/patch-vendor_CMakeLists.txt new file mode 100644 index 000000000000..c6c095066435 --- /dev/null +++ b/emulators/Ymir/files/patch-vendor_CMakeLists.txt @@ -0,0 +1,100 @@ +--- vendor/CMakeLists.txt.orig 2025-07-20 22:35:27 UTC ++++ vendor/CMakeLists.txt +@@ -22,9 +22,12 @@ message(STATUS "Adding vendored libraries") + + message(STATUS "Adding vendored libraries") + ++find_package(PkgConfig REQUIRED) ++ + # {fmt} - https://github.com/fmtlib/fmt + message(STATUS "==> {fmt}") +-add_subdirectory(fmt EXCLUDE_FROM_ALL) ++pkg_check_modules(fmt REQUIRED IMPORTED_TARGET GLOBAL fmt) ++add_library(fmt ALIAS PkgConfig::fmt) + + # mio - https://github.com/vimpunk/mio + # Notes: +@@ -36,65 +39,55 @@ message(STATUS "==> SDL") + + # SDL - https://github.com/libsdl-org/SDL + message(STATUS "==> SDL") +-set(SDL_DISABLE_UNINSTALL ON) +-set(SDL_TEST_LIBRARY OFF) +-set(SDL_TESTS OFF) +-set(SDL_EXAMPLES OFF) +-if (BUILD_SHARED_LIBS) +- set(SDL_SHARED ON) +- set(SDL_STATIC OFF) +-else () +- set(SDL_SHARED OFF) +- set(SDL_STATIC ON) +-endif () +-add_subdirectory_quiet(SDL EXCLUDE_FROM_ALL) ++find_package(SDL3 REQUIRED GLOBAL) + + # cxxopts - https://github.com/jarro2783/cxxopts + message(STATUS "==> cxxopts") +-add_subdirectory(cxxopts EXCLUDE_FROM_ALL) ++find_package(cxxopts REQUIRED GLOBAL) ++add_library(cxxopts ALIAS cxxopts::cxxopts) + + # concurrentqueue - https://github.com/cameron314/concurrentqueue + message(STATUS "==> concurrentqueue") +-add_subdirectory(concurrentqueue EXCLUDE_FROM_ALL) ++find_package(concurrentqueue REQUIRED GLOBAL) ++add_library(concurrentqueue ALIAS concurrentqueue::concurrentqueue) + + # dear ImGui - https://github.com/ocornut/imgui + # docking branch + message(STATUS "==> dear ImGui") +-add_subdirectory(imgui EXCLUDE_FROM_ALL) ++find_package(imgui REQUIRED GLOBAL) + + # toml++ - https://github.com/marzer/tomlplusplus + message(STATUS "==> toml++") +-add_subdirectory(tomlplusplus EXCLUDE_FROM_ALL) ++find_package(tomlplusplus REQUIRED GLOBAL) + + # xxHash - https://github.com/Cyan4973/xxHash + message(STATUS "==> xxHash") +-add_subdirectory(xxHash EXCLUDE_FROM_ALL) ++pkg_check_modules(libxxhash REQUIRED IMPORTED_TARGET GLOBAL libxxhash) ++add_library(xxHash::xxHash ALIAS PkgConfig::libxxhash) + + # lz4 - https://github.com/lz4/lz4 + message(STATUS "==> lz4") +-add_subdirectory(lz4 EXCLUDE_FROM_ALL) ++pkg_check_modules(liblz4 REQUIRED IMPORTED_TARGET GLOBAL liblz4) ++add_library(lz4::lz4 ALIAS PkgConfig::liblz4) + + # cereal - https://github.com/USCiLab/cereal + message(STATUS "==> cereal") +-set(BUILD_DOC OFF) +-set(BUILD_SANDBOX OFF) +-set(JUST_INSTALL_CEREAL ON) +-add_subdirectory(cereal EXCLUDE_FROM_ALL) ++find_package(cereal REQUIRED GLOBAL) + + # stb - https://github.com/nothings/stb + message(STATUS "==> stb") +-add_subdirectory(stb) ++add_library(stb INTERFACE) ++add_library(stb::stb ALIAS stb) + + # libchdr - https://github.com/rtissera/libchdr + message(STATUS "==> libchdr") +-set(BUILD_FUZZER OFF) +-add_subdirectory(libchdr) ++pkg_check_modules(libchdr REQUIRED IMPORTED_TARGET GLOBAL libchdr) ++add_library(chdr-static ALIAS PkgConfig::libchdr) + + # rtmidi - https://github.com/thestk/rtmidi + message(STATUS "==> rtmidi") +-set(RTMIDI_BUILD_STATIC_LIBS ON) +-set(RTMIDI_BUILD_TESTING OFF) +-add_subdirectory(rtmidi) ++pkg_check_modules(rtmidi REQUIRED IMPORTED_TARGET GLOBAL rtmidi) ++add_library(rtmidi ALIAS PkgConfig::rtmidi) + + # -------------------------------------------------------------------------------------------------- + # Test dependencies diff --git a/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp b/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp new file mode 100644 index 000000000000..cf610729c0d1 --- /dev/null +++ b/emulators/Ymir/files/patch-vendor_mio_include_mio_detail_mmap.ipp @@ -0,0 +1,13 @@ +https://github.com/vimpunk/mio/issues/110 + +--- vendor/mio/include/mio/detail/mmap.ipp.orig 2025-02-12 00:14:41 UTC ++++ vendor/mio/include/mio/detail/mmap.ipp +@@ -208,7 +208,7 @@ inline mmap_context memory_map(const file_handle_type + char* mapping_start = static_cast<char*>(::mmap( + 0, // Don't give hint as to where to map. + length_to_map, +- mode == access_mode::read ? PROT_READ : PROT_WRITE, ++ mode == access_mode::read ? PROT_READ : PROT_READ | PROT_WRITE, + mode == access_mode::copy_on_write ? MAP_PRIVATE : MAP_SHARED, + file_handle, + aligned_offset)); diff --git a/emulators/Ymir/pkg-descr b/emulators/Ymir/pkg-descr new file mode 100644 index 000000000000..2eae362fc391 --- /dev/null +++ b/emulators/Ymir/pkg-descr @@ -0,0 +1,16 @@ +Ymir is a Sega Saturn emulator with the following features: + +- Load games from MAME CHD, BIN+CUE, IMG+CCD, MDF+MDS or ISO files +- Automatic IPL (BIOS) ROM detection +- Automatic region switching +- Up to two players with standard Control Pads or 3D Control Pads on both ports +- Fully customizable keybindings +- Backup RAM, DRAM and ROM cartridges +- Integrated backup memory manager to import and export saves, and transfer + between internal and cartridge RAM +- Save states +- Rewinding (up to one minute at 60 fps), turbo speed, frame step (forwards and + backwards) +- Full screen mode with VRR support and low input lag +- Optional deinterlaced/progressive rendering of high resolution modes +- A feature-rich debugger |