From 2abde9aec3e8cf4fe3f61d91771a68545075de48 Mon Sep 17 00:00:00 2001 From: Diego Parrilla Date: Wed, 2 Dec 2026 12:30:20 +0100 Subject: [PATCH] emu_check.py: make sure [G] was taken before checking GEMDRIVE mode The check pressed G once and waited for GEMDRIVE's SAVE_VECTORS, which [U] logs too. When the key was lost the countdown started the Runner and the check could still pass, or wait for an accessory that never came. It now presses G until the firmware sends [G]'s start command (4, or 6 with the GEMDRIVE Runner on), up to three times. --- tools/dev/emu_check.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/dev/emu_check.py b/tools/dev/emu_check.py index 126fe95..ecd858c 100755 --- a/tools/dev/emu_check.py +++ b/tools/dev/emu_check.py @@ -204,8 +204,17 @@ def milestones(self): for key in self.args.menu_keys or "": self.hatari(f"hatari-event keypress 0x{SCANCODES[key]:02x}") time.sleep(1) - self.hatari("hatari-event keypress 0x22") # G - ok = self.wait_log("GEMDRIVE SAVE_VECTORS", 60) + # [G] starts with command 4, or 6 with the GEMDRIVE Runner on + # ([U] is 5, which the countdown sends when the key is lost): + # press G until the firmware has it. + for _ in range(3): + self.hatari("hatari-event keypress 0x22") # G + ok = (self.wait_log("Sending command: 00000006", 5) + or "Sending command: 00000004" in + self.log.read_text(errors="replace")) + if ok: + break + ok = ok and self.wait_log("GEMDRIVE SAVE_VECTORS", 60) if self.record("gemdrive mode", ok): if "n" in (self.args.menu_keys or ""): # [N] turned the GEMDRIVE Runner off: its accessory is