Changeset d3f2cad in mainline for fb/ega.c


Ignore:
Timestamp:
2006-06-07T10:06:00Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e8d77a4
Parents:
9e951acb
Message:

Better colors for ega.
Small updates to initialization code to use only async api.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fb/ega.c

    r9e951acb rd3f2cad  
    5656#define EGA_IO_SIZE 2
    5757
     58#define NORMAL_COLOR       0x0f
     59#define INVERTED_COLOR     0xf0
     60
     61#define EGA_STYLE(fg,bg) ((fg) > (bg) ? NORMAL_COLOR : INVERTED_COLOR)
     62
    5863typedef unsigned char u8;
    5964typedef unsigned short u16;
     
    6873static char *scr_addr;
    6974
    70 static unsigned int style = 0x1e;
     75static unsigned int style = NORMAL_COLOR;
    7176
    7277static inline void outb(u16 port, u8 b)
     
    181186        for (i=0; i < scr_width*scr_height; i++) {
    182187                scr_addr[i*2] = data[i].character;
    183                 if (data[i].style.fg_color > data[i].style.bg_color)
    184                         scr_addr[i*2+1] = 0x1e;
    185                 else
    186                         scr_addr[i*2+1] = 0xe1;
     188                scr_addr[i*2+1] = EGA_STYLE(data[i].style.fg_color, data[i].style.bg_color);
    187189        }
    188190}
     
    301303                        fgcolor = IPC_GET_ARG1(call);
    302304                        bgcolor = IPC_GET_ARG2(call);
    303                         if (fgcolor > bgcolor)
    304                                 style = 0x1e;
    305                         else
    306                                 style = 0xe1;
     305                        style = EGA_STYLE(fgcolor, bgcolor);
    307306                        break;
    308307                case FB_VP_DRAW_PIXMAP:
Note: See TracChangeset for help on using the changeset viewer.