Changeset d6cc453 in mainline for console/gcons.c


Ignore:
Timestamp:
2006-06-02T19:22:08Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
53daee3
Parents:
e87e18f
Message:

Made tetris compile and somewhat run.
Slightly better console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • console/gcons.c

    re87e18f rd6cc453  
    4949static int console_vp;
    5050static int cstatus_vp[CONSOLE_COUNT];
     51static int console_has_input[CONSOLE_COUNT];
    5152static int cstat_row, cstat_col; /* Size of cstatus buttons */
    5253
     
    5657        CONS_ACTIVE = 0,
    5758        CONS_IDLE,
    58         CONS_HAS_INPUT
     59        CONS_HAS_INPUT,
     60        CONS_DISCONNECTED
    5961};
    6062
     
    6567        {0xd0d0d0, 0x808080},
    6668        {0xd0d0d0, 0x0},
    67         {0xd0d0d0, 0xa04040}
     69        {0xd0d0d0, 0xa04040},
     70        {0xd0d0d0, 0x0}
    6871};
    6972
     
    109112        set_style(stat_colors[state].fgcolor, stat_colors[state].bgcolor);
    110113        clear();
    111         snprintf(data, 5, "%d", consnum+1);
    112         for (i=0;data[i];i++)
    113                 putch(data[i], 0, i);
     114        if (state != CONS_DISCONNECTED) {
     115                snprintf(data, 5, "%d", consnum+1);
     116                for (i=0;data[i];i++)
     117                        putch(data[i], 0, i);
     118        }
    114119}
    115120
     
    122127        active_console = consnum;
    123128        draw_stat(consnum, CONS_ACTIVE);
     129        console_has_input[consnum] = 0;
     130
    124131        vp_switch(console_vp);
    125132}
     
    130137                return;
    131138
     139        if (consnum == active_console || console_has_input[consnum])
     140                return;
     141
     142        console_has_input[consnum] = 1;
     143        draw_stat(consnum, CONS_HAS_INPUT);
     144       
    132145        vp_switch(console_vp);
    133146}
     
    145158
    146159        for (i=0;i < CONSOLE_COUNT; i++)
    147                 draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_IDLE);
     160                draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_DISCONNECTED);
    148161        vp_switch(console_vp);
    149162}
Note: See TracChangeset for help on using the changeset viewer.