#include "includes.h"Go to the source code of this file.
Functions | |
| void | SystemCgaInit (void) |
| void | SystemCgaCursorSet (void) |
| void | SystemCgaScrollUp (void) |
| void | SystemCgaCharPut (U8 CharValue) |
| void | SystemCgaScreenClean (void) |
| void | SystemCgaChangeLine (void) |
| void | SystemCgaStringPrint (U8 *pString) |
Variables | |
| SYSTEM_CGA_CONTROL | SystemCgaCtrl |
| void SystemCgaChangeLine | ( | void | ) |
Definition at line 69 of file systemcga.c.
00069 { 00070 U8 i; 00071 00072 i=0; 00073 while(SystemCgaCtrl.CursorPosition>160){ 00074 SystemCgaCtrl.CursorPosition=SystemCgaCtrl.CursorPosition-160; 00075 i++; 00076 } 00077 SystemCgaCtrl.CursorPosition=(i+1)*160; 00078 if(SystemCgaCtrl.CursorPosition==4000) SystemCgaScrollUp(); 00079 }
| void SystemCgaCharPut | ( | U8 | CharValue | ) |
Definition at line 47 of file systemcga.c.
00047 { 00048 if((CharValue>=0x20)&&(CharValue<=0x7e)){ 00049 SystemCgaByteWrite(SystemCgaCtrl.CursorPosition++,CharValue); 00050 SystemCgaByteWrite(SystemCgaCtrl.CursorPosition++,SystemCgaCtrl.CharacterAttribute); 00051 } 00052 else{ 00053 SystemCgaByteWrite(SystemCgaCtrl.CursorPosition++,'?'); 00054 SystemCgaByteWrite(SystemCgaCtrl.CursorPosition++,SystemCgaCtrl.CharacterAttribute); 00055 } 00056 if(SystemCgaCtrl.CursorPosition==4000) SystemCgaScrollUp(); 00057 }
| void SystemCgaCursorSet | ( | void | ) |
Definition at line 25 of file systemcga.c.
00025 { 00026 OutByte(SYSTEM_CGA_ADDRESS_PORT,SYSTEM_CGA_CLLR); 00027 OutByte(SYSTEM_CGA_DATA_PORT,((SystemCgaCtrl.CursorPosition/2)&0xff)); 00028 OutByte(SYSTEM_CGA_ADDRESS_PORT,SYSTEM_CGA_CLHR); 00029 OutByte(SYSTEM_CGA_DATA_PORT,(((SystemCgaCtrl.CursorPosition/2)>>8)&0xff)); 00030 }
| void SystemCgaInit | ( | void | ) |
Definition at line 14 of file systemcga.c.
00014 { 00015 SystemCgaCtrl.CursorPosition=0; 00016 SystemCgaCtrl.CharacterAttribute=0x1F; 00017 SystemCgaScreenClean(); 00018 SystemCgaCtrl.CharacterAttribute=0x0F; 00019 OutByte(SYSTEM_CGA_ADDRESS_PORT,SYSTEM_CGA_CLLR); 00020 OutByte(SYSTEM_CGA_DATA_PORT,((SystemCgaCtrl.CursorPosition/2)&0xff)); 00021 OutByte(SYSTEM_CGA_ADDRESS_PORT,SYSTEM_CGA_CLHR); 00022 OutByte(SYSTEM_CGA_DATA_PORT,(((SystemCgaCtrl.CursorPosition/2)>>8)&0xff)); 00023 }
| void SystemCgaScreenClean | ( | void | ) |
Definition at line 59 of file systemcga.c.
00059 { 00060 U32 i; 00061 00062 for(i=0;i<4000;i=i+2){ 00063 SystemCgaByteWrite(i,' '); 00064 SystemCgaByteWrite(i+1,SystemCgaCtrl.CharacterAttribute); 00065 } 00066 SystemCgaCtrl.CursorPosition=0; 00067 }
| void SystemCgaScrollUp | ( | void | ) |
Definition at line 32 of file systemcga.c.
00032 { 00033 U32 i; 00034 U8 ByteValue; 00035 00036 for(i=0;i<3840;i++){ 00037 ByteValue=SystemCgaByteRead(i+160); 00038 SystemCgaByteWrite(i,ByteValue); 00039 } 00040 for(i=3840;i<4000;i=i+2){ 00041 SystemCgaByteWrite(i,' '); 00042 SystemCgaByteWrite(i+1,SystemCgaCtrl.CharacterAttribute); 00043 } 00044 SystemCgaCtrl.CursorPosition=3840; 00045 }
| void SystemCgaStringPrint | ( | U8 * | pString | ) |
Definition at line 81 of file systemcga.c.
00081 { 00082 while(*pString!=0){ 00083 if(*pString==0x0a) SystemCgaChangeLine(); 00084 else if(*pString==0x0d); // 0x0a 0x0d is change line ,too. 00085 else SystemCgaCharPut(*pString); 00086 pString++; 00087 } 00088 SystemCgaCursorSet(); 00089 }
Definition at line 12 of file systemcga.c.
1.5.9