Skip to content

Commit

Permalink
Merge pull request #3323 from joolswills/backend_config
Browse files Browse the repository at this point in the history
Allow configuration of driver backends for sdl1/sdl2 modules
  • Loading branch information
joolswills authored Apr 25, 2021
2 parents 6d396a3 + c829f32 commit d6d715b
Show file tree
Hide file tree
Showing 35 changed files with 292 additions and 172 deletions.
2 changes: 1 addition & 1 deletion scriptmodules/emulators/advmame.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extension: .zip\n\nCopy your AdvanceMAME roms to either $rom
rp_module_licence="GPL2 https://raw.githubusercontent.com/amadvance/advancemame/master/COPYING"
rp_module_repo="git https://github.com/amadvance/advancemame v3.9"
rp_module_section="opt"
rp_module_flags=""
rp_module_flags="sdl2 sdl1-videocore"

function _update_hook_advmame() {
# if the non split advmame is installed, make directories for 0.94 / 1.4 so they will be updated
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/basilisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .img .rom\n\nCopy your Macintosh roms mac.rom an
rp_module_licence="GPL2 https://raw.githubusercontent.com/cebix/macemu/master/BasiliskII/COPYING"
rp_module_repo="git https://github.com/cebix/macemu.git master"
rp_module_section="opt"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl1 !mali"

function depends_basilisk() {
local depends=(libsdl1.2-dev autoconf automake oss-compat)
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/capricerpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .cdt .cpc .dsk\n\nCopy your Amstrad CPC games to
rp_module_licence="GPL2 https://raw.githubusercontent.com/KaosOverride/CapriceRPI/master/COPYING.txt"
rp_module_repo="git https://github.com/KaosOverride/CapriceRPI.git master"
rp_module_section="opt"
rp_module_flags="dispmanx !all videocore"
rp_module_flags="sdl1 !all videocore"

function depends_capricerpi() {
getDepends libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev zlib1g-dev libpng-dev
Expand Down
4 changes: 2 additions & 2 deletions scriptmodules/emulators/daphne.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extension: .daphne\n\nCopy your Daphne roms to $romdir/daphn
rp_module_licence="GPL2 https://raw.githubusercontent.com/RetroPie/daphne-emu/master/COPYING"
rp_module_repo="git https://github.com/RetroPie/daphne-emu.git retropie"
rp_module_section="opt"
rp_module_flags="dispmanx !x86 !mali"
rp_module_flags="sdl1 !x86 !mali"

function depends_daphne() {
getDepends libsdl1.2-dev libvorbis-dev libglew-dev zlib1g-dev
Expand Down Expand Up @@ -57,7 +57,7 @@ function configure_daphne() {

mkUserDir "$md_conf_root/daphne"

setDispmanx "$md_id" 1
isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"

if [[ ! -f "$md_conf_root/daphne/dapinput.ini" ]]; then
cp -v "$md_data/dapinput.ini" "$md_conf_root/daphne/dapinput.ini"
Expand Down
4 changes: 2 additions & 2 deletions scriptmodules/emulators/dgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .32x .iso .cue .smd .bin .gen .md .sg .zip\n\nCo
rp_module_licence="GPL2 https://sourceforge.net/p/dgen/dgen/ci/master/tree/COPYING"
rp_module_repo="file $__archive_url/dgen-sdl-1.33.tar.gz"
rp_module_section="opt"
rp_module_flags="dispmanx !mali !kms"
rp_module_flags="sdl1 !mali !kms"

function depends_dgen() {
getDepends libsdl1.2-dev libarchive-dev
Expand Down Expand Up @@ -104,5 +104,5 @@ function configure_dgen() {
iniSet "joy_pad2_mode" "joystick1-button6"
iniSet "joy_pad2_start" "joystick1-button7"

setDispmanx "$md_id" 1
isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"
}
1 change: 1 addition & 0 deletions scriptmodules/emulators/dosbox-sdl2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rp_module_help="ROM Extensions: .bat .com .exe .sh .conf\n\nCopy your DOS games
rp_module_licence="GPL2 https://sourceforge.net/p/dosbox/code-0/HEAD/tree/dosbox/trunk/COPYING"
rp_module_repo="git https://github.com/duganchen/dosbox.git master"
rp_module_section="exp"
rp_module_flags="sdl2"

function depends_dosbox-sdl2() {
local depends=(libsdl2-dev libsdl2-net-dev libfluidsynth-dev fluid-soundfont-gm libglew-dev)
Expand Down
9 changes: 6 additions & 3 deletions scriptmodules/emulators/dosbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .bat .com .exe .sh .conf\n\nCopy your DOS games
rp_module_licence="GPL2 https://sourceforge.net/p/dosbox/code-0/HEAD/tree/dosbox/trunk/COPYING"
rp_module_repo="svn https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk - 4252"
rp_module_section="opt"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl1 !mali"

function depends_dosbox() {
local depends=(libasound2-dev libpng-dev automake autoconf zlib1g-dev "$@")
Expand Down Expand Up @@ -117,6 +117,9 @@ else
params+=(-exit)
fi
# fullscreen when running in X
[[ -n "\$DISPLAY" ]] && params+=(-fullscreen)
midi_synth start
"$md_inst/bin/dosbox" "\${params[@]}"
midi_synth stop
Expand All @@ -138,8 +141,8 @@ _EOF_
fi
fi

# default to dispmanx on rpi4/kms
isPlatform "mesa" && setDispmanx "$md_id" 1
# set dispmanx by default on rpi with fkms
isPlatform "dispmanx" && ! isPlatform "videocore" && setBackend "$md_id" "dispmanx"

moveConfigDir "$home/.$md_id" "$md_conf_root/pc"

Expand Down
41 changes: 16 additions & 25 deletions scriptmodules/emulators/drastic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rp_module_desc="NDS emu - DraStic"
rp_module_help="ROM Extensions: .nds .zip\n\nCopy your Nintendo DS roms to $romdir/nds"
rp_module_licence="PROP"
rp_module_section="exp"
rp_module_flags="!all arm !armv6 !mali"
rp_module_flags="sdl2 !all arm !armv6 !mali"

function depends_drastic() {
local depends=(libasound2-dev libsdl2-dev zlib1g-dev)
Expand All @@ -36,38 +36,29 @@ function install_bin_drastic() {
function configure_drastic() {
mkRomDir "nds"

# wrong permissions on game_database.xml
chmod 644 "$md_inst/game_database.xml"
addEmulator 1 "$md_id" "nds" "$md_inst/drastic.sh %ROM%"
addSystem "nds"

mkUserDir "$md_conf_root/nds/drastic"
mkUserDir "$md_conf_root/nds/drastic/system"
[[ "$md_mode" == "remove" ]] && return

local file
for file in game_database.xml system/drastic_bios_arm7.bin system/drastic_bios_arm9.bin usrcheat.dat drastic_logo_0.raw drastic_logo_1.raw; do
ln -sfv "$md_inst/$file" "$md_conf_root/nds/drastic/$file"
done
isPlatform "kms" && ! isPlatform "x11" && setBackend "$md_id" "x11"

if [[ "$md_mode" == "install" ]]; then
cat > "$md_inst/drastic.sh" << _EOF_
cat > "$md_inst/drastic.sh" << _EOF_
#!/bin/bash
# Don't start a window manager on x11 platforms
if [[ -n \$DISPLAY && "\$2" == "kms" ]]; then
matchbox-window-manager -use_cursor no &
sleep 0.5
fi
pushd "$md_conf_root/nds/drastic"
$md_inst/drastic "\$1"
popd
_EOF_
chmod +x "$md_inst/drastic.sh"
fi
chmod +x "$md_inst/drastic.sh"

# Launch DraStic in an x11 session for KMS platforms
if isPlatform "kms" && ! isPlatform "x11"; then
addEmulator 1 "$md_id" "nds" "XINIT:$md_inst/drastic.sh %ROM% kms"
else
addEmulator 1 "$md_id" "nds" "$md_inst/drastic.sh %ROM%"
fi
# wrong permissions on game_database.xml
chmod 644 "$md_inst/game_database.xml"

addSystem "nds"
mkUserDir "$md_conf_root/nds/drastic"
mkUserDir "$md_conf_root/nds/drastic/system"

local file
for file in game_database.xml system/drastic_bios_arm7.bin system/drastic_bios_arm9.bin usrcheat.dat drastic_logo_0.raw drastic_logo_1.raw; do
ln -sfv "$md_inst/$file" "$md_conf_root/nds/drastic/$file"
done
}
4 changes: 2 additions & 2 deletions scriptmodules/emulators/fbzx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .sna .szx .z80 .tap .tzx .gz .udi .mgt .img .trd
rp_module_licence="GPL3 https://raw.githubusercontent.com/rastersoft/fbzx/master/COPYING"
rp_module_repo="git https://github.com/rastersoft/fbzx :_get_branch_fbzx"
rp_module_section="opt"
rp_module_flags="dispmanx !mali !kms"
rp_module_flags="sdl1 !mali !kms"

function _get_branch_fbzx() {
local branch
Expand Down Expand Up @@ -53,6 +53,6 @@ function install_fbzx() {
function configure_fbzx() {
mkRomDir "zxspectrum"

addEmulator 0 "$md_id" "zxspectrum" "pushd $md_inst/share; $md_inst/bin/fbzx %ROM%; popd"
addEmulator 0 "$md_id" "zxspectrum" "pushd $md_inst/share; $md_inst/bin/fbzx -fs %ROM%; popd"
addSystem "zxspectrum"
}
36 changes: 19 additions & 17 deletions scriptmodules/emulators/fuse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .sna .szx .z80 .tap .tzx .gz .udi .mgt .img .trd
rp_module_licence="GPL2 https://sourceforge.net/p/fuse-emulator/fuse/ci/master/tree/COPYING"
rp_module_repo="file $__archive_url/fuse-1.5.7.tar.gz"
rp_module_section="opt"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl1 !mali"

function depends_fuse() {
getDepends libsdl1.2-dev libpng-dev zlib1g-dev libbz2-dev libaudiofile-dev bison flex
Expand Down Expand Up @@ -50,29 +50,31 @@ function install_fuse() {
function configure_fuse() {
mkRomDir "zxspectrum"

mkUserDir "$md_conf_root/zxspectrum"
addEmulator 0 "$md_id-48k" "zxspectrum" "$md_inst/bin/fuse --machine 48 --full-screen %ROM%"
addEmulator 0 "$md_id-128k" "zxspectrum" "$md_inst/bin/fuse --machine 128 --full-screen %ROM%"
addSystem "zxspectrum"

[[ "$md_mode" == "remove" ]] && return

mkUserDir "$md_conf_root/zxspectrum"
moveConfigFile "$home/.fuserc" "$md_conf_root/zxspectrum/.fuserc"

setDispmanx "$md_id" 1
configure_dispmanx_on_fuse
# default to dispmanx backend
isPlatform "dispmanx" && _backend_set_fuse "dispmanx"

cat > "$romdir/zxspectrum/+Start Fuse.sh" << _EOF_
local script="$romdir/zxspectrum/+Start Fuse.sh"
cat > "$script" << _EOF_
#!/bin/bash
$md_inst/bin/fuse --machine 128 --full-screen
_EOF_

addEmulator 0 "$md_id-48k" "zxspectrum" "$md_inst/bin/fuse --machine 48 --full-screen %ROM%"
addEmulator 0 "$md_id-128k" "zxspectrum" "$md_inst/bin/fuse --machine 128 --full-screen %ROM%"
addSystem "zxspectrum"
}

function configure_dispmanx_on_fuse() {
setDispmanx "$md_id-48k" 1
setDispmanx "$md_id-128k" 1
chown $user:$user "$script"
chmod +x "$script"
}

function configure_dispmanx_off_fuse() {
setDispmanx "$md_id-48k" 0
setDispmanx "$md_id-128k" 0
function _backend_set_fuse() {
local mode="$1"
local force="$2"
setBackend "$md_id" "$mode" "$force"
setBackend "$md_id-48k" "$mode" "$force"
setBackend "$md_id-128k" "$mode" "$force"
}
6 changes: 2 additions & 4 deletions scriptmodules/emulators/jzintv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .int .bin\n\nCopy your Intellivision roms to $ro
rp_module_licence="GPL2 http://spatula-city.org/%7Eim14u2c/intv/"
rp_module_repo="file $__archive_url/jzintv-20181225.zip"
rp_module_section="opt"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl1 !mali"

function depends_jzintv() {
getDepends libsdl1.2-dev
Expand Down Expand Up @@ -47,9 +47,7 @@ function install_jzintv() {
function configure_jzintv() {
mkRomDir "intellivision"

if ! isPlatform "x11"; then
setDispmanx "$md_id" 1
fi
! isPlatform "x11" && setBackend "$md_id" "dispmanx"

addEmulator 1 "$md_id" "intellivision" "$md_inst/bin/jzintv -p $biosdir -q %ROM%"
addSystem "intellivision"
Expand Down
4 changes: 2 additions & 2 deletions scriptmodules/emulators/linapple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .dsk\n\nCopy your Apple 2 games to $romdir/apple
rp_module_licence="GPL2 https://raw.githubusercontent.com/dabonetn/linapple-pie/master/LICENSE"
rp_module_repo="git https://github.com/dabonetn/linapple-pie.git master"
rp_module_section="opt"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl1 !mali"

function depends_linapple() {
getDepends libzip-dev libsdl1.2-dev libsdl-image1.2-dev libcurl4-openssl-dev
Expand Down Expand Up @@ -59,7 +59,7 @@ function configure_linapple() {
copyDefaultConfig "$file" "$md_conf_root/apple2/$file"
done

setDispmanx "$md_id" 1
isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"

mkUserDir "$md_conf_root/apple2"
moveConfigDir "$home/.linapple" "$md_conf_root/apple2"
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/mupen64plus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .z64 .n64 .v64\n\nCopy your N64 roms to $romdir/
rp_module_licence="GPL2 https://raw.githubusercontent.com/mupen64plus/mupen64plus-core/master/LICENSES"
rp_module_repo=":_pkg_info_mupen64plus"
rp_module_section="main"
rp_module_flags=""
rp_module_flags="sdl2"

function depends_mupen64plus() {
local depends=(cmake libsamplerate0-dev libspeexdsp-dev libsdl2-dev libpng-dev libfreetype6-dev fonts-freefont-ttf libboost-filesystem-dev)
Expand Down
5 changes: 3 additions & 2 deletions scriptmodules/emulators/np2pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rp_module_desc="NEC PC-9801 emulator"
rp_module_help="ROM Extensions: .d88 .d98 .88d .98d .fdi .xdf .hdm .dup .2hd .tfd .hdi .thd .nhd .hdd\n\nCopy your pc98 games to to $romdir/pc88\n\nCopy bios files 2608_bd.wav, 2608_hh.wav, 2608_rim.wav, 2608_sd.wav, 2608_tom.wav 2608_top.wav, bios.rom, FONT.ROM and sound.rom to $biosdir/pc98"
rp_module_repo="git https://github.com/eagle0wl/np2pi.git master"
rp_module_section="exp"
rp_module_flags="!all dispmanx rpi !aarch64"
rp_module_flags="sdl1 !all rpi !aarch64"

function depends_np2pi() {
getDepends libsdl1.2-dev libasound2-dev libsdl-ttf2.0-dev fonts-takao-gothic
Expand All @@ -40,7 +40,8 @@ function configure_np2pi() {
mkRomDir "pc98"

mkUserDir "$md_conf_root/pc98"
setDispmanx "$md_id" 1

isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"

# we launch from $md_conf_root/pc98 as emulator wants to create files in
# the current directory (eg font.tmp).
Expand Down
4 changes: 2 additions & 2 deletions scriptmodules/emulators/pcsx-rearmed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="ROM Extensions: .bin .cue .cbn .img .iso .m3u .mdf .pbp .toc .z
rp_module_licence="GPL2 https://raw.githubusercontent.com/notaz/pcsx_rearmed/master/COPYING"
rp_module_repo="git https://github.com/notaz/pcsx_rearmed.git master"
rp_module_section="opt"
rp_module_flags="dispmanx !all videocore"
rp_module_flags="sdl1 !all videocore"

function depends_pcsx-rearmed() {
getDepends libsdl1.2-dev libasound2-dev libpng-dev libx11-dev
Expand Down Expand Up @@ -65,7 +65,7 @@ function configure_pcsx-rearmed() {
# symlink config folder
moveConfigDir "$md_inst/.pcsx" "$md_conf_root/psx/pcsx"

setDispmanx "$md_id" 1
isPlatform "dispmanx" && setBackend "$md_id" "dispmanx"

addEmulator 0 "$md_id" "psx" "pushd $md_inst; ./pcsx -cdfile %ROM%; popd"
addSystem "psx"
Expand Down
4 changes: 1 addition & 3 deletions scriptmodules/emulators/px68k.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rp_module_desc="SHARP X68000 Emulator"
rp_module_help="You need to copy a X68000 bios file (iplrom30.dat, iplromco.dat, iplrom.dat, or iplromxv.dat), and the font file (cgrom.dat or cgrom.tmp) to $biosdir/keropi. Use F12 to access the in emulator menu."
rp_module_repo="git https://github.com/hissorii/px68k.git master"
rp_module_section="exp"
rp_module_flags="!mali !kms"
rp_module_flags="sdl1 !mali !kms"

function depends_px68k() {
getDepends libsdl1.2-dev libsdl-gfx1.2-dev
Expand Down Expand Up @@ -51,8 +51,6 @@ function configure_px68k() {
ln -sf "$biosdir/keropi/$bios" "$md_conf_root/x68000/$bios"
done

setDispmanx "$md_id" 0

addEmulator 1 "$md_id" "x68000" "$md_inst/px68k %ROM%"
addSystem "x68000"
}
2 changes: 1 addition & 1 deletion scriptmodules/emulators/quasi88.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rp_module_desc="NEC PC-8801 emulator"
rp_module_help="ROM Extensions: .d88 .88d .cmt .t88\n\nCopy your pc88 games to to $romdir/pc88\n\nCopy bios files FONT.ROM, N88.ROM, N88KNJ1.ROM, N88KNJ2.ROM, and N88SUB.ROM to $biosdir/pc88"
rp_module_repo="file $__archive_url/quasi88-0.6.4.tgz"
rp_module_section="exp"
rp_module_flags="dispmanx !mali !kms"
rp_module_flags="sdl1 !mali !kms"

function depends_quasi88() {
getDepends libsdl1.2-dev
Expand Down
2 changes: 1 addition & 1 deletion scriptmodules/emulators/residualvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="Copy your ResidualVM games to $romdir/residualvm"
rp_module_licence="GPL2 https://raw.githubusercontent.com/residualvm/residualvm/master/COPYING"
rp_module_repo="git https://github.com/ResidualVM/ResidualVM.git master"
rp_module_section="exp"
rp_module_flags="dispmanx !mali"
rp_module_flags="sdl2 !mali"

function depends_residualvm() {
local depends=(
Expand Down
5 changes: 3 additions & 2 deletions scriptmodules/emulators/scummvm-sdl1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="Copy your ScummVM games to $romdir/scummvm"
rp_module_licence="GPL2 https://raw.githubusercontent.com/scummvm/scummvm/master/COPYING"
rp_module_repo="git https://github.com/scummvm/scummvm.git v2.2.0"
rp_module_section="opt"
rp_module_flags="dispmanx !mali !x11"
rp_module_flags="sdl1 !mali !x11"

function depends_scummvm-sdl1() {
depends_scummvm
Expand Down Expand Up @@ -43,6 +43,7 @@ function install_scummvm-sdl1() {
}

function configure_scummvm-sdl1() {
isPlatform "kms" && setDispmanx "$md_id" 1
# use dispmanx by default on rpi with fkms
isPlatform "dispmanx" && ! isPlatform "videocore" && setBackend "$md_id" "dispmmanx"
configure_scummvm
}
2 changes: 1 addition & 1 deletion scriptmodules/emulators/scummvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rp_module_help="Copy your ScummVM games to $romdir/scummvm"
rp_module_licence="GPL2 https://raw.githubusercontent.com/scummvm/scummvm/master/COPYING"
rp_module_repo="git https://github.com/scummvm/scummvm.git v2.2.0"
rp_module_section="opt"
rp_module_flags=""
rp_module_flags="sdl2"

function depends_scummvm() {
local depends=(
Expand Down
Loading

0 comments on commit d6d715b

Please sign in to comment.