From 61ebfffa973046fe6564dfe1b31b8b658f396696 Mon Sep 17 00:00:00 2001 From: Yaya48 Date: Tue, 13 Oct 2026 17:35:58 +0200 Subject: [PATCH] StarletBootstrapProbe: fail on a Dolphin alert instead of opening a dialog With no handler registered, Dolphin shows an alert in a modal MessageBox on Windows, and the probe waits until someone closes it. A run that hits an alert then looks like a hang (StarOS EXP-001). The probe now writes the alert to stderr and exits at once with status 3. Co-Authored-By: Claude Opus 5.5 --- .../StarletBootstrapProbe.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp b/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp index 0ced1683af..39b8e96fe7 100644 --- a/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp +++ b/Tools/StarletBootstrapProbe/StarletBootstrapProbe.cpp @@ -1,12 +1,14 @@ // Copyright 2026 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include #include #include #include #include #include +#include "Common/MsgHandler.h" #include "Core/Core.h" #include "Core/HW/WII_IPC.h" #include "Core/IOS/Starlet/ARMCore.h" @@ -25,6 +27,18 @@ enum class ExpectedOutcome Phase2 }; +// Exit status of a run stopped by a Dolphin alert (1: failed expectation, 2: usage). +constexpr int ALERT_EXIT_STATUS = 3; + +// Dolphin's default handler shows an alert in a modal MessageBox on Windows, which blocks the +// probe until someone closes it. Report the alert on stderr and fail the run at once instead. +bool FailOnAlert(const char* caption, const char* text, bool, Common::MsgType) +{ + std::cout.flush(); + std::cerr << "Dolphin alert (" << caption << "): " << text << std::endl; + std::_Exit(ALERT_EXIT_STATUS); +} + bool Run(const std::string& path, bool jit, ExpectedOutcome expected) { std::ifstream file(path, std::ios::binary | std::ios::ate); @@ -132,6 +146,7 @@ bool Run(const std::string& path, bool jit, ExpectedOutcome expected) int main(int argc, char** argv) { + Common::RegisterMsgAlertHandler(FailOnAlert); if (argc < 2 || argc > 4) { std::cerr << "Usage: StarletBootstrapProbe [--jit] "