From 1f6c99635e7f7e55c49a1c3ab41d2444716f8f98 Mon Sep 17 00:00:00 2001 From: Silvris <58583688+Silvris@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:25:11 -0500 Subject: [PATCH] FF1: fix client breaking other NES games (#5293) --- worlds/ff1/Client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worlds/ff1/Client.py b/worlds/ff1/Client.py index f7315f69..a4279afd 100644 --- a/worlds/ff1/Client.py +++ b/worlds/ff1/Client.py @@ -89,11 +89,15 @@ class FF1Client(BizHawkClient): async def validate_rom(self, ctx: "BizHawkClientContext") -> bool: try: + if (await bizhawk.get_memory_size(ctx.bizhawk_ctx, self.rom)) < rom_name_location + 0x0D: + return False # ROM is not large enough to be a Final Fantasy 1 ROM # Check ROM name/patch version rom_name = ((await bizhawk.read(ctx.bizhawk_ctx, [(rom_name_location, 0x0D, self.rom)]))[0]) rom_name = rom_name.decode("ascii") if rom_name != "FINAL FANTASY": return False # Not a Final Fantasy 1 ROM + except UnicodeDecodeError: + return False # rom_name returned invalid text except bizhawk.RequestFailedError: return False # Not able to get a response, say no for now