Subversion Repositories HelenOS

Rev

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

Rev 4347 Rev 4348
Line 81... Line 81...
81
static uint8_t *scr_addr;
81
static uint8_t *scr_addr;
82
 
82
 
83
static unsigned int style;
83
static unsigned int style;
84
 
84
 
85
static unsigned attr_to_ega_style(const attrs_t *a);
85
static unsigned attr_to_ega_style(const attrs_t *a);
-
 
86
static uint8_t ega_glyph(wchar_t ch);
86
 
87
 
87
static void clrscr(void)
88
static void clrscr(void)
88
{
89
{
89
    int i;
90
    int i;
90
   
91
   
Line 141... Line 142...
141
        for (i = 0; i < -rows * scr_width; i++)
142
        for (i = 0; i < -rows * scr_width; i++)
142
            ((short *)scr_addr)[i] = ((style << 8 ) + ' ');
143
            ((short *)scr_addr)[i] = ((style << 8 ) + ' ');
143
    }
144
    }
144
}
145
}
145
 
146
 
146
static void printchar(char c, unsigned int row, unsigned int col)
147
static void printchar(wchar_t c, unsigned int row, unsigned int col)
147
{
148
{
148
    scr_addr[(row * scr_width + col) * 2] = c;
149
    scr_addr[(row * scr_width + col) * 2] = ega_glyph(c);
149
    scr_addr[(row * scr_width + col) * 2 + 1] = style;
150
    scr_addr[(row * scr_width + col) * 2 + 1] = style;
150
   
151
   
151
    cursor_goto(row, col + 1);
152
    cursor_goto(row, col + 1);
152
}
153
}
153
 
154
 
Line 170... Line 171...
170
    for (j = 0; j < h; j++) {
171
    for (j = 0; j < h; j++) {
171
        for (i = 0; i < w; i++) {
172
        for (i = 0; i < w; i++) {
172
            field = &data[j * w + i];
173
            field = &data[j * w + i];
173
            dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))];
174
            dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))];
174
 
175
 
175
            dp[0] = field->character;
176
            dp[0] = ega_glyph(field->character);
176
            dp[1] = attr_to_ega_style(&field->attrs);
177
            dp[1] = attr_to_ega_style(&field->attrs);
177
        }
178
        }
178
    }
179
    }
179
}
180
}
180
 
181
 
Line 246... Line 247...
246
        a->a.i.bg_color, a->a.i.flags);
247
        a->a.i.bg_color, a->a.i.flags);
247
    default: return INVERTED_COLOR;
248
    default: return INVERTED_COLOR;
248
    }
249
    }
249
}
250
}
250
 
251
 
-
 
252
static uint8_t ega_glyph(wchar_t ch)
-
 
253
{
-
 
254
    if (ch >= 0 && ch < 128)
-
 
255
        return ch;
-
 
256
 
-
 
257
    return '?';
-
 
258
}
-
 
259
 
251
static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall)
260
static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall)
252
{
261
{
253
    int retval;
262
    int retval;
254
    ipc_callid_t callid;
263
    ipc_callid_t callid;
255
    ipc_call_t call;
264
    ipc_call_t call;
256
    char c;
265
    wchar_t c;
257
    unsigned int row, col, w, h;
266
    unsigned int row, col, w, h;
258
    int bg_color, fg_color, attr;
267
    int bg_color, fg_color, attr;
259
    uint32_t bg_rgb, fg_rgb;
268
    uint32_t bg_rgb, fg_rgb;
260
    keyfield_t *interbuf = NULL;
269
    keyfield_t *interbuf = NULL;
261
    size_t intersize = 0;
270
    size_t intersize = 0;
Line 380... Line 389...
380
                free(saved_screens[i].data);
389
                free(saved_screens[i].data);
381
                saved_screens[i].data = NULL;
390
                saved_screens[i].data = NULL;
382
            }
391
            }
383
            retval = 0;
392
            retval = 0;
384
            break;
393
            break;
-
 
394
        case FB_SCREEN_YIELD:
-
 
395
        case FB_SCREEN_RECLAIM:
-
 
396
            retval = EOK;
385
 
397
            break;
386
        default:
398
        default:
387
            retval = EINVAL;
399
            retval = EINVAL;
388
        }
400
        }
389
        ipc_answer_0(callid, retval);
401
        ipc_answer_0(callid, retval);
390
    }
402
    }