LADX: fix egg sprite in non-patched gfx mode (#1699)

This commit is contained in:
zig-for 2023-04-14 22:47:45 -07:00 committed by GitHub
parent d8f79b4a42
commit 808203a50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -64,9 +64,6 @@ from ..Options import TrendyGame, Palette, MusicChangeCondition
def generateRom(args, settings, ap_settings, auth, seed_name, logic, rnd=None, multiworld=None, player_name=None, player_names=[], player_id = 0): def generateRom(args, settings, ap_settings, auth, seed_name, logic, rnd=None, multiworld=None, player_name=None, player_names=[], player_id = 0):
rom_patches = [] rom_patches = []
if ap_settings["ap_title_screen"]:
rom_patches.append(pkgutil.get_data(__name__, "patches/title_screen.bdiff4"))
rom = ROMWithTables(args.input_filename, rom_patches) rom = ROMWithTables(args.input_filename, rom_patches)
rom.player_names = player_names rom.player_names = player_names
pymods = [] pymods = []
@ -416,9 +413,7 @@ def generateRom(args, settings, ap_settings, auth, seed_name, logic, rnd=None, m
assert(len(auth) == 12) assert(len(auth) == 12)
rom.patch(0x00, SEED_LOCATION, None, binascii.hexlify(auth)) rom.patch(0x00, SEED_LOCATION, None, binascii.hexlify(auth))
for pymod in pymods: for pymod in pymods:
pymod.postPatch(rom) pymod.postPatch(rom)
return rom return rom

View File

@ -1,5 +1,8 @@
import binascii import binascii
import bsdiff4
import os import os
import pkgutil
import tempfile
from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial from BaseClasses import Entrance, Item, ItemClassification, Location, Tutorial
from Fill import fill_restrictive from Fill import fill_restrictive
@ -406,10 +409,18 @@ class LinksAwakeningWorld(World):
player_names=all_names, player_names=all_names,
player_id = self.player) player_id = self.player)
handle = open(out_path, "wb") with open(out_path, "wb") as handle:
rom.save(handle, name="LADXR") rom.save(handle, name="LADXR")
# Write title screen after everything else is done - full gfxmods may stomp over the egg tiles
if self.player_options["ap_title_screen"]:
with tempfile.NamedTemporaryFile(delete=False) as title_patch:
title_patch.write(pkgutil.get_data(__name__, "LADXR/patches/title_screen.bdiff4"))
bsdiff4.file_patch_inplace(out_path, title_patch.name)
os.unlink(title_patch.name)
handle.close()
patch = LADXDeltaPatch(os.path.splitext(out_path)[0]+LADXDeltaPatch.patch_file_ending, player=self.player, patch = LADXDeltaPatch(os.path.splitext(out_path)[0]+LADXDeltaPatch.patch_file_ending, player=self.player,
player_name=self.multiworld.player_name[self.player], patched_path=out_path) player_name=self.multiworld.player_name[self.player], patched_path=out_path)
patch.write() patch.write()