mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Convert setup segment into game's .data segment
This commit is contained in:
1 parent
669add3455
commit
b06e2a87b2
98 files changed
+391
-302
No files matched your search
+3
-3
@@ -20,7 +20,7 @@ def main():
|
||||
write_binary(fd, 0x40, get_rspboot())
|
||||
write_binary(fd, 0x1000, get_boot())
|
||||
write_binary(fd, 0x3050, get_library())
|
||||
write_binary(fd, 0x39850, get_setup())
|
||||
write_binary(fd, 0x39850, get_gamedata())
|
||||
write_binary(fd, 0x4e850, get_inflate())
|
||||
write_binary(fd, 0x4fc40, get_gamezips())
|
||||
write_binary(fd, 0x7f2388, get_fonts())
|
||||
@@ -64,8 +64,8 @@ def get_boot():
|
||||
def get_library():
|
||||
return zip('build/ntsc-final/ucode/library.bin')
|
||||
|
||||
def get_setup():
|
||||
return zip('build/ntsc-final/ucode/setup.bin')
|
||||
def get_gamedata():
|
||||
return zip('build/ntsc-final/ucode/gamedata.bin')
|
||||
|
||||
def get_inflate():
|
||||
return getfilecontents('build/ntsc-final/ucode/inflate.bin')
|
||||
|
||||
+12
-12
@@ -26,14 +26,14 @@ class Extractor:
|
||||
self.rom = fd.read()
|
||||
fd.close()
|
||||
|
||||
self.setup = self.decompress(self.rom[self.val('setup'):])
|
||||
self.gamedata = self.decompress(self.rom[self.val('gamedata'):])
|
||||
self.extract_all()
|
||||
|
||||
def extract_all(self):
|
||||
self.extract_audio()
|
||||
self.extract_files()
|
||||
self.extract_fonts()
|
||||
self.extract_globals()
|
||||
self.extract_gamedata()
|
||||
self.extract_textures()
|
||||
self.extract_ucodes()
|
||||
|
||||
@@ -122,7 +122,7 @@ class Extractor:
|
||||
i = self.val('files')
|
||||
offsets = []
|
||||
while True:
|
||||
offset = int.from_bytes(self.setup[i:i+4], 'big')
|
||||
offset = int.from_bytes(self.gamedata[i:i+4], 'big')
|
||||
if offset == 0 and len(offsets):
|
||||
return offsets
|
||||
offsets.append(offset)
|
||||
@@ -151,11 +151,11 @@ class Extractor:
|
||||
pass
|
||||
|
||||
#
|
||||
# Globals
|
||||
# Game data
|
||||
#
|
||||
|
||||
def extract_globals(self):
|
||||
self.write('ucode/setup.bin', self.setup)
|
||||
def extract_gamedata(self):
|
||||
self.write('ucode/gamedata.bin', self.gamedata)
|
||||
|
||||
#
|
||||
# Textures
|
||||
@@ -227,37 +227,37 @@ class Extractor:
|
||||
'ntsc-final': {
|
||||
'game': 0x4fc40,
|
||||
'files': 0x28080,
|
||||
'setup': 0x39850,
|
||||
'gamedata': 0x39850,
|
||||
'sfxctl': 0x80a250,
|
||||
},
|
||||
'ntsc-1.0': {
|
||||
'game': 0x4fc40,
|
||||
'files': 0x28080,
|
||||
'setup': 0x39850,
|
||||
'gamedata': 0x39850,
|
||||
'sfxctl': 0x80a250,
|
||||
},
|
||||
'ntsc-beta': {
|
||||
'game': 0x43c40,
|
||||
'files': 0x29160,
|
||||
'setup': 0x30850,
|
||||
'gamedata': 0x30850,
|
||||
'sfxctl': 0x7be940,
|
||||
},
|
||||
'pal-final': {
|
||||
'game': 0x4fc40,
|
||||
'files': 0x28910,
|
||||
'setup': 0x39850,
|
||||
'gamedata': 0x39850,
|
||||
'sfxctl': 0x7f87e0,
|
||||
},
|
||||
'pal-beta': {
|
||||
'game': 0x4fc40,
|
||||
'files': 0x29b90,
|
||||
'setup': 0x39850,
|
||||
'gamedata': 0x39850,
|
||||
'sfxctl': 0x7f87e0,
|
||||
},
|
||||
'jap-final': {
|
||||
'game': 0x4fc40,
|
||||
'files': 0x28800,
|
||||
'setup': 0x39850,
|
||||
'gamedata': 0x39850,
|
||||
'sfxctl': 0x7fc670,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
segment=$1
|
||||
|
||||
pos=$(grep "^\.$segment" $B_DIR/stage1.map | awk '{print $6}')
|
||||
len=$(grep "^\.$segment" $B_DIR/stage1.map | awk '{print $3}')
|
||||
pos=$(grep "^\.$segment " $B_DIR/stage1.map | awk '{print $6}')
|
||||
len=$(grep "^\.$segment " $B_DIR/stage1.map | awk '{print $3}')
|
||||
|
||||
dd if=$B_DIR/stage1.bin of=$B_DIR/ucode/$segment.bin skip=$(($pos)) iflag=skip_bytes bs=$(($len)) count=1
|
||||
|
||||
Reference in new issue
Block a user