From 456c7056ddf37bcf30075b1ecb93224483bba734 Mon Sep 17 00:00:00 2001 From: Miepee Date: Sat, 3 Jan 2026 15:35:57 +0100 Subject: [PATCH] Update patcher to work with 0.10.0 asm --- pull-assembly-patches.py | 2 +- src/mars_patcher/mf/auto_generated_types.py | 6 ++++++ src/mars_patcher/mf/constants/reserved_space.py | 2 ++ src/mars_patcher/mf/data/schema.json | 10 ++++++++++ src/mars_patcher/mf/misc_patches.py | 8 ++++++++ src/mars_patcher/mf/patcher.py | 8 ++++++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/pull-assembly-patches.py b/pull-assembly-patches.py index 793adb2..d4a0c0e 100644 --- a/pull-assembly-patches.py +++ b/pull-assembly-patches.py @@ -6,7 +6,7 @@ import requests -VERSION = "0.9.2" +VERSION = "0.10.0" ASSET_NAME = "Randomizer.Patches.zip" DESTINATION_ASSEMBLY_PATH = ( Path(__file__) diff --git a/src/mars_patcher/mf/auto_generated_types.py b/src/mars_patcher/mf/auto_generated_types.py index 35f83bb..d4b2f75 100644 --- a/src/mars_patcher/mf/auto_generated_types.py +++ b/src/mars_patcher/mf/auto_generated_types.py @@ -608,6 +608,12 @@ class Marsschemamf(typ.TypedDict, total=False): InstantUnmorph: bool = False """When true, enables instant unmorphing via the SELECT button.""" + NerfGerons: bool = False + """When true, changes the Geron weaknesses to only be weak to their 'intended' values.""" + + UseAlternativeHudHealthLayout: bool = False + """When true, changes the HUD health layout to display 'currentHP/totalHP'.""" + SkipDoorTransitions: bool = False """Makes all door transitions instant when true.""" diff --git a/src/mars_patcher/mf/constants/reserved_space.py b/src/mars_patcher/mf/constants/reserved_space.py index 9f2222c..731e408 100644 --- a/src/mars_patcher/mf/constants/reserved_space.py +++ b/src/mars_patcher/mf/constants/reserved_space.py @@ -13,6 +13,7 @@ class ReservedConstantsMF: PATCHER_FREE_SPACE_ADDR = 0x7D0000 PATCHER_FREE_SPACE_END = PATCHER_FREE_SPACE_ADDR + 0x20000 + # TODO: refactor these to be like in ZM. Instead of hardcoding the addresses. MINOR_LOCS_TABLE_ADDR = 0x7FF000 MINOR_LOCS_ARRAY_ADDR = 0x7FF004 MAJOR_LOCS_POINTER_ADDR = 0x7FF008 @@ -30,3 +31,4 @@ class ReservedConstantsMF: TITLESCREEN_TEXT_POINTERS_POINTER_ADDR = 0x7FF030 DEFAULT_STEREO_FLAG_POINTER_ADDR = 0x7FF034 INSTANT_MORPH_FLAG_POINTER_ADDR = 0x7FF038 + USE_ALTERNATIVE_HUD_DISPLAY = 0x7FF03C diff --git a/src/mars_patcher/mf/data/schema.json b/src/mars_patcher/mf/data/schema.json index 09e842d..68d39bd 100644 --- a/src/mars_patcher/mf/data/schema.json +++ b/src/mars_patcher/mf/data/schema.json @@ -556,6 +556,16 @@ "description": "When true, enables instant unmorphing via the SELECT button.", "default": false }, + "NerfGerons": { + "type": "boolean", + "description": "When true, changes the Geron weaknesses to only be weak to their 'intended' values.", + "default": false + }, + "UseAlternativeHudHealthLayout": { + "type": "boolean", + "description": "When true, changes the HUD health layout to display 'currentHP/totalHP'.", + "default": false + }, "SkipDoorTransitions": { "type": "boolean", "description": "Makes all door transitions instant when true.", diff --git a/src/mars_patcher/mf/misc_patches.py b/src/mars_patcher/mf/misc_patches.py index 69024d8..12ad9b1 100644 --- a/src/mars_patcher/mf/misc_patches.py +++ b/src/mars_patcher/mf/misc_patches.py @@ -81,6 +81,14 @@ def apply_pbs_without_bombs(rom: Rom) -> None: apply_patch_in_asm_path(rom, "bombless_pbs.ips") +def apply_nerf_gerons(rom: Rom) -> None: + apply_patch_in_asm_path(rom, "nerf_geron_weakness.ips") + + +def apply_alternative_health_layout(rom: Rom) -> None: + rom.write_8(rom.read_ptr(ReservedConstantsMF.USE_ALTERNATIVE_HUD_DISPLAY), 1) + + def apply_reveal_hidden_tiles(rom: Rom) -> None: rom.write_8(rom.read_ptr(ReservedConstantsMF.REVEAL_HIDDEN_TILES_ADDR), 1) diff --git a/src/mars_patcher/mf/patcher.py b/src/mars_patcher/mf/patcher.py index 2a2a812..1a1a5e7 100644 --- a/src/mars_patcher/mf/patcher.py +++ b/src/mars_patcher/mf/patcher.py @@ -16,8 +16,10 @@ from mars_patcher.mf.locations import LocationSettings from mars_patcher.mf.misc_patches import ( apply_accessibility_patch, + apply_alternative_health_layout, apply_base_patch, apply_instant_unmorph_patch, + apply_nerf_gerons, apply_pbs_without_bombs, apply_reveal_hidden_tiles, apply_reveal_unexplored_doors, @@ -156,6 +158,12 @@ def patch_mf( if patch_data.get("PowerBombsWithoutBombs"): apply_pbs_without_bombs(rom) + if patch_data.get("NerfGerons"): + apply_nerf_gerons(rom) + + if patch_data.get("UseAlternativeHudHealthLayout"): + apply_alternative_health_layout(rom) + if patch_data.get("UnexploredMap"): apply_unexplored_map(rom)