Skip to content

Commit

Permalink
supermodel3: add new Sega Model 3 emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
cmitu committed May 25, 2024
1 parent fa2dde4 commit 13b39e7
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions scriptmodules/emulators/supermodel3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/usr/bin/env bash

# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#

rp_module_id="supermodel3"
rp_module_desc="Super Model 3 Emulator"
rp_module_help="Copy your roms to $romdir/arcade"
rp_module_licence="GPL3 https://raw.githubusercontent.com/DirtBagXon/model3emu-code-sinden/main/Docs/LICENSE.txt"
rp_module_repo="git https://github.com/DirtBagXon/model3emu-code-sinden.git :_get_branch_supermodel3"
rp_module_section="exp"
rp_module_flags="all !armv6 !rpi3"

function _get_branch_supermodel3() {
if isPlatform "x86"; then
echo "main"
else
echo "arm"
fi
}

function depends_supermodel3() {
local depends=(libglu1-mesa-dev libsdl2-dev libsdl2-net-dev)
isPlatform "x11" && depends+=(libxi-dev)
getDepends "${depends[@]}"
}

function sources_supermodel3() {
gitPullOrClone
}

function build_supermodel3() {
make -f Makefiles/Makefile.UNIX clean
make -f Makefiles/Makefile.UNIX NET_BOARD=1 VERBOSE=1 ARCH="" OPT="$__default_cflags"
md_ret_require="bin/supermodel"
}

function install_supermodel3() {
md_ret_files=(
'bin/supermodel'
'Config'
'Docs/LICENSE.txt'
'Docs/README.txt'
)
}

function configure_supermodel3() {

mkRomDir "arcade"
addSystem "arcade"
local game_args="-no-throttle -fullscreen -vsync -res=%XRES%,%YRES%"
addEmulator 0 "$md_id" "arcade" "$md_inst/supermodel.sh %ROM% $game_args"
addEmulator 0 "$md_id-borders" "arcade" "$md_inst/supermodel.sh %ROM% -borders=2 $game_args"
if isPlatform "x86"; then
# add a legacy entry on a PC, for less powerful systems
addEmulator 0 "$md_id-legacy" "arcade" "$md_inst/supermodel.sh %ROM% -legacy3da $game_args"
fi

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

local conf_dir="$md_conf_root/arcade/supermodel3"
mkUserDir "$conf_dir"
mkUserDir "$conf_dir/NVRAM"
mkUserDir "$conf_dir/Saves"
mkUserDir "$conf_dir/Config"

# keep the local config, but overwrite the game configs
copyDefaultConfig "$md_inst/Config/Supermodel.ini" "$conf_dir/Config/Supermodel.ini"
cp -f "$md_inst/Config/Games.xml" "$conf_dir/Config/"
chown -R "$user:$user" "$conf_dir"

cat >"$md_inst/supermodel.sh" <<_EOF_
#!/usr/bin/env bash
commands="\${1%.*}.commands"
if [[ -f "\$commands" ]]; then
params=\$(<"\$commands" tr -d '\r' | tr '\n' ' ')
fi
pushd $conf_dir
$md_inst/supermodel "\$@" \$params
popd
_EOF_
chmod +x "$md_inst/supermodel.sh"
}

0 comments on commit 13b39e7

Please sign in to comment.