mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
Finish sync to Steam functionalities (#551)
* Update for alternative emulators 1 Added first batch of alternative retroarch core for launch * Added log Added log features to the game parsing funtionality * Update altemu Updated with the second and final batch of alternative retroarch cores * Update shortcut.py Added pico8 default emulator * Update shortcut.py Updated with standalone alternative emulators * Final update for alternative emulators Fixed some errors and debug refuses. Added all the check for global alternative emulators * Update configurator.sh Update with sync features * Update shortcut.py Done the sync to steam features * Space escaped
This commit is contained in:
parent
48666f41f8
commit
a6f90e87ff
|
@ -1,4 +1,4 @@
|
|||
"""Export RetroDECK favorites games to steam shortcuts"""
|
||||
"""Sync RetroDECK favorites games with steam shortcuts"""
|
||||
import binascii
|
||||
import os
|
||||
import re
|
||||
|
@ -136,7 +136,135 @@ command_list_default={
|
|||
"wii": "flatpak run --command=dolphin-emu-wrapper net.retrodeck.retrodeck -b -e",
|
||||
"xbox": "flatpak run --command=xemu net.retrodeck.retrodeck -dvd_path",
|
||||
"ps3": "flatpak run --command=pcsx3 net.retrodeck.retrodeck --no-gui",
|
||||
"psp": "flatpak run --command=PPSSPPSDL net.retrodeck.retrodeck"
|
||||
"psp": "flatpak run --command=PPSSPPSDL net.retrodeck.retrodeck",
|
||||
"pico8": "flatpak run --command=pico8 net.retrodeck.retrodeck -desktop_path ~/retrodeck/screenshots -root_path {GAMEDIR} -run"
|
||||
}
|
||||
|
||||
alt_command_list={
|
||||
"PUAE": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/puae_libretro.so",
|
||||
"Caprice32": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/cap32_libretro.so",
|
||||
"MAME - CURRENT": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mame_libretro.so",
|
||||
"Stella": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/stella_libretro.so",
|
||||
"a5200": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/a5200_libretro.so",
|
||||
"Atari800": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/atari800_libretro.so",
|
||||
"Handy": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/handy_libretro.so",
|
||||
"VICE x64sc Accurate": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vice_x64sc_libretro.so",
|
||||
"SAME CDi": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/same_cdi_libretro.so",
|
||||
"blueMSX": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/bluemsx_libretro.so",
|
||||
"MAME - CURRENT": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mame_libretro.so",
|
||||
"PrBoom": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/prboom_libretro.so",
|
||||
"DOSBox-Pure": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/dosbox_pure_libretro.so",
|
||||
"Mesen": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mesen_libretro.so",
|
||||
"Genesis Plus GX": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/genesis_plus_gx_libretro.so",
|
||||
"Gamebatte": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/gambatte_libretro.so",
|
||||
"mGBA": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mgba_libretro.so",
|
||||
"ParaLLEI N64": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/parallel_n64_libretro.so",
|
||||
"DeSmuME": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/desmume_libretro.so",
|
||||
"NeoCD": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/neocd_libretro.so",
|
||||
"Beetle NeoPop": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_ngp_libretro.so",
|
||||
"Neko Project II Kai": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/np2kai_libretro.so",
|
||||
"Beetle PCE": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_pce_libretro.so",
|
||||
"Swanstation": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/swanstation_libretro.so",
|
||||
"TyrQuake": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/tyrquake_libretro.so",
|
||||
"Beetle Saturn": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_saturn_libretro.so",
|
||||
"Snes 9x - Current": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/snes9x_libretro.so",
|
||||
"Beetle SuperGrafx": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_supergrafx_libretro.so",
|
||||
"Yuzu (Standalone)": "flatpak run --command=yuzu net.retrodeck.retrodeck -f -g",
|
||||
"Citra (Standalone)": "flatpak run --command=citra net.retrodeck.retrodeck",
|
||||
"PCSX2 (Standalone)": "flatpak run --command=pcsx2-qt net.retrodeck.retrodeck -batch",
|
||||
"Dolphin (Standalone)": "flatpak run --command=dolphin-emu-wrapper net.retrodeck.retrodeck -b -e",
|
||||
"RPCS3 Directory (Standalone)": "flatpak run --command=pcsx3 net.retrodeck.retrodeck --no-gui",
|
||||
"PPSSPP (Standalone)": "flatpak run --command=PPSSPPSDL net.retrodeck.retrodeck",
|
||||
"PICO-8 (Standalone)": "flatpak run --command=pico8 net.retrodeck.retrodeck -desktop_path ~/retrodeck/screenshots -root_path {GAMEDIR} -run",
|
||||
"PUAE 2021": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/puae2021_libretro.so",
|
||||
"CrocoDS": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/crocods_libretro.so",
|
||||
"CPCemu (Standalone)": "NYI", #NYI
|
||||
"MAME 2010": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mame2010_libretro.so",
|
||||
"MAME 2003-Plus": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mame2003_plus_libretro.so",
|
||||
"MAME 2000": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mame2000_libretro.so",
|
||||
"MAME (Standalone)": "NYI", #NYI
|
||||
"FinalBurn Neo": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fbneo_libretro.so",
|
||||
"FinalBurn Neo (Standalone)": "NYI", #NYI
|
||||
"FB Alpha 2012": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fbalpha2012_libretro.so",
|
||||
"Flycast": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/flycast_libretro.so",
|
||||
"Flycast (Standalone)": "NYI", #NYI
|
||||
"Kronos": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/kronos_libretro.so",
|
||||
"Supermodel (Standalone)": "NYI", #NYI
|
||||
"Supermodel [Fullscreen] (Standalone)": "NYI", #NYI
|
||||
"Shortcut or script": "TODO: I have to catch how it works", #TODO
|
||||
"Atari800 (Standalone)": "NYI", #NYI
|
||||
"Stella 2014": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/stella2014_libretro.so",
|
||||
"Atari800": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/atari800_libretro.so",
|
||||
"Beetle Lynx": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_lynx_libretro.so",
|
||||
"VICE x64 Fast": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vice_x64_libretro.so",
|
||||
"VICE x64 SuperCPU": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vice_xscpu64_libretro.so",
|
||||
"VICE x128": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vice_x128_libretro.so",
|
||||
"Frodo": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/frodo_libretro.so",
|
||||
"CDi 2015": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/cdi2015_libretro.so",
|
||||
"Gearcoleco": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/gearcoleco_libretro.so",
|
||||
"FB Alpha 2012 CPS-1": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fbalpha2012_cps1_libretro.so",
|
||||
"FB Alpha 2012 CPS-2": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fbalpha2012_cps2_libretro.so",
|
||||
"FB Alpha 2012 CPS-3": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fbalpha2012_cps3_libretro.so",
|
||||
"Boom 3": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/boom3_libretro.so",
|
||||
"Boom 3 xp": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/boom3_libretro_xp.so",
|
||||
"DOSBox-Core": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/dosbox_core_libretro.so",
|
||||
"DOSBox-SVN": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/dosbox_svn_libretro.so",
|
||||
"Keep ES-DE running": "TODO: I have to catch how it works", #TODO
|
||||
"AppImage (Suspend ES-DE)": "TODO: I have to catch how it works", #TODO
|
||||
"AppImage (Keep ES-DE running)": "TODO: I have to catch how it works", #TODO
|
||||
"Nestopia UE": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/nestopia_libretro.so",
|
||||
"FCEUmm": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fceumm_libretro.so",
|
||||
"QuickNES": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/quicknes_libretro.so",
|
||||
"Genesis Plus GX Wide": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/genesis_plus_gx_wide_libretro.so",
|
||||
"Gearsystem": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/gearsystem_libretro.so",
|
||||
"SMS Plus GX": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/smsplus_libretro.so",
|
||||
"SameBoy": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/sameboy_libretro.so",
|
||||
"Gearboy": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/gearboy_libretro.so",
|
||||
"TGB Dual": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/tgbdual_libretro.so",
|
||||
"Mesen-S": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mesen-s_libretro.so",
|
||||
"VBA-M": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vbam_libretro.so",
|
||||
"bsnes": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/bsnes_libretro.so",
|
||||
"mGBA": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mgba_libretro.so",
|
||||
"VBA Next": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vba_next_libretro.so",
|
||||
"gpSP": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/gpsp_libretro.so",
|
||||
"Dolphin": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/dolphin_libretro.so",
|
||||
"PrimeHack (Standalone)": "flatpak run --command=primehack-wrapper net.retrodeck.retrodeck -b -e",
|
||||
"PicoDrive": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/picodrive_libretro.so",
|
||||
"BlastEm": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/blastem_libretro.so",
|
||||
"CrocoDS": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/crocods_libretro.so",
|
||||
"fMSX": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/fmsx_libretro.so",
|
||||
"Citra": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/citra_libretro.so",
|
||||
"Citra 2018": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/citra2018_libretro.so",
|
||||
"Mupen64Plus-Next": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mupen64plus_next_libretro.so",
|
||||
"DeSmuME 2015": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/desmume2015_libretro.so",
|
||||
"melonDS": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/melonds_libretro.so",
|
||||
"melonDS (Standalone)": "flatpak run --command=melonDS net.retrodeck.retrodeck",
|
||||
"FinalBurn Neo neogeocd": "flatpak run --command=retroarch net.retrodeck.retrodeck --subsystem neocd -L /var/config/retroarch/cores/fbneo_libretro.so",
|
||||
"RACE": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/race_libretro.so",
|
||||
"Neko Project II": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/nekop2_libretro.so",
|
||||
"Beetle PCE FAST": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_pce_fast_libretro.so",
|
||||
"PICO-8 Splore (Standalone)": "flatpak run --command=pico8 net.retrodeck.retrodeck -desktop_path ~/retrodeck/screenshots -root_path {GAMEDIR} -splore",
|
||||
"AppImage": "TODO: I have to catch how it works", #TODO
|
||||
"LRPS2": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/pcsx2_libretro.so",
|
||||
"PCSX2": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/pcsx2_libretro.so",
|
||||
"RPCS3 Shortcut (Standalone)": "TODO: I have to catch how it works", #TODO
|
||||
"PPSSPP": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/ppsspp_libretro.so",
|
||||
"Beetle PSX": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_psx_libretro.so",
|
||||
"Beetle PSX HW": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_psx_hw_libretro.so",
|
||||
"PCSX ReARMed": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/pcsx_rearmed_libretro.so",
|
||||
"DuckStation (Standalone)": "flatpak run --command=duckstation-qt net.retrodeck.retrodeck -batch",
|
||||
"vitaQuake 2": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vitaquake2_libretro.so",
|
||||
"vitaQuake 2 [Rogue]": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vitaquake2-rogue_libretro.so",
|
||||
"vitaQuake 2 [Xatrix]": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vitaquake2-xatrix_libretro.so",
|
||||
"vitaQuake 2 [Zaero]": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vitaquake2-zaero_libretro.so",
|
||||
"vitaQuake 3": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/vitaquake3_libretro.so",
|
||||
"YabaSanshiro": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/yabasanshiro_libretro.so",
|
||||
"Yabause": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/yabause_libretro.so",
|
||||
"Snes9x 2010": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/snes9x2010_libretro.so",
|
||||
"bsnes-hd": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/bsnes_hd_beta_libretro.so",
|
||||
"bsnes-mercury Accuracy": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/bsnes_mercury_accuracy_libretro.so",
|
||||
"Beetle Supafaust": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_supafaust_libretro.so",
|
||||
"Beetle PCE": "flatpak run --command=retroarch net.retrodeck.retrodeck -L /var/config/retroarch/cores/mednafen_pce_libretro.so"
|
||||
}
|
||||
|
||||
STEAM_DATA_DIRS = (
|
||||
|
@ -158,11 +286,28 @@ def create_shortcut(games, launch_config_name=None):
|
|||
else:
|
||||
shortcuts = []
|
||||
|
||||
old_shortcuts=[]
|
||||
for shortcut in shortcuts:
|
||||
if "net.retrodeck.retrodeck" in shortcut["Exe"]:
|
||||
keep=False
|
||||
for game in games:
|
||||
gameid=generate_shortcut_id(game[0])
|
||||
if gameid==shortcut["appid"]:
|
||||
shortcut["Exe"]=game[1]
|
||||
game[0]="###"
|
||||
keep=True
|
||||
break
|
||||
if keep:
|
||||
old_shortcuts.append(shortcut)
|
||||
else:
|
||||
old_shortcuts.append(shortcut)
|
||||
|
||||
new_shortcuts=[]
|
||||
for game in games:
|
||||
new_shortcuts=new_shortcuts+ [generate_shortcut(game, launch_config_name)]
|
||||
if not game[0]=="###":
|
||||
new_shortcuts=new_shortcuts+[generate_shortcut(game, launch_config_name)]
|
||||
|
||||
shortcuts = list(shortcuts) + new_shortcuts
|
||||
shortcuts = list(old_shortcuts) + list(new_shortcuts)
|
||||
|
||||
updated_shortcuts = {
|
||||
'shortcuts': {
|
||||
|
@ -196,8 +341,8 @@ def search_recursive_in_steam_dirs(path_suffix):
|
|||
|
||||
def generate_shortcut(game, launch_config_name):
|
||||
return {
|
||||
'appid': generate_shortcut_id(game),
|
||||
'AppName': f'{game[0]}',
|
||||
'appid': generate_shortcut_id(game[0]),
|
||||
'appname': f'{game[0]}',
|
||||
'Exe': f'{game[1]}',
|
||||
'StartDir': f'{os.path.expanduser("~")}',
|
||||
'icon': "",
|
||||
|
@ -211,15 +356,17 @@ def generate_shortcut(game, launch_config_name):
|
|||
'LastPlayTime': 0,
|
||||
}
|
||||
|
||||
def generate_preliminary_id(game):
|
||||
unique_id = ''.join(["RetroDECK", game[0]])
|
||||
def generate_preliminary_id(name):
|
||||
unique_id = ''.join(["RetroDECK", name])
|
||||
top = binascii.crc32(str.encode(unique_id, 'utf-8')) | 0x80000000
|
||||
return (top << 32) | 0x02000000
|
||||
|
||||
def generate_shortcut_id(game):
|
||||
return (generate_preliminary_id(game) >> 32) - 0x100000000
|
||||
def generate_shortcut_id(name):
|
||||
return (generate_preliminary_id(name) >> 32) - 0x100000000
|
||||
|
||||
def addToSteam():
|
||||
print("Open RetroDECK config file: {}".format(os.path.expanduser("~/.var/app/net.retrodeck.retrodeck/config/retrodeck/retrodeck.cfg")))
|
||||
|
||||
fl=open(os.path.expanduser("~/.var/app/net.retrodeck.retrodeck/config/retrodeck/retrodeck.cfg"),"r")
|
||||
lines=fl.readlines()
|
||||
for line in lines:
|
||||
|
@ -229,31 +376,59 @@ def addToSteam():
|
|||
roms_folder=line[12:-1]
|
||||
fl.close()
|
||||
games=[]
|
||||
|
||||
command_list_default["pico8"]=command_list_default["pico8"].replace("{GAMEDIR}",roms_folder+"/pico8")
|
||||
alt_command_list["PICO-8 Splore (Standalone)"]=alt_command_list["PICO-8 Splore (Standalone)"].replace("{GAMEDIR}",roms_folder+"/pico8")
|
||||
|
||||
for system in os.listdir(rdhome+"/gamelists/"):
|
||||
tree=ET.parse(rdhome+"/gamelists/"+system+"/gamelist.xml")
|
||||
root=tree.getroot()
|
||||
print("Start parsing system: {}".format(system))
|
||||
|
||||
for game in root:
|
||||
path=""
|
||||
name=""
|
||||
favorite=""
|
||||
altemulator=""
|
||||
for tag in game:
|
||||
if tag.tag=="path":
|
||||
path=tag.text
|
||||
elif tag.tag=="name":
|
||||
name=tag.text
|
||||
elif tag.tag=="favorite":
|
||||
favorite=tag.text
|
||||
elif tag.tag=="altemulator":
|
||||
altemulator=tag.text
|
||||
|
||||
if favorite=="true" and altemulator=="":
|
||||
games.append((name,command_list_default[system]+" "+roms_folder+"/"+system+path[1:]))
|
||||
f=open(rdhome+"/gamelists/"+system+"/gamelist.xml","r")
|
||||
f.readline()
|
||||
parser=ET.XMLParser()
|
||||
parser.feed(b'<root>')
|
||||
parser.feed(f.read())
|
||||
parser.feed(b'</root>')
|
||||
root=parser.close()
|
||||
f.close()
|
||||
|
||||
globalAltEmu=""
|
||||
for subroot in root:
|
||||
if subroot.tag=="alternativeEmulator":
|
||||
for alt in subroot:
|
||||
globalAltEmu=alt.text
|
||||
else:
|
||||
for game in subroot:
|
||||
path=""
|
||||
name=""
|
||||
favorite=""
|
||||
altemulator=globalAltEmu
|
||||
for tag in game:
|
||||
if tag.tag=="path":
|
||||
path=tag.text
|
||||
elif tag.tag=="name":
|
||||
name=tag.text
|
||||
elif tag.tag=="favorite":
|
||||
favorite=tag.text
|
||||
elif tag.tag=="altemulator":
|
||||
altemulator=tag.text
|
||||
|
||||
if favorite=="true" and altemulator=="":
|
||||
print("Find favorite game: {}".format(name))
|
||||
games.append([name,command_list_default[system]+" '"+roms_folder+"/"+system+path[1:]+"'"])
|
||||
elif favorite=="true":
|
||||
print("Find favorite game with alternative emulator: {}, {}".format(name,altemulator))
|
||||
if ("neogeocd" in system) and altemulator=="FinalBurn Neo":
|
||||
games.append([name,alt_command_list[altemulator+" neogeocd"]+" '"+roms_folder+"/"+system+path[1:]+"'"])
|
||||
print(alt_command_list[altemulator+" neogeocd"]+" '"+roms_folder+"/"+system+path[1:]+"'")
|
||||
elif system=="pico8" and altemulator=="PICO-8 Splore (Standalone)":
|
||||
games.append([name,alt_command_list[altemulator]])
|
||||
print(alt_command_list[altemulator])
|
||||
else:
|
||||
games.append([name,alt_command_list[altemulator]+" '"+roms_folder+"/"+system+path[1:]+"'"])
|
||||
print(alt_command_list[altemulator]+" '"+roms_folder+"/"+system+path[1:]+"'")
|
||||
|
||||
create_shortcut(games)
|
||||
|
||||
if __name__=="__main__":
|
||||
addToSteam()
|
||||
#create_shortcut([sys.argv[1],sys.argv[2]])
|
||||
|
|
|
@ -102,7 +102,7 @@ configurator_welcome_dialog() {
|
|||
"RetroDECK: Tools" "Compress games, move RetroDECK and install optional features" \
|
||||
"RetroDECK: Troubleshooting" "Backup data, perform BIOS / multi-disc file checks checks and emulator resets" \
|
||||
"RetroDECK: About" "Show additional information about RetroDECK" \
|
||||
"Add to Steam" "Add to Steam all the favorite games, it will not remove added games" \
|
||||
"Sync with Steam" "Sync with Steam all the favorites games" \
|
||||
"Developer Options" "Welcome to the DANGER ZONE")
|
||||
else
|
||||
welcome_menu_options=("Presets & Settings" "Here you find various presets, tweaks and settings to customize your RetroDECK experience" \
|
||||
|
@ -140,7 +140,7 @@ configurator_welcome_dialog() {
|
|||
configurator_about_retrodeck_dialog
|
||||
;;
|
||||
|
||||
"Add to Steam" )
|
||||
"Sync with Steam" )
|
||||
configurator_add_steam
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in a new issue