From 51134965fa856b8537060bb911476e008ecd9358 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Mon, 5 Oct 2020 10:49:32 -0700 Subject: [PATCH] basepatch.bmbp is now generated by the basepatch build process. --- Rom.py | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/Rom.py b/Rom.py index eded985b..fffa4e9c 100644 --- a/Rom.py +++ b/Rom.py @@ -91,32 +91,7 @@ class LocalRom(object): stream.write(buffer) return - # verify correct checksum of baserom - if not self.verify(self.buffer, JAP10HASH): - logging.getLogger('').warning( - 'Supplied Base Rom does not match known MD5 for JAP(1.0) release. Will try to patch anyway.') - - # extend to 2MB - self.buffer.extend(bytearray([0x00]) * (0x400000 - len(self.buffer))) - - # load randomizer patches - with open(local_path('data', 'base2current.json')) as stream: - patches = json.load(stream) - for patch in patches: - if isinstance(patch, dict): - for baseaddress, values in patch.items(): - self.write_bytes(int(baseaddress), values) - - # verify md5 - if self.verify(self.buffer): - with open(local_path('basepatch.sfc'), 'wb') as stream: - stream.write(self.buffer) - Patch.create_patch_file(local_path('basepatch.sfc'), - destination=local_path('data', 'basepatch.bmbp')) - os.remove(local_path('data', 'base2current.json')) - else: - raise RuntimeError( - 'Provided Base Rom unsuitable for patching. Please provide a JAP(1.0) "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc" rom to use as a base.') + raise RuntimeError('Could not find Base Patch. Unable to continue.') def write_crc(self): crc = (sum(self.buffer[:0x7FDC] + self.buffer[0x7FE0:]) + 0x01FE) & 0xFFFF