diff --git a/emulators/altirra.yml b/emulators/altirra.yml index d7e395fa..d8219425 100644 --- a/emulators/altirra.yml +++ b/emulators/altirra.yml @@ -378,31 +378,34 @@ files: description: "Happy 810 pre-v7 firmware, 4K original (serial $4490)" system: atari-400-800 required: false - size: 4096 - crc32: "942ec3d5" - validation: [size, crc32] - source_ref: "src/Altirra/source/uifirmware.cpp:528" + size: [4096, 8192] + validation: [size] + on_mismatch: warn + source_ref: "src/Altirra/source/uifirmware.cpp:528, src/Altirra/source/firmwaredetect.cpp:186-231" - name: happy-810-prev7-4k-nonoriginal.rom description: "Happy 810 pre-v7 firmware, 4K non-original (serial $1704)" system: atari-400-800 required: false - size: 4096 - crc32: "143b8538" - validation: [size, crc32] - source_ref: "src/Altirra/source/uifirmware.cpp:528" + size: [4096, 8192] + validation: [size] + on_mismatch: warn + source_ref: "src/Altirra/source/uifirmware.cpp:528, src/Altirra/source/firmwaredetect.cpp:186-231" - name: happy-810-prev7-3k.rom description: "Happy 810 pre-v7 firmware, functional 3K inside a 6K image (serial $4B9B)" note: > The image is 6144 bytes; Altirra identifies it by a checksum taken over - the functional 3K, which its firmware list reports as the size. + the functional 3K, which its firmware list reports as the size. The + checksum skips the hidden 1K of a 4K image and the 2-byte serial, so any + serial is recognised; a file it does not recognise can still be given + the Happy 810 type by hand. system: atari-400-800 required: false - size: 6144 - crc32: "f81b69cb" - validation: [size, crc32] - source_ref: "src/Altirra/source/uifirmware.cpp:528" + size: [3072, 6144] + validation: [size] + on_mismatch: warn + source_ref: "src/Altirra/source/uifirmware.cpp:528, src/Altirra/source/firmwaredetect.cpp:186-231" - name: happy-810-v7-6k-modified.rom description: "Happy 810 firmware (v7, 6K functional ROM, modified)" diff --git a/tests/test_profile_checks.py b/tests/test_profile_checks.py index 8fbca2b0..309bec63 100644 --- a/tests/test_profile_checks.py +++ b/tests/test_profile_checks.py @@ -315,5 +315,19 @@ class AppleIIgsRomSizes(_Probe): self.assertFalse(self.accepts(emulator, "ROM", b"\0" * 65536)) +class AltirraHappy810(_Probe): + """ATFirmwareDetection recognises the pre-v7 Happy 810 ROM by its size + (3K, 4K or a doubled overdump) and a CRC32 that skips the hidden 1K and + the serial; the whole-file CRC32 the profile checked is never computed, + so a dump with another serial was refused (firmwaredetect.cpp:186-231 in + the 4.40 source).""" + + def test_any_serial_passes_and_size_only_warns(self): + self.assertTrue(self.accepts("altirra", "happy-810-prev7-4k.rom", b"\5" * 4096, strict=True)) + self.assertTrue(self.accepts("altirra", "happy-810-prev7-3k.rom", b"\5" * 3072, strict=True)) + self.assertFalse(self.accepts("altirra", "happy-810-prev7-4k.rom", b"\5" * 5000, strict=True)) + self.assertTrue(self.accepts("altirra", "happy-810-prev7-4k.rom", b"\5" * 5000)) + + if __name__ == "__main__": unittest.main()