Subversion Repositories HelenOS

Rev

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

Rev 4201 Rev 4296
Line 66... Line 66...
66
#include "pointer_mask.xbm"
66
#include "pointer_mask.xbm"
67
 
67
 
68
#define DEFAULT_BGCOLOR  0xf0f0f0
68
#define DEFAULT_BGCOLOR  0xf0f0f0
69
#define DEFAULT_FGCOLOR  0x000000
69
#define DEFAULT_FGCOLOR  0x000000
70
 
70
 
-
 
71
#define GLYPH_UNAVAIL   '?'
-
 
72
 
71
#define MAX_ANIM_LEN     8
73
#define MAX_ANIM_LEN     8
72
#define MAX_ANIMATIONS   4
74
#define MAX_ANIMATIONS   4
73
#define MAX_PIXMAPS      256  /**< Maximum number of saved pixmaps */
75
#define MAX_PIXMAPS      256  /**< Maximum number of saved pixmaps */
74
#define MAX_VIEWPORTS    128  /**< Viewport is a rectangular area on the screen */
76
#define MAX_VIEWPORTS    128  /**< Viewport is a rectangular area on the screen */
75
 
77
 
76
/** Function to render a pixel from a RGB value. */
78
/** Function to render a pixel from a RGB value. */
77
typedef void (*rgb_conv_t)(void *, uint32_t);
79
typedef void (*rgb_conv_t)(void *, uint32_t);
78
 
80
 
79
/** Function to draw a glyph. */
81
/** Function to draw a glyph. */
80
typedef void (*dg_t)(unsigned int x, unsigned int y, bool cursor,
82
typedef void (*dg_t)(unsigned int x, unsigned int y, bool cursor,
81
    uint8_t *glyphs, uint8_t glyph, uint32_t fg_color, uint32_t bg_color);
83
    uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color);
82
 
84
 
83
struct {
85
struct {
84
    uint8_t *fb_addr;
86
    uint8_t *fb_addr;
85
   
87
   
86
    unsigned int xres;
88
    unsigned int xres;
Line 89... Line 91...
89
    unsigned int scanline;
91
    unsigned int scanline;
90
    unsigned int glyphscanline;
92
    unsigned int glyphscanline;
91
   
93
   
92
    unsigned int pixelbytes;
94
    unsigned int pixelbytes;
93
    unsigned int glyphbytes;
95
    unsigned int glyphbytes;
-
 
96
 
-
 
97
    /** Pre-rendered mask for rendering glyphs. Specific for the visual. */
-
 
98
    uint8_t *glyphs;
94
   
99
   
95
    rgb_conv_t rgb_conv;
100
    rgb_conv_t rgb_conv;
96
} screen;
101
} screen;
97
 
102
 
98
/** Backbuffer character cell. */
103
/** Backbuffer character cell. */
99
typedef struct {
104
typedef struct {
100
    uint8_t glyph;
105
    uint32_t glyph;
101
    uint32_t fg_color;
106
    uint32_t fg_color;
102
    uint32_t bg_color;
107
    uint32_t bg_color;
103
} bb_cell_t;
108
} bb_cell_t;
104
 
109
 
105
typedef struct {
110
typedef struct {
Line 118... Line 123...
118
     */
123
     */
119
 
124
 
120
    /** Current attributes. */
125
    /** Current attributes. */
121
    attr_rgb_t attr;
126
    attr_rgb_t attr;
122
 
127
 
123
    /** Pre-rendered mask for rendering glyphs. Different viewports
-
 
124
     * might use different drawing functions depending on whether their
-
 
125
     * scanlines are aligned on a word boundary.*/
-
 
126
    uint8_t *glyphs;
-
 
127
 
-
 
128
    uint8_t *bgpixel;
128
    uint8_t *bgpixel;
129
 
129
 
-
 
130
    /**
130
    /** Glyph drawing function for this viewport. */
131
     * Glyph drawing function for this viewport.  Different viewports
-
 
132
     * might use different drawing functions depending on whether their
-
 
133
     * scanlines are aligned on a word boundary.
-
 
134
     */
131
    dg_t dglyph;
135
    dg_t dglyph;
132
   
136
   
133
    /* Auto-cursor position */
137
    /* Auto-cursor position */
134
    bool cursor_active;
138
    bool cursor_active;
135
    unsigned int cur_col;
139
    unsigned int cur_col;
Line 192... Line 196...
192
 
196
 
193
static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,
197
static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,
194
    ipcarg_t bg_color, ipcarg_t attr);
198
    ipcarg_t bg_color, ipcarg_t attr);
