Changeset 7284260 in mainline


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

Small change in colors.
Added scrolling to sysio output.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • console/console.c

    r0f09bd45 r7284260  
    244244
    245245        set_style(&conn->screenbuffer.style);
    246         curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x);
    247246        curs_visibility(0);
    248247        if (interbuffer) {
     
    272271        }
    273272       
     273        curs_goto(conn->screenbuffer.position_y, conn->screenbuffer.position_x);
    274274        curs_visibility(conn->screenbuffer.is_cursor_visible);
    275275}
  • console/screenbuffer.h

    r0f09bd45 r7284260  
    3131
    3232
    33 #define DEFAULT_FOREGROUND 0xffff00     /**< default console foreground color */
    34 #define DEFAULT_BACKGROUND 0x000080     /**< default console background color */
     33#define DEFAULT_FOREGROUND 0x0  /**< default console foreground color */
     34#define DEFAULT_BACKGROUND 0xf0f0f0     /**< default console background color */
    3535
    3636typedef struct {
  • fb/fb.c

    r0f09bd45 r7284260  
    4848#include "ppm.h"
    4949
    50 #define DEFAULT_BGCOLOR                0x000080
    51 #define DEFAULT_FGCOLOR                0xffff00
     50#define DEFAULT_BGCOLOR                0xf0f0f0
     51#define DEFAULT_FGCOLOR                0x0
    5252
    5353/***************************************************************/
  • fb/sysio.c

    r0f09bd45 r7284260  
    3737
    3838#include "sysio.h"
     39
     40#define WIDTH 80
     41#define HEIGHT 25
    3942
    4043/* Allow only 1 connection */
     
    8083}
    8184
     85static void scroll(int i)
     86{
     87        if (i > 0) {
     88                curs_goto(HEIGHT-1, 0);
     89                while (i--)
     90                        sysputs("\033D");
     91        } else if (i < 0) {
     92                curs_goto(0,0);
     93                while (i++)
     94                        sysputs("\033M");
     95        }
     96}
     97
    8298/** ANSI terminal emulation main thread */
    8399static void sysio_client_connection(ipc_callid_t iid, ipc_call_t *icall)
     
    91107        int newcol,newrow;
    92108        int fgcolor,bgcolor;
     109        int i;
    93110
    94111        if (client_connected) {
     
    120137                        newcol = IPC_GET_ARG2(call);
    121138                        curs_goto(newrow, newcol);
     139                        lastrow = newrow;
     140                        lastcol = newcol;
    122141                        break;
    123142                case FB_GET_CSIZE:
    124                         ipc_answer_fast(callid, 0, 25, 80);
     143                        ipc_answer_fast(callid, 0, HEIGHT, WIDTH);
    125144                        continue;
    126145                case FB_CLEAR:
     
    131150                        fgcolor = IPC_GET_ARG1(call);
    132151                        bgcolor = IPC_GET_ARG2(call);
    133                         if (fgcolor > bgcolor)
     152                        if (bgcolor == 0xf0f0f0)
     153                                set_style(0);
     154                        else if (fgcolor > bgcolor)
    134155                                set_style(0);
    135156                        else
     
    137158                        retval = 0;
    138159                        break;
     160                case FB_SCROLL:
     161                        i = IPC_GET_ARG1(call);
     162                        if (i > HEIGHT || i < -HEIGHT) {
     163                                retval = EINVAL;
     164                                break;
     165                        }
     166                        scroll(i);
     167                        curs_goto(lastrow, lastcol);
     168                        retval = 0;
     169                        break;
     170
    139171                default:
    140172                        retval = ENOENT;
     
    150182        clrscr();
    151183        curs_goto(0,0);
     184        /* Set scrolling region to 0-25 lines */
     185        sysputs("\033[0;25r");
    152186}
Note: See TracChangeset for help on using the changeset viewer.