Use unique hashtable for entrance randomizer.

This commit is contained in:
LLCoolDave 2017-05-25 21:41:37 +02:00
parent 6ef621fe66
commit 8e7a8d7a8d
2 changed files with 14 additions and 2 deletions

11
Main.py
View File

@ -13,6 +13,15 @@ import os
__version__ = '0.2-dev'
logic_hash = [182, 244, 92, 144, 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, seed=None):
start = time.clock()
@ -62,7 +71,7 @@ def main(args, seed=None):
logger.info('Patching ROM.')
rom = bytearray(open(args.rom, 'rb').read())
patched_rom = patch_rom(world, rom, args.quickswap, args.heartbeep)
patched_rom = patch_rom(world, rom, logic_hash, args.quickswap, args.heartbeep)
outfilebase = 'ER_%s_%s_%s_%s' % (world.mode, world.goal, world.shuffle, world.seed)

5
Rom.py
View File

@ -6,7 +6,7 @@ from Text import KingsReturn_texts, Sanctuary_texts, Kakariko_texts, Blacksmiths
import random
def patch_rom(world, rom, quickswap=False, beep='normal'):
def patch_rom(world, rom, hashtable, quickswap=False, beep='normal'):
# patch items
for location in world.get_locations():
if location.name == 'Ganon':
@ -230,6 +230,9 @@ def patch_rom(world, rom, quickswap=False, beep='normal'):
# set heart beep rate
write_byte(rom, 0x180033, {'off': 0x00, 'half': 0x40, 'quarter': 0x80, 'normal': 0x20}[beep])
# store hash table for main menu hash
write_bytes(rom, 0x181000, hashtable)
return rom