Skip to content

Commit

Permalink
Added check for old version of ExtraSpace
Browse files Browse the repository at this point in the history
FixNo$GbaSaves 1.0.0 crashes the game on old versions of ExtraSpace, so we need to check for those old versions and prompt the user to update accordingly.
  • Loading branch information
Chesyon authored Dec 19, 2024
1 parent 53b207e commit c5f84d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions skytemple_files/patch/handler/fix_nocash_saves.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
OFFSET_US = 0x4AA98
OFFSET_JP = 0x4AE00

EXTRA_SPACE_OFFSET = 0xC6C+0x34
EXTRA_SPACE_ORIGINAL_INSTRUCTION = 0xE3A00000

class FixNocashSavesPatchHandler(AbstractPatchHandler, DependantPatch):
@property
Expand Down Expand Up @@ -73,8 +75,11 @@ def is_applied(self, rom: NintendoDSRom, config: Pmd2Data) -> bool:
raise NotImplementedError()

def apply(self, apply: Callable[[], None], rom: NintendoDSRom, config: Pmd2Data) -> None:
# Apply the patch
apply()
if 36 in rom.loadArm9Overlays([36]) and read_u32(rom.arm9, EXTRA_SPACE_OFFSET) == EXTRA_SPACE_ORIGINAL_INSTRUCTION: # if overlay36 exists, but the NitroMain hook to load it does not, we're on the old version of ExtraSpace
# TODO: prompt user to update ExtraSpace; fail to apply patch
else:

Check failure on line 80 in skytemple_files/patch/handler/fix_nocash_saves.py

View workflow job for this annotation

GitHub Actions / Type checks (3.10)

expected an indented block after 'if' statement on line 78 [syntax]

Check failure on line 80 in skytemple_files/patch/handler/fix_nocash_saves.py

View workflow job for this annotation

GitHub Actions / Type checks (3.11)

expected an indented block after 'if' statement on line 78 [syntax]

Check failure on line 80 in skytemple_files/patch/handler/fix_nocash_saves.py

View workflow job for this annotation

GitHub Actions / Type checks (3.12)

expected an indented block after 'if' statement on line 78 [syntax]
# Apply the patch
apply()

def unapply(self, unapply: Callable[[], None], rom: NintendoDSRom, config: Pmd2Data) -> None:
raise NotImplementedError()

0 comments on commit c5f84d3

Please sign in to comment.