Reorganise repository and rename globals to setup

This commit is contained in:
Ryan Dwyer committed 2019-09-29 11:57:51 +10:00
1 parent 66e581a77c
commit 0994436231
9 files changed
+105 -117

No files matched your search

+9 -9
View File
@@ -26,7 +26,7 @@ class Extractor:
self.rom = fd.read()
fd.close()
self.globals = self.decompress(self.rom[self.val('globals'):])
self.setup = self.decompress(self.rom[self.val('setup'):])
self.extract_all()
def extract_all(self):
@@ -110,7 +110,7 @@ class Extractor:
i = self.val('files')
offsets = []
while True:
offset = int.from_bytes(self.globals[i:i+4], 'big')
offset = int.from_bytes(self.setup[i:i+4], 'big')
if offset == 0 and len(offsets):
return offsets
offsets.append(offset)
@@ -143,7 +143,7 @@ class Extractor:
#
def extract_globals(self):
self.write('Uglobals', self.globals)
self.write('ucode/setup.bin', self.setup)
#
# Textures
@@ -208,37 +208,37 @@ class Extractor:
'ntsc-final': {
'game': 0x4fc40,
'files': 0x28080,
'globals': 0x39850,
'setup': 0x39850,
'sfxctl': 0x80a250,
},
'ntsc-1.0': {
'game': 0x4fc40,
'files': 0x28080,
'globals': 0x39850,
'setup': 0x39850,
'sfxctl': 0x80a250,
},
'ntsc-beta': {
'game': 0x43c40,
'files': 0x29160,
'globals': 0x30850,
'setup': 0x30850,
'sfxctl': 0x7be940,
},
'pal-final': {
'game': 0x4fc40,
'files': 0x28910,
'globals': 0x39850,
'setup': 0x39850,
'sfxctl': 0x7f87e0,
},
'pal-beta': {
'game': 0x4fc40,
'files': 0x29b90,
'globals': 0x39850,
'setup': 0x39850,
'sfxctl': 0x7f87e0,
},
'jap-final': {
'game': 0x4fc40,
'files': 0x28800,
'globals': 0x39850,
'setup': 0x39850,
'sfxctl': 0x7fc670,
},
}
+5 -5
View File
@@ -34,19 +34,19 @@ class Injector:
self.rompart3 = rombuffer[0x001a15c0:0x00ed83a0]
self.rompart4 = rombuffer[0x01d5ca00:]
fp = open('build/ntsc-final/Uglobals', 'rb')
globals = fp.read()
fp = open('build/ntsc-final/ucode/setup.bin', 'rb')
setup = fp.read()
fp.close()
self.globaltop = globals[0:0x28080]
self.globalbot = globals[0x2a000:]
self.globaltop = setup[0:0x28080]
self.globalbot = setup[0x2a000:]
self.files = []
i = 0
while i <= 0x7dd:
romnameaddr = int.from_bytes(rombuffer[0x01d5ca00 + i * 4:0x01d5ca00 + i * 4 + 4], 'big') + 0x01d5ca00
romdataaddr = int.from_bytes(globals[0x28080 + i * 4:0x28080 + i * 4 + 4], 'big')
romdataaddr = int.from_bytes(setup[0x28080 + i * 4:0x28080 + i * 4 + 4], 'big')
name = ''
while rombuffer[romnameaddr] != 0: