From ccfcab88d37a0ce85426066497597e0b66b46936 Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Thu, 26 Nov 2020 20:33:35 +0100 Subject: [PATCH] [v0.92][ARM] Add MediaTek ASCII art --- src/common/ascii.h | 65 +++++++++++++++++++++++++++++--------------- src/common/printer.c | 15 ++++++++-- 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/src/common/ascii.h b/src/common/ascii.h index 7e8fc42..3696a40 100644 --- a/src/common/ascii.h +++ b/src/common/ascii.h @@ -45,27 +45,6 @@ ##### ########## \ ########## ################ \ ############################### " - -#define ARM_ASCII \ -" \ - \ - \ - \ - \ - \ - ############ ########## #### ###### ######## \ - ############### ######### ####################### \ - #### #### #### ##### ####### ##### \ - #### #### #### #### ##### #### \ - #### #### #### #### #### #### \ - #### ##### #### #### #### #### \ - ############### #### #### #### #### \ - ######## #### #### #### #### #### \ - \ - \ - \ - \ - " #define SNAPDRAGON_ASCII \ " \ @@ -87,7 +66,48 @@ @@@@########### \ \ " - + +#define MEDIATEK_ASCII \ +" \ + \ + \ + \ + \ + \ + ## ## ###### ###### # ### @@@@@@ @@@@@@ @@ @@ \ + ### ### # # # # #### @@ @ @@ @@ \ + ######## # ### # # # ## ## @@ @ @@@ @@@@ \ + ## ### ## # # # # ## ## @@ @ @@ @@ \ + ## ## ## ###### ##### # ## ## @@ @@@@@@ @@ @@ \ + \ + \ + \ + \ + \ + \ + \ + " + +#define ARM_ASCII \ +" \ + \ + \ + \ + \ + \ + ############ ########## #### ###### ######## \ + ############### ######### ####################### \ + #### #### #### ##### ####### ##### \ + #### #### #### #### ##### #### \ + #### #### #### #### #### #### \ + #### ##### #### #### #### #### \ + ############### #### #### #### #### \ + ######## #### #### #### #### #### \ + \ + \ + \ + \ + " #define UNKNOWN_ASCII \ " \ @@ -115,6 +135,7 @@ static const char* ASCII_ARRAY [] = { INTEL_ASCII, ARM_ASCII, SNAPDRAGON_ASCII, + MEDIATEK_ASCII, UNKNOWN_ASCII }; diff --git a/src/common/printer.c b/src/common/printer.c index 4c1c56c..ec3682d 100644 --- a/src/common/printer.c +++ b/src/common/printer.c @@ -173,6 +173,13 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) { COL_FANCY_4 = COLOR_FG_WHITE; art->ascii_chars[0] = '@'; } + else if(art->vendor == SOC_MEDIATEK) { + COL_FANCY_1 = COLOR_BG_BLUE; + COL_FANCY_2 = COLOR_BG_YELLOW; + COL_FANCY_3 = COLOR_FG_WHITE; + COL_FANCY_4 = COLOR_FG_BLUE; + art->ascii_chars[0] = '@'; + } else { COL_FANCY_1 = COLOR_BG_CYAN; COL_FANCY_2 = COLOR_BG_CYAN; @@ -274,6 +281,8 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) { #elif ARCH_ARM if(art->vendor == SOC_SNAPDRAGON) strcpy(tmp, SNAPDRAGON_ASCII); + else if(art->vendor == SOC_MEDIATEK) + strcpy(tmp, MEDIATEK_ASCII); else strcpy(tmp, ARM_ASCII); #endif @@ -452,7 +461,7 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct colors* cs) { #endif #ifdef ARCH_ARM -void print_algorithm_snapdragon(struct ascii* art, int i, int n) { +void print_algorithm_snapd_mtk(struct ascii* art, int i, int n) { if(art->art[n][i] == '@') printf("%s%c%s", art->color1_ascii, art->ascii_chars[0], art->reset); else if(art->art[n][i] == '#') @@ -514,8 +523,8 @@ void print_ascii_arm(struct ascii* art, uint32_t la, void (*callback_print_algor void print_ascii(struct ascii* art) { uint32_t longest_attribute = longest_attribute_length(art); - if(art->vendor == SOC_SNAPDRAGON) - print_ascii_arm(art, longest_attribute, &print_algorithm_snapdragon); + if(art->vendor == SOC_SNAPDRAGON || art->vendor == SOC_MEDIATEK) + print_ascii_arm(art, longest_attribute, &print_algorithm_snapd_mtk); else { if(art->vendor != SOC_UNKNOWN) printWarn("Invalid SOC vendor: %d\n", art->vendor);