This commit is contained in:
Rudis Muiznieks 2022-05-07 18:35:48 -05:00
parent 8338359f31
commit 6d069696c7
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
1 changed files with 24 additions and 52 deletions

View File

@ -2,125 +2,97 @@
rom_dir=$(echo "$1" | sed -e 's/\/$//') rom_dir=$(echo "$1" | sed -e 's/\/$//')
sys_type="$(basename "$rom_dir")" sys_type="$(basename "$rom_dir")"
ROM_PREFIX=${ROM_PREFIX:-"/storage/roms"}
CORE_PREFIX=${CORE_PREFIX:-"/tmp/cores"}
case "$sys_type" in case "$sys_type" in
'nes') 'nes')
rom_ext="nes" rom_ext="nes"
core_path="/tmp/cores/fceumm_libretro.so" core_path="$CORE_PREFIX/fceumm_libretro.so"
core_name="Nintendo - NES / Famicom (FCEUmm)" core_name="Nintendo - NES / Famicom (FCEUmm)"
db_name="Nintendo - Nintendo Entertainment System.lpl" db_name="Nintendo - Nintendo Entertainment System.lpl"
;; ;;
'atari2600') 'atari2600')
rom_ext="a26" rom_ext="a26"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/stella_libretro.so"
core_path="/tmp/cores/stella2014_libretro.so"
core_name="Atari - 2600 (Stella 2014)"
else
core_path="/tmp/cores/stella_libretro.so"
core_name="Atari - 2600 (Stella)" core_name="Atari - 2600 (Stella)"
fi
db_name="Atari - 2600.lpl" db_name="Atari - 2600.lpl"
;; ;;
'atarilynx') 'atarilynx')
rom_ext="lnx" rom_ext="lnx"
core_path="/tmp/cores/handy_libretro.so" core_path="$CORE_PREFIX/handy_libretro.so"
core_name="Atari - Lynx (Handy)" core_name="Atari - Lynx (Handy)"
db_name="Atari - Lynx.lpl" db_name="Atari - Lynx.lpl"
;; ;;
'arcade') 'arcade')
rom_ext="zip" rom_ext="zip"
core_path="/tmp/cores/mame2003_plus_libretro.so" core_path="$CORE_PREFIX/mame2003_plus_libretro.so"
core_name="Arcade (MAME 2003-Plus)" core_name="Arcade (MAME 2003-Plus)"
db_name="MAME 2003-Plus.lpl" db_name="MAME 2003-Plus.lpl"
;; ;;
'pcengine') 'pcengine')
rom_ext="pce" rom_ext="pce"
core_path="/tmp/cores/mednafen_supergrafx_libretro.so" core_path="$CORE_PREFIX/mednafen_supergrafx_libretro.so"
core_name="NEC - PC Engine SuperGrafx (Beetle SuperGrafx)" core_name="NEC - PC Engine SuperGrafx (Beetle SuperGrafx)"
db_name="NEC - PC Engine - TurboGrafx 16.lpl" db_name="NEC - PC Engine - TurboGrafx 16.lpl"
;; ;;
'gba') 'gba')
rom_ext="gba" rom_ext="gba"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/mgba_libretro.so"
core_path="/tmp/cores/gpsp_libretro.so"
core_name="Nintendo - Game Boy Advance (gpSP)"
else
core_path="/tmp/cores/mgba_libretro.so"
core_name="Nintendo - Game Boy Advance (mGBA)" core_name="Nintendo - Game Boy Advance (mGBA)"
fi
db_name="Nintendo - Game Boy Advance.lpl" db_name="Nintendo - Game Boy Advance.lpl"
;; ;;
'gbc') 'gbc')
rom_ext="gbc" rom_ext="gbc"
core_path="/tmp/cores/gambatte_libretro.so" core_path="$CORE_PREFIX/gambatte_libretro.so"
core_name="Nintendo - Game Boy / Color (Gambatte)" core_name="Nintendo - Game Boy / Color (Gambatte)"
db_name="Nintendo - Game Boy Color.lpl" db_name="Nintendo - Game Boy Color.lpl"
;; ;;
'gb') 'gb')
rom_ext="gb" rom_ext="gb"
core_path="/tmp/cores/gambatte_libretro.so" core_path="$CORE_PREFIX/gambatte_libretro.so"
core_name="Nintendo - Game Boy / Color (Gambatte)" core_name="Nintendo - Game Boy / Color (Gambatte)"
db_name="Nintendo - Game Boy.lpl" db_name="Nintendo - Game Boy.lpl"
;; ;;
'n64') 'n64')
rom_ext="z64" rom_ext="z64"
core_path="/tmp/cores/mupen64plus_next_libretro.so" core_path="$CORE_PREFIX/mupen64plus_next_libretro.so"
core_name="Nintendo - Nintendo 64 (Mupen64Plus-Next)" core_name="Nintendo - Nintendo 64 (Mupen64Plus-Next)"
db_name="Nintendo - Nintendo 64.lpl" db_name="Nintendo - Nintendo 64.lpl"
;; ;;
'snes') 'snes')
rom_ext="sfc" rom_ext="sfc"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/snes9x_libretro.so"
core_path="/tmp/cores/snes9x2002_libretro.so"
core_name="Nintendo - SNES / SFC (Snes9x 2002)"
else
core_path="/tmp/cores/snes9x_libretro.so"
core_name="Nintendo - SNES / SFC (Snes9x - Current)" core_name="Nintendo - SNES / SFC (Snes9x - Current)"
fi
db_name="Nintendo - Super Nintendo Entertainment System.lpl" db_name="Nintendo - Super Nintendo Entertainment System.lpl"
;; ;;
'ngpc') 'ngpc')
rom_ext="ngc" rom_ext="ngc"
core_path="/tmp/cores/mednafen_ngp_libretro.so" core_path="$CORE_PREFIX/mednafen_ngp_libretro.so"
core_name="SNK - Neo Geo Pocket / Color (Beetle NeoPop)" core_name="SNK - Neo Geo Pocket / Color (Beetle NeoPop)"
db_name="SNK - Neo Geo Pocket Color.lpl" db_name="SNK - Neo Geo Pocket Color.lpl"
;; ;;
'gamegear') 'gamegear')
rom_ext="gg" rom_ext="gg"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/genesis_plus_gx_libretro.so"
core_path="/tmp/cores/gearsystem_libretro.so"
core_name="Sega - MS/GG/SG-1000 (Gearsystem)"
else
core_path="/tmp/cores/genesis_plus_gx_libretro.so"
core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)" core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)"
fi
db_name="Sega - Game Gear.lpl" db_name="Sega - Game Gear.lpl"
;; ;;
'mastersystem') 'mastersystem')
rom_ext="sms" rom_ext="sms"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/genesis_plus_gx_libretro.so"
core_path="/tmp/cores/picodrive_libretro.so"
core_name="Sega - MS/MD/CD/32X (PicoDrive)"
else
core_path="/tmp/cores/genesis_plus_gx_libretro.so"
core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)" core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)"
fi
db_name="Sega - Master System - Mark III.lpl" db_name="Sega - Master System - Mark III.lpl"
;; ;;
'megadrive') 'megadrive')
rom_ext="md" rom_ext="md"
if [ -n "$GPI_CASE" ]; then core_path="$CORE_PREFIX/genesis_plus_gx_libretro.so"
core_path="/tmp/cores/picodrive_libretro.so"
core_name="Sega - MS/MD/CD/32X (PicoDrive)"
else
core_path="/tmp/cores/genesis_plus_gx_libretro.so"
core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)" core_name="Sega - MS/GG/MD/CD (Genesis Plus GX)"
fi
db_name="Sega - Mega Drive - Genesis.lpl" db_name="Sega - Mega Drive - Genesis.lpl"
;; ;;
'psx') 'psx')
rom_ext="cue" rom_ext="cue"
core_path="/tmp/cores/pcsx_rearmed_libretro.so" core_path="$CORE_PREFIX/pcsx_rearmed_libretro.so"
core_name="Sony - PlayStation (PCSX ReARMed)" core_name="Sony - PlayStation (PCSX ReARMed)"
db_name="Sony - PlayStation.lpl" db_name="Sony - PlayStation.lpl"
;; ;;
@ -153,7 +125,7 @@ for rom in "$rom_dir"/*."$rom_ext"; do
else else
rom_label="$(echo "$rom_file" | sed -e 's/\( ([^)]\+)\)*\.[^.]\+$//')" rom_label="$(echo "$rom_file" | sed -e 's/\( ([^)]\+)\)*\.[^.]\+$//')"
fi fi
rom_path="/storage/roms/$sys_type/$rom_file" rom_path="$ROM_PREFIX/$sys_type/$rom_file"
cat >> temp.json <<EOF cat >> temp.json <<EOF
$comma{ $comma{
"path": "$rom_path", "path": "$rom_path",