From 3766b1dd11dcafaa0996a4bfb271d342ff0c12a7 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 16 Oct 2026 06:41:08 +0200 Subject: [PATCH] fix: accept a longer a5200 bios image --- emulators/a5200.yml | 4 ++-- tests/test_profile_checks.py | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/emulators/a5200.yml b/emulators/a5200.yml index 015f839a..a4de1b28 100644 --- a/emulators/a5200.yml +++ b/emulators/a5200.yml @@ -35,11 +35,11 @@ systems: files: - name: "5200.rom" path: "5200.rom" - size: 2048 + min_size: 2048 required: false hle_fallback: true validation: [size] note: > Atari 5200 OS ROM. Core option "a5200_bios" controls official vs internal. Altirra replacement has lower compatibility with some titles. - source_ref: "libretro/libretro.c:58-59, libretro/libretro.c:416-507, emu/memory.c:46" + source_ref: "libretro/libretro.c:58-59, libretro/libretro.c:416-507, libretro/libretro.c:456-468, emu/memory.c:46" diff --git a/tests/test_profile_checks.py b/tests/test_profile_checks.py index b38c0ce4..46b0c18d 100644 --- a/tests/test_profile_checks.py +++ b/tests/test_profile_checks.py @@ -148,5 +148,16 @@ class AresAtari5200Bios(unittest.TestCase): ) +class A5200Bios(_Probe): + """The core reads 0x800 bytes and falls back to the Altirra OS on a short + read; bytes past them are never read (libretro/libretro.c:456-468 at + 40c6f2f).""" + + def test_short_falls_back_and_longer_is_read(self): + self.assertFalse(self.accepts("a5200", "5200.rom", b"\0" * 1024)) + self.assertTrue(self.accepts("a5200", "5200.rom", b"\0" * 2048)) + self.assertTrue(self.accepts("a5200", "5200.rom", b"\0" * 4096)) + + if __name__ == "__main__": unittest.main()