From 3a5a4b89ee860d4b9c762119c27df4abb74c3ba7 Mon Sep 17 00:00:00 2001 From: threeandthreee Date: Thu, 16 Jan 2025 21:58:49 -0500 Subject: [PATCH] LADX: improved warps across unexplored tiles (#4111) --- worlds/ladx/LADXR/generator.py | 1 + worlds/ladx/LADXR/patches/core.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/worlds/ladx/LADXR/generator.py b/worlds/ladx/LADXR/generator.py index ff6cc06c..413bf89c 100644 --- a/worlds/ladx/LADXR/generator.py +++ b/worlds/ladx/LADXR/generator.py @@ -103,6 +103,7 @@ def generateRom(args, world: "LinksAwakeningWorld"): assembler.const("wGoldenLeaves", 0xDB42) # New memory location where to store the golden leaf counter assembler.const("wCollectedTunics", 0xDB6D) # Memory location where to store which tunic options are available (and boots) assembler.const("wCustomMessage", 0xC0A0) + assembler.const("wOverworldRoomStatus", 0xD800) # We store the link info in unused color dungeon flags, so it gets preserved in the savegame. assembler.const("wLinkSyncSequenceNumber", 0xDDF6) diff --git a/worlds/ladx/LADXR/patches/core.py b/worlds/ladx/LADXR/patches/core.py index f4752c82..d9fcd62e 100644 --- a/worlds/ladx/LADXR/patches/core.py +++ b/worlds/ladx/LADXR/patches/core.py @@ -716,9 +716,7 @@ def addWarpImprovements(rom, extra_warps): # Allow cursor to move over black squares # This allows warping to undiscovered areas - a fine cheat, but needs a check for wOverworldRoomStatus in the warp code - CHEAT_WARP_ANYWHERE = False - if CHEAT_WARP_ANYWHERE: - rom.patch(0x01, 0x1AE8, None, ASM("jp $5AF5")) + rom.patch(0x01, 0x1AE8, None, ASM("jp $5AF5")) # This disables the arrows around the selection bubble #rom.patch(0x01, 0x1B6F, None, ASM("ret"), fill_nop=True) @@ -797,8 +795,14 @@ def addWarpImprovements(rom, extra_warps): TeleportHandler: ld a, [$DBB4] ; Load the current selected tile - ; TODO: check if actually revealed so we can have free movement - ; Check cursor against different tiles to see if we are selecting a warp + ld hl, wOverworldRoomStatus + ld e, a ; $5D38: $5F + ld d, $00 ; $5D39: $16 $00 + add hl, de ; $5D3B: $19 + ld a, [hl] + and $80 + jr z, exit + ld a, [$DBB4] ; Load the current selected tile {warp_jump} jr exit