mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Name each sequence file and use them when building the ROM
This commit is contained in:
1 parent
51c80db5be
commit
d74d72893a
5 files changed
+307
-5
No files matched your search
+123
-2
@@ -62,14 +62,13 @@ class Extractor:
|
||||
length = 0x563b0 if self.romid == 'ntsc-beta' else 0x563a0
|
||||
|
||||
sequences = self.rom[sequencestbl:sequencestbl+length]
|
||||
self.write_asset('sequences.bin', sequences)
|
||||
|
||||
# Extract sequences
|
||||
count = int.from_bytes(sequences[0:2], 'big')
|
||||
i = 0
|
||||
while i < count:
|
||||
sequence = self.extract_sequence(sequences, i)
|
||||
self.write_asset('sequences/%03d.seq' % i, sequence)
|
||||
self.write_asset('sequences/%s.seq' % self.sequencenames[i], sequence)
|
||||
i += 1
|
||||
|
||||
def extract_sequence(self, sequences, index):
|
||||
@@ -307,6 +306,128 @@ class Extractor:
|
||||
index = ['ntsc-beta','ntsc-1.0','ntsc-final','pal-beta','pal-final','jpn-final'].index(self.romid)
|
||||
return self.vals[name][index]
|
||||
|
||||
sequencenames = [
|
||||
'dummy',
|
||||
'title-part1',
|
||||
'extraction-pri',
|
||||
'pause',
|
||||
'defense-pri',
|
||||
'investigation-amb',
|
||||
'escape-pri',
|
||||
'deepsea-pri',
|
||||
'defection-amb',
|
||||
'defection-pri',
|
||||
'solodeath',
|
||||
'defection-intro-effects',
|
||||
'villa-pri',
|
||||
'training-pri',
|
||||
'chicago-pri',
|
||||
'g5building-pri',
|
||||
'defection-nrg',
|
||||
'extraction-nrg',
|
||||
'investigation-pri',
|
||||
'investigation-nrg',
|
||||
'infiltration-pri',
|
||||
'mpdeath-beta',
|
||||
'rescue-pri',
|
||||
'airbase-pri',
|
||||
'afo-pri',
|
||||
'mpdeath',
|
||||
'villa-intro',
|
||||
'endscreen-missing',
|
||||
'pelagic-pri',
|
||||
'crashsite-pri',
|
||||
'crashsite-nrg',
|
||||
'attackship-pri',
|
||||
'attackship-nrg',
|
||||
'skedarruins-pri',
|
||||
'defection-intro',
|
||||
'defection-outro',
|
||||
'defense-nrg',
|
||||
'investigation-intro',
|
||||
'investigation-outro',
|
||||
'villa-nrg',
|
||||
'chicago-nrg',
|
||||
'g5building-nrg',
|
||||
'infiltration-nrg',
|
||||
'chicago-outro',
|
||||
'extraction-outro',
|
||||
'extraction-intro',
|
||||
'g5building-intro',
|
||||
'chicago-intro',
|
||||
'villa-intro-v1',
|
||||
'infiltration-intro',
|
||||
'rescue-nrg',
|
||||
'escape-nrg',
|
||||
'airbase-nrg',
|
||||
'afo-nrg',
|
||||
'pelagic-nrg',
|
||||
'deepsea-nrg',
|
||||
'skedarruins-nrg',
|
||||
'airbase-intro-part2',
|
||||
'darkcombat',
|
||||
'skedarmystery',
|
||||
'crashsite-intro-amb',
|
||||
'cioperative',
|
||||
'datadyneaction',
|
||||
'maiantears',
|
||||
'alienconflict',
|
||||
'escape-intro',
|
||||
'rescue-outro',
|
||||
'villa-intro-v2',
|
||||
'villa-intro-v3',
|
||||
'g5building-outro',
|
||||
'g5building-special',
|
||||
'endscreen-failed',
|
||||
'mpsetup',
|
||||
'endscreen-completed',
|
||||
'crashsite-intro',
|
||||
'airbase-intro',
|
||||
'attackship-intro',
|
||||
'deepsea-special',
|
||||
'afo-intro',
|
||||
'attackship-outro',
|
||||
'escape-specical',
|
||||
'rescue-intro',
|
||||
'deepsea-intro',
|
||||
'infiltration-outro',
|
||||
'pelagic-intro',
|
||||
'escape-outro-long',
|
||||
'defense-intro',
|
||||
'crashsite-outro',
|
||||
'credits',
|
||||
'mainmenu',
|
||||
'deepsea-outro',
|
||||
'afo-special',
|
||||
'pelagic-outro',
|
||||
'afo-outro',
|
||||
'skedarruins-intro',
|
||||
'bloop',
|
||||
'airbase-outro',
|
||||
'defense-outro',
|
||||
'skedarruins-outro',
|
||||
'villa-outro',
|
||||
'skedarruins-king',
|
||||
'training-session',
|
||||
'crashsite-amb',
|
||||
'mpendscreen-completed',
|
||||
'ocean',
|
||||
'airbase-wind',
|
||||
'chicago-traffic',
|
||||
'title-part2',
|
||||
'training-intro',
|
||||
'infiltration-amb',
|
||||
'deepsea-amb',
|
||||
'afo-amb',
|
||||
'attackship-amb',
|
||||
'skedarruins-amb',
|
||||
'escape-outro-ufo',
|
||||
'rescue-amb',
|
||||
'escape-amb',
|
||||
'jingle',
|
||||
'escape-outro-short',
|
||||
]
|
||||
|
||||
vals = {
|
||||
# ntsc-beta ntsc-1.0 ntsc-final pal-beta pal-final jpn-final
|
||||
'game': [0x43c40, 0x4fc40, 0x4fc40, 0x4fc40, 0x4fc40, 0x4fc40, ],
|
||||
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.append('src/assets/sequences')
|
||||
from sequences import sequences
|
||||
|
||||
def zip(filename):
|
||||
return subprocess.check_output(['tools/rarezip', filename])
|
||||
|
||||
zips = []
|
||||
|
||||
fd = open('build/%s/assets/sequences.bin' % os.environ['ROMID'], 'wb')
|
||||
fd.write(len(sequences).to_bytes(2, 'big'))
|
||||
fd.seek(4)
|
||||
|
||||
offset = 4 + len(sequences) * 8
|
||||
|
||||
for name in sequences:
|
||||
filename = 'src/assets/sequences/' + name;
|
||||
fd2 = open(filename, 'rb')
|
||||
data = fd2.read()
|
||||
fd2.close()
|
||||
|
||||
zipped = zip(filename)
|
||||
ziplen = len(zipped)
|
||||
|
||||
if ziplen % 2 == 1:
|
||||
zipped += (0x0a).to_bytes(1, 'big')
|
||||
ziplen += 1
|
||||
|
||||
fd.write(offset.to_bytes(4, 'big'))
|
||||
fd.write(len(data).to_bytes(2, 'big'))
|
||||
fd.write(len(zipped).to_bytes(2, 'big'))
|
||||
|
||||
zips.append(zipped)
|
||||
offset += len(zipped)
|
||||
|
||||
for zipdata in zips:
|
||||
fd.write(zipdata)
|
||||
|
||||
fd.close()
|
||||
Reference in new issue
Block a user