write 1024 bytes in one go instead of one by one

This commit is contained in:
Fabian Dill 2020-04-16 09:55:55 +02:00
parent 07da1c510b
commit 770f3c305a
1 changed files with 1 additions and 2 deletions

3
Rom.py
View File

@ -727,8 +727,7 @@ def patch_rom(world, rom, player, team, enemized):
rom.write_byte(0x180182, 0x00) # Don't auto equip silvers on pickup
# set up game internal RNG seed
for i in range(1024):
rom.write_byte(0x178000 + i, random.randint(0, 255))
rom.write_bytes(0x178000, random.getrandbits(8 * 1024).to_bytes(1024, 'big'))
# shuffle prize packs
prizes = [0xD8, 0xD8, 0xD8, 0xD8, 0xD9, 0xD8, 0xD8, 0xD9, 0xDA, 0xD9, 0xDA, 0xDB, 0xDA, 0xD9, 0xDA, 0xDA, 0xE0, 0xDF, 0xDF, 0xDA, 0xE0, 0xDF, 0xD8, 0xDF,