Skip to content

Commit

Permalink
MLSS: General bugfixes + Add patch extension to inno_setup.iss (#3286)
Browse files Browse the repository at this point in the history
* Remove outdated header change for ROM verification

* Update Connections to be compatible with python ver. 3.8

* Update inno_setup.iss

* Update inno_setup.iss
  • Loading branch information
jamesbrq authored May 18, 2024
1 parent 2bc3455 commit 0e89388
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
5 changes: 5 additions & 0 deletions inno_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ Root: HKCR; Subkey: "{#MyAppName}pkmnepatch"; ValueData: "Ar
Root: HKCR; Subkey: "{#MyAppName}pkmnepatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}pkmnepatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";

Root: HKCR; Subkey: ".apmlss"; ValueData: "{#MyAppName}mlsspatch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}mlsspatch"; ValueData: "Archipelago Mario & Luigi Superstar Saga Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}mlsspatch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}mlsspatch\shell\open\command"; ValueData: """{app}\ArchipelagoBizHawkClient.exe"" ""%1"""; ValueType: string; ValueName: "";

Root: HKCR; Subkey: ".apcv64"; ValueData: "{#MyAppName}cv64patch"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}cv64patch"; ValueData: "Archipelago Castlevania 64 Patch"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}cv64patch\DefaultIcon"; ValueData: "{app}\ArchipelagoBizHawkClient.exe,0"; ValueType: string; ValueName: "";
Expand Down
15 changes: 3 additions & 12 deletions worlds/mlss/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,10 @@ async def validate_rom(self, ctx: "BizHawkClientContext") -> bool:
# Check ROM name/patch version
rom_name_bytes = await bizhawk.read(ctx.bizhawk_ctx, [(0xA0, 14, "ROM")])
rom_name = bytes([byte for byte in rom_name_bytes[0] if byte != 0]).decode("UTF-8")
if not rom_name.startswith("MARIO&LUIGIU"):
return False
if rom_name == "MARIO&LUIGIUA8":
logger.info(
"ERROR: You appear to be running an unpatched version of Mario & Luigi Superstar Saga. "
"You need to generate a patch file and use it to create a patched ROM."
)
return False
if rom_name != "MARIO&LUIGIUAP":
if not rom_name.startswith("MARIO&LUIGIUA8"):
logger.info(
"ERROR: The patch file used to create this ROM is not compatible with "
"this client. Double check your client version against the version being "
"used by the generator."
"ERROR: You have opened a game that is not Mario & Luigi Superstar Saga. "
"Please make sure you are opening the correct ROM."
)
return False
except UnicodeDecodeError:
Expand Down
7 changes: 2 additions & 5 deletions worlds/mlss/Regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def connect(
target: str,
rule: typing.Optional[typing.Callable] = None,
reach: typing.Optional[bool] = False,
) -> Entrance | None:
) -> typing.Optional[Entrance]:
source_region = world.multiworld.get_region(source, world.player)
target_region = world.multiworld.get_region(target, world.player)

Expand All @@ -317,7 +317,4 @@ def connect(

source_region.exits.append(connection)
connection.connect(target_region)
if reach:
return connection
else:
return None
return connection if reach else None
3 changes: 0 additions & 3 deletions worlds/mlss/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ def write_tokens(world: "MLSSWorld", patch: MLSSProcedurePatch) -> None:
# Bake seed name into ROM
patch.write_token(APTokenTypes.WRITE, 0xDF00A0, world.multiworld.seed_name.encode("UTF-8"))

# Bake patch into header
patch.write_token(APTokenTypes.WRITE, 0xAD, "P".encode("UTF-8"))

# Intro Skip
patch.write_token(
APTokenTypes.WRITE,
Expand Down
Binary file modified worlds/mlss/data/basepatch.bsdiff
Binary file not shown.

0 comments on commit 0e89388

Please sign in to comment.