diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-09-08 22:14:26 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-09-08 22:14:26 +0200 |
| commit | db967b35d4c24000ef69283c2995010a08efb598 (patch) | |
| tree | be0a20b9a18c04429b85afe14abe97dfe4440752 /kernel/vesa.c | |
| parent | 52f3e224fb4d3e05202134f7747fdee00a03ed61 (diff) | |
working on mouse driver
Diffstat (limited to 'kernel/vesa.c')
| -rw-r--r-- | kernel/vesa.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/kernel/vesa.c b/kernel/vesa.c index 7b7b531..0619f1a 100644 --- a/kernel/vesa.c +++ b/kernel/vesa.c @@ -191,15 +191,28 @@ void PutConsoleNL() } } +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; @@ -207,8 +220,6 @@ void vesa_init_doublebuff() log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"Init buffer of %d blocks at 0x%08X",blocks,buffer); VbeModeInfoBlock->physbase=buffer; - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"test"); - vesa_switch_buffers(); } void vesa_switch_buffers() @@ -217,6 +228,16 @@ void vesa_switch_buffers() } +void vesa_clear_screen() +{ + vesa_put_rect(0,0,VbeModeInfoBlock->Xres, VbeModeInfoBlock->Yres, 0xffffff); +} +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); +} |
