From 0d78a9e0740a1faa32210f39687e68bade5195fb Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 16 Oct 2026 06:35:06 +0200 Subject: [PATCH] fix: check the beetle lynx boot rom size --- emulators/beetle_lynx.yml | 3 ++- tests/test_profile_checks.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/emulators/beetle_lynx.yml b/emulators/beetle_lynx.yml index 7bedcdc1..6130604d 100644 --- a/emulators/beetle_lynx.yml +++ b/emulators/beetle_lynx.yml @@ -30,7 +30,8 @@ files: description: "Atari Lynx boot ROM" region: [world] required: true - size: 512 + min_size: 512 + validation: [size] crc32: "0d973c9d" source_ref: "libretro.cpp:191, mednafen/lynx/rom.cpp:50-78, mednafen/lynx/cart.cpp:67" note: "512-byte boot ROM. Core silently degrades without it but games will not run." diff --git a/tests/test_profile_checks.py b/tests/test_profile_checks.py index d9b90aaa..7cb54661 100644 --- a/tests/test_profile_checks.py +++ b/tests/test_profile_checks.py @@ -88,5 +88,16 @@ class BeebEmSidewaysRoms(_Probe): self.assertFalse(self.accepts("beebem", "BASIC2.rom", b"\0" * 200000)) +class BeetleLynxBootRom(_Probe): + """CRom drops a boot ROM under 512 bytes and keeps the 0x88 fill, so no + game boots; a longer one is read for its first 512 bytes + (mednafen/lynx/rom.cpp:61-75 at fcdefcf).""" + + def test_short_is_refused_and_longer_is_read(self): + self.assertFalse(self.accepts("beetle_lynx", "lynxboot.img", b"\0" * 256)) + self.assertTrue(self.accepts("beetle_lynx", "lynxboot.img", b"\0" * 512)) + self.assertTrue(self.accepts("beetle_lynx", "lynxboot.img", b"\0" * 1024)) + + if __name__ == "__main__": unittest.main()