mirror of
https://github.com/ksherlock/ample.git
synced 2026-01-22 16:16:02 +00:00
Updates to enable more machines, currently only in Ample Lite.
This commit is contained in:
@@ -43,12 +43,46 @@ MACHINES = (
|
||||
# "unitron", "utrn1024",
|
||||
|
||||
#atari
|
||||
"st", "megast"
|
||||
"st", "megast",
|
||||
)
|
||||
|
||||
|
||||
MACHINES_EXTRA = MACHINES + (
|
||||
|
||||
# other (for Ample-lite...)
|
||||
|
||||
# acorn
|
||||
"bbcb", "bbca", "bbcb_de", "bbcb_us", "bbcb_no", "bbcbp", "bbcbp128", "bbcm", "bbcmt", "bbcmc", "electron",
|
||||
|
||||
|
||||
# amiga
|
||||
"a500", "a500n", "a1000", "a1000n", "a2000", "a2000n",
|
||||
|
||||
|
||||
# DEC
|
||||
"vt52", "vt100", "vt101", "vt102", "vt240",
|
||||
"ds2100", "ds3100", "ds5k133", "pdp11qb", "pdp11ub", "pdp11ub2",
|
||||
# IBM
|
||||
"rtpc010", "rtpc015", "rtpc020", "rtpc025", "rtpca25",
|
||||
# HP
|
||||
"hp9k310", "hp9k320", "hp9k330", "hp9k332", "hp9k340", "hp9k360", "hp9k370", "hp9k380", "hp9k382",
|
||||
# Intergraph
|
||||
"ip2000", "ip2400", "ip2500", "ip2700", "ip2800", "ip6000", "ip6400", "ip6700", "ip6800",
|
||||
# MIPS
|
||||
"rc2030", "rs2030", "rc3230", "rs3230",
|
||||
# SGI
|
||||
"indigo", "indigo2_4415", "indigo_r4000", "indigo_r4400", "indy_4610", "indy_4613", "indy_5015", "pi4d20", "pi4d25", "pi4d30", "pi4d35",
|
||||
# Sony
|
||||
"nws3260", "nws3410", "nws1580", "nws5000x",
|
||||
# SUN
|
||||
"sun1", "sun2_50", "sun2_120", "sun3_50", "sun3_60", "sun3_110", "sun3_150", "sun3_260", "sun3_e", "sun3_80", "sun4_40", "sun4_50", "sun4_20", "sun4_25", "sun4_65",
|
||||
# "sun3_460", "sun4_400", "sun4_110", "sun4_300", "sun4_60", "sun4_75", "sun_s10", "sun_s20"
|
||||
|
||||
)
|
||||
|
||||
|
||||
SLOTS = (
|
||||
"fdc", # bbc fdc
|
||||
"sl0", "sl1", "sl2", "sl3",
|
||||
"sl4", "sl5", "sl6", "sl7",
|
||||
"exp", "aux",
|
||||
@@ -64,7 +98,21 @@ SLOTS = (
|
||||
"pds", "pds030", "lcpds",
|
||||
|
||||
# st
|
||||
"centronics", "mdin", "mdout"
|
||||
"centronics", "mdin", "mdout",
|
||||
|
||||
# amiga
|
||||
"zorro1", "zorro2", "zorro3", "zorro4", "zorro5",
|
||||
|
||||
# dec
|
||||
"eia", "host", "com_port", "prt_port",
|
||||
"rs232a", "rs232b", "serial0", "serial1", "tty0", "tty1",
|
||||
"kbd", "mse", "keyboard", "kbd_con", "mouseport",
|
||||
|
||||
"isa0", "isa1", "isa2", "isa3", "isa4", "isa5", "isa6", "isa7", "isa8", "isa9",
|
||||
"qbus:1", "qbus:2", "qbus:3", "qbus:4", "qbus:5",
|
||||
|
||||
# bbc
|
||||
"rs423", "tube", "econet254", "analogue", "userport", "internal", "1mhzbus"
|
||||
)
|
||||
|
||||
SLOT_NAMES = {
|
||||
@@ -80,7 +128,7 @@ SLOT_NAMES = {
|
||||
"sl7": "Slot 7",
|
||||
"exp": "Expansion",
|
||||
"aux": "Auxiliary",
|
||||
"rs232": "Modem",
|
||||
"rs232": "Serial",
|
||||
"gameio": "Game I/O",
|
||||
"modem": "Modem",
|
||||
"printer": "Printer",
|
||||
@@ -99,4 +147,54 @@ SLOT_NAMES = {
|
||||
"centronics": "Printer",
|
||||
"mdin": "MIDI In",
|
||||
"mdout": "MIDI Out",
|
||||
|
||||
"zorro1": "Zorro 1",
|
||||
"zorro2": "Zorro 2",
|
||||
"zorro3": "Zorro 3",
|
||||
"zorro4": "Zorro 4",
|
||||
"zorro5": "Zorro 5",
|
||||
|
||||
|
||||
"kbd": "Keyboard",
|
||||
"keyboard": "Keyboard",
|
||||
"kbd_con": "Keyboard",
|
||||
"mse": "Mouse",
|
||||
"mouseport": "Mouse",
|
||||
|
||||
"rs423": "Serial",
|
||||
"eia": "Serial",
|
||||
"host": "Serial",
|
||||
"com_port": "Serial",
|
||||
"prt_port": "Printer",
|
||||
"rs232a": "Serial A",
|
||||
"rs232b": "Serial B",
|
||||
"serial0": "Serial 0",
|
||||
"serial1": "Serial 1",
|
||||
"tty0": "TTY 0",
|
||||
"tty1": "TTY 1",
|
||||
|
||||
"isa0": "Slot 0",
|
||||
"isa1": "Slot 1",
|
||||
"isa2": "Slot 2",
|
||||
"isa3": "Slot 3",
|
||||
"isa4": "Slot 4",
|
||||
"isa5": "Slot 5",
|
||||
"isa6": "Slot 6",
|
||||
"isa7": "Slot 7",
|
||||
"isa8": "Slot 8",
|
||||
"isa9": "Slot 9",
|
||||
|
||||
"qbus:1": "Q-Bus 1",
|
||||
"qbus:2": "Q-Bus 2",
|
||||
"qbus:3": "Q-Bus 3",
|
||||
"qbus:4": "Q-Bus 4",
|
||||
"qbus:5": "Q-Bus 5",
|
||||
|
||||
"tube": "Tube",
|
||||
"econet254": "Econet",
|
||||
"analogue": "Analog Port",
|
||||
"userport": "User Port",
|
||||
"internal": "Internal",
|
||||
"1mhzbus": "1MHz Bus",
|
||||
"fdc": "Disk Drives",
|
||||
}
|
||||
|
||||
17
python/mame.py
Normal file
17
python/mame.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def run(*args):
|
||||
|
||||
env = {'DYLD_FALLBACK_FRAMEWORK_PATH': '../embedded'}
|
||||
path = "../embedded/mame64"
|
||||
path = "../mame/mame-x64"
|
||||
|
||||
st = subprocess.run([path, *args], capture_output=True, env=env, text=True, check=True)
|
||||
|
||||
#if st.returncode != 0:
|
||||
# print("mame error: {}".format(m))
|
||||
# exit(1)
|
||||
|
||||
return st.stdout
|
||||
@@ -1,12 +1,13 @@
|
||||
import argparse
|
||||
import subprocess
|
||||
import hashlib
|
||||
|
||||
from copy import deepcopy
|
||||
from plist import to_plist
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from machines import MACHINES, SLOTS, SLOT_NAMES
|
||||
from machines import MACHINES, MACHINES_EXTRA, SLOTS, SLOT_NAMES
|
||||
import mame
|
||||
|
||||
# macintosh errata:
|
||||
# maclc has scsi:1 - scsi:7 and lcpds slots, but none are currently configurable.
|
||||
@@ -75,14 +76,7 @@ def load_machine(name):
|
||||
rootname = name
|
||||
if name in machine_cache: return machine_cache[name]
|
||||
|
||||
# print(" {}".format(name))
|
||||
env = {'DYLD_FALLBACK_FRAMEWORK_PATH': '../embedded'}
|
||||
st = subprocess.run(["../embedded/mame64", name, "-listxml"], capture_output=True, env=env)
|
||||
if st.returncode != 0:
|
||||
print("mame error: {}".format(name))
|
||||
return False
|
||||
|
||||
xml = st.stdout
|
||||
xml = mame.run(name, "-listxml")
|
||||
root = ET.fromstring(xml)
|
||||
|
||||
for x in root.findall("./machine"):
|
||||
@@ -134,28 +128,34 @@ def find_machine_media(parent):
|
||||
# not built in. Except the Apple3, where the floppy drives are actually slots 0/1/2/3/4
|
||||
#
|
||||
# apple1 has a "snapshot" device. not currently supported.
|
||||
# mac fpds slot - not supported
|
||||
# mac128 kbd slot - not supported
|
||||
# in the //c (but not //c+) the floppy drives are in slot 6 which doesn't otherwise exist.
|
||||
#
|
||||
# not supported:
|
||||
# apple1 - snapshot device
|
||||
# mac [various] - pds/lcpds slot
|
||||
# mac128k - kbd slot
|
||||
#
|
||||
# mac - if scsi:3 / scsibus:3 are not in the xml but are hardcoded cd-rom drives.
|
||||
# pdp11 "floppydisk" is an 8" floppy.
|
||||
|
||||
|
||||
mname = parent.get("name")
|
||||
|
||||
|
||||
|
||||
remap = {
|
||||
"cassette": "cass",
|
||||
"apple1_cass": "cass",
|
||||
"apple2_cass": "cass",
|
||||
"floppy_5_25": "floppy_5_25",
|
||||
"floppy_3_5": "floppy_3_5",
|
||||
"floppy_8": "floppy_8", # pdp-11, etc
|
||||
# mac
|
||||
"scsi_hdd": "hard",
|
||||
"cdrom": "cdrom",
|
||||
|
||||
# bbc
|
||||
"bbc_rom": "rom", # bbc rom slot 0-3
|
||||
"bbc_cass": "cass",
|
||||
}
|
||||
media = {}
|
||||
for x in parent.findall("./device"):
|
||||
@@ -164,25 +164,37 @@ def find_machine_media(parent):
|
||||
intf = x.get("interface")
|
||||
if intf == None: intf = typ # cassette has no interface.
|
||||
|
||||
# print(" ",intf)
|
||||
|
||||
slot = None
|
||||
if ':' in tag:
|
||||
tt = tag.split(':')
|
||||
slot = tt[0]
|
||||
if slot in ("rx01", ):
|
||||
slot = None # pdp-11
|
||||
|
||||
# hack for now - these are scsi:1-7 slots but slot option isn't adjustable.
|
||||
# as of 232 (231?), these are configurable as :scsi:0, etc or :scsibus:0, etc.
|
||||
# if mname[0:3] == "mac" and slot in ("scsi", "scsibus"): slot = None
|
||||
# print(tag, " - ", slot, " - ",intf)
|
||||
|
||||
# MAME 0.258 - scsi slot 3 now hardcoded for cd-rom
|
||||
if slot and intf != "cdrom": continue
|
||||
# skip slot devices -- they'll be handled as part of the device.
|
||||
if slot: continue
|
||||
|
||||
if intf in remap:
|
||||
name = remap[intf]
|
||||
media[name] = media.get(name, 0) + 1
|
||||
|
||||
# mac - scsi:3 / scsibus:3 are not in the xml but are hardcoded cd-rom drives.
|
||||
# check for undeclared cd-rom
|
||||
slotlist = set()
|
||||
for x in parent.findall("./slot"):
|
||||
slotname = split2(x.get("name"))
|
||||
slotlist.add(slotname)
|
||||
|
||||
# print(slotlist)
|
||||
for name in ("scsi","scsibus","scsi0", "scsi1"):
|
||||
if name + ":4" in slotlist and name + ":3" not in slotlist:
|
||||
media["cdrom"] = media.get("cdrom", 0) + 1
|
||||
|
||||
|
||||
#print(media)
|
||||
return media
|
||||
|
||||
|
||||
@@ -233,6 +245,8 @@ def find_media(parent, include_slots=False):
|
||||
name = remap_dev[name]
|
||||
media[name] = media.get(name, 0) + 1
|
||||
|
||||
|
||||
|
||||
# ata_slot (vulcan, cffa, zip, etc) needs to check slot to see if default.
|
||||
# nscsi_connector (a2scsi, a2hsscsi) needs to check slot to see if default.
|
||||
|
||||
@@ -264,6 +278,7 @@ def find_media(parent, include_slots=False):
|
||||
if parent.get("name") == "a2romusr":
|
||||
media["rom"] = media.get("rom", 0) + 1
|
||||
|
||||
|
||||
# scsibus:1 is special cd-rom
|
||||
if parent.get("name") == "a2scsi":
|
||||
media["cdrom"] = media.get("cdrom", 0) + 1
|
||||
@@ -308,6 +323,15 @@ DEVICE_MEDIA = {
|
||||
# 'null_modem': 'bitbanger',
|
||||
# 'rs232_sync_io': 'bitbanger',
|
||||
'a2romusr': 'rom',
|
||||
|
||||
# bbc, etc
|
||||
"525dd": "floppy_5_25",
|
||||
"525hd": "floppy_5_25",
|
||||
"525qd": "floppy_5_25",
|
||||
"525sd": "floppy_5_25",
|
||||
"525ssdd": "floppy_5_25",
|
||||
"525sssd": "floppy_5_25",
|
||||
|
||||
}
|
||||
|
||||
DEVICE_EXCLUDE = set([
|
||||
@@ -335,7 +359,6 @@ def make_device_options(slot):
|
||||
# apple 2 scsi slot 1 is a default cd rom device.
|
||||
# Macintosh scsi slot 3 is a default cd rom device.
|
||||
# THIS IS NOT REFLECTED IN THE XML SINCE IT'S SET AT RUN TIME.
|
||||
# IN FACT, THE :scsi
|
||||
|
||||
options = []
|
||||
has_default = False
|
||||
@@ -388,31 +411,22 @@ def make_device_options(slot):
|
||||
return options
|
||||
|
||||
|
||||
def split2(x):
|
||||
xx = x.split(":")
|
||||
if len(xx) == 1: return xx[0]
|
||||
return xx[0] + ":" + xx[1]
|
||||
|
||||
# given a machine, return a list of slotoptions.
|
||||
def make_device_slots(machine):
|
||||
|
||||
mname = machine.get('name')
|
||||
|
||||
# add missing cd-rom scsi slot1
|
||||
# s0 = machine.find('./slot[@name=":scsibus:0"]')
|
||||
# s1 = machine.find('./slot[@name=":scsibus:1"]')
|
||||
# if s0 and not s1:
|
||||
# s1 = deepcopy(s0)
|
||||
# s1.set('name', ':scsibus:1')
|
||||
# s1.find('slotoption[@name="cdrom"]').set('default','yes')
|
||||
# for ix in range(0, len(machine)):
|
||||
# if machine[ix] == s0:
|
||||
# machine.insert(ix+1, s1)
|
||||
# break
|
||||
# #machine.insert(5,s1)
|
||||
|
||||
|
||||
|
||||
slots = []
|
||||
for slot in machine.findall('./slot'):
|
||||
slotname = slot.get("name")
|
||||
options = make_device_options(slot)
|
||||
if not options: continue
|
||||
|
||||
slots.append({
|
||||
"name": slotname,
|
||||
"options": options
|
||||
@@ -458,6 +472,7 @@ def make_ram(machine):
|
||||
if len(options) == 0 and machine.get('name') == 'las3000':
|
||||
options.append( { "intValue": 192, "description": "192K", "value": "192K", "default": True} )
|
||||
|
||||
if not options: return None
|
||||
|
||||
# sort and add empty starting entry.
|
||||
options.sort(key=lambda x: x["intValue"])
|
||||
@@ -507,35 +522,14 @@ def make_smartport(machine):
|
||||
SLOTS = [
|
||||
*['fdc:' + str(x) for x in range(0,4)],
|
||||
*['scsi:' + str(x) for x in range(0,7)],
|
||||
*['scsi0:' + str(x) for x in range(0,7)],
|
||||
*['scsi1:' + str(x) for x in range(0,7)],
|
||||
*['scsibus:' + str(x) for x in range(0,7)],
|
||||
*['wd1772:' + str(x) for x in range(0,4)],
|
||||
|
||||
"sl6:0", "sl6:1", "0", "1", "2", "3"
|
||||
]
|
||||
|
||||
# surgery to add cd-rom scsi nodes:
|
||||
# s2 = machine.find('slot[@name="scsi:2"]')
|
||||
# s3 = machine.find('slot[@name="scsi:3"]')
|
||||
# if s2 and not s3:
|
||||
# s3 = deepcopy(s2)
|
||||
# parent = s2.find("..")
|
||||
# # print(s2)
|
||||
# # print(parent)
|
||||
# s3.set('name', 'scsi:3')
|
||||
# s3.find('slotoption[@name="cdrom"]').set('default','yes')
|
||||
# machine.append(s3)
|
||||
# # print("inserting s3")
|
||||
|
||||
# s2 = machine.find('slot[@name="scsibus:2"]')
|
||||
# s3 = machine.find('slot[@name="scsibus:3"]')
|
||||
# if s2 and not s3:
|
||||
# s3 = deepcopy(s2)
|
||||
# parent = s2.find("..")
|
||||
# s3.set('name', 'scsibus:3')
|
||||
# s3.find('slotoption[@name="cdrom"]').set('default','yes')
|
||||
# machine.append(s3)
|
||||
|
||||
|
||||
|
||||
for s in SLOTS:
|
||||
path = 'slot[@name="{}"]'.format(s)
|
||||
@@ -598,15 +592,76 @@ def make_slot(m, slotname, nodes):
|
||||
}
|
||||
|
||||
|
||||
def file_changed(path, data):
|
||||
# check if a file has changed.
|
||||
|
||||
try:
|
||||
with open(path, mode='rb') as f:
|
||||
d1 = hashlib.file_digest(f, 'sha256')
|
||||
except Exception as e:
|
||||
return 'new'
|
||||
|
||||
d2 = hashlib.sha256(bytes(data, 'utf8'))
|
||||
|
||||
if d1.digest() == d2.digest(): return False
|
||||
return 'updated'
|
||||
|
||||
|
||||
def find_machine_resolution(machine):
|
||||
|
||||
name = machine.get("cloneof")
|
||||
if not name: name = machine.get("name")
|
||||
|
||||
# node = machine.find('display[@tag="screen"]')
|
||||
node = machine.find('./display')
|
||||
width = int(node.get("width"))
|
||||
height = int(node.get("height"))
|
||||
|
||||
hscale = 1
|
||||
wscale = 1
|
||||
|
||||
# mame height is often garbage.
|
||||
|
||||
# raster screens have a default aspect ratio of 4 : 3
|
||||
# pre-calc something like that, but integer-based.
|
||||
|
||||
#hscale = round((width * 3 / 4 ) / height)
|
||||
#if hscale < 1 : hscale = 1
|
||||
|
||||
return [width, height * hscale]
|
||||
|
||||
# if height * 2 < width:
|
||||
# hscale = 2
|
||||
|
||||
# if name in (
|
||||
# "apple1", "apple2", "apple2e", "apple2c", "apple2gs", "apple3",
|
||||
# "las3000",
|
||||
# "st", "ste", "tt030",
|
||||
# "ceci", "cece", "cecg", "cecm", "cec2000", "zijini"):
|
||||
# hscale = 2
|
||||
|
||||
|
||||
#print('display:', node.get('tag'))
|
||||
#hscale = 2
|
||||
#if m[0:3] == "mac": hscale = 1
|
||||
#return [int(node.get("width")), int(node.get("height")) * hscale]
|
||||
|
||||
|
||||
|
||||
devices = {}
|
||||
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument('machine', nargs="*")
|
||||
p.add_argument('--extra', action='store_true')
|
||||
args = p.parse_args()
|
||||
|
||||
extra = args.extra
|
||||
machines = args.machine
|
||||
if not machines: machines = MACHINES
|
||||
if not machines:
|
||||
if extra:
|
||||
machines = MACHINES_EXTRA
|
||||
else:
|
||||
machines = MACHINES
|
||||
|
||||
for m in machines:
|
||||
|
||||
@@ -615,13 +670,6 @@ for m in machines:
|
||||
machine = load_machine_recursive(m)
|
||||
if not machine:
|
||||
exit(1)
|
||||
# env = {'DYLD_FALLBACK_FRAMEWORK_PATH': '../embedded'}
|
||||
# st = subprocess.run(["../embedded/mame64", m, "-listxml"], capture_output=True, env=env)
|
||||
# if st.returncode != 0:
|
||||
# print("mame error: {}".format(m))
|
||||
# exit(1)
|
||||
# xml = st.stdout
|
||||
# root = ET.fromstring(xml)
|
||||
|
||||
data = { }
|
||||
|
||||
@@ -634,12 +682,7 @@ for m in machines:
|
||||
|
||||
data["media"] = find_machine_media(machine)
|
||||
|
||||
|
||||
# node = machine.find('display[@tag="screen"]')
|
||||
node = machine.find('./display')
|
||||
hscale = 2
|
||||
if m[0:3] == "mac": hscale = 1
|
||||
data["resolution"] = [int(node.get("width")), int(node.get("height")) * hscale]
|
||||
data["resolution"] = find_machine_resolution(machine)
|
||||
|
||||
# submachines.clear()
|
||||
# for x in root.findall("machine[@isdevice='yes']"):
|
||||
@@ -650,7 +693,8 @@ for m in machines:
|
||||
|
||||
# ss = {}
|
||||
slots = []
|
||||
slots.append(make_ram(machine))
|
||||
x = make_ram(machine)
|
||||
if x: slots.append(x)
|
||||
x = make_bios(machine)
|
||||
if x: slots.append(x)
|
||||
|
||||
@@ -684,8 +728,12 @@ for m in machines:
|
||||
|
||||
|
||||
path = "../Ample/Resources/{}.plist".format(m)
|
||||
pl = to_plist(data)
|
||||
st = file_changed(path, pl)
|
||||
if st == False: continue
|
||||
print(m + ':', st)
|
||||
with open(path, "w") as f:
|
||||
f.write(to_plist(data))
|
||||
f.write(pl)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import subprocess
|
||||
|
||||
from plist import to_plist
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from machines import MACHINES
|
||||
|
||||
import re
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from plist import to_plist
|
||||
from machines import MACHINES, MACHINES_EXTRA
|
||||
import mame
|
||||
|
||||
|
||||
apple1_children = None
|
||||
apple2_children = ["apple2", "apple2p", "apple2jp"]
|
||||
@@ -32,12 +33,13 @@ mac_ii_children = [
|
||||
|
||||
mac_lc_children = [
|
||||
"maclc", "maclc2", "maclc3", "maclc3p",
|
||||
"maclc475", "maclc520", "maclc550", "maclc575", "maclc580",
|
||||
"maclc475", "maclc520", "maclc550", "maclc575",
|
||||
"macct610", "macct650",
|
||||
]
|
||||
# maclc50" / macqd630 slots are messed up right now.
|
||||
|
||||
mac_quadra_children = [
|
||||
"macqd605", "macqd610", "macqd630", "macqd650", "macqd700", "macqd800",
|
||||
"macqd605", "macqd610", "macqd650", "macqd700", "macqd800",
|
||||
]
|
||||
|
||||
# se/30 and classic 2 are implemented as a nubus but i'm sticking then with the 128 due to the form factor.
|
||||
@@ -46,7 +48,24 @@ mac_128k_children = ["mac128k", "mac512k", "mac512ke", "macplus",
|
||||
|
||||
atari_st_children = ["st", "megast"]
|
||||
|
||||
tree = [
|
||||
amiga_children = ["a500", "a500n", "a1000", "a1000n", "a2000", "a2000n" ]
|
||||
|
||||
acorn_children = [ "bbcb", "bbca", "bbcb_de", "bbcb_us", "bbcb_no", "bbcbp", "bbcbp128", "bbcm", "bbcmt", "bbcmc", "electron" ]
|
||||
|
||||
dec_vt_children = ["vt52", "vt100", "vt101", "vt102", "vt240"]
|
||||
dec_children = ["ds2100", "ds3100", "ds5k133", "pdp11qb", "pdp11ub", "pdp11ub2"]
|
||||
ibm_rt_children = ["rtpc010", "rtpc015", "rtpc020", "rtpc025", "rtpca25"]
|
||||
hp_9000_children = ["hp9k310", "hp9k320", "hp9k330", "hp9k332", "hp9k340", "hp9k360", "hp9k370", "hp9k380", "hp9k382"]
|
||||
intergraph_children = ["ip2000", "ip2400", "ip2500", "ip2700", "ip2800", "ip6000", "ip6400", "ip6700", "ip6800"]
|
||||
mips_children = ["rc2030", "rs2030", "rc3230", "rs3230"]
|
||||
sgi_children = ["indigo", "indigo2_4415", "indigo_r4000", "indigo_r4400", "indy_4610", "indy_4613", "indy_5015", "pi4d20", "pi4d25", "pi4d30", "pi4d35"]
|
||||
sony_children = ["nws3260", "nws3410", "nws1580", "nws5000x"]
|
||||
sun_children = [
|
||||
"sun1", "sun2_50", "sun2_120", "sun3_50", "sun3_60", "sun3_110", "sun3_150", "sun3_260", "sun3_e", "sun3_80",
|
||||
"sun4_40", "sun4_50", "sun4_20", "sun4_25", "sun4_65",
|
||||
]
|
||||
|
||||
TREE = [
|
||||
("Apple I", "apple1", apple1_children),
|
||||
("Apple ][", "apple2", apple2_children),
|
||||
("Apple IIe", "apple2e", apple2e_children),
|
||||
@@ -63,18 +82,52 @@ tree = [
|
||||
("Macintosh (II)", "maciix", mac_ii_children),
|
||||
("Macintosh (Quadra)", None, mac_quadra_children),
|
||||
("Macintosh (LC)", None, mac_lc_children),
|
||||
("Atari ST", "st", atari_st_children)
|
||||
("Atari ST", "st", atari_st_children),
|
||||
]
|
||||
|
||||
env = {'DYLD_FALLBACK_FRAMEWORK_PATH': '../embedded'}
|
||||
st = subprocess.run(["../embedded/mame64", "-listfull", *MACHINES], check=True, capture_output=True, text=True, env=env)
|
||||
TREE_EXTRA = TREE + [
|
||||
("Acorn", None, acorn_children),
|
||||
("Amiga", None, amiga_children),
|
||||
("DEC VT", None, dec_vt_children),
|
||||
("DEC", None, dec_children),
|
||||
("HP 9000", None, hp_9000_children),
|
||||
("IBM RT", None, ibm_rt_children),
|
||||
("Intergraph", None, intergraph_children),
|
||||
("MIPS", None, mips_children),
|
||||
("SGI", None, sgi_children),
|
||||
("Sony", None, sony_children),
|
||||
("SUN", None, sun_children),
|
||||
]
|
||||
|
||||
|
||||
|
||||
extra = False
|
||||
machines = MACHINES
|
||||
tree = TREE
|
||||
|
||||
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument('--extra', action='store_true')
|
||||
p.add_argument('machine', nargs="*")
|
||||
args = p.parse_args()
|
||||
|
||||
extra = args.extra
|
||||
|
||||
if extra:
|
||||
machines = MACHINES_EXTRA
|
||||
tree = TREE_EXTRA
|
||||
|
||||
|
||||
# Name: Description:
|
||||
# apple2gs "Apple IIgs (ROM03)"
|
||||
# apple2gsr0 "Apple IIgs (ROM00)"
|
||||
|
||||
names = {}
|
||||
|
||||
t = st.stdout
|
||||
#t = st.stdout
|
||||
|
||||
t = mame.run("-listfull", *machines)
|
||||
|
||||
lines = t.split("\n")
|
||||
lines.pop(0)
|
||||
for x in lines:
|
||||
@@ -99,6 +152,7 @@ def make_children(clist):
|
||||
|
||||
data = []
|
||||
|
||||
|
||||
for x in tree:
|
||||
desc, value, children = x
|
||||
tmp = { "description": desc }
|
||||
@@ -107,7 +161,10 @@ for x in tree:
|
||||
|
||||
data.append(tmp)
|
||||
|
||||
path = "../Ample/Resources/models.plist"
|
||||
if extra:
|
||||
path = "../Ample/Resources/models~extra.plist"
|
||||
else:
|
||||
path = "../Ample/Resources/models.plist"
|
||||
with open(path, "w") as f:
|
||||
f.write(to_plist(data))
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import argparse
|
||||
import subprocess
|
||||
|
||||
from plist import to_plist
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
from html.parser import HTMLParser
|
||||
from os.path import splitext
|
||||
|
||||
|
||||
from machines import MACHINES
|
||||
|
||||
from machines import MACHINES, MACHINES_EXTRA
|
||||
import mame
|
||||
from plist import to_plist
|
||||
|
||||
|
||||
# a2pcxport dependencies. not automatically included though
|
||||
@@ -30,17 +28,24 @@ EXTRA_MACHINES = [
|
||||
'apple2c3',
|
||||
'apple2c4',
|
||||
'mac2fdhd',
|
||||
'cuda',
|
||||
]
|
||||
|
||||
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument('--full', action='store_true')
|
||||
p.add_argument('--extra', action='store_true')
|
||||
p.add_argument('machine', nargs="*")
|
||||
args = p.parse_args()
|
||||
|
||||
# full = args.full
|
||||
extra = args.extra
|
||||
machines = args.machine
|
||||
if not machines: machines = [ *MACHINES, *EXTRA_MACHINES]
|
||||
if not machines:
|
||||
if extra:
|
||||
machines = [ *MACHINES_EXTRA, *EXTRA_MACHINES]
|
||||
else:
|
||||
machines = [ *MACHINES, *EXTRA_MACHINES]
|
||||
|
||||
# roms stored in other files.
|
||||
xEXCLUDE = [
|
||||
@@ -116,6 +121,10 @@ EXCLUDE = set([
|
||||
'cw7501',
|
||||
'smoc501',
|
||||
|
||||
# amiga ntsc
|
||||
"a500n",
|
||||
"a1000n",
|
||||
"a2000n",
|
||||
])
|
||||
|
||||
def fix_machine_description(x, devname):
|
||||
@@ -164,12 +173,7 @@ for m in machines:
|
||||
|
||||
print(m)
|
||||
|
||||
env = {'DYLD_FALLBACK_FRAMEWORK_PATH': '../embedded'}
|
||||
st = subprocess.run(["../embedded/mame64", m, "-listxml"], capture_output=True, env=env)
|
||||
if st.returncode != 0:
|
||||
print("mame error: {}".format(m))
|
||||
exit(1)
|
||||
xml = st.stdout
|
||||
xml = mame.run(m, "-listxml")
|
||||
root = ET.fromstring(xml)
|
||||
|
||||
data = { }
|
||||
@@ -213,5 +217,10 @@ ROMS.sort(key=lambda x: x.get('description'))
|
||||
|
||||
|
||||
# print(ROMS)
|
||||
with open("../Ample/Resources/roms.plist", "w") as f:
|
||||
if extra:
|
||||
path = "../Ample/Resources/roms~extra.plist"
|
||||
else:
|
||||
path = "../Ample/Resources/roms.plist"
|
||||
|
||||
with open(path, "w") as f:
|
||||
f.write(to_plist(ROMS))
|
||||
|
||||
Reference in New Issue
Block a user