-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagicdesk-config-gen.py
More file actions
44 lines (36 loc) · 1.03 KB
/
magicdesk-config-gen.py
File metadata and controls
44 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/env python
import os
filename = 'multicart'
size = 1024
colour = 6
spacing = 0
directory = './prg'
subdirectories = []
for dirname in os.listdir(directory):
subdirectories.append(str(dirname))
menunumber = 0
print "[cartridge]"
print "bin=" + filename + ".bin"
print "size=" + str(size)
print "wave=0"
print "sound=0"
print "\nborder=" + str(colour)
print "background=" + str(colour)
print "character=" + str(colour)
for subdirectory in subdirectories:
menunumber = menunumber + 1
prgnumber = 0
menu = subdirectory.replace("_", " ")
menu = menu.title()
items = os.listdir(directory + "/" + subdirectory)
print "\n\n[menu" + str(menunumber) + "]"
print "spacing=" + str(spacing)
print "title=" + menu
for game in items:
prgnumber = prgnumber + 1
print "\n[prg" + str(menunumber) + str(prgnumber).zfill(2) + "]"
gametitle = os.path.splitext(game)
gametitle = gametitle[0].replace("_", " ")
gametitle = gametitle.title()
print ("file=" + subdirectory + "/" + game)
print ("name=" + gametitle)