📄 c.c
字号:
/**************************************************/ /**/ int g_x=0, g_y=0; /**/ /**/ char g_color=0x31; /**/ /**/ void kputc(char c,char color,int x,int y); /**/ /**/ void setcolor(char ); /**/ /**/ void newline(); /**/ /**/ void show(char *); /**/ /**/ void clear(); /**/ /**/ void delay(); /**/ /**************************************************/ /***************************/ /* System Entry */ /***************************/ void c() { int color; dead: if(color>=15) color=color-15; if(color==0)color++; setcolor(color++); setcolor(color++); show(" Thanks Snow,my love! Suport me forever " ); newline(); goto dead; while(1); }/*****************************************************************************//*****************************************************************************//* delay about 0.5 sec*/void delay(){ int i=10000; int j=1000; for(i=0;i<10000;i++) { for(j=0;j<10;j++) {;} }}/** Clear screen in text mode 80x25
*/void clear(){ int x=0,y=0; setcolor(0); for(;x<25;x++) { for(y=0;y<80;y++) kputc(0,0,x,y); }} /* Set corrent color*/void setcolor(char color){ g_color=color;}/* genarete new line */void newline(){ if(g_x>=10) g_x=0; else g_x++; g_y=0;}/* * Show str in screen corrent pos*/void show(char *str){ int i=0; while(str[i] != 0) { if(str[i]!=' ') delay(); if(g_color>=15) g_color-=15; if(g_color==0) g_color++; g_color++; kputc(str[i++],g_color,g_x,g_y++); }}/* Text mode kprint Show 'c' at line : x (0...24 ) col : y (0...79 )*/void kputc(char c,char color,int x,int y){ /* p ponitor to Video Memory */ char *p = (char*)0xb8000; /* calc line pos*/ p += 2*x*80+y*2; /* show char whith color*/ *p = c; *(p+1) = color;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -