updates for nds and new rom paths

This commit is contained in:
Rudis Muiznieks 2024-02-08 08:40:55 -06:00
parent 5b7262c6ab
commit db7e1be6bc
Signed by: rudism
GPG key ID: CABF2F86EF7884F9
3 changed files with 28 additions and 20 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
out/
*.lpl

View file

@ -1,6 +1,6 @@
{
"version": "1.5",
"default_core_path": "/tmp/cores/prboom_libretro.so",
"default_core_path": "$CORE_PREFIX/prboom_libretro.so",
"default_core_name": "Doom (PrBoom)",
"label_display_mode": 0,
"right_thumbnail_mode": 0,
@ -8,26 +8,20 @@
"sort_mode": 0,
"items": [
{
"path": "/storage/roms/dooms/doom/doom.wad",
"path": "$ROM_PREFIX/prboom/doom.wad",
"label": "Doom",
"core_path": "/tmp/cores/prboom_libretro.so",
"core_name": "Doom (PrBoom)",
"crc32": "DETECT",
"db_name": "DOOM.lpl"
},
{
"path": "/storage/roms/dooms/doom2/doom2.wad",
"path": "$ROM_PREFIX/prboom/doom2.wad",
"label": "Doom II - Hell on Earth",
"core_path": "/tmp/cores/prboom_libretro.so",
"core_name": "Doom (PrBoom)",
"crc32": "DETECT",
"db_name": "DOOM.lpl"
},
{
"path": "/storage/roms/dooms/finaldoom/plutonia.wad",
"path": "$ROM_PREFIX/prboom/plutonia.wad",
"label": "Final Doom - The Plutonia Experiment",
"core_path": "/tmp/cores/prboom_libretro.so",
"core_name": "Doom (PrBoom)",
"crc32": "DETECT",
"db_name": "DOOM.lpl"
}

View file

@ -18,13 +18,13 @@ case "$sys_type" in
core_name="Atari - 2600 (Stella)"
db_name="Atari - 2600.lpl"
;;
'atarilynx')
'lynx')
rom_ext="lnx"
core_path="$CORE_PREFIX/handy_libretro.so"
core_name="Atari - Lynx (Handy)"
db_name="Atari - Lynx.lpl"
;;
'arcade')
'mame')
rom_ext="zip"
core_path="$CORE_PREFIX/mame2003_plus_libretro.so"
core_name="Arcade (MAME 2003-Plus)"
@ -102,25 +102,37 @@ case "$sys_type" in
core_name="Sony - PlayStation Portable (PPSSPP)"
db_name="Sony - PlayStation Portable.lpl"
;;
'ws')
'wswan')
rom_ext="ws"
core_path="$CORE_PREFIX/mednafen_wswan_libretro.so"
core_name="Bandai - WonderSwan (Beetle Cygne)"
db_name="Bandai - WonderSwan.lpl"
;;
'wsc')
'wswanc')
rom_ext="wsc"
core_path="$CORE_PREFIX/mednafen_wswan_libretro.so"
core_name="Bandai - WonderSwan Color (Beetle Cygne)"
db_name="Bandai - WonderSwan Color.lpl"
;;
'nds')
rom_ext="nds"
core_path="$CORE_PREFIX/desmume_libretro.so"
core_name="Nintendo - DS (DeSmuME)"
db_name="Nintendo - Nintendo DS.lpl"
;;
'prboom')
# special case, use template
echo 'Generating DOOM.lpl from template...'
sed "s|\\\$CORE_PREFIX|$CORE_PREFIX|g" DOOM.lpl | sed "s|\\\$ROM_PREFIX|$ROM_PREFIX|g" > out/DOOM.lpl
exit 0
;;
*)
echo "Don't recognize system for roms in $sys_type directory..."
exit 1
;;
esac
cat > temp.json <<EOF
cat > out/temp.json <<EOF
{
"version": "1.5",
"default_core_path": "$core_path",
@ -132,19 +144,20 @@ cat > temp.json <<EOF
"items": [
EOF
mkdir -p out
echo "Reading roms from $rom_dir/*.$rom_ext..."
comma=
for rom in "$rom_dir"/*."$rom_ext"; do
rom_file="$(basename "$rom" | sed 's/"/\\"/g')"
if [ "$sys_type" = "arcade" ]; then
mame_name="${rom_file%.$rom_ext}"
mame_name="${rom_file%."$rom_ext"}"
rom_label="$(jq -r '.[] | select(.name=="'"$mame_name"'") | .description' mame2003plusdb.json | sed 's/\( ([^)]\+)\)*$//')"
else
rom_label="$(echo "$rom_file" | sed 's/ \?\[[^]]\+\]//g' | sed 's/\( ([^)]\+)\)*\.[^.]\+$//')"
fi
rom_path="$ROM_PREFIX/$sys_type/$rom_file"
cat >> temp.json <<EOF
cat >> out/temp.json <<EOF
$comma{
"path": "$rom_path",
"label": "$rom_label",
@ -155,11 +168,11 @@ EOF
comma=','
done
cat >> temp.json <<EOF
cat >> out/temp.json <<EOF
]
}
EOF
if jq . temp.json > "$db_name"; then
rm temp.json
if jq . out/temp.json > "out/$db_name"; then
rm out/temp.json
fi