From 64e2d55e92415d29b6108de1f4af292265f0c620 Mon Sep 17 00:00:00 2001 From: PoryGone <98504756+PoryGone@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:25:02 -0500 Subject: [PATCH] SMW: Bug+logic fixes (#1279) * Allow levels to scroll vertically without climb or run * Account for needing Yoshi for VB2 Dragon Coins * Don't allow messages on intro level --- worlds/smw/Client.py | 2 +- worlds/smw/Regions.py | 3 ++- worlds/smw/Rom.py | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/worlds/smw/Client.py b/worlds/smw/Client.py index 9cf5a5fc..c2981eff 100644 --- a/worlds/smw/Client.py +++ b/worlds/smw/Client.py @@ -50,7 +50,7 @@ SMW_RECV_PROGRESS_ADDR = WRAM_START + 0x1F2B SMW_GOAL_LEVELS = [0x28, 0x31, 0x32] SMW_INVALID_MARIO_STATES = [0x05, 0x06, 0x0A, 0x0C, 0x0D] -SMW_BAD_TEXT_BOX_LEVELS = [0x26, 0x02, 0x4B] +SMW_BAD_TEXT_BOX_LEVELS = [0x00, 0x26, 0x02, 0x4B] SMW_BOSS_STATES = [0x80, 0xC0, 0xC1] SMW_UNCOLLECTABLE_LEVELS = [0x25, 0x07, 0x0B, 0x40, 0x0E, 0x1F, 0x20, 0x1B, 0x1A, 0x35, 0x34, 0x31, 0x32] diff --git a/worlds/smw/Regions.py b/worlds/smw/Regions.py index fa18d980..d37ad00e 100644 --- a/worlds/smw/Regions.py +++ b/worlds/smw/Regions.py @@ -834,7 +834,8 @@ def create_regions(world, player: int, active_locations): state.has(ItemName.super_star_active, player) and state.has(ItemName.progressive_powerup, player, 3))) add_location_to_region(world, player, active_locations, LocationName.valley_of_bowser_1_region, LocationName.valley_of_bowser_1_dragon) - add_location_to_region(world, player, active_locations, LocationName.valley_of_bowser_2_region, LocationName.valley_of_bowser_2_dragon) + add_location_to_region(world, player, active_locations, LocationName.valley_of_bowser_2_region, LocationName.valley_of_bowser_2_dragon, + lambda state: state.has(ItemName.yoshi_activate, player)) add_location_to_region(world, player, active_locations, LocationName.valley_of_bowser_3_region, LocationName.valley_of_bowser_3_dragon) add_location_to_region(world, player, active_locations, LocationName.valley_ghost_house_region, LocationName.valley_ghost_house_dragon, lambda state: state.has(ItemName.p_switch, player)) diff --git a/worlds/smw/Rom.py b/worlds/smw/Rom.py index b55e666c..d827c124 100644 --- a/worlds/smw/Rom.py +++ b/worlds/smw/Rom.py @@ -677,6 +677,22 @@ def handle_collected_paths(rom): rom.write_bytes(COLLECTED_PATHS_SUB_ADDR + 0x13, bytearray([0x6B])) # RTL +def handle_vertical_scroll(rom): + rom.write_bytes(0x285BA, bytearray([0x22, 0x90, 0xBC, 0x03])) # JSL $03BC90 + + VERTICAL_SCROLL_SUB_ADDR = 0x01BC90 + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x00, bytearray([0x4A])) # LSR + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x01, bytearray([0x4A])) # LSR + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x02, bytearray([0x4A])) # LSR + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x03, bytearray([0x4A])) # LSR + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x04, bytearray([0x08])) # PHP + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x05, bytearray([0xC9, 0x02])) # CMP #02 + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x07, bytearray([0xD0, 0x02])) # BNE +0x02 + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x09, bytearray([0xA9, 0x01])) # LDA #01 + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x0B, bytearray([0x28])) # PLP + rom.write_bytes(VERTICAL_SCROLL_SUB_ADDR + 0x0C, bytearray([0x6B])) # RTL + + def handle_music_shuffle(rom, world, player): from .Aesthetics import generate_shuffled_level_music, generate_shuffled_ow_music, level_music_address_data, ow_music_address_data @@ -808,6 +824,8 @@ def patch_rom(world, rom, player, active_level_dict): handle_collected_paths(rom) + handle_vertical_scroll(rom) + # Handle Level Shuffle handle_level_shuffle(rom, active_level_dict)