Skip to content

Instantly share code, notes, and snippets.

@zach-morris
Last active February 10, 2023 04:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zach-morris/0be85391cc4977d98cd5e843ee15b850 to your computer and use it in GitHub Desktop.
Create MAME dummy/empty files for use with RetroArch a
from pathlib import Path
import xmltodict
print('Starting')
folder_to_put_clone_files = Path('/path_to/mame_empty_clone_files/')
# https://www.progettosnaps.net/dats/MAME/
# https://github.com/libretro/FBNeo/tree/master/dats
# dat_file = Path('/path_to/MAME 0.236 (Arcade).dat') #Path to the MAME dat file
dat_file = Path('/path_to/ARCADE 0.236.dat') #Path to the MAME dat file
print('Parsing DAT file')
with open(dat_file,'rb') as fn:
games = [x.get('@name') for x in xmltodict.parse(fn).get('datafile').get('machine') if x.get('@name') and x.get('@cloneof')] #MAME DAT
#games = [x.get('@name') for x in xmltodict.parse(fn).get('datafile').get('game') if x.get('@name') and x.get('@cloneof')] #FBNeo DAT
for gg in games:
folder_to_put_clone_files.joinpath(gg+'.zip').write_text('') #Write dummy file
print('Done!')
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment