Subversion Repositories HelenOS-historic

Rev

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

Rev 1312 Rev 1316
Line 28... Line 28...
28
 
28
 
29
#include <genarch/fb/font-8x16.h>
29
#include <genarch/fb/font-8x16.h>
30
#include <genarch/fb/fb.h>
30
#include <genarch/fb/fb.h>
31
#include <console/chardev.h>
31
#include <console/chardev.h>
32
#include <console/console.h>
32
#include <console/console.h>
-
 
33
#include <mm/slab.h>
33
#include <panic.h>
34
#include <panic.h>
34
#include <memstr.h>
35
#include <memstr.h>
-
 
36
#include <config.h>
35
 
37
 
36
#include "helenos.xbm"
38
#include "helenos.xbm"
37
 
39
 
38
SPINLOCK_INITIALIZE(fb_lock);
40
SPINLOCK_INITIALIZE(fb_lock);
39
 
41
 
40
static __u8 *fbaddress = NULL;
42
static __u8 *fbaddress = NULL;
41
 
43
 
-
 
44
static __u8 *blankline = NULL;
-
 
45
 
42
static unsigned int xres = 0;
46
static unsigned int xres = 0;
43
static unsigned int yres = 0;
47
static unsigned int yres = 0;
44
static unsigned int scanline = 0;
48
static unsigned int scanline = 0;
45
static unsigned int pixelbytes = 0;
49
static unsigned int pixelbytes = 0;
46
 
50
 
Line 157... Line 161...
157
 
161
 
158
/** Scroll screen one row up */
162
/** Scroll screen one row up */
159
static void scroll_screen(void)
163
static void scroll_screen(void)
160
{
164
{
161
    unsigned int i;
165
    unsigned int i;
-
 
166
    __u8 *lastline = &fbaddress[(rows - 1) * ROW_BYTES];
162
 
167
 
163
    memcpy((void *) fbaddress, (void *) &fbaddress[ROW_BYTES], scanline * yres - ROW_BYTES);
168
    memcpy((void *) fbaddress, (void *) &fbaddress[ROW_BYTES], scanline * yres - ROW_BYTES);
164
 
169
 
165
    /* Clear last row */
170
    /* Clear last row */
-
 
171
    if (blankline) {
-
 
172
        memcpy((void *) lastline, (void *) blankline, ROW_BYTES);
-
 
173
    } else {
166
    for (i = 0; i < FONT_SCANLINES; i++)
174
        for (i = 0; i < FONT_SCANLINES; i++)
167
        clear_line((rows - 1) * FONT_SCANLINES + i);
175
            clear_line((rows - 1) * FONT_SCANLINES + i);
-
 
176
 
-
 
177
        if (config.mm_initialized) {
-
 
178
            /* Save a blank line aside. */
-
 
179
            blankline = (__u8 *) malloc(ROW_BYTES, FRAME_ATOMIC);
-
 
180
            if (blankline)
-
 
181
                memcpy((void *) blankline, (void *) lastline, ROW_BYTES);
-
 
182
        }
-
 
183
    }
168
}
184
}
169
 
185
 
170
 
186
 
171
static void invert_pixel(unsigned int x, unsigned int y)
187
static void invert_pixel(unsigned int x, unsigned int y)
172
{
188
{