Skip to content

Commit

Permalink
can now specify the slippery world on hard mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nstbayless committed Jan 27, 2024
1 parent 0d62d2c commit 1c7f3f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/mmdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 1c7f3f4

Please sign in to comment.