Skip to content

Commit a0180b5

Browse files
committed
update mkroms to handle missing parents (eg, sun4_300 is not usable but clones are...)
1 parent 5501124 commit a0180b5

1 file changed

Lines changed: 35 additions & 23 deletions

File tree

python/mkroms.py

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616

1717

1818

19-
20-
# standalone vgmplay????
2119
EXTRA_MACHINES = [
22-
"vgmplay",
23-
"a2pcxport"
20+
"vgmplay"
2421
]
2522

2623
EXCLUDE = set()
@@ -54,34 +51,28 @@ def fix_machine_description(x, devname):
5451
return x
5552

5653

57-
p = argparse.ArgumentParser()
58-
p.add_argument('--full', action='store_true')
59-
p.add_argument('--extra', action='store_true')
60-
p.add_argument('machine', nargs="*")
61-
args = p.parse_args()
62-
63-
extra = args.extra
64-
machines = args.machine
65-
if not machines:
66-
if extra:
67-
machines = [ *MACHINES_EXTRA, *EXTRA_MACHINES]
68-
else:
69-
machines = [ *MACHINES, *EXTRA_MACHINES]
7054

7155
romdata = { }
7256
parents = set()
7357
processed = set()
7458

75-
for mname in machines:
59+
def process_machine(mname):
60+
61+
global romdata
62+
global parents
63+
global processed
64+
global EXCLUDE
7665

7766
print(mname)
7867

68+
69+
7970
xml = mame.run(mname, "-listxml")
8071
root = ET.fromstring(xml)
8172

8273
# todo -- if child in included and has roms, mark them with the parent.
8374

84-
first = True
75+
# first = True
8576
# included = set()
8677
for m in root.findall('./machine'):
8778

@@ -111,15 +102,36 @@ def fix_machine_description(x, devname):
111102
# continue
112103

113104

114-
ROMS = [{ 'value': k, 'description': fix_machine_description(v, k)} for k, v in romdata.items()];
115-
ROMS.sort(key=lambda x: x.get('description'))
116-
# print(ROMS)
105+
106+
p = argparse.ArgumentParser()
107+
p.add_argument('--full', action='store_true')
108+
p.add_argument('--extra', action='store_true')
109+
p.add_argument('machine', nargs="*")
110+
args = p.parse_args()
111+
112+
extra = args.extra
113+
machines = args.machine
114+
if not machines:
115+
if extra:
116+
machines = [ *MACHINES_EXTRA, *EXTRA_MACHINES]
117+
else:
118+
machines = [ *MACHINES, *EXTRA_MACHINES]
119+
120+
121+
122+
for mname in machines:
123+
process_machine(mname)
124+
117125

118126
missing = parents - processed
119127
if len(missing):
120128
print('Missing parents:')
121-
for x in missing: print(x)
129+
for x in missing: process_machine(x)
130+
122131

132+
ROMS = [{ 'value': k, 'description': fix_machine_description(v, k)} for k, v in romdata.items()];
133+
ROMS.sort(key=lambda x: x.get('description'))
134+
# print(ROMS)
123135

124136
if extra:
125137
path = "../Ample/Resources/roms~extra.plist"

0 commit comments

Comments
 (0)