195
 
199
 
196
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
200
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
197
    uint8_t *glyphs, uint8_t glyph, uint32_t fg_color, uint32_t bg_color);
201
    uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color);
198
static void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
202
static void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
199
    uint8_t *glyphs, uint8_t glyph, uint32_t fg_color, uint32_t bg_color);
203
    uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color);
200
 
204
 
201
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col,
205
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col,
202
    unsigned int row);
206
    unsigned int row);
203
 
207
 
204
 
208
 
Line 384... Line 388...
384
 */
388
 */
385
static void vport_scroll(viewport_t *vport, int lines)
389
static void vport_scroll(viewport_t *vport, int lines)
386
{
390
{
387
    unsigned int row, col;
391
    unsigned int row, col;
388
    unsigned int x, y;
392
    unsigned int x, y;
389
    uint8_t glyph;
393
    uint32_t glyph;
390
    uint32_t fg_color;
394
    uint32_t fg_color;
391
    uint32_t bg_color;
395
    uint32_t bg_color;
392
    bb_cell_t *bbp, *xbp;
396
    bb_cell_t *bbp, *xbp;
393
 
397
 
394
    /*
398
    /*
Line 417... Line 421...
417
                glyph = 0;
421
                glyph = 0;
418
                fg_color = vport->attr.fg_color;
422
                fg_color = vport->attr.fg_color;
419
                bg_color = vport->attr.bg_color;
423
                bg_color = vport->attr.bg_color;
420
            }
424
            }
421
 
425
 
422
            (*vport->dglyph)(x, y, false, vport->glyphs, glyph,
426
            (*vport->dglyph)(x, y, false, screen.glyphs, glyph,
423
                fg_color, bg_color);
427
                fg_color, bg_color);
424
            x += FONT_WIDTH;
428
            x += FONT_WIDTH;
425
        }
429
        }
426
        y += FONT_SCANLINES;
430
        y += FONT_SCANLINES;
427
    }
431
    }
Line 445... Line 449...
445
 
449
 
446
/** Render glyphs
450
/** Render glyphs
447
 *
451
 *
448
 * Convert glyphs from device independent font
452
 * Convert glyphs from device independent font
449
 * description to current visual representation.
453
 * description to current visual representation.
450
 *
-
 
451
 * @param vport Viewport
-
 
452
 *
-
 
453
 */
454
 */
454
static void render_glyphs(viewport_t* vport)
455
static void render_glyphs(void)
455
{
456
{
456
    unsigned int glyph;
457
    unsigned int glyph;
457
   
458
 
458
    for (glyph = 0; glyph < FONT_GLYPHS; glyph++) {
459
    for (glyph = 0; glyph < FONT_GLYPHS; glyph++) {
459
        unsigned int y;
460
        unsigned int y;
460
       
461
 
461
        for (y = 0; y < FONT_SCANLINES; y++) {
462
        for (y = 0; y < FONT_SCANLINES; y++) {
462
            unsigned int x;
463
            unsigned int x;
463
           
464
 
464
            for (x = 0; x < FONT_WIDTH; x++) {
465
            for (x = 0; x < FONT_WIDTH; x++) {
465
                screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, false) + x * screen.pixelbytes],
466
                screen.rgb_conv(&screen.glyphs[GLYPH_POS(glyph, y, false) + x * screen.pixelbytes],
466
                    (fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x)))
467
                    (fb_font[glyph][y] & (1 << (7 - x)))
467
                    ? 0xffffff : 0x000000);
468
                    ? 0xffffff : 0x000000);
468
               
469
 
469
                screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, true) + x * screen.pixelbytes],
470
                screen.rgb_conv(&screen.glyphs[GLYPH_POS(glyph, y, true) + x * screen.pixelbytes],
470
                    (fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x)))
471
                    (fb_font[glyph][y] & (1 << (7 - x)))
471
                    ? 0x000000 : 0xffffff);
472
                    ? 0x000000 : 0xffffff);
472
            }
473
            }
473
        }
474
        }
474
    }
475
    }
475
   
-
 
476
    screen.rgb_conv(vport->bgpixel, vport->attr.bg_color);
-
 
477
}
476
}
478
 
477
 
479
 
478
 
