Complete work to split es_systems.

This commit is contained in:
fewtarius 2023-06-04 17:55:09 +00:00
parent 9516bc58be
commit d304388bfe
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
7 changed files with 59 additions and 43 deletions

View file

@ -1,6 +1,7 @@
SYSTEM_NAME="imageviewer"
SYSTEM_FULLNAME="Screenshots"
SYSTEM_MANUFACTURER="Various"
SYSTEM_RELEASE="unknown"
SYSTEM_RELEASE="2021"
SYSTEM_HARDWARE="system"
SYSTEM_PATH="/roms/screenshots"
SYSTEM_EXTENSION=".jpg .jpeg .png .bmp .psd .tga .gif .hdr .pic .ppm .pgm .mkv .pdf .mp4 .avi"

View file

@ -1,5 +1,8 @@
SYSTEM_NAME="moonlight"
SYSTEM_FULLNAME="Moonlight Game Streaming"
SYSTEM_MANUFACTURER="JELOS"
SYSTEM_RELEASE="2021"
SYSTEM_HARDWARE="system"
SYSTEM_PATH="/storage/roms/moonlight/"
SYSTEM_EXTENSION=".sh .SH"
SYSTEM_COMMAND="%ROM%"

View file

@ -0,0 +1,10 @@
SYSTEM_NAME="msx2"
SYSTEM_FULLNAME="MSX2"
SYSTEM_MANUFACTURER="Microsoft"
SYSTEM_RELEASE="1988"
SYSTEM_HARDWARE="computer"
SYSTEM_PATH="/storage/roms/msx2"
SYSTEM_EXTENSION=".dsk .DSK .mx1 .MX1 .mx2 .MX2 .rom .ROM .zip .ZIP .7z .7Z .M3U .m3u"
SYSTEM_COMMAND="/usr/bin/runemu.sh %ROM% -P%SYSTEM% --core=%CORE% --emulator=%EMULATOR% --controllers=\"%CONTROLLERSCONFIG%\""
SYSTEM_PLATFORM="msx"
SYSTEM_THEME="msx2"

View file

@ -1,10 +1,10 @@
SYSTEM_NAME="ports"
SYSTEM_FULLNAME="Ports"
SYSTEM_MANUFACTURER="Various"
SYSTEM_RELEASE="unknown"
SYSTEM_HARDWARE="various"
SYSTEM_RELEASE="2021"
SYSTEM_HARDWARE="PC"
SYSTEM_PATH="/storage/roms/ports"
SYSTEM_EXTENSION=".sh .SH"
SYSTEM_COMMAND="/USR/BIN/BASH %ROM% -P%SYSTEM% --CORE=%CORE% --EMULATOR=%EMULATOR% --CONTROLLERS="%CONTROLLERSCONFIG%""
SYSTEM_COMMAND="/USR/BIN/BASH %ROM% -P%SYSTEM% --CORE=%CORE% --EMULATOR=%EMULATOR% --CONTROLLERS=\"%CONTROLLERSCONFIG%\""
SYSTEM_PLATFORM="pc"
SYSTEM_THEME="ports"

View file

@ -1,11 +1,10 @@
SYSTEM_NAME="tools"
SYSTEM_FULLNAME="Tools"
SYSTEM_MANUFACTURER="Various"
SYSTEM_RELEASE="unknown"
SYSTEM_RELEASE="2021"
SYSTEM_HARDWARE="system"
SYSTEM_PATH="/storage/.config/modules"
SYSTEM_EXTENSION=".sh"
SYSTEM_COMMAND="/usr/bin/run %ROM%"
SYSTEM_PLATFORM="tools"
SYSTEM_THEME="tools"
SYSTEM_FULLNAME="Screenshots"

View file

