Skip to content

Commit 06e2ce9

Browse files
authored
Merge pull request #3847 from cmitu/px68k-standalone-sdl2
px68: change upstream project, use SDL2
2 parents ad3ca8c + 49384cc commit 06e2ce9

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

scriptmodules/emulators/px68k.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,35 @@
1212
rp_module_id="px68k"
1313
rp_module_desc="SHARP X68000 Emulator"
1414
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."
15-
rp_module_repo="git https://github.com/hissorii/px68k.git master"
15+
rp_module_repo="git https://github.com/TurtleBazooka/px68k.git master"
1616
rp_module_section="exp"
17-
rp_module_flags="sdl1 !mali !kms"
17+
rp_module_flags="sdl2"
1818

1919
function depends_px68k() {
20-
getDepends libsdl1.2-dev libsdl-gfx1.2-dev
20+
local depends=(cmake libsdl2-dev)
21+
# MIDI support is through Fluidsynth, but it needs version 2 of the library
22+
[[ "$__os_debian_ver" -gt 10 ]] && depends+=(libfluidsynth-dev timgm6mb-soundfont)
23+
getDepends "${depends[@]}"
2124
}
2225

2326
function sources_px68k() {
2427
gitPullOrClone
2528
}
2629

2730
function build_px68k() {
31+
local has_fluid
32+
[[ "$__os_debian_ver" -gt 10 ]] && has_fluid="FLUID=1"
2833
make clean
29-
make MOPT="" CDEBUGFLAGS="$CFLAGS -O2 -DUSE_SDLGFX -DNO_MERCURY"
30-
md_ret_require="$md_build/px68k"
34+
make CDEBUGFLAGS="$CFLAGS -DNO_MERCURY -DSDL2" SDL2=1 $has_fluid
35+
md_ret_require="$md_build/px68k.sdl2"
3136
}
3237

3338
function install_px68k() {
3439
md_ret_files=(
35-
'px68k'
40+
'px68k.sdl2'
3641
'readme.txt'
42+
'README.md'
43+
'version.txt'
3744
)
3845
}
3946

@@ -51,6 +58,19 @@ function configure_px68k() {
5158
ln -sf "$biosdir/keropi/$bios" "$md_conf_root/x68000/$bios"
5259
done
5360

54-
addEmulator 1 "$md_id" "x68000" "$md_inst/px68k %ROM%"
61+
addEmulator 1 "$md_id" "x68000" "$md_inst/px68k.sdl2 %ROM%"
5562
addSystem "x68000"
63+
64+
[[ "$md_mode" == "remove" ]] && return
65+
66+
# generate a minimal config file when no configuration is present
67+
local conf="$md_conf_root/x68000/config"
68+
if [[ ! -f "$conf" ]]; then
69+
echo "[WinX68k]" > "$conf"
70+
echo "StartDir=$romdir/x68000" >> "$conf"
71+
echo "MenuLanguage=1" >> "$conf" # anything non-zero means US
72+
# when fluidsynth is enabled, add the soundfont path
73+
[[ "$__os_debian_ver" -gt 10 ]] && echo "SoundFontFile=/usr/share/sounds/sf2/TimGM6mb.sf2" >> "$conf"
74+
fi
75+
chown $user:$user "$conf"
5676
}

0 commit comments

Comments
 (0)