summaryrefslogtreecommitdiff
path: root/src/bees.c
blob: 6703fcafa7d96a2dae09990914941317cfc0b80c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#include "vga.h"
#include "printf.h"
#include "string.h"

const char *bees_msg =
"\n\n\n"
"       /  \\        the number of bees generated by citrons os has exceeded the"  "\n"
"      /    \\       maximum amount your computer is capable of handling."         "\n"
"      \\ -- /"                                                                    "\n"
"      _====_       your computer will now halt."                                  "\n"
"     / |--| \\"                                                                   "\n"
"    /  /==\\  \\     error: "                                                     "\n"
"   /  /----\\  \\     %"                                                          "\n"
"  /  /======\\  \\    %"                                                          "\n"
"  \\_/  ----  \\_/    %"                                                          "\n"
"                    % "                                                           "\n"
"                    % "                                                           "\n"
"                    % "                                                           "\n"
"                    % "                                                           "\n"
"                    % "                                                           "\n"
"                    % "                                                           "\n";

_Noreturn void bees(const char *error) {
	vsetcolor(vga_color(vga_white, vga_blue));
	vclear();
	// wrap the error message
	for (int i = 0; bees_msg[i] != '\0'; i++) {
		if (bees_msg[i] != '%') vputchar(bees_msg[i]);
		else {
			while (isspace(*error)) error++;
			for (int j = 20; j <= VGA_WIDTH - 3 && *error != '\0'; j++)
				vputchar(*(error++));
		}
	}
	while (1) asm("cli;hlt");
}