480
/** Create new viewport
479
/** Create new viewport
481
 *
480
 *
Line 500... Line 499...
500
        return ELIMIT;
499
        return ELIMIT;
501
   
500
   
502
    unsigned int cols = width / FONT_WIDTH;
501
    unsigned int cols = width / FONT_WIDTH;
503
    unsigned int rows = height / FONT_SCANLINES;
502
    unsigned int rows = height / FONT_SCANLINES;
504
    unsigned int bbsize = cols * rows * sizeof(bb_cell_t);
503
    unsigned int bbsize = cols * rows * sizeof(bb_cell_t);
505
    unsigned int glyphsize = 2 * FONT_GLYPHS * screen.glyphbytes;
-
 
506
    unsigned int word_size = sizeof(unsigned long);
504
    unsigned int word_size = sizeof(unsigned long);
507
   
505
   
508
    bb_cell_t *backbuf = (bb_cell_t *) malloc(bbsize);
506
    bb_cell_t *backbuf = (bb_cell_t *) malloc(bbsize);
509
    if (!backbuf)
507
    if (!backbuf)
510
        return ENOMEM;
508
        return ENOMEM;
511
   
509
   
512
    uint8_t *glyphs = (uint8_t *) malloc(glyphsize);
-
 
513
    if (!glyphs) {
-
 
514
        free(backbuf);
-
 
515
        return ENOMEM;
-
 
516
    }
-
 
517
   
-
 
518
    uint8_t *bgpixel = (uint8_t *) malloc(screen.pixelbytes);
510
    uint8_t *bgpixel = (uint8_t *) malloc(screen.pixelbytes);
519
    if (!bgpixel) {
511
    if (!bgpixel) {
520
        free(glyphs);
-
 
521
        free(backbuf);
512
        free(backbuf);
522
        return ENOMEM;
513
        return ENOMEM;
523
    }
514
    }
524
 
515
 
525
    backbuf_clear(backbuf, cols * rows, DEFAULT_FGCOLOR, DEFAULT_BGCOLOR);
516
    backbuf_clear(backbuf, cols * rows, DEFAULT_FGCOLOR, DEFAULT_BGCOLOR);
526
    memset(glyphs, 0, glyphsize);
-
 
527
    memset(bgpixel, 0, screen.pixelbytes);
517
    memset(bgpixel, 0, screen.pixelbytes);
528
   
518
   
529
    viewports[i].x = x;
519
    viewports[i].x = x;
530
    viewports[i].y = y;
520
    viewports[i].y = y;
531
    viewports[i].width = width;
521
    viewports[i].width = width;
Line 535... Line 525...
535
    viewports[i].rows = rows;
525
    viewports[i].rows = rows;
536
   
526
   
537
    viewports[i].attr.bg_color = DEFAULT_BGCOLOR;
527
    viewports[i].attr.bg_color = DEFAULT_BGCOLOR;
538
    viewports[i].attr.fg_color = DEFAULT_FGCOLOR;
528
    viewports[i].attr.fg_color = DEFAULT_FGCOLOR;
539
   
529
   
540
    viewports[i].glyphs = glyphs;
-
 
541
    viewports[i].bgpixel = bgpixel;
530
    viewports[i].bgpixel = bgpixel;
542
 
531
 
543
    /*
532
    /*
544
     * Conditions necessary  to select aligned version:
533
     * Conditions necessary  to select aligned version:
545
     *
534
     *
Line 565... Line 554...
565
    viewports[i].bbsize = bbsize;
554
    viewports[i].bbsize = bbsize;
566
    viewports[i].backbuf = backbuf;
555
    viewports[i].backbuf = backbuf;
567
   
556
   
568
    viewports[i].initialized = true;
557
    viewports[i].initialized = true;
569
   
558
   
570
    render_glyphs(&viewports[i]);
559
    screen.rgb_conv(viewports[i].bgpixel, viewports[i].attr.bg_color);
571
   
560
   
572
    return i;
561
    return i;
573
}
562
}
574
 
563
 
575
 
564
 
Line 583... Line 572...
583
 *
572
 *
584
 */
573
 */
585
static bool screen_init(void *addr, unsigned int xres, unsigned int yres,
574
static bool screen_init(void *addr, unsigned int xres, unsigned int yres,
586
    unsigned int scan, unsigned int visual)
575
    unsigned int scan, unsigned int visual)
