From 0361709adab88a5b88f3d9eca1b27558728d659e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Sun, 9 May 2021 02:48:24 +0200 Subject: [PATCH] Add a warning for `cpu_override` --- src/86box.c | 28 ++++++++++++++++------------ src/include/86box/language.h | 5 ++++- src/win/86Box.rc | 3 +++ src/win/win_ui.c | 5 +++++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/86box.c b/src/86box.c index 1f793673d..4d1e64782 100644 --- a/src/86box.c +++ b/src/86box.c @@ -845,18 +845,22 @@ pc_reset_hard_init(void) cycles = cycles_main = 0; mbstowcs(wmachine, machine_getname(), strlen(machine_getname())+1); - mbstowcs(wcpufamily, cpu_f->name, - strlen(cpu_f->name)+1); - wcp = wcschr(wcpufamily, L'('); - if (wcp) /* remove parentheses */ - *(wcp - 1) = L'\0'; - mbstowcs(wcpu, cpu_s->name, strlen(cpu_s->name)+1); - swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls", - EMU_NAME_W, EMU_VERSION_W, wmachine, wcpufamily, wcpu, - plat_get_string(IDS_2077)); - swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls", - EMU_NAME_W, EMU_VERSION_W, wmachine, wcpufamily, wcpu, - (mouse_get_buttons() > 2) ? plat_get_string(IDS_2078) : plat_get_string(IDS_2079)); + + if (!cpu_override) + mbstowcs(wcpufamily, cpu_f->name, strlen(cpu_f->name)+1); + else + swprintf(wcpufamily, sizeof_w(wcpufamily), L"[U] %hs", cpu_f->name); + + wcp = wcschr(wcpufamily, L'('); + if (wcp) /* remove parentheses */ + *(wcp - 1) = L'\0'; + mbstowcs(wcpu, cpu_s->name, strlen(cpu_s->name)+1); + swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls", + EMU_NAME_W, EMU_VERSION_W, wmachine, wcpufamily, wcpu, + plat_get_string(IDS_2077)); + swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls", + EMU_NAME_W, EMU_VERSION_W, wmachine, wcpufamily, wcpu, + (mouse_get_buttons() > 2) ? plat_get_string(IDS_2078) : plat_get_string(IDS_2079)); } diff --git a/src/include/86box/language.h b/src/include/86box/language.h index 61a4e3933..af52954c6 100644 --- a/src/include/86box/language.h +++ b/src/include/86box/language.h @@ -118,6 +118,9 @@ #define IDS_2142 2142 // "Monitor in sleep mode" #define IDS_2143 2143 // "OpenGL Shaders (*.GLSL)..." #define IDS_2144 2144 // "OpenGL options" +#define IDS_2145 2145 // "You are loading an unsupported..." +#define IDS_2146 2146 // "CPU type filtering based on..." +#define IDS_2147 2147 // "Continue" #define IDS_4096 4096 // "Hard disk (%s)" #define IDS_4097 4097 // "%01i:%01i" @@ -225,7 +228,7 @@ #define IDS_LANG_ENUS IDS_7168 -#define STR_NUM_2048 97 +#define STR_NUM_2048 100 #define STR_NUM_3072 11 #define STR_NUM_4096 39 #define STR_NUM_4352 6 diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 87f4679a0..145c90f5a 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -1104,6 +1104,9 @@ BEGIN IDS_2142 "Monitor in sleep mode" IDS_2143 "OpenGL Shaders (*.GLSL)\0*.GLSL\0All files (*.*)\0*.*\0" IDS_2144 "OpenGL options" + IDS_2145 "You are loading an unsupported configuration" + IDS_2146 "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid." + IDS_2147 "Continue" END STRINGTABLE DISCARDABLE diff --git a/src/win/win_ui.c b/src/win/win_ui.c index e5d8e6ba8..cce913b00 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -1339,6 +1339,11 @@ ui_init(int nCmdShow) } #endif + /* Warn the user about unsupported configs. */ + if (cpu_override && ui_msgbox_ex(MBX_WARNING | MBX_QUESTION_OK, (void *) IDS_2145, (void *) IDS_2146, (void *) IDS_2147, (void *) IDS_2119, NULL)) { + return(0); + } + /* Create our main window's class and register it. */ wincl.hInstance = hinstance; wincl.lpszClassName = CLASS_NAME;