From 5e48d8259fb2857ad4441de77cbacddd50a21ec0 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 27 Aug 2014 14:24:42 +0200 Subject: added bitmap fonts and put string for vesa modes --- kernel/vesa.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'kernel/vesa.c') diff --git a/kernel/vesa.c b/kernel/vesa.c index 93a42f3..b1a298f 100644 --- a/kernel/vesa.c +++ b/kernel/vesa.c @@ -38,6 +38,14 @@ typedef struct ModeInfoBlock { static vbemodeinfo *VbeModeInfoBlock; + +typedef struct foolfont_struct +{ + uint8_t line[10]; //every single fool font consists of 10 lines a 8 bit + +}foolfont; + + void vesa_init(vbeinfo *info,vbemodeinfo *mode) { int i=0; @@ -109,3 +117,51 @@ void PutPixel(int x,int y, int color){ cTemp[x+y+2] = (uint8_t)((color>>16) & 0xff); } +void PutFont(foolfont *font , char c, int x,int y, int color) +{ + int fnt=0; + + + if(c>='A'&&c<='Z')fnt=c-'A'+1; + else if(c>='a'&&c<='z')fnt=c-'a'+1; + else if(c>='0'&&c<='9')fnt=c-'0'+28; + else if(c=' ')fnt=27; + + + int posx, posy, sizex=8, sizey=10; + + for(posx=x;posx