587
{
576
{
-
 
577
    unsigned int glyphsize;
-
 
578
    uint8_t *glyphs;
588
    switch (visual) {
579
    switch (visual) {
589
    case VISUAL_INDIRECT_8:
580
    case VISUAL_INDIRECT_8:
590
        screen.rgb_conv = rgb_323;
581
        screen.rgb_conv = rgb_323;
591
        screen.pixelbytes = 1;
582
        screen.pixelbytes = 1;
592
        break;
583
        break;
Line 627... Line 618...
627
    screen.yres = yres;
618
    screen.yres = yres;
628
    screen.scanline = scan;
619
    screen.scanline = scan;
629
   
620
   
630
    screen.glyphscanline = FONT_WIDTH * screen.pixelbytes;
621
    screen.glyphscanline = FONT_WIDTH * screen.pixelbytes;
631
    screen.glyphbytes = screen.glyphscanline * FONT_SCANLINES;
622
    screen.glyphbytes = screen.glyphscanline * FONT_SCANLINES;
-
 
623
 
-
 
624
    glyphsize = 2 * FONT_GLYPHS * screen.glyphbytes;
-
 
625
    glyphs = (uint8_t *) malloc(glyphsize);
-
 
626
    if (!glyphs)
-
 
627
        return false;
-
 
628
   
-
 
629
    memset(glyphs, 0, glyphsize);
-
 
630
    screen.glyphs = glyphs;
-
 
631
 
-
 
632
    render_glyphs();
632
   
633
   
633
    /* Create first viewport */
634
    /* Create first viewport */
634
    vport_create(0, 0, xres, yres);
635
    vport_create(0, 0, xres, yres);
635
   
636
   
636
    return true;
637
    return true;
Line 657... Line 658...
657
 * @param glyph     Code of the glyph to draw.
658
 * @param glyph     Code of the glyph to draw.
658
 * @param fg_color  Foreground color.
659
 * @param fg_color  Foreground color.
659
 * @param bg_color  Backgroudn color.
660
 * @param bg_color  Backgroudn color.
660
 */
661
 */
661
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
662
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor,
662
    uint8_t *glyphs, uint8_t glyph, uint32_t fg_color, uint32_t bg_color)
663
    uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color)
663
{
664
{
664
    unsigned int i, yd;
665
    unsigned int i, yd;
665
    unsigned long fg_buf, bg_buf;
666
    unsigned long fg_buf, bg_buf;
666
    unsigned long *maskp, *dp;
667
    unsigned long *maskp, *dp;
667
    unsigned long mask;
668
    unsigned long mask;
Line 676... Line 677...
676
            fg_color);
677
            fg_color);
677
        screen.rgb_conv(&((uint8_t *)&bg_buf)[i * screen.pixelbytes],
678
        screen.rgb_conv(&((uint8_t *)&bg_buf)[i * screen.pixelbytes],
678
            bg_color);
679
            bg_color);
679
    }
680
    }
680
 
681
 
681
 
-
 
682
    /* Pointer to the current position in the mask. */
682
    /* Pointer to the current position in the mask. */
683
    maskp = (unsigned long *) &glyphs[GLYPH_POS(glyph, 0, cursor)];
683
    maskp = (unsigned long *) &glyphs[GLYPH_POS(glyph, 0, cursor)];
684
 
684
 
685
    /* Pointer to the current position on the screen. */
685
    /* Pointer to the current position on the screen. */
686
    dp = (unsigned long *) &screen.fb_addr[FB_POS(x, y)];
686
    dp = (unsigned long *) &screen.fb_addr[FB_POS(x, y)];
Line 718... Line 718...
718
 * @param glyph     Code of the glyph to draw.
718
 * @param glyph     Code of the glyph to draw.
719
 * @param fg_color  Foreground color.
719
 * @param fg_color  Foreground color.
720
 * @param bg_color  Backgroudn color.
720
 * @param bg_color  Backgroudn color.
721
 */
721
 */
722
void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
722
void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor,
723
    uint8_t *glyphs, uint8_t glyph, uint32_t fg_color, uint32_t bg_color)
723
    uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color)
