From a8dc25e59d0f80471b466ff1d96ae3064d3ab942 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sat, 24 Jan 2026 13:47:53 -0600 Subject: [PATCH] Remove unnecessary references to data/base2current.json --- Rom.py | 24 ------------------------ pyproject.toml | 6 +++--- uv.lock | 3 ++- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/Rom.py b/Rom.py index 8702bdff..70ec5eb4 100644 --- a/Rom.py +++ b/Rom.py @@ -162,8 +162,6 @@ class LocalRom(object): with open(local_path('data/base2current.bps'), 'rb') as stream: bps.apply.apply_to_bytearrays(bps.io.read_bps(stream), orig_buffer, self.buffer) - self.create_json_patch(orig_buffer) - if not os.getenv("SKIP_BASEROM_CHECK", False): # verify md5 patchedmd5 = hashlib.md5() @@ -171,28 +169,6 @@ class LocalRom(object): if RANDOMIZERBASEHASH != patchedmd5.hexdigest(): 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.') - def create_json_patch(self, orig_buffer): - # extend to 2MB - orig_buffer.extend(bytearray([0x00] * (len(self.buffer) - len(orig_buffer)))) - - i = 0 - patches = [] - - while i < len(self.buffer): - if self.buffer[i] == orig_buffer[i]: - i += 1 - continue - - patch_start = i - patch_contents = [] - while self.buffer[i] != orig_buffer[i]: - patch_contents.append(self.buffer[i]) - i += 1 - patches.append({patch_start: patch_contents}) - - with open(local_path('data/base2current.json'), 'w') as fp: - json.dump(patches, fp, separators=(',', ':')) - def write_crc(self): crc = (sum(self.buffer[:0x7FDC] + self.buffer[0x7FE0:]) + 0x01FE) & 0xFFFF inv = crc ^ 0xFFFF diff --git a/pyproject.toml b/pyproject.toml index a10a4674..3daaea9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "ALttPOverworldRandomizer" -version = "0.1.0" -description = "Add your description here" +name = "alttpr-python" +version = "1.0.0" +description = "Python ALttP Randomizer" readme = "README.md" requires-python = ">=3.7" dependencies = [ diff --git a/uv.lock b/uv.lock index dc2946cf..5bb90917 100644 --- a/uv.lock +++ b/uv.lock @@ -11,6 +11,7 @@ resolution-markers = [ name = "aenum" version = "3.1.16" source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/09/7a/61ed58e8be9e30c3fe518899cc78c284896d246d51381bab59b5db11e1f3/aenum-3.1.16.tar.gz", hash = "sha256:bfaf9589bdb418ee3a986d85750c7318d9d2839c1b1a1d6fe8fc53ec201cf140", size = 137693, upload-time = "2026-01-12T22:34:38.819Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/e3/52/6ad8f63ec8da1bf40f96996d25d5b650fdd38f5975f8c813732c47388f18/aenum-3.1.16-py3-none-any.whl", hash = "sha256:9035092855a98e41b66e3d0998bd7b96280e85ceb3a04cc035636138a1943eaf", size = 165627, upload-time = "2025-04-25T03:17:58.89Z" }, ] @@ -41,7 +42,7 @@ wheels = [ ] [[package]] -name = "alttpoverworldrandomizer" +name = "alttpr-python" version = "0.1.0" source = { virtual = "." } dependencies = [