From 889bffa2316d217d9b9c19d6ba317335af5a2030 Mon Sep 17 00:00:00 2001 From: clue cat Date: Sat, 22 Feb 2025 16:29:21 -0500 Subject: [PATCH 1/3] Reveal Breakable tiles --- src/mars_patcher/constants/reserved_space.py | 1 + src/mars_patcher/data/schema.json | 7 ++++++- src/mars_patcher/misc_patches.py | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mars_patcher/constants/reserved_space.py b/src/mars_patcher/constants/reserved_space.py index 562214c..0abed21 100644 --- a/src/mars_patcher/constants/reserved_space.py +++ b/src/mars_patcher/constants/reserved_space.py @@ -26,3 +26,4 @@ class ReservedConstants: MISSILE_LIMIT_ADDR = 0x7FF06A MINOR_LOCS_ARRAY_ADDR = 0x7FF06C ROOM_NAMES_TABLE_ADDR = 0x7FF070 + REVEAL_HIDDEN_TILES_ADDR = 0x7FF08C diff --git a/src/mars_patcher/data/schema.json b/src/mars_patcher/data/schema.json index 377f64f..ec17585 100644 --- a/src/mars_patcher/data/schema.json +++ b/src/mars_patcher/data/schema.json @@ -651,6 +651,11 @@ }, "required": ["Area", "Room", "Name"] } + }, + "RevealHiddenTiles": { + "type": "boolean", + "description": "When enabled, reveals normally hidden blocks that are breakable by upgrades. Hidden pickup tanks are not revealed regardless of this setting.", + "default": false } }, "required": [ @@ -961,4 +966,4 @@ "default": "OPEN" } } -} \ No newline at end of file +} diff --git a/src/mars_patcher/misc_patches.py b/src/mars_patcher/misc_patches.py index eca474c..8f22a4c 100644 --- a/src/mars_patcher/misc_patches.py +++ b/src/mars_patcher/misc_patches.py @@ -70,3 +70,6 @@ def apply_pbs_without_bombs(rom: Rom) -> None: def apply_anti_softlock_edits(rom: Rom) -> None: apply_patch_in_data_path(rom, "anti_softlock.ips") + +def apply_reveal_hidden_tiles(rom: Rom, enabled: bool) -> None: + rom.write_8(ReservedConstants.REVEAL_HIDDEN_TILES_ADDR, 1 if enabled else 0) From 05fc59145cebcff55c655ae742d9a16ff46193a0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 21:37:17 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/mars_patcher/auto_generated_types.py | 3 +++ src/mars_patcher/misc_patches.py | 1 + 2 files changed, 4 insertions(+) diff --git a/src/mars_patcher/auto_generated_types.py b/src/mars_patcher/auto_generated_types.py index a2b0c84..ee2de07 100644 --- a/src/mars_patcher/auto_generated_types.py +++ b/src/mars_patcher/auto_generated_types.py @@ -624,5 +624,8 @@ class Marsschema(typ.TypedDict, total=False): RoomNames: typ.Annotated[list[MarsschemaRoomnamesItem], 'Unique items'] """Specifies a name to be displayed when the A Button is pressed on the pause menu.""" + RevealHiddenTiles: bool = False + """When enabled, reveals normally hidden blocks that are breakable by upgrades. Hidden pickup tanks are not revealed regardless of this setting.""" + MarsSchema: typ.TypeAlias = Marsschema diff --git a/src/mars_patcher/misc_patches.py b/src/mars_patcher/misc_patches.py index 8f22a4c..62f75a7 100644 --- a/src/mars_patcher/misc_patches.py +++ b/src/mars_patcher/misc_patches.py @@ -71,5 +71,6 @@ def apply_pbs_without_bombs(rom: Rom) -> None: def apply_anti_softlock_edits(rom: Rom) -> None: apply_patch_in_data_path(rom, "anti_softlock.ips") + def apply_reveal_hidden_tiles(rom: Rom, enabled: bool) -> None: rom.write_8(ReservedConstants.REVEAL_HIDDEN_TILES_ADDR, 1 if enabled else 0) From 6de145ef88a819ec7ad6e734c43c43427bab6bc6 Mon Sep 17 00:00:00 2001 From: biosp4rk <37962487+biosp4rk@users.noreply.github.com> Date: Sat, 22 Feb 2025 13:51:26 -0800 Subject: [PATCH 3/3] Check for RevealHiddenTiles in patcher.py --- src/mars_patcher/misc_patches.py | 4 ++-- src/mars_patcher/patcher.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mars_patcher/misc_patches.py b/src/mars_patcher/misc_patches.py index 62f75a7..bf2e7cb 100644 --- a/src/mars_patcher/misc_patches.py +++ b/src/mars_patcher/misc_patches.py @@ -72,5 +72,5 @@ def apply_anti_softlock_edits(rom: Rom) -> None: apply_patch_in_data_path(rom, "anti_softlock.ips") -def apply_reveal_hidden_tiles(rom: Rom, enabled: bool) -> None: - rom.write_8(ReservedConstants.REVEAL_HIDDEN_TILES_ADDR, 1 if enabled else 0) +def apply_reveal_hidden_tiles(rom: Rom) -> None: + rom.write_8(ReservedConstants.REVEAL_HIDDEN_TILES_ADDR, 1) diff --git a/src/mars_patcher/patcher.py b/src/mars_patcher/patcher.py index be85ec9..861543a 100644 --- a/src/mars_patcher/patcher.py +++ b/src/mars_patcher/patcher.py @@ -15,6 +15,7 @@ from mars_patcher.misc_patches import ( apply_anti_softlock_edits, apply_pbs_without_bombs, + apply_reveal_hidden_tiles, apply_unexplored_map, change_missile_limit, disable_demos, @@ -166,6 +167,9 @@ def patch( if patch_data.get("UnexploredMap"): apply_unexplored_map(rom) + if patch_data.get("RevealHiddenTiles"): + apply_reveal_hidden_tiles(rom) + if patch_data.get("DoorLocks") or "HideDoorsOnMinimap" in patch_data: remove_door_colors_on_minimap(rom)