Compare commits

...

4 Commits
i230 ... ascii

Author SHA1 Message Date
Dr-Noob
ae53d97a47 Add AMD txt 2021-03-31 09:25:52 +02:00
Dr-Noob
eeeaec3ba9 Small changes to art. Back to previous algorithm 2021-03-30 22:43:28 +02:00
Dr-Noob
7c5a0c3280 Testing white background for Intel art 2021-03-30 22:22:22 +02:00
Dr-Noob
d4ad5a58f0 Add new Intel ASCII art made with unicode characters 2021-03-30 21:41:59 +02:00
5 changed files with 79 additions and 43 deletions

File diff suppressed because one or more lines are too long

19
src/common/ascii/amd.txt Normal file
View File

@@ -0,0 +1,19 @@
████ ███ ███ ████████ ▜███████████
██████ █████ █████ ███ ███ ▗▀▀▀▀▀▀▜███
███ ███ █████████████ ███ ██ ▐█ ▐███
███ ███ ███ ███ ███ ███ ██ ▟██ ▐███
████████████ ███ ███ ███ ███ ████▄▄▄▄▄▄▝▜██
███ ███ ███ ███ █████████ ████████▛ ██

3
src/common/ascii/convert.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
cat intel.txt | hexdump -vC | head -n-1 | cut -d' ' -f2- | cut -d'|' -f1 | tr '\n' ' ' | tr -s ' ' | tr ' ' ',' | sed "s/,/,0x/g"

View File

@@ -0,0 +1,19 @@
▁▂▃▄▅▆▆▇▇███████▇▇▆▅▅▄▂▁
▁▃▄▆▇▛▀▀▀▀▔▔▔ ▔▔▔▀▀▀██▇▅▃
▂▄▆█▀▀▔ ▝▜██▅▁
▀▀▔ ▔▜██▖
▅▅▅ ▆▆▆ ▜██▖
▁▅ ▀▀▀ ▐██▌ ███ ██▉
▄▛▘ ▄▄▄ ▗▄▄▄▄▄▄▃▁ ▐██▙▄▖ ▁▃▄▅▄▃ ███ ███
▗▟▛ ███ ▐██▀▀▀▜██▖ ▐██▛▀▘ ▟██▀▀▀██▖ ███ ▗██▊
█▛ ███ ▐██ ▕██▌ ▐██▌ ▐██▂▂▂▂▂██ ███ ▗███▘
▐█▍ ███ ▐██ ▕██▌ ▐██▌ ▐██▛▀▀▀▀▀▀ ███ ▄██▛▘
██▏ ███ ▐██ ▕██▌ ▐██▌ ▝██▙▁ ▁▂▃ ███ ▅███▀
██▍ ▝██ ▐██ ▕██▌ ▀███▋ ▝▀█████▛ ▝▜█ █▀▔
▐█▙ ▔▔▔
▜█▙▖ ▁▂▄▖
▜██▆▃▁ ▁▂▄▅▇███▌
▝▜███▇▅▄▃▂▁ ▁▁▂▃▄▅▆▇███████▀▀
▔▀▀████████▇▇▇▇▇▇▇▇▇▇███████████▛▀▀▔▔
▔▔▀▀▀▀█████████████▀▀▀▀▀▔▔▔

View File

@@ -105,6 +105,7 @@ struct attribute {
struct ascii {
char art[NUMBER_OF_LINES][LINE_SIZE+1];
unsigned char* art_unicode;
char color1_ascii[100];
char color2_ascii[100];
char color1_text[100];
@@ -159,8 +160,8 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
#ifdef ARCH_X86
if(art->vendor == CPU_VENDOR_INTEL) {
COL_FANCY_1 = COLOR_BG_CYAN;
COL_FANCY_2 = COLOR_BG_WHITE;
COL_FANCY_1 = COLOR_FG_CYAN;
COL_FANCY_2 = COLOR_FG_WHITE;
COL_FANCY_3 = COLOR_FG_CYAN;
COL_FANCY_4 = COLOR_FG_WHITE;
art->ascii_chars[0] = '#';
@@ -262,6 +263,12 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
if(cs != NULL) {
COL_FANCY_1 = rgb_to_ansi(cs->c1, true, true);
COL_FANCY_2 = rgb_to_ansi(cs->c2, true, true);
#ifdef ARCH_X86
if(art->vendor == CPU_VENDOR_INTEL) {
COL_FANCY_1 = rgb_to_ansi(cs->c1, false, true);
COL_FANCY_2 = rgb_to_ansi(cs->c2, false, true);
}
#endif
COL_FANCY_3 = rgb_to_ansi(cs->c3, false, true);
COL_FANCY_4 = rgb_to_ansi(cs->c4, false, true);
}
@@ -303,9 +310,11 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
}
char tmp[NUMBER_OF_LINES * LINE_SIZE + 1];
art->art_unicode = NULL;
#ifdef ARCH_X86
if(art->vendor == CPU_VENDOR_INTEL)
strcpy(tmp, INTEL_ASCII);
art->art_unicode = art_unicode_intel;
else if(art->vendor == CPU_VENDOR_AMD)
strcpy(tmp, AMD_ASCII);
else
@@ -325,8 +334,11 @@ struct ascii* set_ascii(VENDOR vendor, STYLE style, struct colors* cs) {
strcpy(tmp, ARM_ASCII);
#endif
for(int i=0; i < NUMBER_OF_LINES; i++)
if(art->art_unicode != NULL) {
for(int i=0; i < NUMBER_OF_LINES; i++) {
memcpy(art->art[i], tmp + i*LINE_SIZE, LINE_SIZE);
}
}
return art;
}
@@ -347,24 +359,26 @@ uint32_t longest_attribute_length(struct ascii* art) {
#ifdef ARCH_X86
void print_algorithm_intel(struct ascii* art, int n, bool* flag) {
for(int i=0; i < LINE_SIZE; i++) {
if(*flag) {
if(art->art[n][i] == ' ') {
*flag = false;
printf("%s%c%s", art->color2_ascii, art->ascii_chars[1], art->reset);
int start = -1;
for(int i=0, newlines=0; newlines < n; i++) {
if(art->art_unicode[i] == '\n') {
newlines++;
start = i;
}
}
for(int i=start+1, x=0; art->art_unicode[i] != '\n'; i++, x++) {
if(art->art_unicode[i] == ' ') {
printf(" ");
}
else {
printf("%s%c%s", art->color1_ascii, art->ascii_chars[0], art->reset);
}
}
else {
if(art->art[n][i] != ' ' && art->art[n][i] != '\0') {
*flag = true;
printf("%c",' ');
}
else {
printf("%c",' ');
}
printf("%s", art->color1_ascii);
printf("%c", art->art_unicode[i]);
printf("%c", art->art_unicode[i + 1]);
printf("%c", art->art_unicode[i + 2]);
printf("%s", COLOR_RESET);
i += 2;
}
}
}