diff --git a/other_authors/README.md b/other_authors/README.md index 7210d81..858f4b6 100644 --- a/other_authors/README.md +++ b/other_authors/README.md @@ -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 + + diff --git a/other_authors/mra_rom_check.sh b/other_authors/mra_rom_check.sh index 181afc3..21ae8b8 100755 --- a/other_authors/mra_rom_check.sh +++ b/other_authors/mra_rom_check.sh @@ -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')