超级蓝屏模拟器!!
# include<stdio.h>
# include<windows.h>
# include<conio.h>
# include<string.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
void setcolor(bool l, bool r, bool g, bool b) {
int ans = 0;
if (l)ans |= FOREGROUND_INTENSITY;
if (r)ans |= FOREGROUND_RED;
if (g)ans |= FOREGROUND_GREEN;
if (b)ans |= FOREGROUND_BLUE;
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ans);
}
void setpos(int x, int y) {
COORD pos;
pos.X = x, pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void rect(int x, int y, int x2, int y2) {
setpos(x, y);
printf("┌ ");
for (int i = 0; i < x2 / 2 - 2; i++) {
printf("─ ");
}
printf("┐\n");
for (int i = 0; i < y2 - 2; i++) {
for (int i = 0; i < x; i++) {
printf(" ");
}
printf("│ ");
for (int j = 0; j < x2 / 2 - 2; j++) {
printf(" ");
}
printf("│\n");
}
for (int i = 0; i < x; i++) {
printf(" ");
}
printf("└ ");
for (int i = 0; i < x2 / 2 - 2; i++) {
printf("─ ");
}
printf("┘");
}
void slowprint(int n, char* str) {
for (int i = 0; i < strlen(str); i++) {
putchar(str[i]);
Sleep(n);
}
}
char* fuhao(int n) {
switch (n) {
case 1:
return "█ ";
break;
case 2:
return "▲ ";
break;
case 3:
return "▓ ";
break;
case 4:
return "● ";
break;
default:
return " ";
break;
}
}
int main() {
system("mode con cols=40 lines=20");
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize = sizeof cfi;
cfi.nFont = 0;
cfi.dwFontSize.X = 10; //字宽
cfi.dwFontSize.Y = 20;//字高
cfi.FontFamily = FF_DONTCARE;
cfi.FontWeight = FW_NORMAL;//粗细
wcscpy_s(cfi.FaceName, L"Raster"); //设置字体,此处设为点阵字体
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
keybd_event(VK_F11,0,0,0);
keybd_event(VK_F11,0,2,0);
system("color 1f");
printf("A problem has been detected and windows has been shutdown to prevent damage\nto your computer.\n\nHAL_MEMORY_ALLOCATION\n\nIf this is the first time you've seen this Stop error screen,\nrestart your computer.If this screen appears again, follow\nthis steps:\n\nCheck to make sure any new hardware or software if properly installed.\nIf this is a new installation, ask hardware or software manufacturer\nfor any windows updates you might need.\n\nIf problem continue, disable or remove any newly installed hardware\nor software. Disable BIOS memory option such as caching or shadowing.\nIf you need to nsu Safe Mode to remove or disable components, restart\nyour computer, press F8 to select Advanced Startup Options, and then select Safe Mode.\n\nTechnical information:\n\"\"\"STOP:0x000000AC (0xFD3094c2,0x00000001,0xFBFE7617,0x00000000)\n\n\"\"\"SPCMDON.SYS - Address FBFS7617 base at FBFE5000, DateStamp 3d6dd67c");
while(1){
//TODO
}
}