Changeset 1180a88e in mainline


Ignore:
Timestamp:
2006-06-02T08:52:59Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
838c48e
Parents:
10569b1
Message:

Doc updates.

Location:
fb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fb/ega.c

    r10569b1 r1180a88e  
    123123                return -1;
    124124       
    125         map_physmem(ega_ph_addr, scr_addr, (scr_width*scr_height+PAGE_SIZE-1)>>PAGE_WIDTH,
     125        map_physmem(ega_ph_addr, scr_addr, (scr_width*scr_height*2+PAGE_SIZE-1)>>PAGE_WIDTH,
    126126                    AS_AREA_READ | AS_AREA_WRITE);
    127127
  • fb/fb.c

    r10569b1 r1180a88e  
    166166}
    167167
     168/** Put pixel into viewport
     169 *
     170 * @param vp Viewport identification
     171 * @param x X coord relative to viewport
     172 * @param y Y coord relative to viewport
     173 * @param color RGB color
     174 */
    168175static void putpixel(int vp, unsigned int x, unsigned int y, int color)
    169176{
    170177        screen.putpixel(viewports[vp].x + x, viewports[vp].y + y, color);
    171178}
     179/** Get pixel from viewport */
    172180static int getpixel(int vp, unsigned int x, unsigned int y)
    173181{
     
    258266
    259267/** Draw character at given position */
    260 static void draw_glyph(int vp,__u8 glyph, unsigned int row, unsigned int col)
     268static void draw_glyph(int vp,__u8 glyph, unsigned int sx, unsigned int sy)
    261269{
    262270        unsigned int y;
    263271
    264272        for (y = 0; y < FONT_SCANLINES; y++)
    265                 draw_glyph_line(vp ,fb_font[glyph * FONT_SCANLINES + y], col * COL_WIDTH, row * FONT_SCANLINES + y);
     273                draw_glyph_line(vp ,fb_font[glyph * FONT_SCANLINES + y], sx, sy + y);
    266274}
    267275
     
    308316        int i;
    309317
    310         for (i=0; i < MAX_VIEWPORTS; i++) {
     318for (i=0; i < MAX_VIEWPORTS; i++) {
    311319                if (!viewports[i].initialized)
    312320                        break;
     
    388396}
    389397
     398/** Draw character at given position relative to viewport
     399 *
     400 * @param vp Viewport identification
     401 * @param c Character to print
     402 * @param row Screen position relative to viewport
     403 * @param col Screen position relative to viewport
     404 */
    390405static void draw_char(int vp, char c, unsigned int row, unsigned int col)
    391406{
     
    395410                invert_char(vp, vport->cur_row, vport->cur_col);
    396411       
    397         draw_glyph(vp, c, row, col);
     412        draw_glyph(vp, c, col * COL_WIDTH, row * FONT_SCANLINES);
    398413
    399414        vport->cur_col = col;
     
    411426}
    412427
     428/** Function for handling connections to FB
     429 *
     430 */
    413431static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    414432{
     
    546564}
    547565
     566/** Initialization of framebuffer */
    548567int fb_init(void)
    549568{
  • fb/sysio.c

    r10569b1 r1180a88e  
    4141static int client_connected = 0;
    4242
    43 #define CLRSCR   "\033[2J"
    44 
    4543static void sysput(char c)
    4644{
     
    5351}
    5452
     53/** Send clearscreen sequence to console */
     54static void clrscr(void)
     55{
     56        sysputs("\033[2J");
     57}
     58
     59/** Send ansi sequence to console to change cursor position */
    5560static void curs_goto(unsigned int row, unsigned int col)
    5661{
    5762        char control[20];
    5863
    59         if (row > 100 || col > 100)
     64        if (row > 200 || col > 200)
    6065                return;
    6166
     
    6469}
    6570
     71/** ANSI terminal emulation main thread */
    6672static void sysio_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    6773{
     
    107113                        continue;
    108114                case FB_CLEAR:
    109                         sysputs(CLRSCR);
     115                        clrscr();
    110116                        retval = 0;
    111117                        break;
     
    117123}
    118124
     125/** ANSI terminal emulation initialization */
    119126void sysio_init(void)
    120127{
    121128        async_set_client_connection(sysio_client_connection);
    122         sysputs(CLRSCR);
     129        clrscr();
    123130        curs_goto(0,0);
    124131}
Note: See TracChangeset for help on using the changeset viewer.