fix cdrom miscount, add some more slots

This commit is contained in:
Kelvin Sherlock 2023-11-12 20:22:24 -05:00
parent 09ced05403
commit 37920884e0
3 changed files with 44 additions and 11 deletions

View File

@ -91,7 +91,8 @@ SLOTS = (
"centronics", "mdin", "mdout",
# dec
"eia", "host", "com_prt", "prt_port"
"eia", "host", "com_prt", "prt_port",
"rs232a", "rs232b", "serial0", "serial1",
)
SLOT_NAMES = {
@ -127,8 +128,12 @@ SLOT_NAMES = {
"mdin": "MIDI In",
"mdout": "MIDI Out",
"eia": "Modem",
"host": "Modem",
"com_prt": "Modem",
"prt_port": "Printer"
"eia": "Serial",
"host": "Serial",
"com_prt": "Serial",
"prt_port": "Printer",
"rs232a": "Serial A",
"rs232b": "Serial B",
"serial0": "Serial 0",
"serial1": "Serial 1",
}

View File

@ -137,10 +137,12 @@ def find_machine_media(parent):
# 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.
mname = parent.get("name")
remap = {
"cassette": "cass",
"apple1_cass": "cass",
@ -158,7 +160,6 @@ 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:
@ -169,14 +170,32 @@ def find_machine_media(parent):
# 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
# MAME 0.258 - scsi slot 3 now hardcoded for cd-rom
if slot and intf != "cdrom": continue
# MAME 0.258 - macintosh scsi slot 3 now hardcoded for cd-rom
#print(tag, " - ", slot, " - ",intf)
#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","scsi1"):
if name + ":4" in slotlist and name + ":3" not in slotlist:
media["cdrom"] = media.get("cdrom", 0) + 1
return media
@ -227,6 +246,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.
@ -258,6 +279,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
@ -382,6 +404,11 @@ 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):

View File

@ -33,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.