Merge pull request #4329 from cold-brewed/config-cpu-version
Add host_cpu and emu_build_num to config
This commit is contained in:
10
src/config.c
10
src/config.c
@@ -77,6 +77,7 @@
|
|||||||
#include <86box/plat_dir.h>
|
#include <86box/plat_dir.h>
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#include <86box/snd_opl.h>
|
#include <86box/snd_opl.h>
|
||||||
|
#include <86box/version.h>
|
||||||
|
|
||||||
static int cx;
|
static int cx;
|
||||||
static int cy;
|
static int cy;
|
||||||
@@ -1884,6 +1885,15 @@ save_general(void)
|
|||||||
else
|
else
|
||||||
ini_section_delete_var(cat, "do_auto_pause");
|
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");
|
||||||
|
|
||||||
if (strnlen(uuid, sizeof(uuid) - 1) > 0)
|
if (strnlen(uuid, sizeof(uuid) - 1) > 0)
|
||||||
ini_section_set_string(cat, "uuid", uuid);
|
ini_section_set_string(cat, "uuid", uuid);
|
||||||
else
|
else
|
||||||
|
@@ -686,7 +686,7 @@ plat_get_cpu_string(char *outbuf, uint8_t len) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QByteArray result = process->readAll();
|
QByteArray result = process->readAll();
|
||||||
auto command_result = QString(result).split(": ").last();
|
auto command_result = QString(result).split(": ").last().trimmed();
|
||||||
if(!command_result.isEmpty()) {
|
if(!command_result.isEmpty()) {
|
||||||
cpu_string = command_result;
|
cpu_string = command_result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user