Changeset 10569b1 in mainline for console/screenbuffer.c


Ignore:
Timestamp:
2006-06-02T08:44:26Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1180a88e
Parents:
df688cd
Message:

Another console improvement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • console/screenbuffer.c

    rdf688cd r10569b1  
    4444        field->style = scr->style;
    4545       
    46         scr->position_x++;
    47         if (scr->position_x == scr->size_x) {
    48                 scr->position_x = 0;
    49                 scr->position_y++;
    50                 if (scr->position_y == scr->size_y) {
    51                         /* scroll */
    52                         scr->position_y--;
    53                         screenbuffer_clear_line(scr, scr->top_line++);
    54                 }
    55         }
    56        
    5746        return 1;
    5847}
     
    6655        scr->size_x = size_x;
    6756        scr->size_y = size_y;
    68         scr->position_y = 0;
    69         scr->position_x = 0;
    7057        scr->style.fg_color = DEFAULT_FOREGROUND_COLOR;
    7158        scr->style.bg_color = DEFAULT_BACKGROUND_COLOR;
    72         scr->top_line = 0;
     59       
     60        screenbuffer_clear(scr);
     61       
    7362        return scr;
    7463}
     
    7867        unsigned int i;
    7968       
    80         for (i = 0; i < scr->size_x * scr->size_y; i++) {
     69        for (i = 0; i < (scr->size_x * scr->size_y); i++) {
    8170                scr->buffer[i].character = ' ';
    8271                scr->buffer[i].style = scr->style;
     
    114103{
    115104        scr->position_x = x % scr->size_x;
    116         scr->position_y = (y + scr->top_line) % scr->size_y;
     105        scr->position_y = y % scr->size_y;
    117106}
    118107
Note: See TracChangeset for help on using the changeset viewer.