From 165ad489ef02087ead30f12ac184b2c0a403b88f Mon Sep 17 00:00:00 2001 From: cold-brewed <47337035+cold-brewed@users.noreply.github.com> Date: Mon, 1 Apr 2024 08:58:43 -0400 Subject: [PATCH 1/2] Trim the newline from the resulting string on macOS --- src/qt/qt_platform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index c7cc76ffe..275d1df2e 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -686,7 +686,7 @@ plat_get_cpu_string(char *outbuf, uint8_t len) { return; } QByteArray result = process->readAll(); - auto command_result = QString(result).split(": ").last(); + auto command_result = QString(result).split(": ").last().trimmed(); if(!command_result.isEmpty()) { cpu_string = command_result; } From f637e72488de866d05b2af03daff94379fb79f42 Mon Sep 17 00:00:00 2001 From: cold-brewed <47337035+cold-brewed@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:40:00 -0400 Subject: [PATCH 2/2] config: Add host_cpu and emu_build_num to general --- src/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/config.c b/src/config.c index da02a93b0..08edb4c59 100644 --- a/src/config.c +++ b/src/config.c @@ -77,6 +77,7 @@ #include <86box/plat_dir.h> #include <86box/ui.h> #include <86box/snd_opl.h> +#include <86box/version.h> static int cx; static int cy; @@ -1878,6 +1879,15 @@ save_general(void) else ini_section_delete_var(cat, "do_auto_pause"); + char cpu_buf[128] = { 0 }; + plat_get_cpu_string(cpu_buf, 128); + ini_section_set_string(cat, "host_cpu", cpu_buf); + + if (EMU_BUILD_NUM != 0) + ini_section_set_int(cat, "emu_build_num", EMU_BUILD_NUM); + else + ini_section_delete_var(cat, "emu_build_num"); + ini_delete_section_if_empty(config, cat); }