#include "includes.h"Go to the source code of this file.
Functions | |
| void | CgaInit (void) |
| void | CgaCursorSet (void) |
| void | CgaScrollUp (void) |
| void | CgaCharPut (U8 CharValue) |
| void | CgaBackSpace (void) |
| void | CgaScreenClean (void) |
| void | CgaChangeLine (void) |
Variables | |
| CGA_CONTROL | CgaCtrl |
| void CgaBackSpace | ( | void | ) |
Definition at line 58 of file cga.c.
00058 { 00059 if(CgaCtrl.CursorPosition>=2) CgaCtrl.CursorPosition=CgaCtrl.CursorPosition-2; 00060 CgaByteWrite(CgaCtrl.CursorPosition,' '); 00061 CgaByteWrite(CgaCtrl.CursorPosition+1,CgaCtrl.CharacterAttribute); 00062 }
| void CgaChangeLine | ( | void | ) |
Definition at line 74 of file cga.c.
00074 { 00075 U8 i; 00076 00077 i=0; 00078 while(CgaCtrl.CursorPosition>160){ 00079 CgaCtrl.CursorPosition=CgaCtrl.CursorPosition-160; 00080 i++; 00081 } 00082 CgaCtrl.CursorPosition=(i+1)*160; 00083 if(CgaCtrl.CursorPosition==4000) CgaScrollUp(); 00084 }
| void CgaCharPut | ( | U8 | CharValue | ) |
Definition at line 46 of file cga.c.
00046 { 00047 if((CharValue>=0x20)&&(CharValue<=0x7e)){ 00048 CgaByteWrite(CgaCtrl.CursorPosition++,CharValue); 00049 CgaByteWrite(CgaCtrl.CursorPosition++,CgaCtrl.CharacterAttribute); 00050 } 00051 else{ 00052 CgaByteWrite(CgaCtrl.CursorPosition++,'?'); 00053 CgaByteWrite(CgaCtrl.CursorPosition++,CgaCtrl.CharacterAttribute); 00054 } 00055 if(CgaCtrl.CursorPosition==4000) CgaScrollUp(); 00056 }
| void CgaCursorSet | ( | void | ) |
Definition at line 24 of file cga.c.
00024 { 00025 OutByte(CGA_ADDRESS_PORT,CGA_CLLR); 00026 OutByte(CGA_DATA_PORT,((CgaCtrl.CursorPosition/2)&0xff)); 00027 OutByte(CGA_ADDRESS_PORT,CGA_CLHR); 00028 OutByte(CGA_DATA_PORT,(((CgaCtrl.CursorPosition/2)>>8)&0xff)); 00029 }
| void CgaInit | ( | void | ) |
Definition at line 14 of file cga.c.
00014 { 00015 CgaCtrl.CursorPosition=0; 00016 CgaCtrl.CharacterAttribute=0x0f; 00017 CgaScreenClean(); 00018 OutByte(CGA_ADDRESS_PORT,CGA_CLLR); 00019 OutByte(CGA_DATA_PORT,((CgaCtrl.CursorPosition/2)&0xff)); 00020 OutByte(CGA_ADDRESS_PORT,CGA_CLHR); 00021 OutByte(CGA_DATA_PORT,(((CgaCtrl.CursorPosition/2)>>8)&0xff)); 00022 }
| void CgaScreenClean | ( | void | ) |
Definition at line 64 of file cga.c.
00064 { 00065 U32 i; 00066 00067 for(i=0;i<4000;i=i+2){ 00068 CgaByteWrite(i,' '); 00069 CgaByteWrite(i+1,CgaCtrl.CharacterAttribute); 00070 } 00071 CgaCtrl.CursorPosition=0; 00072 }
| void CgaScrollUp | ( | void | ) |
Definition at line 31 of file cga.c.
00031 { 00032 U32 i; 00033 U8 ByteValue; 00034 00035 for(i=0;i<3840;i++){ 00036 ByteValue=CgaByteRead(i+160); 00037 CgaByteWrite(i,ByteValue); 00038 } 00039 for(i=3840;i<4000;i=i+2){ 00040 CgaByteWrite(i,' '); 00041 CgaByteWrite(i+1,CgaCtrl.CharacterAttribute); 00042 } 00043 CgaCtrl.CursorPosition=3840; 00044 }
1.5.9