From 97f3deb891ce6966375d1c94bae7b9b1c9341198 Mon Sep 17 00:00:00 2001 From: MathemanFlo Date: Fri, 3 Sep 2021 12:17:14 +0200 Subject: [PATCH] Improve graphics card output on windows --- Sources/arm/ui/UIMenu.hx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Sources/arm/ui/UIMenu.hx b/Sources/arm/ui/UIMenu.hx index f2caf3ab..f9d6d74e 100644 --- a/Sources/arm/ui/UIMenu.hx +++ b/Sources/arm/ui/UIMenu.hx @@ -394,12 +394,20 @@ class UIMenu { var save = (Path.isProtected() ? Krom.savePath() : Path.data()) + Path.sep + "tmp.txt"; Krom.sysCommand('wmic path win32_VideoController get name > "' + save + '"'); var bytes = haxe.io.Bytes.ofData(Krom.loadBlob(save)); - var gpu = ""; - for (i in 30...Std.int(bytes.length / 2)) { + var gpuRaw = ""; + for (i in 0...Std.int(bytes.length / 2)) { var c = String.fromCharCode(bytes.get(i * 2)); - if (c == "\n") continue; - gpu += c; + gpuRaw += c; } + + var gpus = gpuRaw.split("\n"); + gpus = gpus.splice(1,gpus.length-2); + var gpu = ""; + for (g in gpus) { + gpu += g.rtrim() + ", "; + } + gpu = gpu.substr(0,gpu.length-2); + msg += '\n$gpu'; #else // { lshw -C display }