|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# This file is part of The RetroPie Project |
| 4 | +# |
| 5 | +# The RetroPie Project is the legal property of its developers, whose names are |
| 6 | +# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. |
| 7 | +# |
| 8 | +# See the LICENSE.md file at the top-level directory of this distribution and |
| 9 | +# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md |
| 10 | +# |
| 11 | + |
| 12 | +rp_module_id="lr-flycast-dev" |
| 13 | +rp_module_desc="Multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator" |
| 14 | +rp_module_help="Dreamcast ROM Extensions: .cdi .gdi .chd .m3u, Naomi/Atomiswave ROM Extension: .zip\n\nCopy your Dreamcast/Naomi roms to $romdir/dreamcast\n\nCopy the required Dreamcast BIOS files dc_boot.bin and dc_flash.bin to $biosdir/dc\n\nCopy the required Naomi/Atomiswave BIOS files naomi.zip/naomigd.zip and awbios.zip to $biosdir/dc" |
| 15 | +rp_module_licence="GPL2 https://raw.githubusercontent.com/flyinghead/flycast/master/LICENSE" |
| 16 | +rp_module_repo="git https://github.com/flyinghead/flycast.git master" |
| 17 | +rp_module_section="exp" |
| 18 | +rp_module_flags="!armv6 !videocore" |
| 19 | + |
| 20 | +function depends_lr-flycast-dev() { |
| 21 | + if [[ "$__gcc_version" -lt 9 ]]; then |
| 22 | + md_ret_errors+=("Sorry, you need an OS with gcc 9 or newer to compile $md_id") |
| 23 | + return 1 |
| 24 | + fi |
| 25 | + local depends=(zlib1g-dev libgl-dev) |
| 26 | + getDepends "${depends[@]}" |
| 27 | +} |
| 28 | + |
| 29 | +function sources_lr-flycast-dev() { |
| 30 | + gitPullOrClone |
| 31 | +} |
| 32 | + |
| 33 | +function build_lr-flycast-dev() { |
| 34 | + local params=("-DLIBRETRO=ON -DWITH_SYSTEM_ZLIB=ON -DCMAKE_BUILD_TYPE=Release") |
| 35 | + |
| 36 | + if isPlatform "gles3"; then |
| 37 | + params+=("-DUSE_GLES=ON") |
| 38 | + elif isPlatform "gles2"; then |
| 39 | + params+=("-DUSE_GLES2=ON") |
| 40 | + fi |
| 41 | + isPlatform "vulkan" && params+=("-DUSE_VULKAN=ON") || params+=("-DUSE_VULKAN=OFF") |
| 42 | + |
| 43 | + rm -fr build && mkdir build |
| 44 | + cd build |
| 45 | + cmake "${params[@]}" .. |
| 46 | + make |
| 47 | + |
| 48 | + md_ret_require="$md_build/build/flycast_libretro.so" |
| 49 | +} |
| 50 | + |
| 51 | +function install_lr-flycast-dev() { |
| 52 | + md_ret_files=( |
| 53 | + 'build/flycast_libretro.so' |
| 54 | + 'LICENSE' |
| 55 | + ) |
| 56 | +} |
| 57 | + |
| 58 | +function configure_lr-flycast-dev() { |
| 59 | + local sys |
| 60 | + local def |
| 61 | + for sys in "arcade" "dreamcast"; do |
| 62 | + def=0 |
| 63 | + isPlatform "kms" && [[ "$sys" == "dreamcast" ]] && def=1 |
| 64 | + # segfaults on the rpi without redirecting stdin from </dev/null |
| 65 | + addEmulator $def "$md_id" "$sys" "$md_inst/flycast_libretro.so </dev/null" |
| 66 | + addSystem "$sys" |
| 67 | + done |
| 68 | + |
| 69 | + [[ "$md_mode" == "remove" ]] && return |
| 70 | + |
| 71 | + for sys in "arcade" "dreamcast"; do |
| 72 | + mkRomDir "$sys" |
| 73 | + defaultRAConfig "$sys" |
| 74 | + done |
| 75 | + |
| 76 | + mkUserDir "$biosdir/dc" |
| 77 | +} |
0 commit comments