[v1.03][RISCV] Add SiFive ascii art

This commit is contained in:
Dr-Noob
2023-04-03 13:25:51 +02:00
parent 14819c350e
commit a496f694a6
5 changed files with 32 additions and 4 deletions

View File

@@ -266,6 +266,27 @@ $C1 ## ### ## ##. ## ### ### \
$C1 ## ### ## ##########. ########## ### \
$C1 "
#define ASCII_SIFIVE \
"$C1 ########################### \
$C1 ############################### \
$C1 #### #### \
$C1 ##### ##### \
$C1 ##### ##### \
$C1 #### ######################### \
$C1 #### ########################### \
$C1 #### #### \
$C1 ##### ##### \
$C1 ##### ##### \
$C1 ################################# #### \
$C1 ############################## ##### \
$C1 ###### ####### ####### \
$C1 ###### # ###### \
$C1 ###### ###### \
$C1 ###### ###### \
$C1 ###### ###### \
$C1 ########### \
$C1 ### "
// --------------------- LONG LOGOS ------------------------- //
#define ASCII_AMD_L \
"$C1 \
@@ -369,6 +390,7 @@ asciiL logo_apple = { ASCII_APPLE, 32, 17, false, {C_FG_WHITE},
asciiL logo_allwinner = { ASCII_ALLWINNER, 47, 16, false, {C_FG_CYAN}, {C_FG_B_BLACK, C_FG_B_CYAN } };
asciiL logo_rockchip = { ASCII_ROCKCHIP, 58, 8, false, {C_FG_CYAN, C_FG_YELLOW}, {C_FG_CYAN, C_FG_YELLOW} };
asciiL logo_riscv = { ASCII_RISCV, 63, 18, false, {C_FG_CYAN, C_FG_YELLOW}, {C_FG_CYAN, C_FG_YELLOW} };
asciiL logo_sifive = { ASCII_SIFIVE, 51, 19, false, {C_FG_WHITE}, {C_FG_WHITE, C_FG_B_CYAN} };
// Long variants | ----------------------------------------------------------------------------------------------------|
asciiL logo_amd_l = { ASCII_AMD_L, 62, 19, true, {C_BG_WHITE, C_BG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };

View File

@@ -369,7 +369,10 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter
art->art = choose_ascii_art_aux(&logo_arm_l, &logo_arm, term, lf);
}
#elif ARCH_RISCV
art->art = &logo_riscv;
if(art->vendor == SOC_VENDOR_SIFIVE)
art->art = &logo_sifive;
else
art->art = &logo_riscv;
#endif
// 2. Choose colors
@@ -919,7 +922,7 @@ bool print_cpufetch_arm(struct cpuInfo* cpu, STYLE s, struct color** cs, struct
#ifdef ARCH_RISCV
bool print_cpufetch_riscv(struct cpuInfo* cpu, STYLE s, struct color** cs, struct terminal* term) {
struct ascii* art = set_ascii(get_cpu_vendor(cpu), s);
struct ascii* art = set_ascii(get_soc_vendor(cpu->soc), s);
if(art == NULL)
return false;

View File

@@ -38,7 +38,6 @@ struct cpuInfo* get_cpu_info(void) {
cpu->hv->present = false;
cpu->soc = get_soc();
cpu->freq = get_frequency_info(0);
cpu->cpu_vendor = CPU_VENDOR_RISCV;
cpu->peak_performance = get_peak_performance(cpu);
return cpu;

View File

@@ -5,6 +5,10 @@
#include <string.h>
VENDOR get_soc_vendor(struct system_on_chip* soc) {
return soc->soc_vendor;
}
char* get_str_process(struct system_on_chip* soc) {
char* str;

View File

@@ -21,7 +21,7 @@ struct system_on_chip {
struct system_on_chip* get_soc(void);
char* get_soc_name(struct system_on_chip* soc);
//VENDOR get_soc_vendor(struct system_on_chip* soc);
VENDOR get_soc_vendor(struct system_on_chip* soc);
char* get_str_process(struct system_on_chip* soc);
#endif