mirror of
https://github.com/MiSTer-devel/Scripts_MiSTer.git
synced 2026-04-19 03:05:34 +00:00
Merge pull request #27 from alanswx/master
added description of mra checker to readme
This commit is contained in:
@@ -11,6 +11,12 @@ Toggles 1000hz USB polling for joysticks and gamepads on or off by editing /linu
|
||||
|
||||
Should not overwrite other u-boot.txt settings.
|
||||
|
||||
###### mra_rom_check.sh by alanswx
|
||||
|
||||
This will validate the standard MRAs and report which ones are missing mame zip files
|
||||
|
||||
###### wifi.sh by MiSTerAddons
|
||||
|
||||
Script adapted from RetroPie for use with MiSTer FPGA project by MiSterAddons
|
||||
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ mame_paths = [
|
||||
]
|
||||
|
||||
def find_mame_folder():
|
||||
for x in mame_paths:
|
||||
if os.path.isdir(x):
|
||||
return x
|
||||
for x in mame_paths:
|
||||
if os.path.isdir(x):
|
||||
return x
|
||||
|
||||
return nil
|
||||
return nil
|
||||
|
||||
broken = []
|
||||
|
||||
@@ -39,13 +39,16 @@ def parseMRA(mraFile):
|
||||
zipfiles = []
|
||||
info = {}
|
||||
noCRC = True
|
||||
noMameVersion= True
|
||||
info['mraname']=mraFile
|
||||
for item in root.findall('mameversion'):
|
||||
noMameVersion = False
|
||||
for item in root.findall('rom'):
|
||||
if (item.attrib.has_key('zip')):
|
||||
if ('zip' in item.attrib):
|
||||
zip=item.attrib['zip']
|
||||
zipfiles = zipfiles+ zip.split('|')
|
||||
for child in item:
|
||||
if (child.attrib.has_key('zip')):
|
||||
if ('zip' in child.attrib):
|
||||
zip=child.attrib['zip']
|
||||
zipfiles = zipfiles+ zip.split('|')
|
||||
#print(zipfiles)
|
||||
@@ -61,7 +64,7 @@ def parseMRA(mraFile):
|
||||
crclist.append('{0:0{1}x}'.format(zi.CRC,8))
|
||||
except:
|
||||
#print('file not found: '+zipfilename)
|
||||
if info.has_key('filename'):
|
||||
if ('filename' in info):
|
||||
info['filename'].append(zipfilename)
|
||||
else:
|
||||
info['filename']=[]
|
||||
@@ -70,7 +73,7 @@ def parseMRA(mraFile):
|
||||
#print(crclist)
|
||||
for item in root.findall('rom/part'):
|
||||
#print(item.attrib)
|
||||
if (item.attrib.has_key('crc')):
|
||||
if ('crc' in item.attrib):
|
||||
noCRC = False
|
||||
crc=item.attrib['crc']
|
||||
if (crc.lower() in crclist):
|
||||
@@ -78,7 +81,7 @@ def parseMRA(mraFile):
|
||||
#print('rom found')
|
||||
else:
|
||||
#print('**ROM NOT FOUND** '+crc)
|
||||
if info.has_key('crc'):
|
||||
if (crc in info):
|
||||
info['crc'].append(crc)
|
||||
else:
|
||||
info['crc']=[]
|
||||
@@ -88,6 +91,8 @@ def parseMRA(mraFile):
|
||||
broken.append(info)
|
||||
if noCRC and len(zipfiles):
|
||||
print(mraFile+':NO CRC, Could not validate')
|
||||
if noMameVersion:
|
||||
print(mraFile+':No MameVersion ')
|
||||
|
||||
return working
|
||||
|
||||
@@ -108,11 +113,12 @@ iterateMRAFiles('/media/fat/_Arcade/')
|
||||
|
||||
for info in broken:
|
||||
missingzips=""
|
||||
if info.has_key('filename'):
|
||||
if ('filename' in info):
|
||||
for fname in info['filename']:
|
||||
missingzips=missingzips+fname+","
|
||||
print("missing: "+missingzips+" for: "+info['mraname'])
|
||||
|
||||
#working=parseMRA('Xevious.mra')
|
||||
#working=parseMRA('Tapper.mra')
|
||||
#print('Working:'+str(working))
|
||||
#working=parseMRA('Asteroids.mra')
|
||||
|
||||
Reference in New Issue
Block a user