Rev 3733 | Rev 3752 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3733 | Rev 3741 | ||
---|---|---|---|
Line 232... | Line 232... | ||
232 | 232 | ||
233 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
233 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
234 | unsigned int x; |
234 | unsigned int x; |
235 | unsigned int col; |
235 | unsigned int col; |
236 | 236 | ||
237 | for (col = 0, x = 0; col < cols; col++, x += FONT_WIDTH) { |
237 | for (col = 0, x = 0; col < cols; col++, |
- | 238 | x += FONT_WIDTH) { |
|
238 | uint8_t glyph; |
239 | uint8_t glyph; |
239 | 240 | ||
240 | if (row < rows - 1) { |
241 | if (row < rows - 1) { |
- | 242 | if (backbuf[BB_POS(col, row)] == |
|
241 | if (backbuf[BB_POS(col, row)] == backbuf[BB_POS(col, row + 1)]) |
243 | backbuf[BB_POS(col, row + 1)]) |
242 | continue; |
244 | continue; |
243 | 245 | ||
244 | glyph = backbuf[BB_POS(col, row + 1)]; |
246 | glyph = backbuf[BB_POS(col, row + 1)]; |
245 | } else |
247 | } else |
246 | glyph = 0; |
248 | glyph = 0; |
247 | 249 | ||
248 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
250 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
249 | &glyphs[GLYPH_POS(glyph, yd)], glyphscanline); |
251 | &glyphs[GLYPH_POS(glyph, yd)], |
- | 252 | glyphscanline); |
|
250 | } |
253 | } |
251 | } |
254 | } |
252 | } |
255 | } |
253 | 256 | ||
254 | memcpy(backbuf, backbuf + cols, cols * (rows - 1)); |
257 | memcpy(backbuf, backbuf + cols, cols * (rows - 1)); |
Line 293... | Line 296... | ||
293 | position--; |
296 | position--; |
294 | break; |
297 | break; |
295 | case '\t': |
298 | case '\t': |
296 | cursor_remove(); |
299 | cursor_remove(); |
297 | do { |
300 | do { |
298 | glyph_draw((uint8_t) ' ', position % cols, position / cols); |
301 | glyph_draw((uint8_t) ' ', position % cols, |
- | 302 | position / cols); |
|
299 | position++; |
303 | position++; |
300 | } while ((position % 8) && (position < cols * rows)); |
304 | } while ((position % 8) && (position < cols * rows)); |
301 | break; |
305 | break; |
302 | default: |
306 | default: |
303 | glyph_draw((uint8_t) ch, position % cols, position / cols); |
307 | glyph_draw((uint8_t) ch, position % cols, position / cols); |
Line 335... | Line 339... | ||
335 | unsigned int y; |
339 | unsigned int y; |
336 | 340 | ||
337 | for (y = 0; y < FONT_SCANLINES; y++) { |
341 | for (y = 0; y < FONT_SCANLINES; y++) { |
338 | unsigned int x; |
342 | unsigned int x; |
339 | 343 | ||
340 | for (x = 0; x < FONT_WIDTH; x++) |
344 | for (x = 0; x < FONT_WIDTH; x++) { |
341 | 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] & |
|
342 | (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 | } |
|
343 | } |
351 | } |
344 | } |
352 | } |
345 | 353 | ||
346 | /* Prerender background scanline */ |
354 | /* Prerender background scanline */ |
347 | unsigned int x; |
355 | unsigned int x; |
Line 362... | Line 370... | ||
362 | for (y = 0; y < LOGO_HEIGHT; y++) { |
370 | for (y = 0; y < LOGO_HEIGHT; y++) { |
363 | unsigned int x; |
371 | unsigned int x; |
364 | 372 | ||
365 | for (x = 0; x < xres; x++) |
373 | for (x = 0; x < xres; x++) |
366 | rgb_conv(&fb_addr[FB_POS(x, y)], |
374 | rgb_conv(&fb_addr[FB_POS(x, y)], |
- | 375 | (x < LOGO_WIDTH) ? |
|
367 | (x < LOGO_WIDTH) ? fb_logo[y * LOGO_WIDTH + x] : LOGO_COLOR); |
376 | fb_logo[y * LOGO_WIDTH + x] : |
- | 377 | LOGO_COLOR); |
|
368 | } |
378 | } |
369 | } |
379 | } |
370 | 380 | ||
371 | unsigned int row; |
381 | unsigned int row; |
372 | 382 | ||
Line 376... | Line 386... | ||
376 | 386 | ||
377 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
387 | for (yd = 0; yd < FONT_SCANLINES; yd++) { |
378 | unsigned int x; |
388 | unsigned int x; |
379 | unsigned int col; |
389 | unsigned int col; |
380 | 390 | ||
381 | for (col = 0, x = 0; col < cols; col++, x += FONT_WIDTH) |
391 | for (col = 0, x = 0; col < cols; |
- | 392 | col++, x += FONT_WIDTH) { |
|
382 | memcpy(&fb_addr[FB_POS(x, y + yd)], |
393 | void *d = &fb_addr[FB_POS(x, y + yd)]; |
383 | &glyphs[GLYPH_POS(backbuf[BB_POS(col, row)], yd)], |
394 | void *s = &glyphs[GLYPH_POS(backbuf[BB_POS(col, |
- | 395 | row)], yd)]; |
|
384 | glyphscanline); |
396 | memcpy(d, s, glyphscanline); |
- | 397 | } |
|
385 | } |
398 | } |
386 | } |
399 | } |
387 | 400 | ||
388 | if (COL2X(cols) < xres) { |
401 | if (COL2X(cols) < xres) { |
389 | unsigned int y; |
402 | unsigned int y; |