update the built-in media list. previous logic was incorrect and

excluded apple 3 floppies (which are actually in slots 0,1,2, and 3)
and included and extra cassette for the Apple 1.
This commit is contained in:
Kelvin Sherlock 2020-09-05 01:20:28 -04:00
parent ad33f06f98
commit 8e7e6fa396
5 changed files with 37 additions and 8 deletions

View File

@ -19,8 +19,6 @@
</array>
<key>media</key>
<dict>
<key>flop_5_25</key>
<integer>2</integer>
<key>cass</key>
<integer>1</integer>
</dict>

View File

@ -19,8 +19,6 @@
</array>
<key>media</key>
<dict>
<key>flop_5_25</key>
<integer>2</integer>
<key>cass</key>
<integer>1</integer>
</dict>

View File

@ -107,8 +107,6 @@
</array>
<key>media</key>
<dict>
<key>cass</key>
<integer>1</integer>
</dict>
<key>resolution</key>
<array>

View File

@ -35,6 +35,8 @@
</array>
<key>media</key>
<dict>
<key>flop_5_25</key>
<integer>4</integer>
</dict>
<key>resolution</key>
<array>

View File

@ -19,7 +19,40 @@ DISABLED = set((
'vulcangold',
'vulcaniie',
))
def find_machine_media(parent):
# look for relevant device nodes. If the tag contains a slot, skip since it's
# 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.
# no machines have built-in hard drives.
remap = {
"cassette": "cass",
"apple1_cass": "cass",
"apple2_cass": "cass",
"floppy_5_25": "flop_5_25",
"floppy_3_5": "flop_3_5",
}
media = {}
for x in parent.findall("./device"):
tag = x.get("tag")
typ = x.get("type")
intf = x.get("interface")
if intf == None: intf = typ # cassette has no interface.
# print(" ",intf)
# skip slot devices -- they'll be handled as part of the device.
if ":" in tag and tag[0] not in "0123456789": continue
if intf in remap:
name = remap[intf]
media[name] = media.get(name, 0) + 1
return media
def find_media(parent, include_slots=False):
@ -123,7 +156,7 @@ for m in MACHINES:
data["ram"] = tmp
data["media"] = find_media(machine)
data["media"] = find_machine_media(machine)
# node = machine.find('display[@tag="screen"]')