blob: 1ce0e3928e32950efbcecc1407a1cd74913f80ad (
plain)
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
|
import struct
def Goldwood():
names = {}
names['PATH'] = '/Maps/forest/pathdata.bin'
names['SCN0'] = '/Maps/forest/mainscene.bin'
names['3D00'] = '/Maps/forest/base.brres'
names['LV_M'] = '/Maps/common/marker.brres'
return ('SMGoldwood.fileset', names)
def World():
names = {}
names['PATH'] = '/Maps/main/pathdata.bin'
names['SCN0'] = '/Maps/main/mainscene.bin'
names['3D00'] = '/Maps/main/base.brres'
names['LV_M'] = '/Maps/common/marker.brres'
return ('MMFullWorld.fileset', names)
filename, names = World()
header = struct.pack('>4sI', b'MSet', len(names))
entrydata = b''
stringtable = b''
currentoffset = 8 + (8 * len(names))
for key,path in names.items():
entrydata += struct.pack('>4sI', key.encode('Shift-JIS'), currentoffset)
encpath = path.encode('Shift-JIS')
stringtable += encpath
stringtable += b'\0'
currentoffset += len(encpath) + 1
open(filename, 'wb').write(header + entrydata + stringtable)
|