diff options
| author | Miguel <m.i@gmx.at> | 2018-08-19 03:15:50 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-19 03:15:50 +0200 |
| commit | 9b13ca03dacb6a385461dccad319010537add5cf (patch) | |
| tree | 4397fdff0d1566b7bec761031ce2077e88cd5379 /xxx | |
| parent | a2bd733e517364b6c9ddd26706d85fac09656854 (diff) | |
get vesa working in vmem.
Diffstat (limited to 'xxx')
| -rw-r--r-- | xxx/font/Makefile | 5 | ||||
| -rw-r--r-- | xxx/font/binarize.py | 87 | ||||
| -rw-r--r-- | xxx/font/binfont.src | 1235 | ||||
| -rw-r--r-- | xxx/video/vesa.c | 245 | ||||
| -rw-r--r-- | xxx/video/vesa.h | 47 |
5 files changed, 0 insertions, 1619 deletions
diff --git a/xxx/font/Makefile b/xxx/font/Makefile deleted file mode 100644 index 2eeaf37..0000000 --- a/xxx/font/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -############ fool-font ############ -binfont.bin: binfont.src - python3.2 binarize.py $< $@ -clean: - -rm binfont.bin diff --git a/xxx/font/binarize.py b/xxx/font/binarize.py deleted file mode 100644 index 1abb9d6..0000000 --- a/xxx/font/binarize.py +++ /dev/null @@ -1,87 +0,0 @@ -import sys - -def binarize(file_in, file_out): - - """ Create a binary file from an ASCII file. Everything - but '0' and '1' (alternatively '_' and 'X') is ignored - from the input file. """ - - print ("binarizing " + file_in + " to "+ file_out + ".") - - try: - - f=open(file_in,'r') - - try: - - o=open(file_out,'wb') - - try: - - while True: - - b=readnext(f) - if b==-1: - break - - o.write(bytes([b])) - - except IOError: - print("IOError happened during processing."); - print("I am closing the input and ouput files and aborting."); - print("Warning: The output file is very likely incomplete."); - - o.close() - - except IOError: - print("IOError opening output file: " + file_out); - - f.close() - - except IOError: - print("IOError opening input file: " + file_in); - - -def readnext(f): - - """ Read next 'byte' from the given ASCII file (BufferedWriter) - everything but '_','X','0','1' is ignored. - Returns the byte as integer or -1 on EOF """ - - l=0 - b="" - - while l<8: - - c=f.read(1) - - if not c: - return -1 - - if c=="0" or c=='_': - l+=1 - b+="0" - - if c=="1" or c=='X': - l+=1 - b+="1" - - return int(b,2) - -def usage(): - - """ Prints usage information to sdtout """ - - print ("python3.x binarize.py [file_in] [file_out]") - - - -""" direct use """ - -if __name__ == "__main__": - - if(len(sys.argv)==3): - binarize(sys.argv[1],sys.argv[2]) - else: - usage() - diff --git a/xxx/font/binfont.src b/xxx/font/binfont.src deleted file mode 100644 index c1d9ccc..0000000 --- a/xxx/font/binfont.src +++ /dev/null @@ -1,1235 +0,0 @@ - -// space (ox2o) - -________ -________ -________ -________ -________ -________ -________ -________ -________ -________ - -// ! - -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -________ -________ -___XX___ -___XX___ - -// " - -_XX__XX_ -_XX__XX_ -_XX__XX_ -________ -________ -________ -________ -________ -________ -________ - -// # - -________ -__X__X__ -__X__X__ -XXXXXXXX -__X__X__ -__X__X__ -__X__X__ -XXXXXXXX -__X__X__ -__X__X__ - -// $ - -________ -___X____ -_XXXXXX_ -XX_X__XX -_XXX____ -__XXXX__ -___X_XX_ -XX_X__XX -_XXXXXX_ -___X____ - -// % - -______XX -_X___XX_ -X_X_XX__ -_X__XX__ -___XX___ -___XX___ -__XX__X_ -__XX_X_X -_XX___X_ -XX______ - -// & - -__X_____ -_X_X____ -X___X___ -_X_X____ -__XX____ -_X_X____ -X___X_X_ -X____X__ -X___X_X_ -_XXX___X - -// ' - -___XX___ -___XX___ -___XX___ -________ -________ -________ -________ -________ -________ -________ - -// ( - -___X____ -__X_____ -_X______ -_X______ -X_______ -X_______ -_X______ -_X______ -__X_____ -___X____ - -// ) - -___X____ -_____X__ -______X_ -______X_ -_______X -_______X -______X_ -______X_ -_____X__ -___X____ - -// * - -________ -________ -X__X__X_ -_X_X_X__ -__XXX___ -XXXXXXX_ -__XXX___ -_X_X_X__ -X__X__X_ -________ - -// + - -________ -________ -___XX___ -___XX___ -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -________ -________ - -// , - -________ -________ -________ -________ -________ -________ -________ -___XX___ -___XX___ -__XX____ - -// - - -________ -________ -________ -________ -_XXXXXX_ -_XXXXXX_ -________ -________ -________ -________ - -// . - -________ -________ -________ -________ -________ -________ -________ -________ -___XX___ -___XX___ - -// / -______XX -_____XX_ -____XX__ -____XX__ -___XX___ -___XX___ -__XX____ -__XX____ -_XX_____ -XX______ - -// zero - -_XXXXXX_ -XXXXXXXX -XX___XXX -XX__X_XX -XX__X_XX -XX_X__XX -XX_X__XX -XXX___XX -XXXXXXXX -_XXXXXX_ - -// one - -___XX___ -__XXX___ -__XXX___ -_XXXX___ -XX_XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - -// 2 - -_XXXXXX_ -XXXXXXXX -_____XXX -_____XXX -____XXX_ -___XXX__ -_XXX____ -XXX_____ -XXXXXXXX -XXXXXXXX - -// 3 - -XXXXXXXX -XXXXXXXX -_____XXX -____XX__ -___XX___ -__XXX___ -____XXX_ -XX___XXX -XXXXXXXX -_XXXXXX_ - -// 4 - -___XX___ -__XXX___ -__XXX___ -_XXXX___ -XX_XX___ -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -___XX___ - -// 5 - -XXXXXXXX -XXXXXXXX -XXX_____ -XXX_____ -XXXXXXX_ -_XXXXXXX -______XX -X_____XX -XXXXXXXX -_XXXXXX_ - -// 6 - -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// 7 - -XXXXXXXX -XXXXXXXX -_____XXX -____XXX_ -____XXX_ -___XXX__ -___XXX__ -__XXX___ -__XXX___ -_XXX____ - -// 8 - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXX_ -_XXXXXX_ -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// 9 - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXXX -_XXXXXXX -______XX -______XX -XXXXXXXX -_XXXXXX_ - - -// : - -________ -________ -________ -________ -___XX___ -___XX___ -________ -___XX___ -___XX___ -________ - - -// ; - -________ -________ -________ -________ -___XX___ -___XX___ -________ -___XX___ -___XX___ -__XX____ - -// < - -________ -________ -______XX -____XX__ -__XX____ -XX______ -__XX____ -____XX__ -______XX -________ - -// = - -________ -________ -________ -________ -XXXXXXXX -________ -XXXXXXXX -________ -________ -________ - - -// > - -________ -________ -XX______ -__XX____ -____XX__ -______XX -____XX__ -__XX____ -XX______ -________ - -// ? - - -_XXXXXX_ -XXXXXXXX -XX____XX -_X___XX_ -____XX__ -___XX___ -___XX___ -________ -___XX___ -___XX___ - -// @ - -_XXXXXX_ -XXXXXXXX -XX____XX -XX_XXXXX -XX_X__XX -XX_X__XX -XX_XXXXX -XX______ -XXXXXXXX -_XXXXXXX - - -// A - -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// B - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ - -// C - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// D - -XXXXXX__ -XXXXXXX_ -XX___XXX -XX____XX -XX____XX -XX____XX -XX____XX -XX___XXX -XXXXXXX_ -XXXXXX__ - -// E - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// F - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// G - -XXXXXXXX -XXXXXXXX -XX______ -XX______ -XX__XXXX -XX__XXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX - -// H - -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// I - -_XXXXXX_ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - -// J - -XXXXXXXX -XXXXXXXX -______XX -______XX -______XX -______XX -XX____XX -XXX___XX -_XXXXXXX -__XXXXXX - -// K - -XX____XX -XX__XXX_ -XX__XXX_ -XX_XXX__ -XXXX____ -XXXX____ -XX_XXX__ -XX__XXX_ -XX__XXX_ -XX____XX - -// L - -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXXXXXX -XXXXXXXX - -// M - -XX____XX -XXX__XXX -XXX_XXXX -XXXXXXXX -XXXXXXXX -XX_XX_XX -XX_XX_XX -XX____XX -XX____XX -XX____XX - -// N - -XX____XX -XXX___XX -XXX___XX -XXXX__XX -XXXXX_XX -XX_XXXXX -XX__XXXX -XX___XXX -XX___XXX -XX____XX - -// O - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// P - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// Q - -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX_XX_XX -XX_XXXXX -XX__XXXX -XXXXXXXX -_XXXXXXX - -// R - -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXXX -XXXXXXX_ -XXXXX___ -XX_XXX__ -XX__XXX_ -XX___XXX - -// S - -_XXXXXX_ -XXXXXXXX -XX____XX -_XX___X_ -__XX____ -___XXX__ -_X__XXX_ -XX___XXX -XXXXXXXX -_XXXXXX_ - -// T - -XXXXXXXX -XXXXXXXX -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ - -// U - -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// V - -XX____XX -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -___XX___ -___XX___ - -// W - -XX____XX -XX____XX -XX_XX_XX -XX_XX_XX -XXXXXXXX -XXXXXXXX -XXX__XXX -XXX__XXX -XX____XX -XX____XX - -// x big - -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -_XX__XX_ -_XX__XX_ -XX____XX -XX____XX - -// Y - -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -__XXXX__ -___XX___ -___XX___ -___XX___ -___XX___ - -// Z - -XXXXXXXX -XXXXXXXX -_____XXX -_____XXX -____XXX_ -___XXX__ -_XXX____ -XXX_____ -XXXXXXXX -XXXXXXXX - -// [ - -XXXX____ -XXXX____ -XX______ -XX______ -XX______ -XX______ -XX______ -XX______ -XXXX____ -XXXX____ -// \ - -XX______ -_XX_____ -__XX____ -__XX____ -___XX___ -___XX___ -____XX__ -____XX__ -_____XX_ -______XX - -// ] - -____XXXX -____XXXX -______XX -______XX -______XX -______XX -______XX -______XX -____XXXX -____XXXX -// ^ - -___XX___ -__XXXX__ -_XX__XX_ -XX____XX -________ -________ -________ -________ -________ -________ - -// underscore - -________ -________ -________ -________ -________ -________ -________ -________ -XXXXXXXX -XXXXXXXX - -// ` - -__XX____ -___XX___ -____XX__ -________ -________ -________ -________ -________ -________ -________ - -// a -________ -________ -_XXXXXX_ -XXXXXXXX -______XX -_XXXXXXX -XXXXXXXX -XX____XX -XXXXXXXX -_XXXX_XX - -// b - -XX______ -XX______ -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX____XX -XX____XX -XXXXXXX_ -XXXXXXX_ - -// c - -________ -________ -________ -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XX______ -XXXXXXXX -_XXXXXX_ - -// d - -______XX -______XX -______XX -______XX -_XXXXXXX -_XXXXXXX -XX____XX -XX____XX -_XXXXXXX -_XXXXXXX - -// e - -________ -________ -_XXXXXX_ -XXXXXXXX -XX_____X -XXXXXXX_ -XX______ -XX______ -XXXXXXXX -_XXXXXX_ - -// f - -_XXXXXX_ -XXXXXXXX -XX______ -XX______ -XXXXXXX_ -XXXXXXX_ -XX______ -XX______ -XX______ -XX______ - -// g - -________ -________ -_XXXXXXX -_XXXXXXX -XX____XX -XX____XX -_XXXXXXX -______XX -XX____XX -_XXXXXXX - -// h - -XX______ -XX______ -XX______ -XX______ -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - - -// i - -________ -________ -________ -___XX___ -________ -___XX___ -___XX___ -___XX___ -___XX___ -__XXXX__ - - -// j - -________ -________ -____XX__ -________ -____XX__ -____XX__ -____XX__ -_XX_XX__ -_XX_XX__ -__XXX___ - -// k - - -XX______ -XX______ -XX______ -XX______ -XX____XX -XX__XXX_ -XXXXXX__ -XX_XXX__ -XX__XXX_ -XX___XXX - -// l - - -_XXXX___ -_XXXX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -_XXXXXX_ - - -// m -________ -________ -________ -XX______ -XXXX_XX_ -XXXXXXXX -XX_XX_XX -XX_XX_XX -XX_XX_XX -XX_XX_XX - -// n -________ -________ -________ -XX______ -XXXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XX____XX - -// o -________ -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XX____XX -XXXXXXXX -_XXXXXX_ - -// p -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -XXXXXXX_ -XX______ -XX______ -XX______ - -// q - -________ -________ -_XXXXXX_ -XXXXXXXX -XX____XX -XX____XX -_XXXXXXX -______XX -______XX -______XX - -// r -________ -________ -________ -XX__XX__ -XX_XXXX_ -XXXX__XX -XX______ -XX______ -XX______ -XX______ - -// s - -________ -________ -________ -_XXXXXX_ -XX____XX -_XX_____ -__XXXX__ -_____XX_ -XX____XX -_XXXXXX_ - -// t - -__XX____ -__XX____ -XXXXXX__ -XXXXXX__ -__XX____ -__XX____ -__XX____ -__XX__X_ -__XX_XX_ -___XXX__ - -// u -________ -________ -________ -________ -XX____XX -XX____XX -XX____XX -XX____XX -XX____XX -_XXXXXX_ - -// v -________ -________ -________ -________ -XX____XX -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -___XX___ - -// w -________ -________ -________ -________ -XX_XX_XX -XX_XX_XX -XX_XX_XX -XX_XX_XX -XXXXXXXX -_XX__XX_ - - -// x - -________ -________ -________ -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -_XX__XX_ -_XX__XX_ -XX____XX - - -// y - -________ -________ -________ -XX____XX -_XX__XX_ -_XX__XX_ -__XXXX__ -___XX___ -__XX____ -_XX_____ - - -// z -________ -________ -________ -________ -XXXXXXXX -_____XX_ -____XX__ -__XXX___ -_XX_____ -XXXXXXXX - -// { - -____XX__ -___X____ -__X_____ -__X_____ -XX______ -XX______ -__X_____ -__X_____ -___X____ -____XX__ - -// | - -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ -___XX___ - -// } - -__XX____ -____X___ -_____X__ -_____X__ -______XX -______XX -_____X__ -_____X__ -____X___ -__XX____ - -// ~ - -________ -________ -________ -_XX_____ -X__XX__X -_____XX_ -________ -________ -________ -________ diff --git a/xxx/video/vesa.c b/xxx/video/vesa.c deleted file mode 100644 index b43ca50..0000000 --- a/xxx/video/vesa.c +++ /dev/null @@ -1,245 +0,0 @@ -//http://wiki.osdev.org/GUI - -#include <stdarg.h> -#include "kernel/mem.h" -#include "vesa.h" - -#include "lib/logger/log.h" // logger facilities -#include "lib/printf/printf.h" -#define FOOLOS_MODULE_NAME "vesa" - -#define FOOLSOS_SHOW_VESAMODES - -static foolfont *deffont; -static vbemodeinfo *VbeModeInfoBlock; - -static int console_x; -static int console_y; - -static int console_lines; -static int console_cols; - -static uint8_t* buffer; -static uint8_t* physbase; - -void PutConsoleNL(); -void PutPixel(int x,int y, int color); - -void vesa_switch_buffers() -{ - for(int i=0;i<800*600*2;i++)physbase[i]=buffer[i]; - -} - -void vesa_put_rect(int x, int y, int w , int h, int color) -{ - for(int i=x;i<x+w;i++) - for(int j=y;j<y+h;j++) - PutPixel(i,j,color); -} - -void vesa_clear_screen() -{ - vesa_put_rect(0,0,VbeModeInfoBlock->Xres, VbeModeInfoBlock->Yres, 0xffffff); -} - - -void vesa_set_physbase(uint32_t addr) -{ - VbeModeInfoBlock->physbase=addr; -} - - // - // We want to get output to the screen as fast as possible! - // - // Our Fool-Boot-Loader did set up VESA already for us. - // The desired VESA mode is hardcoded in [boot/mbr.asm]. - // - // The [vesa_init(...)] function requires: - // - // * the addresses of the vbeinfo struct - // * the address of the vbemodeinfo struct (for selected mode). - // * Fool Font loaded inside ramimage - // - // The first two paramters are hardcoded in [boot/mbr.asm], - // while the last one is set in the Makefile. The font binary - // is integrated in the kernel image. - // - // this function returns the physical base address of - // our video memory - // - -uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) -{ - //the only functionallu important init lines! (rest is log) - VbeModeInfoBlock=mode; - deffont=rawfont; - console_x=0; - console_y=0; - - int line_height=12; - int col_width=10; - console_lines=mode->Yres/line_height; - console_cols=mode->Xres/col_width; - - // vesa info - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"vbe version: 0x%x / video mode ptr: 0x%x 0x%x", - info->VbeVersion, info->VideoModePtr[1], info->VideoModePtr[0]); - - // vesa info on selected mode: - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"colors r:%d 0x%x g:%d 0x%x b:%d 0x%x", - mode->red_position,mode->red_mask, - mode->green_position,mode->green_mask, - mode->blue_position,mode->blue_mask); - - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"res: %d * %d / banks: %d / attr: 0x%x", - mode->Xres, mode->Yres, mode->banks, mode->attributes); - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"bpp: %d / physbase: 0x%x", - mode->bpp,mode->physbase); - - // vesa modes - // todo: take segment from vbeinfo! -#ifdef FOOLSOS_SHOW_VESAMODES - uint16_t *modeptr=info->VideoModePtr[0]; - - while(*modeptr!=0xffff&&*modeptr!=0) - { - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"mode supported : 0x%X", (*modeptr)); - modeptr++; - } -#endif - - - return VbeModeInfoBlock->physbase; - -} - -void PutPixel(int x,int y, int color){ - - //do not write memory outside the screen buffer, check parameters against the VBE mode info - if (x<0 || x>VbeModeInfoBlock->Xres|| y<0 || y>VbeModeInfoBlock->Yres) return; - if (x) x = (x*(VbeModeInfoBlock->bpp>>3)); // get bytes (divide by 8) - if (y) y = (y*VbeModeInfoBlock->pitch); - uint8_t *cTemp=VbeModeInfoBlock->physbase; - - cTemp[x+y] = (uint8_t)(color & 0xff); - cTemp[x+y+1] = (uint8_t)((color>>8) & 0xff); - //cTemp[x+y+2] = (uint8_t)((color>>16) & 0xff); - - } - - -void PutFont(char c, int x,int y, int color) -{ - - int fnt=0x126-0x20; - - if(c>=0x20&&c<=0x126)fnt=c-0x20; - - int posx, posy, sizex=8, sizey=10; - - for(posx=x;posx<x+sizex;posx++) - { - - for(posy=y;posy<y+sizey;posy++) - { - if(deffont[fnt].line[posy-y]&1<<(7-(posx-x))) - { - PutPixel(posx,posy,color); - } - else - { - PutPixel(posx,posy,0); - } - - } - } - -} - -void PutString(char *str, int x,int y, int color, va_list va) -{ - - char buff[256]; - tfp_sprintf(buff,str,va); - str=buff; - - int i=x; - while((*str)!=0) - { - PutFont(*str, i,y, color); - i+=9; // spacing - str++; - } - -} - -void PutConsoleChar(char c, int color) -{ - if(c=='\n') - { - PutConsoleNL(); - return; - } - PutFont(c, console_x*10,console_y*12, color); - console_x++; - - - #ifdef FOOLOS_CONSOLE_AUTOBREAK - if(console_x>=console_cols)PutConsoleNL(); - #endif -} - -void PutConsole(char *str, int color) -{ - - while((*str)!=0) - { - PutConsoleChar(*str,color); - str++; - } - -} -void PutConsoleNL() -{ - console_x=0; - console_y++; - if(console_y>=console_lines-5)console_y=0; - - for(int i=0;i<console_cols;i++) - { - PutFont(' ',i*10,(console_y)*12,0); - } -} - -static int boxx; -static int boxy; -//////////////// -void vesa_render() -{ - vesa_clear_screen(); - vesa_put_rect(100,100,VbeModeInfoBlock->Xres-200,VbeModeInfoBlock->Yres-200,0xff); - vesa_put_rect(boxx-10,boxy-10,20,20,0x999999); - - boxx++; -// boxy+=boxx; - if(boxx>VbeModeInfoBlock->Xres-100)boxx=100; - // if(boxy>VbeModeInfoBlock->Yres-200)boxy=200; - - vesa_switch_buffers(); -} - -/* -void vesa_init_doublebuff() -{ - boxx=300; - boxy=300; - - int blocks=800*600*2/4096+1; - physbase=VbeModeInfoBlock->physbase; - buffer=pmmngr_alloc_blocks(blocks); - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"Init buffer of %d blocks at 0x%08X",blocks,buffer); - - VbeModeInfoBlock->physbase=buffer; -} -*/ diff --git a/xxx/video/vesa.h b/xxx/video/vesa.h deleted file mode 100644 index 371e944..0000000 --- a/xxx/video/vesa.h +++ /dev/null @@ -1,47 +0,0 @@ -#include <stdint.h> - -typedef struct foolfont_struct -{ - uint8_t line[10]; //every single fool font consists of 10 lines a 8 bit - -}foolfont; - -typedef struct vbeinfo_struct{ - char VbeSignature[4]; // == "VESA" - uint16_t VbeVersion; // == 0x0300 for VBE 3.0 - uint16_t OemStringPtr[2]; // isa vbeFarPtr - uint8_t Capabilities[4]; - uint16_t VideoModePtr[2]; // isa vbeFarPtr - uint16_t TotalMemory; // as # of 64KB blocks -}vbeinfo; - - -typedef struct ModeInfoBlock { - uint16_t attributes; - uint8_t winA,winB; - uint16_t granularity; - uint16_t winsize; - uint16_t segmentA, segmentB; - uint16_t realFctPtr[2]; -// VBE_FAR(realFctPtr); - uint16_t pitch; // bytes per scanline - - uint16_t Xres, Yres; - uint8_t Wchar, Ychar, planes, bpp, banks; - uint8_t memory_model, bank_size, image_pages; - uint8_t reserved0; - - uint8_t red_mask, red_position; - uint8_t green_mask, green_position; - uint8_t blue_mask, blue_position; - uint8_t rsv_mask, rsv_position; - uint8_t directcolor_attributes; - - volatile uint32_t physbase; // your LFB (Linear Framebuffer) address ;) - uint32_t reserved1; - uint16_t reserved2; -}vbemodeinfo; - -uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont); -void PutConsoleChar(char c, int color); -void PutConsole(char *str, int color); |
