[v0.92][ARM] Add MediaTek ASCII art

This commit is contained in:
Dr-Noob
2020-11-26 20:33:35 +01:00
parent e5d5e5ef92
commit ccfcab88d3
2 changed files with 55 additions and 25 deletions

View File

@@ -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
};

View File

@@ -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);