-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra.h
121 lines (95 loc) · 1.86 KB
/
extra.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
void setMonitorColor(char);
void cls();
void printString(char*);
void vid();
void put();
void get();
extern void read();
extern void write();
int blockAddr;
char At[1024];
char* TM_START;
void blink() {
setMonitorColor(0x59);
int TIME_OUT = 0x10fffff;
while(--TIME_OUT);
setMonitorColor(0xa5);
}
char strcmp(char* sou , char* dest) {
int i = 0;
while(*(sou + i) == *(dest + i)) {
if(*(sou + i) == 0 && *(dest + i) == 0)
return 1;
i++;
}
return 0;
}
// *evaluates the commands and performs necessary operation.
void strEval(char* CMD) {
char cmd1[] = "CLS";
char cmd2[] = "COLORA";
char cmd3[] = "COLORB";
char cmd4[] = "COLORC";
char cmd5[] = "COLORD";
char cmd6[] = "VID";
char cmd7[] = "HI";
char cmd8[] = "PUT";
char cmd9[] = "GET";
char cmd10[] = "VITBHOPAL";
char msg1[] = "\nHELLO , GLAD YOU SELECTED BLOCKS OS\n";
char msg2[] = "\nA place to learn, an chance to grow.\n";
if(strcmp(CMD , cmd1))
cls();
else if(strcmp(CMD , cmd2))
setMonitorColor(0x3c);
else if(strcmp(CMD , cmd3))
setMonitorColor(0x5a);
else if(strcmp(CMD , cmd4))
setMonitorColor(0x2a);
else if(strcmp(CMD , cmd5))
setMonitorColor(0xa5);
else if(strcmp(CMD , cmd6))
vid();
else if(strcmp(CMD , cmd7))
printString(msg1);
else if(strcmp(CMD , cmd8)) {
blockAddr = 0;
int i = 0;
while(i < 511) {
At[i] = 'J'; // Fill with J
i++;
}
At[i] = 0; // Null character
put(); // Writes to Hard disk by calling write function
i = 0;
while(i < 511) {
At[i] = 0; // Clears the content
i++;
}
}
else if(strcmp(CMD , cmd9)) {
blockAddr = 0;
get();
printString(At);
}
// Additional Functions
else if(strcmp(CMD , cmd10))
printString(msg2);
}
void vid() {
char clr = 'A';
while(1) {
int i = 0;
while(i < 2 * 80 * 25) {
*(TM_START + i) = clr;
clr++;
i++;
}
}
}
void put() {
write();
}
void get() {
read();
}