Changeset c8bf88d in mainline for kernel/genarch/src/fb/fb.c


Ignore:
Timestamp:
2009-04-03T15:52:14Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a7b1071
Parents:
2398ee9
Message:

represent special keystrokes (cursor arrows, page up/down, delete, etc.) as appropriate Unicode characters
do not parse ANSI control sequences in kconsole, but in serial line driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/fb/fb.c

    r2398ee9 rc8bf88d  
    4848#include <bitops.h>
    4949#include <print.h>
     50#include <string.h>
    5051#include <ddi/ddi.h>
    5152#include <arch/types.h>
     
    7980#define FG_COLOR     0xffff00
    8081#define INV_COLOR    0xaaaaaa
    81 
    82 #define CURSOR       0x2588
    8382
    8483#define RED(x, bits)         ((x >> (8 + 8 + 8 - bits)) & ((1 << bits) - 1))
     
    201200 *
    202201 */
    203 static void glyph_draw(uint16_t glyph, unsigned int col, unsigned int row, bool silent)
     202static void glyph_draw(uint16_t glyph, unsigned int col, unsigned int row, bool silent, bool overlay)
    204203{
    205204        unsigned int x = COL2X(col);
     
    210209                logo_hide(silent);
    211210       
    212         backbuf[BB_POS(col, row)] = glyph;
     211        if (!overlay)
     212                backbuf[BB_POS(col, row)] = glyph;
    213213       
    214214        if (!silent) {
     
    270270static void cursor_put(bool silent)
    271271{
    272         glyph_draw(fb_font_glyph(CURSOR), position % cols, position / cols, silent);
     272        unsigned int col = position % cols;
     273        unsigned int row = position / cols;
     274       
     275        glyph_draw(fb_font_glyph(U_CURSOR), col, row, silent, true);
    273276}
    274277
     
    276279static void cursor_remove(bool silent)
    277280{
    278         glyph_draw(fb_font_glyph(0), position % cols, position / cols, silent);
     281        unsigned int col = position % cols;
     282        unsigned int row = position / cols;
     283       
     284        glyph_draw(backbuf[BB_POS(col, row)], col, row, silent, true);
    279285}
    280286
     
    308314                do {
    309315                        glyph_draw(fb_font_glyph(' '), position % cols,
    310                             position / cols, silent);
     316                            position / cols, silent, false);
    311317                        position++;
    312318                } while ((position % 8) && (position < cols * rows));
     
    314320        default:
    315321                glyph_draw(fb_font_glyph(ch), position % cols,
    316                     position / cols, silent);
     322                    position / cols, silent, false);
    317323                position++;
    318324        }
Note: See TracChangeset for help on using the changeset viewer.