Subversion Repositories HelenOS

Rev

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

Rev 4509 Rev 4538
Line 285... Line 285...
285
}
285
}
286
 
286
 
287
/** Process a character from the client (TTY emulation). */
287
/** Process a character from the client (TTY emulation). */
288
static void write_char(console_t *cons, wchar_t ch)
288
static void write_char(console_t *cons, wchar_t ch)
289
{
289
{
-
 
290
    bool flush_cursor = false;
-
 
291
 
290
    switch (ch) {
292
    switch (ch) {
291
    case '\n':
293
    case '\n':
292
        fb_pending_flush();
294
        fb_pending_flush();
-
 
295
        flush_cursor = true;
293
        cons->scr.position_y++;
296
        cons->scr.position_y++;
294
        cons->scr.position_x = 0;
297
        cons->scr.position_x = 0;
295
        break;
298
        break;
296
    case '\r':
299
    case '\r':
297
        break;
300
        break;
Line 313... Line 316...
313
       
316
       
314
        screenbuffer_putchar(&cons->scr, ch);
317
        screenbuffer_putchar(&cons->scr, ch);
315
        cons->scr.position_x++;
318
        cons->scr.position_x++;
316
    }
319
    }
317
   
320
   
318
    if (cons->scr.position_x >= cons->scr.size_x)
321
    if (cons->scr.position_x >= cons->scr.size_x) {
-
 
322
        flush_cursor = true;
319
        cons->scr.position_y++;
323
        cons->scr.position_y++;
-
 
324
    }
320
   
325
   
321
    if (cons->scr.position_y >= cons->scr.size_y) {
326
    if (cons->scr.position_y >= cons->scr.size_y) {
322
        fb_pending_flush();
327
        fb_pending_flush();
323
        cons->scr.position_y = cons->scr.size_y - 1;
328
        cons->scr.position_y = cons->scr.size_y - 1;
324
        screenbuffer_clear_line(&cons->scr, cons->scr.top_line);
329
        screenbuffer_clear_line(&cons->scr, cons->scr.top_line);
325
        cons->scr.top_line = (cons->scr.top_line + 1) % cons->scr.size_y;
330
        cons->scr.top_line = (cons->scr.top_line + 1) % cons->scr.size_y;
326
       
331
       
327
        if (cons == active_console)
332
        if (cons == active_console)
328
            async_msg_1(fb_info.phone, FB_SCROLL, 1);
333
            async_msg_1(fb_info.phone, FB_SCROLL, 1);
329
    }
334
    }
330
   
335
 
-
 
336
    if (cons == active_console && flush_cursor)
-
 
337
        curs_goto(cons->scr.position_x, cons->scr.position_y);
331
    cons->scr.position_x = cons->scr.position_x % cons->scr.size_x;
338
    cons->scr.position_x = cons->scr.position_x % cons->scr.size_x;
332
}
339
}
333
 
340
 
334
/** Switch to new console */
341
/** Switch to new console */
335
static void change_console(console_t *cons)
342
static void change_console(console_t *cons)
Line 480... Line 487...
480
    while (off < size) {
487
    while (off < size) {
481
        wchar_t ch = str_decode(buf, &off, size);
488
        wchar_t ch = str_decode(buf, &off, size);
482
        write_char(cons, ch);
489
        write_char(cons, ch);
483
    }
490
    }
484
   
491
   
485
    if (cons == active_console)
-
 
486
        curs_goto(cons->scr.position_x, cons->scr.position_y);
-
 
487
   
-
 
488
    async_serialize_end();
492
    async_serialize_end();
489
   
493
   
490
    gcons_notify_char(cons->index);
494
    gcons_notify_char(cons->index);
491
    ipc_answer_1(rid, EOK, size);
495
    ipc_answer_1(rid, EOK, size);
492
   
496