Rev 3742 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3742 | Rev 3745 | ||
---|---|---|---|
Line 217... | Line 217... | ||
217 | * |
217 | * |
218 | * |
218 | * |
219 | */ |
219 | */ |
220 | static void screen_scroll(void) |
220 | static void screen_scroll(void) |
221 | { |
221 | { |
222 | if (ylogo > 0) |
222 | if (ylogo > 0) { |
223 | logo_hide(); |
223 | logo_hide(); |
- | 224 | return; |
|
- | 225 | } |
|
224 | 226 | ||
225 | unsigned int row; |
227 | unsigned int row; |
226 | 228 | ||
227 | for (row = 0; row < rows; row++) { |
229 | for (row = 0; row < rows; row++) { |
228 | unsigned int y = ROW2Y(row); |
230 | unsigned int y = ROW2Y(row); |
Line 230... | Line 232... | ||
230 | 232 | ||
231 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
233 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
232 | unsigned int x; |
234 | unsigned int x; |
233 | unsigned int col; |
235 | unsigned int col; |
234 | 236 | ||
235 | for (col = 0, x = 0; col < cols; col++, x += FONT_WIDTH) { |
237 | for (col = 0, x = 0; col < cols; col++, |
- | 238 | x += FONT_WIDTH) { |
|
236 | uint8_t glyph; |
239 | uint8_t glyph; |
237 | 240 | ||
238 | if (row < rows - 1) { |
241 | if (row < rows - 1) { |
- | 242 | if (backbuf[BB_POS(col, row)] == |
|
239 | if (backbuf[BB_POS(col, row)] == backbuf[BB_POS(col, row + 1)]) |
243 | backbuf[BB_POS(col, row + 1)]) |
240 | continue; |
244 | continue; |
241 | 245 | ||
242 | glyph = backbuf[BB_POS(col, row + 1)]; |
246 | glyph = backbuf[BB_POS(col, row + 1)]; |
243 | } else |
247 | } else |
244 | glyph = 0; |
248 | glyph = 0; |
245 | 249 | ||
246 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
250 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
247 | &glyphs[GLYPH_POS(glyph, yd)], glyphscanline); |
251 | &glyphs[GLYPH_POS(glyph, yd)], |
- | 252 | glyphscanline); |
|
248 | } |
253 | } |
249 | } |
254 | } |
250 | } |
255 | } |
251 | 256 | ||
252 | memcpy(backbuf, backbuf + cols, cols * (rows - 1)); |
257 | memcpy(backbuf, backbuf + cols, cols * (rows - 1)); |
Line 291... | Line 296... | ||
291 | position--; |
296 | position--; |
292 | break; |
297 | break; |
293 | case '\t': |
298 | case '\t': |
294 | cursor_remove(); |
299 | cursor_remove(); |
295 | do { |
300 | do { |
296 | glyph_draw((uint8_t) ' ', position % cols, position / cols); |
301 | glyph_draw((uint8_t) ' ', position % cols, |
- | 302 | position / cols); |
|
297 | position++; |
303 | position++; |
298 | } while ((position % 8) && (position < cols * rows)); |
304 | } while ((position % 8) && (position < cols * rows)); |
299 | break; |
305 | break; |
300 | default: |
306 | default: |
301 | glyph_draw((uint8_t) ch, position % cols, position / cols); |
307 | glyph_draw((uint8_t) ch, position % cols, position / cols); |
Line 333... | Line 339... | ||
333 | unsigned int y; |
339 | unsigned int y; |
334 | 340 | ||
335 | for (y = 0; y < FONT_SCANLINES; y++) { |
341 | for (y = 0; y < FONT_SCANLINES; y++) { |
336 | unsigned int x; |
342 | unsigned int x; |
337 | 343 | ||
338 | for (x = 0; x < FONT_WIDTH; x++) |
344 | for (x = 0; x < FONT_WIDTH; x++) { |
339 | rgb_conv(&glyphs[GLYPH_POS(glyph, y) + x * pixelbytes], |
345 | void *dst = &glyphs[GLYPH_POS(glyph, y) + |
- | 346 | x * pixelbytes]; |
|
- | 347 | uint32_t rgb = (fb_font[ROW2Y(glyph) + y] & |
|
340 | (fb_font[ROW2Y(glyph) + y] & (1 << (7 - x))) ? FG_COLOR : BG_COLOR); |
348 | (1 << (7 - x))) ? FG_COLOR : BG_COLOR; |
- | 349 | rgb_conv(dst, rgb); |
|
- | 350 | } |
|
341 | } |
351 | } |
342 | } |
352 | } |
343 | 353 | ||
344 | /* Prerender background scanline */ |
354 | /* Prerender background scanline */ |
345 | unsigned int x; |
355 | unsigned int x; |
Line 360... | Line 370... | ||
360 | for (y = 0; y < LOGO_HEIGHT; y++) { |
370 | for (y = 0; y < LOGO_HEIGHT; y++) { |
361 | unsigned int x; |
371 | unsigned int x; |
362 | 372 | ||
363 | for (x = 0; x < xres; x++) |
373 | for (x = 0; x < xres; x++) |
364 | rgb_conv(&fb_addr[FB_POS(x, y)], |
374 | rgb_conv(&fb_addr[FB_POS(x, y)], |
- | 375 | (x < LOGO_WIDTH) ? |
|
365 | (x < LOGO_WIDTH) ? fb_logo[y * LOGO_WIDTH + x] : LOGO_COLOR); |
376 | fb_logo[y * LOGO_WIDTH + x] : |
- | 377 | LOGO_COLOR); |
|
366 | } |
378 | } |
367 | } |
379 | } |
368 | 380 | ||
369 | unsigned int row; |
381 | unsigned int row; |
370 | 382 | ||
Line 374... | Line 386... | ||
374 | 386 | ||
375 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
387 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
376 | unsigned int x; |
388 | unsigned int x; |
377 | unsigned int col; |
389 | unsigned int col; |
378 | 390 | ||
379 | for (col = 0, x = 0; col < cols; col++, x += FONT_WIDTH) |
391 | for (col = 0, x = 0; col < cols; |
- | 392 | col++, x += FONT_WIDTH) { |
|
380 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
393 | void *d = &fb_addr[FB_POS(x, y + yd)]; |
381 | &glyphs[GLYPH_POS(backbuf[BB_POS(col, row)], yd)], |
394 | void *s = &glyphs[GLYPH_POS(backbuf[BB_POS(col, |
- | 395 | row)], yd)]; |
|
382 | glyphscanline); |
396 | memcpy(d, s, glyphscanline); |
- | 397 | } |
|
383 | } |
398 | } |
384 | } |
399 | } |
385 | 400 | ||
386 | if (COL2X(cols) < xres) { |
401 | if (COL2X(cols) < xres) { |
387 | unsigned int y; |
402 | unsigned int y; |
Line 389... | Line 404... | ||
389 | 404 | ||
390 | for (y = ylogo; y < yres; y++) |
405 | for (y = ylogo; y < yres; y++) |
391 | memcpy(&fb_addr[FB_POS(COL2X(cols), y)], bgscan, size); |
406 | memcpy(&fb_addr[FB_POS(COL2X(cols), y)], bgscan, size); |
392 | } |
407 | } |
393 | 408 | ||
394 | if (ROW2Y(rowtrim) < yres) { |
409 | if (ROW2Y(rowtrim) + ylogo < yres) { |
395 | unsigned int y; |
410 | unsigned int y; |
396 | 411 | ||
397 | for (y = ROW2Y(rowtrim); y < yres; y++) |
412 | for (y = ROW2Y(rowtrim) + ylogo; y < yres; y++) |
398 | memcpy(&fb_addr[FB_POS(0, y)], bgscan, bgscanbytes); |
413 | memcpy(&fb_addr[FB_POS(0, y)], bgscan, bgscanbytes); |
399 | } |
414 | } |
400 | } |
415 | } |
401 | 416 | ||
402 | 417 |