diff --git a/src/constants.py b/src/constants.py index 21fd415..a7c7033 100644 --- a/src/constants.py +++ b/src/constants.py @@ -103,6 +103,7 @@ def emucredits(): ram_intro_update = 0xA6CC ram_gamestart = 0xB8F0 ram_ending_dispatch = 0xD61F +ram_hard_world_slippery = 0xF481 mirror_pairs_count = 6 # (x2). world_count = 4 diff --git a/src/mmdata.py b/src/mmdata.py index 497a9f9..776c9a6 100644 --- a/src/mmdata.py +++ b/src/mmdata.py @@ -872,7 +872,7 @@ def get_med_tile(self, idx): def get_micro_tile(self, idx, hard=False): # world 2's special ice topping - if self.idx == 1 and hard: + if self.idx == self.data.hard_slippery_world and hard: if idx in range(0x12, 0x18): return 0x10 return idx @@ -2051,6 +2051,9 @@ def commit(self): # write number of lives self.write_byte(self.ram_to_rom(constants.ram_default_lives), self.default_lives) + # write index of hard mode slippery world + self.write_byte(self.ram_to_rom(constants.ram_hard_world_slippery), self.hard_slippery_world) + # write palettes bs = BitStream(self.bin, self.ram_to_rom(constants.ram_sprite_palette_table)) for i in range(4): @@ -2288,6 +2291,7 @@ def write_bps(self, file): def __init__(self): self.mapper_extension = False + self.hard_slippery_world = 1 self.bin = None self.errors = [] self.startlevel = 0 @@ -2362,6 +2366,9 @@ def stat(self, fname=None, oall=False): out(' "title-press-start-text-position":', str(self.title_screen_press_start_text_position) + ",") out(' "title-players-text-position":', str(self.title_screen_players_text_position) + ",") out() + out(' # index of world which is slippery on hard mode') + out(' "hard-slippery-world":', str(self.hard_slippery_world) + ",") + out() out(' # some special mods that can be applied') out(' "mods": {') for mod in self.mods: @@ -3162,6 +3169,8 @@ def parse(self, file): self.title_screen_press_start_text_position = int(config["title-press-start-text-position"]) if "title-players-text-position" in config: self.title_screen_players_text_position = int(config["title-players-text-position"]) + if "hard-slippery-world" in config: + self.hard_slippery_world = int(config["hard-slippery-world"]) if "mods" in config: for mod in config["mods"]: if mod == "mapper-extension":