From 5df3a707e6f6f6766ee3e376a4370ef73158c93b Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 04:07:22 +0100 Subject: [PATCH] docs: say what the emuscv BIOS check does The note judged the CHECKBIOS handling instead of describing it. It now says what memory.cpp:80 does: the MD5 comparison runs only for YES_VAL, so AUTO accepts any content. A rejected BIOS is filled with 0xFF (line 97), not zeroed. --- emulators/emuscv.yml | 7 ++++--- tests/test_prose_style.py | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/emulators/emuscv.yml b/emulators/emuscv.yml index 075345385..589361b3b 100644 --- a/emulators/emuscv.yml +++ b/emulators/emuscv.yml @@ -33,10 +33,11 @@ notes: | When CHECKBIOS core option is YES, the core computes MD5 of the loaded data and compares against 635a978fd40db9a18ee44eff449fc126. If the - hash does not match, the BIOS is rejected (zeroed out, + hash does not match, the BIOS is rejected (filled with 0xFF, bios_present=false). When CHECKBIOS is AUTO (default) or NO, any file - content is accepted. The log message for AUTO says "automatic (yes)" - but the code skips the check (code bug: != YES_VAL at line 80). + content is accepted. With AUTO the log says "automatic (yes)", and the + MD5 comparison runs only when the option equals YES_VAL + (src/vm/scv/memory.cpp:80), so AUTO accepts any content. The font/character data is embedded within the BIOS at offset 0x200 (memory.h get_font() returns bios + 0x200). No separate font ROM file. diff --git a/tests/test_prose_style.py b/tests/test_prose_style.py index 650e57ecd..67ea6467b 100644 --- a/tests/test_prose_style.py +++ b/tests/test_prose_style.py @@ -178,6 +178,27 @@ class NoMarketingVocabulary(unittest.TestCase): self.assertEqual(offenders, [], "\n".join(offenders[:40])) +class ProfilesStateNoVerdict(unittest.TestCase): + """A profile note says what the code does, never what is wrong with + another project's work (wiki/testing-guide.md): emuscv called its + core's option handling a "code bug".""" + + VERDICTS = [ + re.compile(r"\bcode bug\b", re.IGNORECASE), + ] + + def test_no_profile_note_passes_a_verdict(self): + offenders = [] + for path in sorted((ROOT / "emulators").glob("*.yml")): + text = " ".join(path.read_text(encoding="utf-8").split()) + offenders += [ + f"{path.name}: {found.group(0)}" + for pattern in self.VERDICTS + for found in pattern.finditer(text) + ] + self.assertEqual(offenders, [], "\n".join(offenders)) + + def _name(*parts: str) -> str: """A private name, assembled so that this file does not carry it.""" return "".join(parts)