diff --git a/emulators/hatari.yml b/emulators/hatari.yml index 3ff4605f..512f7433 100644 --- a/emulators/hatari.yml +++ b/emulators/hatari.yml @@ -151,18 +151,7 @@ files: stand in for the default, and a .gz or archive is unpacked first. The program exits when no image loads and none is picked in the settings dialog (src/options.c:1937-1940, src/configuration.c:489, - src/tos.c:983, src/main.c:191-201). The aliases are the names the platform launchers - give it. Batocera passes tos.img from the BIOS - root, trying the chosen version then each machine's list and the - languages us, uk, de, es, fr, it, nl, ru, se and none in turn - (configgen generators/hatari/hatariGenerator.py:74-75, 158-193). - Recalbox writes atarist/st.img, ste.img, megaste.img, tt.img or - falcon.img by machine, then tos.img, then emutos.img, and emutos.img - for any content whose path names emutos - (configgen generators/hatari/hatariGenerator.py:151-167). RetroBat - writes hatari/tos/ followed by the hatari_tos option, tos206.img, - tos106.img, tos104.img, tos102.img or emutos.img, and tos.img at the - BIOS root otherwise (emulatorlauncher Generators/Hatari.Generator.cs:144-154). + src/tos.c:983, src/main.c:191-201). - name: "tos.sym" path: "tos.sym" diff --git a/emulators/hatarib.yml b/emulators/hatarib.yml index 1af8b986..c5027191 100644 --- a/emulators/hatarib.yml +++ b/emulators/hatarib.yml @@ -113,14 +113,7 @@ files: are selected with the hatarib_tos option. Without tos.img the built-in EmuTOS 192uk is the default. A hatarib_tos value that is not one of the four special values is opened as a path under the system - directory (core/core_config.c:1121-1122), and the aliases are the - names the platform launchers write there. RetroBat sets - hatarib/tos206.img, tos106.img, tos104.img or tos102.img from its - hatarib_tos option (emulatorlauncher Generators/LibRetro.CoreOptions.cs:3167-3195), - and emutos.img in system/hatarib/ is listed by the scan like any other - image. Recalbox sets atarist/st.img, ste.img, megaste.img, tt.img or - falcon.img by machine, falling back to tos.img and the built-in - EmuTOS 1024k (configgen generators/libretro/libretroCores.py:211-229). + directory (core/core_config.c:1121-1122). - name: "etos1024k.img" description: "EmuTOS 1.4 1024 KB image, all machine types" diff --git a/tests/test_profile_checks.py b/tests/test_profile_checks.py index c9522dbf..1666f4c0 100644 --- a/tests/test_profile_checks.py +++ b/tests/test_profile_checks.py @@ -9,6 +9,7 @@ check left out lets through a file the emulator refuses. from __future__ import annotations +import re import sys import tempfile import unittest @@ -377,5 +378,40 @@ class FbAlpha2012HiscoreFromSaveDir(unittest.TestCase): self.assertFalse(read_from_system_dir(entry)) +_LAUNCHER_CODE = re.compile( + r"Generator\.(py|cs)|configgen|emulatorlauncher|libretroCores\.py|LibRetro\.CoreOptions", + re.IGNORECASE, +) + + +def _prose(node: object) -> list[str]: + if isinstance(node, dict): + return [ + text + for key, value in node.items() + for text in ([value] if key in ("note", "notes") and isinstance(value, str) + else _prose(value)) + ] + if isinstance(node, list): + return [text for item in node for text in _prose(item)] + return [] + + +class HatariTosNamesLiveWithTheLaunchers(unittest.TestCase): + """The TOS names Batocera, Recalbox and RetroBat pass to Hatari are + recorded under each platform's launchers: since 8dc485dc. The tos.img + notes kept describing those generators and an aliases field the entry + no longer had.""" + + def test_no_launcher_in_the_profiles(self): + for emulator in ("hatari", "hatarib"): + with self.subTest(emulator=emulator): + profile = _profile(emulator) + tos = next(f for f in profile["files"] if f["name"] == "tos.img") + self.assertNotIn("aliases", tos) + cited = [t for t in _prose(profile) if _LAUNCHER_CODE.search(t)] + self.assertEqual(cited, []) + + if __name__ == "__main__": unittest.main()