@ -1782,19 +1782,19 @@ add_emu_core() {
}
mk_es_systems() {
cat <<EOF >${ESTMP}/es_systems.cfg
cat <<EOF >${ESTMP}/.es_systems.cfg
<?xml version="1.0" encoding="UTF-8"?>
<systemList>
EOF
rm -f ${ESTMP}/*-emulators.tmp
for essystem in $(ls ${ESTMP}/*.tmp | sort)
do
sed -i -e '1,1d' -e '$ d' ${essystem}
cat ${essystem} >>${ESTMP}/es_systems.cfg
cat ${essystem} >>${ESTMP}/.es_systems.cfg
done
cat <<EOF >>${ESTMP}/es_systems.cfg
cat <<EOF >>${ESTMP}/.es_systems.cfg
</systemList>
EOF
xmlstarlet fo -t ${ESTMP}/.es_systems.cfg >${ESTMP}/es_systems.cfg 2>/dev/null
}
add_es_system() {
@ -1811,27 +1811,21 @@ add_es_system() {
if [ ! -e "${ESTMP}/${SYSTEM_NAME}.tmp" ]
then
cat <<EOF >${ESTMP}/${SYSTEM_NAME}.tmp
<?xml version="1.0" encoding="UTF-8"?>
<systemList>
</systemList>
<system>
<name>${SYSTEM_NAME}</name>
<fullname>${SYSTEM_FULLNAME}</fullname>
<manufacturer>${SYSTEM_MANUFACTURER}</manufacturer>
<release>${SYSTEM_RELEASE}</release>
<hardware>${SYSTEM_HARDWARE}</hardware>
<path>${SYSTEM_PATH}</path>
<extension>${SYSTEM_EXTENSION}</extension>
<command>${SYSTEM_COMMAND}</command>
<platform>${SYSTEM_PLATFORM}</platform>
<theme>${SYSTEM_THEME}</theme>
</system>
EOF
fi
xmlstarlet ed --omit-decl --inplace \
-d '//systemList/system' \
-s '//systemList' -t elem -n 'system' \
-s '//systemList/system' -t elem -n 'name' -v "${SYSTEM_NAME}" \
-s '//systemList/system' -t elem -n 'fullname' -v "${SYSTEM_FULLNAME}" \
-s '//systemList/system' -t elem -n 'manufacturer' -v "${SYSTEM_MANUFACTURER}" \
-s '//systemList/system' -t elem -n 'release' -v "${SYSTEM_RELEASE}" \
-s '//systemList/system' -t elem -n 'hardware' -v "${SYSTEM_HARDWARE}" \
-s '//systemList/system' -t elem -n 'path' -v "${SYSTEM_PATH}" \
-s '//systemList/system' -t elem -n 'extension' -v "${SYSTEM_EXTENSION}" \
-s '//systemList/system' -t elem -n 'command' -v "${SYSTEM_COMMAND}" \
-s '//systemList/system' -t elem -n 'platform' -v "${SYSTEM_PLATFORM}" \
-s '//systemList/system' -t elem -n 'theme' -v "${SYSTEM_THEME}" \
-s '//systemList/system' -t elem -n "emulators" -v "" ${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
if [ -e "${ESTMP}/${SYSTEM_NAME}-emulators.tmp" ]
then
while read -r line
@ -1841,45 +1835,54 @@ EOF
SYSTEM_DEFAULT=$(echo ${line} | awk 'BEGIN {FS="|"} {print $3}')
### Check to see if we've already added an emulator key.
EMTEST=$(xmlstarlet sel -t -c "////systemList/system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]" ${ESTMP}/${SYSTEM_NAME}.tmp 2>/dev/null ||:)
EMTEST=$(xmlstarlet sel -t -c "//system/emulators" ${ESTMP}/${SYSTEM_NAME}.tmp 2>/dev/null ||:)
if [ -z "${EMTEST}" ]
then
### Add the emulator element
xmlstarlet ed --omit-decl --inplace \
-s "//systemList/system/emulators" -t elem -n "emulator" -v "" \
-s "//system" -t elem -n "emulators" -v "" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
fi
### Check to see if we've already added an emulator key.
EETEST=$(xmlstarlet sel -t -c "//system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]" ${ESTMP}/${SYSTEM_NAME}.tmp 2>/dev/null ||:)
if [ -z "${EETEST}" ]
then
### Add the emulator element
xmlstarlet ed --omit-decl --inplace \
-s "//system/emulators" -t elem -n "emulator" -v "" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
fi
### Add an attribute defining the emulator's name.
xmlstarlet ed --omit-decl --inplace \
-s "//systemList/system/emulators/emulator[not(@name)]" -t attr -n "name" -v "${SYSTEM_EMULATOR}" \
-s "//system/emulators/emulator[not(@name)]" -t attr -n "name" -v "${SYSTEM_EMULATOR}" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
### Check to see if we've already added a core element.
COTEST=$(xmlstarlet sel -t -c "////systemList/system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores/core" ${ESTMP}/${SYSTEM_NAME}.tmp 2>/dev/null ||:)
COTEST=$(xmlstarlet sel -t -c "//system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores/core" ${ESTMP}/${SYSTEM_NAME}.tmp 2>/dev/null ||:)
if [ -z "${COTEST}" ]
then
xmlstarlet ed --omit-decl --inplace \
-s "//systemList/system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]" -t elem -n "cores" -v "" \
-s "//system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]" -t elem -n "cores" -v "" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
fi
### Add each core.
xmlstarlet ed --omit-decl --inplace \
-s "//systemList/system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores" -t elem -n "core" -v "${SYSTEM_CORE}" \
-s "//system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores" -t elem -n "core" -v "${SYSTEM_CORE}" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
if [ "${SYSTEM_DEFAULT}" = "true" ]
then
### Add an attribute defining the default core
xmlstarlet ed --omit-decl --inplace \
-i "//systemList/system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores/core" -t attr -n "default" -v "true" \
-i "//system/emulators/emulator[@name=\"${SYSTEM_EMULATOR}\"]/cores/core" -t attr -n "default" -v "true" \
${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
fi
done <${ESTMP}/${SYSTEM_NAME}-emulators.tmp
fi
xmlstarlet fo -t ${ESTMP}/${SYSTEM_NAME}.tmp 2>&1 >/dev/null
}
# Use distribution functions if any

View file

@ -380,7 +380,7 @@ makeinstall_target() {
### Atari Jaguar
add_emu_core atarijaguar retroarch virtualjaguar true
add_es_system virtualjaguar
add_es_system atarijaguar
### Atari Lynx
add_emu_core atarilynx retroarch handy true
@ -450,9 +450,9 @@ makeinstall_target() {
add_es_system ngp
### SNK NeoGeo Pocket Color
add_emu_core ngc retroarch beetle_ngp true
add_emu_core ngc retroarch race false
add_es_system ngc
add_emu_core ngpc retroarch beetle_ngp true
add_emu_core ngpc retroarch race false
add_es_system ngpc
### Nintendo 64
add_emu_core n64 retroarch mupen64plus_next true
@ -546,9 +546,9 @@ makeinstall_target() {
### Sony Playstation 2
case ${TARGET_ARCH} in
x86_64)
add_emu_core psx2 retroarch pcsx2 true
add_emu_core psx2 pcsx2 pcsx2-sa false
add_es_system psx2
add_emu_core ps2 retroarch pcsx2 true
add_emu_core ps2 pcsx2 pcsx2-sa false
add_es_system ps2
;;
esac