From 876119aca1346f30873c40cc1bb6325c836133de Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Sun, 26 Apr 2020 16:03:33 -0700 Subject: [PATCH 1/5] added description of mra checker to readme --- other_authors/README.md | 6 ++++++ 1 file changed, 6 insertions(+) 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 + + From d879a86b75ac561953a96261944f1241cae12e3a Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Wed, 29 Apr 2020 13:52:29 -0700 Subject: [PATCH 2/5] fix indents --- other_authors/mra_rom_check.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/other_authors/mra_rom_check.sh b/other_authors/mra_rom_check.sh index 181afc3..ba3e2b5 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 = [] From c57b347e045f17afeb52a6b9d7f4fa52d9656870 Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Wed, 29 Apr 2020 15:17:29 -0700 Subject: [PATCH 3/5] fixes for python3 --- other_authors/mra_rom_check.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/other_authors/mra_rom_check.sh b/other_authors/mra_rom_check.sh index ba3e2b5..13817d0 100755 --- a/other_authors/mra_rom_check.sh +++ b/other_authors/mra_rom_check.sh @@ -1,4 +1,4 @@ -#!/bin/python +#!/usr/bin/python3 import os import xml.etree.ElementTree as ET import zipfile @@ -41,11 +41,11 @@ def parseMRA(mraFile): noCRC = True info['mraname']=mraFile 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 +61,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 +70,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 +78,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']=[] @@ -108,7 +108,7 @@ 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']) From d67b110de1cc16f1b840ae36181ed5d3fd0cd96a Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Wed, 29 Apr 2020 15:29:21 -0700 Subject: [PATCH 4/5] fixes --- other_authors/mra_rom_check.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/other_authors/mra_rom_check.sh b/other_authors/mra_rom_check.sh index 13817d0..6b1c40e 100755 --- a/other_authors/mra_rom_check.sh +++ b/other_authors/mra_rom_check.sh @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/bin/python import os import xml.etree.ElementTree as ET import zipfile @@ -39,7 +39,10 @@ def parseMRA(mraFile): zipfiles = [] info = {} noCRC = True + noMameVersion= True info['mraname']=mraFile + if ('mameversion' in root): + noMameVersion = False for item in root.findall('rom'): if ('zip' in item.attrib): zip=item.attrib['zip'] @@ -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 From 0e60a175122ac01cca07663b3bdfaff072c8ceb1 Mon Sep 17 00:00:00 2001 From: Alan Steremberg Date: Wed, 29 Apr 2020 15:58:43 -0700 Subject: [PATCH 5/5] fixed mame version --- other_authors/mra_rom_check.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/other_authors/mra_rom_check.sh b/other_authors/mra_rom_check.sh index 6b1c40e..21ae8b8 100755 --- a/other_authors/mra_rom_check.sh +++ b/other_authors/mra_rom_check.sh @@ -41,8 +41,8 @@ def parseMRA(mraFile): noCRC = True noMameVersion= True info['mraname']=mraFile - if ('mameversion' in root): - noMameVersion = False + for item in root.findall('mameversion'): + noMameVersion = False for item in root.findall('rom'): if ('zip' in item.attrib): zip=item.attrib['zip'] @@ -118,6 +118,7 @@ for info in broken: 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')