From aab696fa9ceb89e076446457a21d877efd20ef07 Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Thu, 11 Jul 2019 17:46:57 -0400 Subject: [PATCH] Remove logic_hash It is no longer used for anything. --- Main.py | 20 +------------------- Plando.py | 12 +----------- Rom.py | 2 +- Utils.py | 8 -------- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/Main.py b/Main.py index 3cd7a78f..c2152e55 100644 --- a/Main.py +++ b/Main.py @@ -19,24 +19,6 @@ from Utils import output_path __version__ = '0.6.2' -logic_hash = [134, 166, 181, 191, 228, 89, 188, 200, 5, 157, 217, 139, 180, 198, 106, 104, - 88, 223, 138, 28, 54, 18, 216, 129, 248, 19, 109, 220, 159, 75, 238, 57, - 231, 183, 143, 167, 114, 176, 82, 169, 179, 94, 115, 193, 252, 222, 52, 245, - 33, 208, 39, 122, 177, 136, 29, 161, 210, 165, 6, 125, 146, 212, 101, 185, - 65, 247, 253, 85, 171, 147, 71, 148, 203, 202, 230, 1, 13, 64, 254, 141, - 32, 93, 152, 4, 92, 16, 195, 204, 246, 201, 11, 7, 189, 97, 9, 91, - 237, 215, 163, 131, 142, 34, 111, 196, 120, 127, 168, 211, 227, 61, 187, 110, - 190, 162, 59, 80, 225, 186, 37, 154, 76, 72, 27, 17, 79, 206, 207, 243, - 184, 197, 153, 48, 119, 99, 2, 151, 51, 67, 121, 175, 38, 224, 87, 242, - 45, 22, 155, 244, 209, 117, 214, 213, 194, 126, 236, 73, 133, 70, 49, 140, - 229, 108, 156, 124, 105, 226, 44, 23, 112, 102, 173, 219, 14, 116, 58, 103, - 55, 10, 95, 251, 84, 118, 160, 78, 63, 250, 31, 41, 35, 255, 170, 25, - 66, 172, 98, 249, 68, 8, 113, 21, 46, 24, 137, 149, 81, 130, 42, 164, - 50, 12, 158, 15, 47, 182, 30, 40, 36, 83, 77, 205, 20, 241, 3, 132, - 0, 60, 96, 62, 74, 178, 53, 56, 135, 174, 145, 86, 107, 233, 218, 221, - 43, 150, 100, 69, 235, 26, 234, 192, 199, 144, 232, 128, 239, 123, 240, 90] - - def main(args, seed=None): start = time.clock() @@ -144,7 +126,7 @@ def main(args, seed=None): else: rom = LocalRom(args.rom) - patch_rom(world, player, rom, bytearray(logic_hash)) + patch_rom(world, player, rom) enemizer_patch = [] if use_enemizer: diff --git a/Plando.py b/Plando.py index 0bb3dd1a..290e212b 100755 --- a/Plando.py +++ b/Plando.py @@ -19,16 +19,6 @@ from Main import create_playthrough __version__ = '0.2-dev' -logic_hash = [182, 244, 144, 92, 149, 200, 93, 183, 124, 169, 226, 46, 111, 163, 5, 193, 13, 112, 125, 101, 128, 84, 31, 67, 107, 94, 184, 100, 189, 18, 8, 171, - 142, 57, 173, 38, 37, 211, 253, 131, 98, 239, 167, 116, 32, 186, 70, 148, 66, 151, 143, 86, 59, 83, 16, 51, 240, 152, 60, 242, 190, 117, 76, 122, - 15, 221, 62, 39, 174, 177, 223, 34, 150, 50, 178, 238, 95, 219, 10, 162, 222, 0, 165, 202, 74, 36, 206, 209, 251, 105, 175, 135, 121, 88, 214, 247, - 154, 161, 71, 19, 85, 157, 40, 96, 225, 27, 230, 49, 231, 207, 64, 35, 249, 134, 132, 108, 63, 24, 4, 127, 255, 14, 145, 23, 81, 216, 113, 90, 194, - 110, 65, 229, 43, 1, 11, 168, 147, 103, 156, 77, 80, 220, 28, 227, 213, 198, 172, 79, 75, 140, 44, 146, 188, 17, 6, 102, 56, 235, 166, 89, 218, 246, - 99, 78, 187, 126, 119, 196, 69, 137, 181, 55, 20, 215, 199, 130, 9, 45, 58, 185, 91, 33, 197, 72, 115, 195, 114, 29, 30, 233, 141, 129, 155, 159, 47, - 224, 236, 21, 234, 191, 136, 104, 87, 106, 26, 73, 250, 248, 228, 48, 53, 243, 237, 241, 61, 180, 12, 208, 245, 232, 192, 2, 7, 170, 123, 176, 160, 201, - 153, 217, 252, 158, 25, 205, 22, 133, 254, 138, 203, 118, 210, 204, 82, 97, 52, 164, 68, 139, 120, 109, 54, 3, 41, 179, 212, 42] - - def main(args): start_time = time.clock() @@ -84,7 +74,7 @@ def main(args): sprite = None rom = LocalRom(args.rom) - patch_rom(world, 1, rom, logic_hash, args.heartbeep, args.heartcolor, sprite) + patch_rom(world, 1, rom, args.heartbeep, args.heartcolor, sprite) for textname, texttype, text in text_patches: if texttype == 'text': diff --git a/Rom.py b/Rom.py index 61105b5b..f1583b9c 100644 --- a/Rom.py +++ b/Rom.py @@ -412,7 +412,7 @@ class Sprite(object): # split into palettes of 15 colors return array_chunk(palette_as_colors, 15) -def patch_rom(world, player, rom, hashtable): +def patch_rom(world, player, rom): random.seed(world.rom_seeds[player]) # patch items for location in world.get_locations(): diff --git a/Utils.py b/Utils.py index 0063ed4a..de9fd0c5 100644 --- a/Utils.py +++ b/Utils.py @@ -87,14 +87,6 @@ def close_console(): except Exception: pass -def new_logic_array(): - import random - l = list(range(256)) - random.SystemRandom().shuffle(l) - chunks = [l[i:i + 16] for i in range(0, len(l), 16)] - lines = [", ".join([str(j) for j in i]) for i in chunks] - print("logic_hash = ["+",\n ".join(lines)+"]") - def make_new_base2current(old_rom='Zelda no Densetsu - Kamigami no Triforce (Japan).sfc', new_rom='working.sfc'): from collections import OrderedDict import json