mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[v0.99] Show new Intel logo only when the CPU was released after Intel started using the new logo
This commit is contained in:
@@ -144,6 +144,7 @@ struct ascii {
|
|||||||
struct attribute** attributes;
|
struct attribute** attributes;
|
||||||
uint32_t n_attributes_set;
|
uint32_t n_attributes_set;
|
||||||
uint32_t additional_spaces;
|
uint32_t additional_spaces;
|
||||||
|
bool new_intel_logo;
|
||||||
VENDOR vendor;
|
VENDOR vendor;
|
||||||
STYLE style;
|
STYLE style;
|
||||||
};
|
};
|
||||||
@@ -260,11 +261,19 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter
|
|||||||
// 1. Choose logo
|
// 1. Choose logo
|
||||||
#ifdef ARCH_X86
|
#ifdef ARCH_X86
|
||||||
if(art->vendor == CPU_VENDOR_INTEL) {
|
if(art->vendor == CPU_VENDOR_INTEL) {
|
||||||
|
if(art->new_intel_logo) {
|
||||||
|
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l_new, lf))
|
||||||
|
art->art = &logo_intel_l_new;
|
||||||
|
else
|
||||||
|
art->art = &logo_intel_new;
|
||||||
|
}
|
||||||
|
else {
|
||||||
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l, lf))
|
if(term != NULL && ascii_fits_screen(term->w, logo_intel_l, lf))
|
||||||
art->art = &logo_intel_l;
|
art->art = &logo_intel_l;
|
||||||
else
|
else
|
||||||
art->art = &logo_intel;
|
art->art = &logo_intel;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(art->vendor == CPU_VENDOR_AMD) {
|
else if(art->vendor == CPU_VENDOR_AMD) {
|
||||||
if(term != NULL && ascii_fits_screen(term->w, logo_amd_l, lf))
|
if(term != NULL && ascii_fits_screen(term->w, logo_amd_l, lf))
|
||||||
art->art = &logo_amd_l;
|
art->art = &logo_amd_l;
|
||||||
@@ -428,6 +437,7 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct color** cs, struct
|
|||||||
if(art == NULL)
|
if(art == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
art->new_intel_logo = choose_new_intel_logo(cpu);
|
||||||
char* uarch = get_str_uarch(cpu);
|
char* uarch = get_str_uarch(cpu);
|
||||||
char* manufacturing_process = get_str_process(cpu);
|
char* manufacturing_process = get_str_process(cpu);
|
||||||
char* sockets = get_str_sockets(cpu->topo);
|
char* sockets = get_str_sockets(cpu->topo);
|
||||||
|
|||||||
@@ -399,6 +399,16 @@ int get_number_of_vpus(struct cpuInfo* cpu) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool choose_new_intel_logo(struct cpuInfo* cpu) {
|
||||||
|
switch(cpu->arch->uarch) {
|
||||||
|
case UARCH_ROCKET_LAKE:
|
||||||
|
// TODO: case UARCH_TIGER_LAKE: missing?
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char* get_str_uarch(struct cpuInfo* cpu) {
|
char* get_str_uarch(struct cpuInfo* cpu) {
|
||||||
return cpu->arch->uarch_str;
|
return cpu->arch->uarch_str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ struct uarch* get_uarch_from_cpuid(struct cpuInfo* cpu, uint32_t ef, uint32_t f,
|
|||||||
bool vpus_are_AVX512(struct cpuInfo* cpu);
|
bool vpus_are_AVX512(struct cpuInfo* cpu);
|
||||||
bool is_knights_landing(struct cpuInfo* cpu);
|
bool is_knights_landing(struct cpuInfo* cpu);
|
||||||
int get_number_of_vpus(struct cpuInfo* cpu);
|
int get_number_of_vpus(struct cpuInfo* cpu);
|
||||||
|
bool choose_new_intel_logo(struct cpuInfo* cpu);
|
||||||
char* get_str_uarch(struct cpuInfo* cpu);
|
char* get_str_uarch(struct cpuInfo* cpu);
|
||||||
char* get_str_process(struct cpuInfo* cpu);
|
char* get_str_process(struct cpuInfo* cpu);
|
||||||
void free_uarch_struct(struct uarch* arch);
|
void free_uarch_struct(struct uarch* arch);
|
||||||
|
|||||||
Reference in New Issue
Block a user