Last active
February 10, 2023 04:44
Star
You must be signed in to star a gist
Create MAME dummy/empty files for use with RetroArch a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
._* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!') |
This file has been truncated, but you can view the full file.
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