Name each sequence file and use them when building the ROM
This commit is contained in:
parent
51c80db5be
commit
d74d72893a
|
|
@ -1,4 +1,5 @@
|
|||
*.o
|
||||
*.pyc
|
||||
pd.*.z64
|
||||
build
|
||||
extracted
|
||||
|
|
|
|||
11
Makefile
11
Makefile
|
|
@ -145,6 +145,8 @@ ASSET_FILES := \
|
|||
$(patsubst src/assets/files/lang/$(ROMID)/%.c, $(B_DIR)/assets/files/L%Z, $(shell find src/assets/files/lang/$(ROMID) -name '*_str_[fgis].c')) \
|
||||
$(B_DIR)/assets/files/ob/ob_mid.seg.o
|
||||
|
||||
SEQ_FILES := $(shell find src/assets/sequences -name '*.seq')
|
||||
|
||||
O_FILES := \
|
||||
$(patsubst src/%.c, $(B_DIR)/%.o, $(C_FILES)) \
|
||||
$(patsubst src/%.s, $(B_DIR)/%.o, $(S_FILES)) \
|
||||
|
|
@ -275,9 +277,6 @@ $(B_DIR)/assets/sfx.ctl.o: src/assets/sfx.ctl
|
|||
$(B_DIR)/assets/sfx.tbl.o: src/assets/sfx.tbl
|
||||
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@
|
||||
|
||||
$(B_DIR)/assets/sequences.o: src/assets/sequences.bin
|
||||
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@
|
||||
|
||||
$(B_DIR)/assets/textures.o: src/assets/textures.bin
|
||||
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@
|
||||
|
||||
|
|
@ -415,6 +414,12 @@ $(B_DIR)/assets/accessingpakZ.o: $(B_DIR)/assets/accessingpakZ
|
|||
$(B_DIR)/assets/copyrightZ.o: $(B_DIR)/assets/copyrightZ
|
||||
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@
|
||||
|
||||
$(B_DIR)/assets/sequences.bin: $(SEQ_FILES) src/assets/sequences/sequences.py
|
||||
tools/mksequences
|
||||
|
||||
$(B_DIR)/assets/sequences.o: $(B_DIR)/assets/sequences.bin
|
||||
TOOLCHAIN=$(TOOLCHAIN) ROMID=$(ROMID) tools/mkrawobject $< $@
|
||||
|
||||
$(B_DIR)/boot/%.o: src/boot/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
/usr/bin/env python3 tools/asmpreproc/asm-processor.py -O2 $< | $(IDOCC) -c $(CFLAGS) tools/asmpreproc/include-stdin.c -o $@
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
This file defines which sequences are available and their sequence numbers
|
||||
(based on their position in the array). The order should match the MUSIC
|
||||
constants in constants.h.
|
||||
|
||||
This file is read by the tools/mksequences tool.
|
||||
"""
|
||||
|
||||
sequences = [
|
||||
'dummy.seq', # 000
|
||||
'title-part1.seq', # 001
|
||||
'extraction-pri.seq', # 002
|
||||
'pause.seq', # 003
|
||||
'defense-pri.seq', # 004
|
||||
'investigation-amb.seq', # 005
|
||||
'escape-pri.seq', # 006
|
||||
'deepsea-pri.seq', # 007
|
||||
'defection-amb.seq', # 008
|
||||
'defection-pri.seq', # 009
|
||||
'solodeath.seq', # 010
|
||||
'defection-intro-effects.seq', # 011
|
||||
'villa-pri.seq', # 012
|
||||
'training-pri.seq', # 013
|
||||
'chicago-pri.seq', # 014
|
||||
'g5building-pri.seq', # 015
|
||||
'defection-nrg.seq', # 016
|
||||
'extraction-nrg.seq', # 017
|
||||
'investigation-pri.seq', # 018
|
||||
'investigation-nrg.seq', # 019
|
||||
'infiltration-pri.seq', # 020
|
||||
'mpdeath-beta.seq', # 021
|
||||
'rescue-pri.seq', # 022
|
||||
'airbase-pri.seq', # 023
|
||||
'afo-pri.seq', # 024
|
||||
'mpdeath.seq', # 025
|
||||
'villa-intro.seq', # 026
|
||||
'endscreen-missing.seq', # 027
|
||||
'pelagic-pri.seq', # 028
|
||||
'crashsite-pri.seq', # 029
|
||||
'crashsite-nrg.seq', # 030
|
||||
'attackship-pri.seq', # 031
|
||||
'attackship-nrg.seq', # 032
|
||||
'skedarruins-pri.seq', # 033
|
||||
'defection-intro.seq', # 034
|
||||
'defection-outro.seq', # 035
|
||||
'defense-nrg.seq', # 036
|
||||
'investigation-intro.seq', # 037
|
||||
'investigation-outro.seq', # 038
|
||||
'villa-nrg.seq', # 039
|
||||
'chicago-nrg.seq', # 040
|
||||
'g5building-nrg.seq', # 041
|
||||
'infiltration-nrg.seq', # 042
|
||||
'chicago-outro.seq', # 043
|
||||
'extraction-outro.seq', # 044
|
||||
'extraction-intro.seq', # 045
|
||||
'g5building-intro.seq', # 046
|
||||
'chicago-intro.seq', # 047
|
||||
'villa-intro-v1.seq', # 048
|
||||
'infiltration-intro.seq', # 049
|
||||
'rescue-nrg.seq', # 050
|
||||
'escape-nrg.seq', # 051
|
||||
'airbase-nrg.seq', # 052
|
||||
'afo-nrg.seq', # 053
|
||||
'pelagic-nrg.seq', # 054
|
||||
'deepsea-nrg.seq', # 055
|
||||
'skedarruins-nrg.seq', # 056
|
||||
'airbase-intro-part2.seq', # 057
|
||||
'darkcombat.seq', # 058
|
||||
'skedarmystery.seq', # 059
|
||||
'crashsite-intro-amb.seq', # 060
|
||||
'cioperative.seq', # 061
|
||||
'datadyneaction.seq', # 062
|
||||
'maiantears.seq', # 063
|
||||
'alienconflict.seq', # 064
|
||||
'escape-intro.seq', # 065
|
||||
'rescue-outro.seq', # 066
|
||||
'villa-intro-v2.seq', # 067
|
||||
'villa-intro-v3.seq', # 068
|
||||
'g5building-outro.seq', # 069
|
||||
'g5building-special.seq', # 070
|
||||
'endscreen-failed.seq', # 071
|
||||
'mpsetup.seq', # 072
|
||||
'endscreen-completed.seq', # 073
|
||||
'crashsite-intro.seq', # 074
|
||||
'airbase-intro.seq', # 075
|
||||
'attackship-intro.seq', # 076
|
||||
'deepsea-special.seq', # 077
|
||||
'afo-intro.seq', # 078
|
||||
'attackship-outro.seq', # 079
|
||||
'escape-specical.seq', # 080
|
||||
'rescue-intro.seq', # 081
|
||||
'deepsea-intro.seq', # 082
|
||||
'infiltration-outro.seq', # 083
|
||||
'pelagic-intro.seq', # 084
|
||||
'escape-outro-long.seq', # 085
|
||||
'defense-intro.seq', # 086
|
||||
'crashsite-outro.seq', # 087
|
||||
'credits.seq', # 088
|
||||
'mainmenu.seq', # 089
|
||||
'deepsea-outro.seq', # 090
|
||||
'afo-special.seq', # 091
|
||||
'pelagic-outro.seq', # 092
|
||||
'afo-outro.seq', # 093
|
||||
'skedarruins-intro.seq', # 094
|
||||
'bloop.seq', # 095
|
||||
'airbase-outro.seq', # 096
|
||||
'defense-outro.seq', # 097
|
||||
'skedarruins-outro.seq', # 098
|
||||
'villa-outro.seq', # 099
|
||||
'skedarruins-king.seq', # 100
|
||||
'training-session.seq', # 101
|
||||
'crashsite-amb.seq', # 102
|
||||
'mpendscreen-completed.seq', # 103
|
||||
'ocean.seq', # 104
|
||||
'airbase-wind.seq', # 105
|
||||
'chicago-traffic.seq', # 106
|
||||
'title-part2.seq', # 107
|
||||
'training-intro.seq', # 108
|
||||
'infiltration-amb.seq', # 109
|
||||
'deepsea-amb.seq', # 110
|
||||
'afo-amb.seq', # 111
|
||||
'attackship-amb.seq', # 112
|
||||
'skedarruins-amb.seq', # 113
|
||||
'escape-outro-ufo.seq', # 114
|
||||
'rescue-amb.seq', # 115
|
||||
'escape-amb.seq', # 116
|
||||
'jingle.seq', # 117
|
||||
'escape-outro-short.seq', # 118
|
||||
]
|
||||
125
tools/extract
125
tools/extract
|
|
@ -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, ],
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
Loading…
Reference in New Issue