From 4ea90f948d885d57f80fb5fbc414ce608587cfe6 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 16 May 2025 19:06:51 +1000 Subject: [PATCH] CDROM: Display OSD message on backend read fail --- src/core/cdrom.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index a0fe2a4d5..2add9abb0 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -27,6 +27,7 @@ #include "common/log.h" #include "common/xorshift_prng.h" +#include "IconsEmoji.h" #include "fmt/format.h" #include "imgui.h" @@ -3259,8 +3260,13 @@ void CDROM::StopMotor() void CDROM::DoSectorRead() { // TODO: Queue the next read here and swap the buffer. - if (!s_reader.WaitForReadToComplete()) + if (!s_reader.WaitForReadToComplete()) [[unlikely]] { + Host::AddIconOSDWarning( + "DiscReadError", ICON_EMOJI_WARNING, + TRANSLATE_STR("OSDMessage", "Failed to read sector from disc image. The game will probably crash now.\nYour " + "dump may be corrupted, or the physical disc is scratched."), + Host::OSD_CRITICAL_ERROR_DURATION); StopReadingWithError(); return; }