mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12:00
Fix fatal error dialog
This commit is contained in:
parent
7b96190e6c
commit
14a6269243
1 changed files with 15 additions and 3 deletions
|
@ -30,13 +30,25 @@ thread_local u64 g_tls_fault_spu = 0;
|
||||||
|
|
||||||
static void report_fatal_error(const std::string& msg)
|
static void report_fatal_error(const std::string& msg)
|
||||||
{
|
{
|
||||||
|
static semaphore<> g_report_only_once;
|
||||||
|
|
||||||
|
g_report_only_once.wait();
|
||||||
|
|
||||||
std::string _msg = msg + "\n"
|
std::string _msg = msg + "\n"
|
||||||
"HOW TO REPORT ERRORS: Check the FAQ, README, other sources.\n"
|
"HOW TO REPORT ERRORS: https://github.com/RPCS3/rpcs3/wiki/How-to-ask-for-Support\n"
|
||||||
"Please, don't send incorrect reports. Thanks for understanding.\n";
|
"Please, don't send incorrect reports. Thanks for understanding.\n";
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
_msg += "Press (Ctrl+C) to copy this message.";
|
_msg += "\nPress Yes or Enter to visit the URL above immediately.";
|
||||||
MessageBoxA(0, _msg.c_str(), "Fatal error", MB_ICONERROR); // TODO: unicode message
|
const std::size_t buf_size = _msg.size() + 1;
|
||||||
|
const int size = static_cast<int>(buf_size);
|
||||||
|
std::unique_ptr<wchar_t[]> buffer(new wchar_t[buf_size]);
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, _msg.c_str(), size, buffer.get(), size);
|
||||||
|
|
||||||
|
if (MessageBoxW(0, buffer.get(), L"Fatal error", MB_ICONERROR | MB_YESNO) == IDYES)
|
||||||
|
{
|
||||||
|
ShellExecuteW(0, L"open", L"https://github.com/RPCS3/rpcs3/wiki/How-to-ask-for-Support", 0, 0, SW_SHOWNORMAL);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
std::printf("Fatal error: \n%s", _msg.c_str());
|
std::printf("Fatal error: \n%s", _msg.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue