From 1af575d018c5a4f92fcb6334dae61023a8dde71b Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Mon, 14 Feb 2022 02:54:16 +0500 Subject: [PATCH 01/16] Remove the last remaining trace of the defunct VRAM dumping function --- src/qt/qt_progsettings.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qt/qt_progsettings.hpp b/src/qt/qt_progsettings.hpp index d0cbcc5d2..75fba149a 100644 --- a/src/qt/qt_progsettings.hpp +++ b/src/qt/qt_progsettings.hpp @@ -32,7 +32,6 @@ public: if (strcmp(sourceText, "Take s&creenshot") == 0) sourceText = "Take s&creenshot\tCtrl+F11"; if (strcmp(sourceText, "Begin trace") == 0) sourceText = "Begin trace\tCtrl+T"; if (strcmp(sourceText, "End trace") == 0) sourceText = "End trace\tCtrl+T"; - if (strcmp(sourceText, "Dump &video RAM") == 0) sourceText = "Dump &video RAM\tCtrl+F1"; if (strcmp(sourceText, "&Qt (Software)") == 0) { QString finalstr = QTranslator::translate("", "&SDL (Software)", disambiguation, n); From 37c77cf0cf8539fc34c408b1a2c016a381c91abe Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 13 Feb 2022 23:50:27 +0100 Subject: [PATCH 02/16] Added some sanity checks to IDE. --- src/disk/hdc_ide.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index a1409175f..6db383cf0 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3018,8 +3018,11 @@ ide_reset(void *p) { ide_log("Resetting IDE...\n"); - ide_board_reset(0); - ide_board_reset(1); + if (ide_boards[0] != NULL) + ide_board_reset(0); + + if (ide_boards[1] != NULL) + ide_board_reset(1); } @@ -3029,8 +3032,15 @@ ide_close(void *priv) { ide_log("Closing IDE...\n"); - ide_board_close(0); - ide_board_close(1); + if (ide_boards[0] != NULL) { + ide_board_close(0); + ide_boards[0] = NULL; + } + + if (ide_boards[1] != NULL) { + ide_board_close(1); + ide_boards[1] = NULL; + } } From 4a752c05a59f2d174533fb0eeb66dff1cd0903e2 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Mon, 14 Feb 2022 05:10:50 +0500 Subject: [PATCH 03/16] Move the Tandy PSG ISA clones to the Dev branch --- CMakeLists.txt | 1 + src/include/86box/sound.h | 4 +++- src/sound/CMakeLists.txt | 4 ++++ src/sound/snd_pssj.c | 6 ++++++ src/sound/snd_sn76489.c | 6 ++++++ src/sound/sound.c | 4 +++- src/win/Makefile.mingw | 10 ++++++++++ 7 files changed, 33 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac9292376..96f3efee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,6 +142,7 @@ cmake_dependent_option(OLIVETTI "Olivetti M290" cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF) cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" OFF "DEV_BRANCH" OFF) cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF) +cmake_dependent_option(TANDY_ISA "Tandy PSG ISA clone boards" ON "DEV_BRANCH" OFF) cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF) cmake_dependent_option(VNC "VNC renderer" OFF "DEV_BRANCH" OFF) cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index cbf380901..f7b3bca0a 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -103,9 +103,11 @@ extern const device_t pas16_device; extern const device_t ps1snd_device; /* Tandy PSSJ */ -extern const device_t tndy_device; extern const device_t pssj_device; +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) extern const device_t pssj_isa_device; +extern const device_t tndy_device; +#endif /* Creative Labs Sound Blaster */ extern const device_t sb_1_device; diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index e815d7329..8879b0378 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -55,5 +55,9 @@ if(GUSMAX) target_compile_definitions(snd PRIVATE USE_GUSMAX) endif() +if(TANDY_ISA) + target_compile_definitions(snd PRIVATE USE_TANDY_ISA) +endif() + add_subdirectory(resid-fp) target_link_libraries(86Box resid-fp) \ No newline at end of file diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 8c93125ea..cd5f274fe 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -215,6 +215,7 @@ void *pssj_1e0_init(const device_t *info) return pssj; } +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) void *pssj_isa_init(const device_t *info) { pssj_t *pssj = malloc(sizeof(pssj_t)); @@ -230,6 +231,7 @@ void *pssj_isa_init(const device_t *info) return pssj; } +#endif void pssj_close(void *p) { @@ -238,6 +240,7 @@ void pssj_close(void *p) free(pssj); } +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) static const device_config_t pssj_isa_config[] = { { @@ -261,6 +264,7 @@ static const device_config_t pssj_isa_config[] = "", "", -1 } }; +#endif const device_t pssj_device = { @@ -290,6 +294,7 @@ const device_t pssj_1e0_device = NULL }; +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t pssj_isa_device = { "Tandy PSSJ Clone", @@ -304,3 +309,4 @@ const device_t pssj_isa_device = NULL, pssj_isa_config }; +#endif diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index c2aa2a52d..e04ca7e5e 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -224,6 +224,7 @@ void *ncr8496_device_init(const device_t *info) return sn76489; } +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) void *tndy_device_init(const device_t *info) { sn76489_t *sn76489 = malloc(sizeof(sn76489_t)); @@ -235,6 +236,7 @@ void *tndy_device_init(const device_t *info) return sn76489; } +#endif void sn76489_device_close(void *p) { @@ -243,6 +245,7 @@ void sn76489_device_close(void *p) free(sn76489); } +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) static const device_config_t tndy_config[] = { { @@ -266,6 +269,7 @@ static const device_config_t tndy_config[] = "", "", -1 } }; +#endif const device_t sn76489_device = { @@ -291,6 +295,7 @@ const device_t ncr8496_device = NULL }; +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t tndy_device = { "TNDY", @@ -302,3 +307,4 @@ const device_t tndy_device = NULL, { NULL }, NULL, tndy_config }; +#endif diff --git a/src/sound/sound.c b/src/sound/sound.c index b2b9c4fca..7fbbd4d1c 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -123,8 +123,10 @@ static const SOUND_CARD sound_cards[] = #if defined(DEV_BRANCH) && defined(USE_PAS16) { &pas16_device }, #endif - { &tndy_device }, +#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) { &pssj_isa_device }, + { &tndy_device }, +#endif { &wss_device }, { &adlib_mca_device }, { &ncr_business_audio_device }, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 26d7239f3..e1a60d873 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -63,6 +63,9 @@ ifeq ($(DEV_BUILD), y) ifndef VGAWONDER VGAWONDER := y endif + ifndef TANDY_ISA + TANDY_ISA := y + endif ifndef VNC VNC := y endif @@ -121,6 +124,9 @@ else ifndef VGAWONDER VGAWONDER := n endif + ifndef TANDY_ISA + TANDY_ISA := n + endif ifndef VNC VNC := n endif @@ -456,6 +462,10 @@ OPTS += -DUSE_SIO_DETECT DEVBROBJ += sio_detect.o endif +ifeq ($(TANDY_ISA), y) +OPTS += -DUSE_TANDY_ISA +endif + ifeq ($(VGAWONDER), y) OPTS += -DUSE_VGAWONDER endif From a378e1a3005eb410e05a486e6c06cf486e9a66f7 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Mon, 14 Feb 2022 05:11:08 +0500 Subject: [PATCH 04/16] Move some options around to maintain alphabetical order --- CMakeLists.txt | 6 ++-- src/device/CMakeLists.txt | 8 +++--- src/win/Makefile.mingw | 60 +++++++++++++++++++-------------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96f3efee6..56a4d446a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,6 +135,9 @@ endif() cmake_dependent_option(AMD_K5 "AMD K5" ON "DEV_BRANCH" OFF) cmake_dependent_option(CYRIX_6X86 "Cyrix 6x86" ON "DEV_BRANCH" OFF) cmake_dependent_option(GUSMAX "Gravis UltraSound MAX" ON "DEV_BRANCH" OFF) +cmake_dependent_option(ISAMEM_RAMPAGE "AST Rampage" ON "DEV_BRANCH" OFF) +cmake_dependent_option(ISAMEM_IAB "Intel Above Board" ON "DEV_BRANCH" OFF) +cmake_dependent_option(ISAMEM_BRAT "BocaRAM/AT" ON "DEV_BRANCH" OFF) cmake_dependent_option(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF) cmake_dependent_option(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" OFF) cmake_dependent_option(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF) @@ -146,9 +149,6 @@ cmake_dependent_option(TANDY_ISA "Tandy PSG ISA clone boards" cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF) cmake_dependent_option(VNC "VNC renderer" OFF "DEV_BRANCH" OFF) cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) -cmake_dependent_option(ISAMEM_RAMPAGE "AST Rampage" ON "DEV_BRANCH" OFF) -cmake_dependent_option(ISAMEM_IAB "Intel Above Board" ON "DEV_BRANCH" OFF) -cmake_dependent_option(ISAMEM_BRAT "BocaRAM/AT" ON "DEV_BRANCH" OFF) # Ditto but for Qt if (QT) diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index 5d7d2d752..658da7280 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -19,10 +19,6 @@ add_library(dev OBJECT bugger.c cassette.c cartridge.c hasp.c hwm.c hwm_lm75.c h smbus_piix4.c smbus_ali7101.c keyboard.c keyboard_xt.c keyboard_at.c mouse.c mouse_bus.c mouse_serial.c mouse_ps2.c phoenix_486_jumper.c) -if(LASERXT) - target_compile_definitions(dev PRIVATE USE_LASERXT) -endif() - if(ISAMEM_RAMPAGE) target_compile_definitions(dev PRIVATE USE_ISAMEM_RAMPAGE) endif() @@ -34,3 +30,7 @@ endif() if(ISAMEM_BRAT) target_compile_definitions(dev PRIVATE USE_ISAMEM_BRAT) endif() + +if(LASERXT) + target_compile_definitions(dev PRIVATE USE_LASERXT) +endif() diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index e1a60d873..3f0b3a3b6 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -42,6 +42,15 @@ ifeq ($(DEV_BUILD), y) ifndef GUSMAX GUSMAX := y endif + ifndef ISAMEM_RAMPAGE + ISAMEM_RAMPAGE := y + endif + ifndef ISAMEM_IAB + ISAMEM_IAB := y + endif + ifndef ISAMEM_BRAT + ISAMEM_BRAT := y + endif ifndef LASERXT LASERXT := y endif @@ -72,15 +81,6 @@ ifeq ($(DEV_BUILD), y) ifndef XL24 XL24 := y endif - ifndef ISAMEM_RAMPAGE - ISAMEM_RAMPAGE := y - endif - ifndef ISAMEM_IAB - ISAMEM_IAB := y - endif - ifndef ISAMEM_BRAT - ISAMEM_BRAT := y - endif ifndef OLIVETTI OLIVETTI := y endif @@ -103,6 +103,15 @@ else ifndef GUSMAX GUSMAX := n endif + ifndef ISAMEM_RAMPAGE + ISAMEM_RAMPAGE := n + endif + ifndef ISAMEM_IAB + ISAMEM_IAB := n + endif + ifndef ISAMEM_BRAT + ISAMEM_BRAT := n + endif ifndef LASERXT LASERXT := n endif @@ -133,15 +142,6 @@ else ifndef XL24 XL24 := n endif - ifndef ISAMEM_RAMPAGE - ISAMEM_RAMPAGE := n - endif - ifndef ISAMEM_IAB - ISAMEM_IAB := n - endif - ifndef ISAMEM_BRAT - ISAMEM_BRAT := n - endif ifndef OLIVETTI OLIVETTI := n endif @@ -434,6 +434,18 @@ ifeq ($(GUSMAX), y) OPTS += -DUSE_GUSMAX endif +ifeq ($(ISAMEM_RAMPAGE), y) +OPTS += -DUSE_ISAMEM_RAMPAGE +endif + +ifeq ($(ISAMEM_IAB), y) +OPTS += -DUSE_ISAMEM_IAB +endif + +ifeq ($(ISAMEM_BRAT), y) +OPTS += -DUSE_ISAMEM_BRAT +endif + ifeq ($(LASERXT), y) OPTS += -DUSE_LASERXT DEVBROBJ += m_xt_laserxt.o @@ -474,18 +486,6 @@ ifeq ($(XL24), y) OPTS += -DUSE_XL24 endif -ifeq ($(ISAMEM_RAMPAGE), y) -OPTS += -DUSE_ISAMEM_RAMPAGE -endif - -ifeq ($(ISAMEM_IAB), y) -OPTS += -DUSE_ISAMEM_IAB -endif - -ifeq ($(ISAMEM_BRAT), y) -OPTS += -DUSE_ISAMEM_BRAT -endif - ifeq ($(OLIVETTI), y) OPTS += -DUSE_OLIVETTI DEVBROBJ += olivetti_eva.o From 743dc0f1a8b50ea608adf7be3068c20e7f655aa7 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Mon, 14 Feb 2022 05:36:12 +0500 Subject: [PATCH 05/16] Fix a warning in snd_sn76489.c --- src/sound/snd_sn76489.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index e04ca7e5e..e4ba68742 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -305,6 +305,7 @@ const device_t tndy_device = tndy_device_init, sn76489_device_close, NULL, { NULL }, NULL, + NULL, tndy_config }; #endif From d250b95a9b7296984bf028cb7c801ea6cf515046 Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Mon, 14 Feb 2022 09:23:17 +0800 Subject: [PATCH 06/16] Updated Simp. Chinese translation --- src/win/languages/zh-CN.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/languages/zh-CN.rc b/src/win/languages/zh-CN.rc index a1b699e41..d68877306 100644 --- a/src/win/languages/zh-CN.rc +++ b/src/win/languages/zh-CN.rc @@ -371,7 +371,7 @@ BEGIN 2048 "86Box" IDS_2049 "错误" IDS_2050 "致命错误" - IDS_2051 " - PAUSED" + IDS_2051 " - 已暂停" IDS_2052 "按 Ctrl+Alt+PgDn 组合键返回到窗口模式。" IDS_2053 "速度" IDS_2054 "ZIP %03i %i (%s): %ls" @@ -402,8 +402,8 @@ BEGIN IDS_2075 "其他外围设备" IDS_2076 "表面镜像 (*.86F)\0*.86F\0" IDS_2077 "单击窗口捕捉鼠标" - IDS_2078 "按 F8+F12 释放鼠标" - IDS_2079 "按 F8+F12 或鼠标中键释放鼠标" + IDS_2078 "按下 F8+F12 释放鼠标" + IDS_2079 "按下 F8+F12 或鼠标中键释放鼠标" END STRINGTABLE DISCARDABLE From 9c4242961c90433bd040c23684b98d8a919b14ce Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Mon, 14 Feb 2022 09:24:13 +0800 Subject: [PATCH 07/16] Updated Japanese translation --- src/win/languages/ja-JP.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/languages/ja-JP.rc b/src/win/languages/ja-JP.rc index e98ef2b45..3917f59c4 100644 --- a/src/win/languages/ja-JP.rc +++ b/src/win/languages/ja-JP.rc @@ -371,7 +371,7 @@ BEGIN 2048 "86Box" IDS_2049 "エラー" IDS_2050 "致命的なエラー" - IDS_2051 " - PAUSED" + IDS_2051 " - 一時停止" IDS_2052 "Ctrl+Alt+PgDnでウィンドウモードに戻ります。" IDS_2053 "速度" IDS_2054 "ZIP %03i %i (%s): %ls" From 695d476196c41becb8b286e8c00ba7130553cc1e Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Mon, 14 Feb 2022 09:26:53 +0800 Subject: [PATCH 08/16] Updated Simp. Chinese translation --- src/qt/languages/zh-CN.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qt/languages/zh-CN.po b/src/qt/languages/zh-CN.po index 165878dec..b9c6f6c98 100644 --- a/src/qt/languages/zh-CN.po +++ b/src/qt/languages/zh-CN.po @@ -599,10 +599,10 @@ msgid "Fatal error" msgstr "致命错误" msgid " - PAUSED" -msgstr " - PAUSED" +msgstr " - 已暂停" msgid "Press Ctrl+Alt+PgDn to return to windowed mode." -msgstr "按 Ctrl+Alt+PgDn 组合键返回到窗口模式。" +msgstr "按下 Ctrl+Alt+PgDn 返回到窗口模式。" msgid "Speed" msgstr "速度" @@ -683,10 +683,10 @@ msgid "Click to capture mouse" msgstr "单击窗口捕捉鼠标" msgid "Press F8+F12 to release mouse" -msgstr "按 F8+F12 释放鼠标" +msgstr "按下 F8+F12 释放鼠标" msgid "Press F8+F12 or middle button to release mouse" -msgstr "按 F8+F12 或鼠标中键释放鼠标" +msgstr "按下 F8+F12 或鼠标中键释放鼠标" msgid "Unable to initialize FluidSynth" msgstr "无法初始化 FluidSynth" @@ -932,10 +932,10 @@ msgid "Pause execution" msgstr "暂停执行" msgid "Press Ctrl+Alt+Del" -msgstr "按 Ctrl+Alt+Del" +msgstr "按下 Ctrl+Alt+Del" msgid "Press Ctrl+Alt+Esc" -msgstr "按 Ctrl+Alt+Esc" +msgstr "按下 Ctrl+Alt+Esc" msgid "Hard reset" msgstr "硬重置" From f586727153d67fa1cd9a5cdb42bde06fe1ad8e92 Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Mon, 14 Feb 2022 09:28:08 +0800 Subject: [PATCH 09/16] Small fixes to Simp. Chinese translation --- src/win/languages/zh-CN.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/languages/zh-CN.rc b/src/win/languages/zh-CN.rc index d68877306..accc0dd47 100644 --- a/src/win/languages/zh-CN.rc +++ b/src/win/languages/zh-CN.rc @@ -372,7 +372,7 @@ BEGIN IDS_2049 "错误" IDS_2050 "致命错误" IDS_2051 " - 已暂停" - IDS_2052 "按 Ctrl+Alt+PgDn 组合键返回到窗口模式。" + IDS_2052 "按下 Ctrl+Alt+PgDn 返回到窗口模式。" IDS_2053 "速度" IDS_2054 "ZIP %03i %i (%s): %ls" IDS_2055 "ZIP 镜像 (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0" @@ -505,8 +505,8 @@ BEGIN IDS_2153 "无法初始化 OpenGL (3.0 核心) 渲染器。请使用其他渲染器。" IDS_2154 "恢复执行" IDS_2155 "暂停执行" - IDS_2156 "按 Ctrl+Alt+Del" - IDS_2157 "按 Ctrl+Alt+Esc" + IDS_2156 "按下 Ctrl+Alt+Del" + IDS_2157 "按下 Ctrl+Alt+Esc" IDS_2158 "硬重置" IDS_2159 "ACPI 关机" IDS_2160 "设置" From 2cc7e5f9c348d1420c24ed068bfa3b5803cdb00f Mon Sep 17 00:00:00 2001 From: EmpyreusX <36258024+EmpyreusX@users.noreply.github.com> Date: Mon, 14 Feb 2022 09:29:12 +0800 Subject: [PATCH 10/16] Updated Japanese translation. --- src/qt/languages/ja-JP.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po index 7a66603b4..d1da289c4 100644 --- a/src/qt/languages/ja-JP.po +++ b/src/qt/languages/ja-JP.po @@ -599,7 +599,7 @@ msgid "Fatal error" msgstr "致命的なエラー" msgid " - PAUSED" -msgstr " - PAUSED" +msgstr " - 一時停止" msgid "Press Ctrl+Alt+PgDn to return to windowed mode." msgstr "Ctrl+Alt+PgDnでウィンドウモードに戻ります。" From 6f35e670ec085de0a1c7f89839b78d5d2c9c1229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 14 Feb 2022 08:33:03 +0100 Subject: [PATCH 11/16] Fix Mac build --- src/qt/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index e246ce920..1604083d0 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -231,9 +231,6 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" DESTINATION "${INSTALL_CMAKE_DIR}") - # Note Mac specific extension .app - set(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/86Box.app") - # Directories to look for dependencies set(DIRS "${CMAKE_BINARY_DIR}") @@ -253,9 +250,10 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) message(STATUS "QT_PLUGINS: ${QT_PLUGINS}") message(STATUS "DIRS: ${DIRS}") - install(CODE " + install(CODE " include(BundleUtilities) - fixup_bundle(\"${APPS}\" \"${QT_PLUGINS}\" \"${DIRS}\")") + get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX} ABSOLUTE) + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS}\" \"${DIRS}\")") endif() if (UNIX AND NOT APPLE) From c52825522ace73ab54c559e8b4e9db7c785f7648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 14 Feb 2022 09:16:14 +0100 Subject: [PATCH 12/16] Fix Mac builds, take two --- src/qt/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 1604083d0..9b109ce30 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -205,7 +205,7 @@ macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var _prefix) install(FILES "${_qt_plugin_path}" DESTINATION "${_qt_plugin_dest}") set(${_qt_plugins_var} - "${${_qt_plugins_var}};\$ENV{DEST_DIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") + "${${_qt_plugins_var}};${_qt_plugin_dest}/${_qt_plugin_file}") else() message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() @@ -250,10 +250,18 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) message(STATUS "QT_PLUGINS: ${QT_PLUGINS}") message(STATUS "DIRS: ${DIRS}") - install(CODE " + install(CODE " include(BundleUtilities) + get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX} ABSOLUTE) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS}\" \"${DIRS}\")") + + set(QT_PLUGINS_ABSOLUTE "") + foreach(PLUGIN ${QT_PLUGINS}) + get_filename_component(PLUGIN_ABSOLUTE \${PLUGIN} ABSOLUTE BASE_DIR \${CMAKE_INSTALL_PREFIX_ABSOLUTE}) + list(APPEND QT_PLUGINS_ABSOLUTE \${PLUGIN_ABSOLUTE}) + endforeach() + + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS_ABSOLUTE}\" \"${DIRS}\")") endif() if (UNIX AND NOT APPLE) From 04e37b87719a0075e5e4abb7b5fef2c29464d4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 14 Feb 2022 09:51:13 +0100 Subject: [PATCH 13/16] Fix Mac builds, take three --- src/qt/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 9b109ce30..f21e348ab 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -204,8 +204,7 @@ macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var _prefix) set(_qt_plugin_dest "${_prefix}/PlugIns/${_qt_plugin_type}") install(FILES "${_qt_plugin_path}" DESTINATION "${_qt_plugin_dest}") - set(${_qt_plugins_var} - "${${_qt_plugins_var}};${_qt_plugin_dest}/${_qt_plugin_file}") + list(APPEND ${_qt_plugins_var} "${_qt_plugin_dest}/${_qt_plugin_file}") else() message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() @@ -252,15 +251,11 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) install(CODE " include(BundleUtilities) - get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX} ABSOLUTE) - - set(QT_PLUGINS_ABSOLUTE "") foreach(PLUGIN ${QT_PLUGINS}) get_filename_component(PLUGIN_ABSOLUTE \${PLUGIN} ABSOLUTE BASE_DIR \${CMAKE_INSTALL_PREFIX_ABSOLUTE}) list(APPEND QT_PLUGINS_ABSOLUTE \${PLUGIN_ABSOLUTE}) endforeach() - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/86Box.app\" \"${QT_PLUGINS_ABSOLUTE}\" \"${DIRS}\")") endif() From f24923b98893c078a5e79ae532b15aa08efdf768 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Mon, 14 Feb 2022 03:18:56 +0500 Subject: [PATCH 14/16] qt: hide machine types with no available machines --- src/qt/qt_settingsmachine.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index 7f402de1b..56456000b 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -74,12 +74,21 @@ SettingsMachine::SettingsMachine(QWidget *parent) : int selectedMachineType = 0; auto* machineTypesModel = ui->comboBoxMachineType->model(); - for (int i = 0; i < MACHINE_TYPE_MAX; ++i) { - Models::AddEntry(machineTypesModel, machine_types[i].name, machine_types[i].id); - if (machine_types[i].id == machine_get_type(machine)) { - selectedMachineType = i; + for (int i = 1; i < MACHINE_TYPE_MAX; ++i) { + int j = 0; + while (machine_get_internal_name_ex(j) != nullptr) { + if (machine_available(j) && (machine_get_type(j) == i)) { + int row = Models::AddEntry(machineTypesModel, machine_types[i].name, machine_types[i].id); + if (machine_types[i].id == machine_get_type(machine)) { + selectedMachineType = row; + } + break; + } + j++; } } + + ui->comboBoxMachineType->setCurrentIndex(-1); ui->comboBoxMachineType->setCurrentIndex(selectedMachineType); } @@ -124,12 +133,16 @@ void SettingsMachine::save() { } void SettingsMachine::on_comboBoxMachineType_currentIndexChanged(int index) { + if (index < 0) { + return; + } + auto* model = ui->comboBoxMachine->model(); int removeRows = model->rowCount(); int selectedMachineRow = 0; for (int i = 0; i < machine_count(); ++i) { - if ((machine_get_type(i) == index) && machine_available(i)) { + if ((machine_get_type(i) == ui->comboBoxMachineType->currentData().toInt()) && machine_available(i)) { int row = Models::AddEntry(model, machines[i].name, i); if (i == machine) { selectedMachineRow = row - removeRows; From 4fcd9186e9c274f5357ee1619420f45ee4eda2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 14 Feb 2022 13:04:05 +0100 Subject: [PATCH 15/16] Infer WIN32 and MACOSX_BUNDLE from respective variables --- src/CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 27cbad661..704024067 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,14 +11,13 @@ # Authors: David Hrdlička, # dob205 # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2022 David Hrdlička. # Copyright 2021 dob205. # -# WIN32 marks us as a GUI app on Windows -add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c - dma.c ddma.c discord.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c fifo8.c - device.c nvr.c nvr_at.c nvr_ps2.c) +add_executable(86Box 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c + dma.c ddma.c discord.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c + mca.c usb.c fifo8.c device.c nvr.c nvr_at.c nvr_ps2.c) if(CPPTHREADS) target_sources(86Box PRIVATE thread.cpp) From c554ba0fdfef29abc09d7098571f9134f6126dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Mon, 14 Feb 2022 13:14:57 +0100 Subject: [PATCH 16/16] Remove some debug code --- src/qt/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index f21e348ab..a69464a1e 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -230,9 +230,6 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" DESTINATION "${INSTALL_CMAKE_DIR}") - # Directories to look for dependencies - set(DIRS "${CMAKE_BINARY_DIR}") - # Path used for searching by FIND_XXX(), with appropriate suffixes added if(CMAKE_PREFIX_PATH) foreach(dir ${CMAKE_PREFIX_PATH}) @@ -245,10 +242,6 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE) include(InstallRequiredSystemLibraries) - message(STATUS "APPS: ${APPS}") - message(STATUS "QT_PLUGINS: ${QT_PLUGINS}") - message(STATUS "DIRS: ${DIRS}") - install(CODE " include(BundleUtilities) get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX} ABSOLUTE)