From 2ff737175fbd58a5b9fa4906aa94f7fb778a3430 Mon Sep 17 00:00:00 2001 From: PoryGone <98504756+PoryGone@users.noreply.github.com> Date: Fri, 11 Nov 2022 05:50:29 -0500 Subject: [PATCH] SMW: Fix Baby Yoshi and Rope Jump Exploits (#1226) * Fix Baby Yoshi and Rope Jump Exploits * Fix logic error of Forest of Illusion 3 Secret Exit --- worlds/smw/Regions.py | 2 +- worlds/smw/Rom.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/worlds/smw/Regions.py b/worlds/smw/Regions.py index 7af7b888..fa18d980 100644 --- a/worlds/smw/Regions.py +++ b/worlds/smw/Regions.py @@ -968,7 +968,7 @@ def connect_regions(world, player, level_to_tile_dict): lambda state: (state.has(ItemName.mario_carry, player) or state.has(ItemName.yoshi_activate, player))) connect(world, player, names, LocationName.forest_of_illusion_3_region, LocationName.forest_of_illusion_3_exit_2, - lambda state: (state.has(ItemName.mario_swim, player) and + lambda state: (state.has(ItemName.mario_spin_jump, player) and state.has(ItemName.mario_carry, player) and state.has(ItemName.progressive_powerup, player, 1))) connect(world, player, names, LocationName.forest_of_illusion_4_region, LocationName.forest_of_illusion_4_exit_1) diff --git a/worlds/smw/Rom.py b/worlds/smw/Rom.py index 34bdd2f0..a2534aa6 100644 --- a/worlds/smw/Rom.py +++ b/worlds/smw/Rom.py @@ -213,6 +213,22 @@ def handle_ability_code(rom): rom.write_bytes(CLIMB_SUB_ADDR + 0x12, bytearray([0x5C, 0x76, 0xCD, 0x00])) # JML $00CD76 # End Climb + # Climb Rope + rom.write_bytes(0xDA33, bytearray([0x22, 0x70, 0xBC, 0x03])) # JSL $03BC70 + + CLIMB_ROPE_SUB_ADDR = 0x01BC70 + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x00, bytearray([0x08])) # PHP + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x01, bytearray([0xAD, 0x2C, 0x1F])) # LDA $1F2C + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x04, bytearray([0x89, 0x20])) # BIT #20 + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x06, bytearray([0xF0, 0x07])) # BEQ +0x07 + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x08, bytearray([0x28])) # PLP + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x09, bytearray([0xA9, 0xB0])) # LDA #B0 + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x0B, bytearray([0x85, 0x7D])) # STA $7D + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x0D, bytearray([0x80, 0x01])) # BRA +0x01 + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x0F, bytearray([0x28])) # PLP + rom.write_bytes(CLIMB_ROPE_SUB_ADDR + 0x10, bytearray([0x6B])) # RTL + # End Climb Rope + # P-Switch rom.write_bytes(0xAB1A, bytearray([0x22, 0xA0, 0xBA, 0x03])) # JSL $03BAA0 rom.write_bytes(0xAB1E, bytearray([0xEA] * 0x01)) @@ -349,6 +365,9 @@ def handle_ability_code(rom): rom.write_bytes(0xA2B8, bytearray([0x22, 0x20, 0xBB, 0x03])) # JSL $03BB20 rom.write_bytes(0xA2BC, bytearray([0xEA] * 0x01)) + rom.write_bytes(0x1C05F, bytearray([0x22, 0x20, 0xBB, 0x03])) # JSL $03BB20 + rom.write_bytes(0x1C063, bytearray([0xEA] * 0x01)) + YOSHI_SUB_ADDR = 0x01BB20 rom.write_bytes(YOSHI_SUB_ADDR + 0x00, bytearray([0x08])) # PHP rom.write_bytes(YOSHI_SUB_ADDR + 0x01, bytearray([0x9C, 0x1E, 0x14])) # STZ $141E