724
{
724
{
725
    unsigned int i, j, yd;
725
    unsigned int i, j, yd;
726
    uint8_t fg_buf[4], bg_buf[4];
726
    uint8_t fg_buf[4], bg_buf[4];
727
    uint8_t *dp, *sp;
727
    uint8_t *dp, *sp;
728
    unsigned int d_add;
728
    unsigned int d_add;
Line 743... Line 743...
743
    /* Offset to add when moving to another screen scanline. */
743
    /* Offset to add when moving to another screen scanline. */
744
    d_add = screen.scanline - FONT_WIDTH * screen.pixelbytes;
744
    d_add = screen.scanline - FONT_WIDTH * screen.pixelbytes;
745
 
745
 
746
    for (yd = 0; yd < FONT_SCANLINES; yd++) {
746
    for (yd = 0; yd < FONT_SCANLINES; yd++) {
747
        /* Byte containing bits of the glyph scanline. */
747
        /* Byte containing bits of the glyph scanline. */
748
        b = fb_font[glyph * FONT_SCANLINES + yd];
748
        b = fb_font[glyph][yd];
749
 
749
 
750
        for (i = 0; i < FONT_WIDTH; i++) {
750
        for (i = 0; i < FONT_WIDTH; i++) {
751
            /* Choose color based on the current bit. */
751
            /* Choose color based on the current bit. */
752
            sp = (b & 0x80) ? fg_buf : bg_buf;
752
            sp = (b & 0x80) ? fg_buf : bg_buf;
753
 
753
 
Line 777... Line 777...
777
    unsigned int row)
777
    unsigned int row)
778
{
778
{
779
    unsigned int x = vport->x + COL2X(col);
779
    unsigned int x = vport->x + COL2X(col);
780
    unsigned int y = vport->y + ROW2Y(row);
780
    unsigned int y = vport->y + ROW2Y(row);
781
 
781
 
782
    uint8_t glyph;
782
    uint32_t glyph;
783
    uint32_t fg_color;
783
    uint32_t fg_color;
784
    uint32_t bg_color;
784
    uint32_t bg_color;
785
   
785
   
786
    glyph = vport->backbuf[BB_POS(vport, col, row)].glyph;
786
    glyph = vport->backbuf[BB_POS(vport, col, row)].glyph;
787
    fg_color = vport->backbuf[BB_POS(vport, col, row)].fg_color;
787
    fg_color = vport->backbuf[BB_POS(vport, col, row)].fg_color;
788
    bg_color = vport->backbuf[BB_POS(vport, col, row)].bg_color;
788
    bg_color = vport->backbuf[BB_POS(vport, col, row)].bg_color;
789
 
789
 
790
    (*vport->dglyph)(x, y, cursor, vport->glyphs, glyph,
790
    (*vport->dglyph)(x, y, cursor, screen.glyphs, glyph,
791
        fg_color, bg_color);
791
        fg_color, bg_color);
792
}
792
}
793
 
793
 
794
/** Hide cursor if it is shown
794
/** Hide cursor if it is shown
795
 *
795
 *
Line 834... Line 834...
834
 * @param c      Character to draw
834
 * @param c      Character to draw
835
 * @param col    Screen position relative to viewport
835
 * @param col    Screen position relative to viewport
836
 * @param row    Screen position relative to viewport
836
 * @param row    Screen position relative to viewport
837
 *
837
 *
838
 */
838
 */
839
static void draw_char(viewport_t *vport, uint8_t c, unsigned int col, unsigned int row)
839
static void draw_char(viewport_t *vport, wchar_t c, unsigned int col, unsigned int row)
840
{
840
{
841
    bb_cell_t *bbp;
841
    bb_cell_t *bbp;
842
 
842
 
843
    /* Do not hide cursor if we are going to overwrite it */
843
    /* Do not hide cursor if we are going to overwrite it */
844
    if ((vport->cursor_active) && (vport->cursor_shown) &&
844
    if ((vport->cursor_active) && (vport->cursor_shown) &&
845
        ((vport->cur_col != col) || (vport->cur_row != row)))
845
        ((vport->cur_col != col) || (vport->cur_row != row)))
846
        cursor_hide(vport);
846
        cursor_hide(vport);
847
 
847
 
848
    bbp = &vport->backbuf[BB_POS(vport, col, row)];
848
    bbp = &vport->backbuf[BB_POS(vport, col, row)];
849
    bbp->glyph = c;
849
    bbp->glyph = fb_font_glyph(c);
850
    bbp->fg_color = vport->attr.fg_color;
850
    bbp->fg_color = vport->attr.fg_color;
851
    bbp->bg_color = vport->attr.bg_color;
851
    bbp->bg_color = vport->attr.bg_color;
852
 
852
 
853
    draw_vp_glyph(vport, false, col, row);
853
    draw_vp_glyph(vport, false, col, row);
854
   
854
   
Line 887... Line 887...
887
        for (i = 0; i < w; i++) {
887
        for (i = 0; i < w; i++) {
888
            unsigned int col = x + i;
888
            unsigned int col = x + i;
889
            unsigned int row = y + j;
889
            unsigned int row = y + j;
890
 
890
 
891
            bbp = &vport->backbuf[BB_POS(vport, col, row)];
891
            bbp = &vport->backbuf[BB_POS(vport, col, row)];
892
            uint8_t glyph = bbp->glyph;
-
 
893
 
892
 
894
            a = &data[j * w + i].attrs;
893
            a = &data[j * w + i].attrs;
895
            rgb_from_attr(&rgb, a);
894
            rgb_from_attr(&rgb, a);
896
 
895
 
897
            bbp->glyph = data[j * w + i].character;
896
            bbp->glyph = fb_font_glyph(data[j * w + i].character);
898
            bbp->fg_color = rgb.fg_color;
897
            bbp->fg_color = rgb.fg_color;
899
            bbp->bg_color = rgb.bg_color;
898
            bbp->bg_color = rgb.bg_color;
900
 
899
 
901
            draw_vp_glyph(vport, false, col, row);
900
            draw_vp_glyph(vport, false, col, row);
902
        }
901
        }
Line 1508... Line 1507...
1508
        ipc_callid_t callid;
1507
        ipc_callid_t callid;
1509
        ipc_call_t call;
1508
        ipc_call_t call;
1510
        int retval;
1509
        int retval;
1511
        unsigned int i;
1510
        unsigned int i;
1512
        int scroll;
1511
        int scroll;
1513
        uint8_t glyph;
1512
        wchar_t ch;
1514
        unsigned int row, col;
1513
        unsigned int row, col;
1515
       
1514
       
1516
        if ((vport->cursor_active) || (anims_enabled))
1515
        if ((vport->cursor_active) || (anims_enabled))
1517
            callid = async_get_call_timeout(&call, 250000);
1516
            callid = async_get_call_timeout(&call, 250000);
1518
        else
1517
        else
Line 1545... Line 1544...
1545
           
1544
           
1546
            /* Exit thread */
1545
            /* Exit thread */
1547
            return;
1546
            return;
1548
       
1547
       
1549
        case FB_PUTCHAR:
1548
        case FB_PUTCHAR:
1550
            glyph = IPC_GET_ARG1(call);
1549
            ch = IPC_GET_ARG1(call);
1551
            row = IPC_GET_ARG2(call);
1550
            row = IPC_GET_ARG2(call);
1552
            col = IPC_GET_ARG3(call);
1551
            col = IPC_GET_ARG3(call);
1553
           
1552
           
1554
            if ((col >= vport->cols) || (row >= vport->rows)) {
1553
            if ((col >= vport->cols) || (row >= vport->rows)) {
1555
                retval = EINVAL;
1554
                retval = EINVAL;
1556
                break;
1555
                break;
1557
            }
1556
            }
1558
            ipc_answer_0(callid, EOK);
1557
            ipc_answer_0(callid, EOK);
1559
           
1558
           
1560
            draw_char(vport, glyph, col, row);
1559
            draw_char(vport, ch, col, row);
1561
           
1560
           
1562
            /* Message already answered */
1561
            /* Message already answered */
1563
            continue;
1562
            continue;
1564
        case FB_CLEAR:
1563
        case FB_CLEAR:
1565
            vport_clear(vport);
1564
            vport_clear(vport);
Line 1632... Line 1631...
1632
            if (!viewports[i].initialized) {
1631
            if (!viewports[i].initialized) {
1633
                retval = EADDRNOTAVAIL;
1632
                retval = EADDRNOTAVAIL;
1634
                break;
1633
                break;
1635
            }
1634
            }
1636
            viewports[i].initialized = false;
1635
            viewports[i].initialized = false;
1637
            if (viewports[i].glyphs)
-
 
1638
                free(viewports[i].glyphs);
-
 
1639
            if (viewports[i].bgpixel)
1636
            if (viewports[i].bgpixel)
1640
                free(viewports[i].bgpixel);
1637
                free(viewports[i].bgpixel);
1641
            if (viewports[i].backbuf)
1638
            if (viewports[i].backbuf)
1642
                free(viewports[i].backbuf);
1639
                free(viewports[i].backbuf);
1643
            retval = EOK;
1640
            retval = EOK;