docs: quote command line flags in comments as code

The lone-dash check read MAME's -rompath and -samplepath, QUASI88's
-romdir and RetroBat's -hash and -sp as half a dash glued to a word.
Quoted as code they read as flags. A C loop quoted in romdir.py and a
docstring in test_agnostic_scope no longer read as clause semicolons.
This commit is contained in:
Abdessamad Derraz committed 2026-11-11 14:28:10 +01:00
1 parent 3fb21f9c1e
commit 02a400aead
8 files changed
+20 -20

No files matched your search

+3 -3
View File
@@ -3390,7 +3390,7 @@ def _build_layouts(
if f.get("bundled") and passed_setting(f):
# The copy installed with the emulator sits where the setting
# pointed before the launcher moved it: RetroBat passes MAME
# -hash bios/mame/hash (Mame64.Generator.cs:172, 177-178), and
# `-hash` bios/mame/hash (Mame64.Generator.cs:172, 177-178), and
# the hash/ beside mame.exe is no longer read.
moved = {k: v for k, v in f.items() if k != "bundled"}
files.extend(_placed_entry(moved, profile, placed) for placed in places)
@@ -3607,7 +3607,7 @@ def content_layout(
for t in tags if t.startswith(CONTENT_FOLDER_PREFIX)
) if core in names and where
})
# The folders a passed -rompath replaces the build's own search
# The folders a passed `-rompath` replaces the build's own search
# path with stand for these: libretro MAME hands MAME
# <system>/mame/bios unless the content's command line names
# another (retro_init.cpp Set_Path_Option, execute_game_cmd).
@@ -3649,7 +3649,7 @@ def content_layout(
if f.get("unplaced") != OUTSIDE_BIOS_FOLDER:
# A set a launcher record placed stays there: EmuDeck's
# mame.ini rompath is read when Steam ROM Manager starts MAME
# with no -rompath (tools/launchers/mame.sh), and ES-DE's
# with no `-rompath` (tools/launchers/mame.sh), and ES-DE's
# commands read the folders they pass.
out.append(f)
held = {(f.get("root") or "", f.get("standalone_path") or "")}
+1 -1
View File
@@ -1075,7 +1075,7 @@ def _bind(
list already fills (Batocera's bios/openmsx beside bios/Machines), else
the first of the BIOS tree, else the first a pack can fill. A list that
already holds the folder the layout's files take without the launcher
keeps them there: KNULLI starts MAME with -rompath
keeps them there: KNULLI starts MAME with `-rompath`
<romDirname>;/userdata/bios/mame;/userdata/bios, and the sets at the BIOS
root stay. A pool standing for the whole layout holds its files
directly, not its folders (SEARCHED_FILES): MAME reads hash/ and
+1 -1
View File
@@ -21,7 +21,7 @@ from dataclasses import dataclass
ENTRY_SIZE = 16
NAME_SIZE = 10
# for (i = 0; i < 512 * 1024; i++) in every LoadBiosVersion.
# `for (i = 0; i < 512 * 1024; i++)` in every LoadBiosVersion.
SEARCH_ENTRIES = 512 * 1024
ROMVER_SIZE = 14
EXTINFO_SIZE = 15
+1 -1
View File
@@ -1120,7 +1120,7 @@ def patched_paths(read: Callable[[str], str], patches: tuple[str, ...] = PATH_PA
# Generators whose command line hands the emulator /userdata/bios folders as
# search paths: MAME's -rompath and -samplepath (mame/mameGenerator.py).
# search paths: MAME's `-rompath` and `-samplepath` (mame/mameGenerator.py).
SEARCH_PATH_GENERATORS = ("mame/mameGenerator.py",)
+1 -1
View File
@@ -58,7 +58,7 @@ class AgnosticScan(unittest.TestCase):
def test_a_placeholder_scans_the_folder_another_profile_proves(self):
"""LRPS2 and PCEE2 name their BIOS <bios>.bin, which resolves nowhere.
On RetroArch yaps2 anchored pcsx2/bios/ for them; on Batocera no
On RetroArch yaps2 anchored pcsx2/bios/ for them. On Batocera no
other libretro PS2 core runs, and the pack held nothing there. The
folder where another profile of the system resolves a hashed dump of
that shape is the evidence, that folder only.
+11 -11
View File
@@ -706,7 +706,7 @@ class AetherSX2OnKnulli(unittest.TestCase):
class Quasi88OnRetroPie(unittest.TestCase):
"""RetroPie writes -romdir $biosdir/pc88 into quasi88.ini (quasi88.sh:67)."""
"""RetroPie writes `-romdir` $biosdir/pc88 into quasi88.ini (quasi88.sh:67)."""
def test_the_roms_land_in_pc88(self) -> None:
profile = load_emulator_profiles(str(REPO_ROOT / "emulators"))["quasi88kai"]
@@ -823,12 +823,12 @@ class MameSearchPaths(unittest.TestCase):
self.assertEqual(entry["standalone_path"], entry["name"])
self.assertNotIn("unplaced", entry)
(bbc,) = [e for e in view["files"] if e["name"] == "bbc.zip"]
# -sp bios/mame/samples, hbmame's folder being another record
# `-sp` bios/mame/samples, hbmame's folder being another record
# (Mame64.Generator.cs:30, 101, 106-107).
self.assertEqual(bbc["standalone_path"], "mame/samples/bbc.zip")
def test_knulli_keeps_the_root_listed_after_bios_mame(self) -> None:
# -rompath <romDirname>;/userdata/bios/mame;/userdata/bios (mameGenerator.py:116-122).
# `-rompath` <romDirname>;/userdata/bios/mame;/userdata/bios (mameGenerator.py:116-122).
view = standalone_view("mame", "knulli")
self.assertTrue(all(e["standalone_path"] == e["name"] for e in self.sets(view)))
(bbc,) = [e for e in view["files"] if e["name"] == "bbc.zip"]
@@ -846,7 +846,7 @@ class MameSearchPaths(unittest.TestCase):
view = standalone_view("mame", "retrodeck")
(bbc,) = [e for e in view["files"] if e["name"] == "bbc.zip"]
self.assertEqual(bbc["standalone_path"], "mame-sa/samples/bbc.zip")
# ES-DE hands -rompath %GAMEDIR%;%ROMPATH%/<system>: no BIOS folder.
# ES-DE hands `-rompath` %GAMEDIR%;%ROMPATH%/<system>: no BIOS folder.
self.assertTrue(all(
e.get("unplaced") == "outside_bios_folder"
or str(e.get("standalone_path")).startswith("roms/")
@@ -854,7 +854,7 @@ class MameSearchPaths(unittest.TestCase):
))
def test_a_passed_search_setting_leaves_the_bundled_tree_unread(self) -> None:
# RetroBat passes -hash bios/mame/hash and -sp bios/mame/samples
# RetroBat passes `-hash` bios/mame/hash and `-sp` bios/mame/samples
# (Mame64.Generator.cs:30, 101, 106-107, 172, 177-178), RetroDECK
# writes samplepath $bios_path/mame-sa/samples (component_prepare.sh:94):
# the trees beside the executable are not read, the pack brings them.
@@ -888,8 +888,8 @@ class MameSearchPaths(unittest.TestCase):
self.assertNotIn("bundled", tree)
def test_batocera_keeps_the_sets_at_the_root_and_samples_in_bios_mame(self) -> None:
# -rompath <romDirname>;/userdata/bios/mame;/userdata/bios and
# -samplepath /userdata/bios/mame/samples (mameGenerator.py:129-142).
# `-rompath` <romDirname>;/userdata/bios/mame;/userdata/bios and
# `-samplepath` /userdata/bios/mame/samples (mameGenerator.py:129-142).
view = standalone_view("mame", "batocera")
self.assertTrue(all(e["standalone_path"] == e["name"] for e in self.sets(view)))
(bbc,) = [e for e in view["files"] if e["name"] == "bbc.zip"]
@@ -908,7 +908,7 @@ class MameSearchPaths(unittest.TestCase):
self.assertTrue(member["path"].startswith("mame-sa/samples/floppy/"))
def test_psxmame_reads_bios_psxmame_bios(self) -> None:
# -rompath bios/psxmame/bios;<rom directory> (PSXMame.Generator.cs:38-48).
# `-rompath` bios/psxmame/bios;<rom directory> (PSXMame.Generator.cs:38-48).
view = standalone_view("psxmame", "retrobat")
self.assertTrue(view["files"])
for entry in view["files"]:
@@ -1113,7 +1113,7 @@ class SetsReadBesideTheGame(unittest.TestCase):
class MameOnRetroDeckRomPaths(unittest.TestCase):
"""ES-DE starts standalone MAME with -rompath %GAMEDIR%;%ROMPATH%/<system>
"""ES-DE starts standalone MAME with `-rompath` %GAMEDIR%;%ROMPATH%/<system>
(resources/systems/linux/es_systems.xml), which outranks mame.ini."""
def test_the_rom_folders_file_records_each_search_path(self) -> None:
@@ -1150,7 +1150,7 @@ class MameOnRetroDeckRomPaths(unittest.TestCase):
class LibretroMameOnEsdeRomPaths(unittest.TestCase):
"""ES-DE hands the libretro MAME core a command line as its content,
with -rompath "%GAMEDIRRAW%;%ROMPATH%/<system>" after the machine. The
with `-rompath` "%GAMEDIRRAW%;%ROMPATH%/<system>" after the machine. The
core passes it to MAME after its own <system>/mame/bios, and the later
value wins (retro_init.cpp:580-597, 902-940, options.cpp:260-276)."""
@@ -1177,7 +1177,7 @@ class LibretroMameOnEsdeRomPaths(unittest.TestCase):
class StandaloneMameOnEmuDeck(unittest.TestCase):
"""EmuDeck writes mame.ini rompath roms/arcade;bios;bios/mame
(emuDeckMAME.sh:66-68), read when Steam ROM Manager starts MAME with no
-rompath (tools/launchers/mame.sh). ES-DE's commands pass their own."""
`-rompath` (tools/launchers/mame.sh). ES-DE's commands pass their own."""
def test_a_set_keeps_its_ini_place_and_gains_the_command_folder(self) -> None:
view = standalone_view("mame", "emudeck")
+1 -1
View File
@@ -545,7 +545,7 @@ MAME_BOOT = """ if boot_disk:
class MameSearchPaths(unittest.TestCase):
"""mameGenerator.py:129-142 at batocera-43.1: -rompath and -samplepath."""
"""mameGenerator.py:129-142 at batocera-43.1: `-rompath` and `-samplepath`."""
def test_the_command_line_search_paths_are_recorded(self):
from scraper.batocera_launchers import search_paths
+1 -1
View File
@@ -226,7 +226,7 @@ class EsdeFormat(unittest.TestCase):
self.assertTrue(standalone["any_machine"])
self.assertNotIn("machines", standalone)
self.assertNotIn("searched_by", self.rows["psx"])
# The libretro core reads the -rompath of the command line it is
# The libretro core reads the `-rompath` of the command line it is
# handed as content (retro_init.cpp execute_game_cmd).
self.assertEqual((libretro["emulator"], libretro["core"]), ("retroarch", "mame"))
self.assertEqual(libretro["reads"], ["arcade"])