Subversion Repositories HelenOS-historic

Rev

Rev 839 | Rev 886 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 839 Rev 862
Line 30... Line 30...
30
#include <genarch/fb/fb.h>
30
#include <genarch/fb/fb.h>
31
#include <console/chardev.h>
31
#include <console/chardev.h>
32
#include <console/console.h>
32
#include <console/console.h>
33
#include <panic.h>
33
#include <panic.h>
34
 
34
 
-
 
35
#include "helenos.xbm"
-
 
36
 
35
SPINLOCK_INITIALIZE(fb_lock);
37
SPINLOCK_INITIALIZE(fb_lock);
36
 
38
 
37
static __u8 *fbaddress=NULL;
39
static __u8 *fbaddress=NULL;
38
static int xres,yres;
40
static int xres,yres;
39
static int position=0;
41
static int position=0;
Line 45... Line 47...
45
#define ROW_HEIGHT  (FONT_SCANLINES)
47
#define ROW_HEIGHT  (FONT_SCANLINES)
46
#define ROW_PIX     (xres*ROW_HEIGHT*pixelbytes)
48
#define ROW_PIX     (xres*ROW_HEIGHT*pixelbytes)
47
 
49
 
48
#define BGCOLOR   0x000080
50
#define BGCOLOR   0x000080
49
#define FGCOLOR   0xffff00
51
#define FGCOLOR   0xffff00
-
 
52
#define LOGOCOLOR 0x2020b0
50
 
53
 
51
#define RED(x,bits)    ((x >> (16+8-bits)) & ((1<<bits)-1))
54
#define RED(x,bits)    ((x >> (16+8-bits)) & ((1<<bits)-1))
52
#define GREEN(x,bits)  ((x >> (8+8-bits)) & ((1<<bits)-1))
55
#define GREEN(x,bits)  ((x >> (8+8-bits)) & ((1<<bits)-1))
53
#define BLUE(x,bits)   ((x >> (8-bits)) & ((1<<bits)-1))
56
#define BLUE(x,bits)   ((x >> (8-bits)) & ((1<<bits)-1))
54
 
57
 
Line 229... Line 232...
229
static void draw_char(char chr)
232
static void draw_char(char chr)
230
{
233
{
231
    draw_glyph(chr, position % columns, position/columns);
234
    draw_glyph(chr, position % columns, position/columns);
232
}
235
}
233
 
236
 
-
 
237
static void draw_logo(int startx, int starty)
-
 
238
{
-
 
239
    int x,y;
-
 
240
    int byte;
-
 
241
    int rowbytes;
-
 
242
 
-
 
243
    rowbytes = (helenos_width-1)/8 + 1;
-
 
244
 
-
 
245
    for (y=0;y < helenos_height;y++)
-
 
246
        for (x=0;x < helenos_width; x++ ) {
-
 
247
            byte = helenos_bits[rowbytes*y + x/8];
-
 
248
            byte >>= x % 8;
-
 
249
            if (byte & 1)
-
 
250
                (*putpixel)(startx+x,starty+y,LOGOCOLOR);
-
 
251
        }
-
 
252
}
-
 
253
 
234
/***************************************************************/
254
/***************************************************************/
235
/* Stdout specific functions */
255
/* Stdout specific functions */
236
 
256
 
237
static void invert_cursor(void)
257
static void invert_cursor(void)
238
{
258
{
Line 320... Line 340...
320
   
340
   
321
    rows = y/ROW_HEIGHT;
341
    rows = y/ROW_HEIGHT;
322
    columns = x/COL_WIDTH;
342
    columns = x/COL_WIDTH;
323
 
343
 
324
    clear_screen();
344
    clear_screen();
-
 
345
    draw_logo(xres-helenos_width, 0);
325
    invert_cursor();
346
    invert_cursor();
326
 
347
 
327
    chardev_initialize("fb", &framebuffer, &fb_ops);
348
    chardev_initialize("fb", &framebuffer, &fb_ops);
328
    stdout = &framebuffer;
349
    stdout = &framebuffer;
329
}
350
}