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/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..bf2e7cb 100644 --- a/src/mars_patcher/misc_patches.py +++ b/src/mars_patcher/misc_patches.py @@ -70,3 +70,7 @@ 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) -> 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)