Subversion Repositories HelenOS-historic

Rev

Rev 1562 | Rev 1565 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1562 Rev 1564
Line 153... Line 153...
153
 
153
 
154
static void scroll(int rows)
154
static void scroll(int rows)
155
{
155
{
156
    int i;
156
    int i;
157
    if (rows > 0) {
157
    if (rows > 0) {
158
        memcpy(scr_addr,((char *)scr_addr)+rows*scr_width*2,scr_width*scr_height*2-rows*scr_width*2);
158
        memcpy(scr_addr,((char *)scr_addr) + rows * scr_width * 2, scr_width * scr_height * 2 - rows * scr_width * 2);
159
        for(i=0;i<rows*scr_width;i++)
159
        for(i = 0; i < rows * scr_width ; i ++)
160
            (((short *)scr_addr)+scr_width*scr_height-rows*scr_width)[i]=((style<<8)+' ');
160
            (((short *)scr_addr) + scr_width * scr_height - rows * scr_width) [i] = ((style << 8) + ' ');
161
    } else if (rows < 0) {
161
    } else if (rows < 0) {
162
 
162
 
163
        memcpy(((char *)scr_addr)-rows*scr_width*2,scr_addr,scr_width*scr_height*2+rows*scr_width*2);
163
        memcpy(((char *)scr_addr) - rows * scr_width * 2 ,scr_addr ,scr_width * scr_height * 2 + rows * scr_width * 2);
164
        for(i=0;i<-rows*scr_width;i++)
164
        for( i = 0; i < - rows * scr_width ; i++)
165
            ((short *)scr_addr)[i]=((style<<8)+' ');
165
            ((short *)scr_addr) [i] = ((style << 8 ) + ' ');
166
    }
166
    }
167
}
167
}
168
 
168
 
169
static void printchar(char c, unsigned int row, unsigned int col)
169
static void printchar(char c, unsigned int row, unsigned int col)
170
{
170
{
Line 189... Line 189...
189
 
189
 
190
static int save_screen(void)
190
static int save_screen(void)
191
{
191
{
192
    int i;
192
    int i;
193
    short *mem;
193
    short *mem;
194
    for(i=0;(i<MAX_SAVED_SCREENS)&&(saved_screens[i].data);i++);
194
    for( i=0 ;( i < MAX_SAVED_SCREENS ) && (saved_screens[i].data); i++);
195
    if(i==MAX_SAVED_SCREENS) return EINVAL;
195
    if( i == MAX_SAVED_SCREENS)
-
 
196
        return EINVAL;
196
    if(!(saved_screens[i].data=malloc(2*scr_width*scr_height))) return ENOMEM;
197
    if(!(saved_screens[i].data=malloc( 2 * scr_width*scr_height )))
-
 
198
        return ENOMEM;
197
    memcpy(saved_screens[i].data,scr_addr,2*scr_width*scr_height);
199
    memcpy(saved_screens[i].data,scr_addr, 2 * scr_width * scr_height )
-
 
200
        ;
198
    return i;
201
    return i;
199
}
202
}
200
 
203
 
201
static int print_screen(int i)
204
static int print_screen(int i)
202
{
205
{