Revision a8aa669b hw/vga.c
b/hw/vga.c | ||
---|---|---|
852 | 852 |
#define DEPTH 32 |
853 | 853 |
#include "vga_template.h" |
854 | 854 |
|
855 |
static inline int c6_to_8(int v) |
|
856 |
{ |
|
857 |
int b; |
|
858 |
v &= 0x3f; |
|
859 |
b = v & 1; |
|
860 |
return (v << 2) | (b << 1) | b; |
|
861 |
} |
|
862 |
|
|
863 | 855 |
static unsigned int rgb_to_pixel8_dup(unsigned int r, unsigned int g, unsigned b) |
864 | 856 |
{ |
865 | 857 |
unsigned int col; |
... | ... | |
1309 | 1301 |
return ret; |
1310 | 1302 |
} |
1311 | 1303 |
|
1304 |
void vga_invalidate_scanlines(VGAState *s, int y1, int y2) |
|
1305 |
{ |
|
1306 |
int y; |
|
1307 |
if (y1 >= VGA_MAX_HEIGHT) |
|
1308 |
return; |
|
1309 |
if (y2 >= VGA_MAX_HEIGHT) |
|
1310 |
y2 = VGA_MAX_HEIGHT; |
|
1311 |
for(y = y1; y < y2; y++) { |
|
1312 |
s->invalidated_y_table[y >> 5] |= 1 << (y & 0x1f); |
|
1313 |
} |
|
1314 |
} |
|
1315 |
|
|
1312 | 1316 |
/* |
1313 | 1317 |
* graphic modes |
1314 |
* Missing: |
|
1315 |
* - double scan |
|
1316 |
* - double width |
|
1317 | 1318 |
*/ |
1318 | 1319 |
static void vga_draw_graphic(VGAState *s, int full_update) |
1319 | 1320 |
{ |
... | ... | |
1400 | 1401 |
s->last_height = height; |
1401 | 1402 |
full_update = 1; |
1402 | 1403 |
} |
1403 |
|
|
1404 |
if (s->cursor_invalidate) |
|
1405 |
s->cursor_invalidate(s); |
|
1406 |
|
|
1404 | 1407 |
line_offset = s->line_offset; |
1405 | 1408 |
#if 0 |
1406 | 1409 |
printf("w=%d h=%d v=%d line_offset=%d double_scan=0x%02x cr[0x17]=0x%02x linecmp=%d sr[0x01]=%02x\n", |
... | ... | |
1433 | 1436 |
/* if wide line, can use another page */ |
1434 | 1437 |
update |= cpu_physical_memory_is_dirty(page0 + TARGET_PAGE_SIZE); |
1435 | 1438 |
} |
1439 |
/* explicit invalidation for the hardware cursor */ |
|
1440 |
update |= (s->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1; |
|
1436 | 1441 |
if (update) { |
1437 | 1442 |
if (y_start < 0) |
1438 | 1443 |
y_start = y; |
... | ... | |
1441 | 1446 |
if (page1 > page_max) |
1442 | 1447 |
page_max = page1; |
1443 | 1448 |
vga_draw_line(s, d, s->vram_ptr + addr, width); |
1449 |
if (s->cursor_draw_line) |
|
1450 |
s->cursor_draw_line(s, d, y); |
|
1444 | 1451 |
} else { |
1445 | 1452 |
if (y_start >= 0) { |
1446 | 1453 |
/* flush to display */ |
... | ... | |
1476 | 1483 |
if (page_max != -1) { |
1477 | 1484 |
cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE); |
1478 | 1485 |
} |
1486 |
memset(s->invalidated_y_table, 0, ((height + 31) >> 5) * 4); |
|
1479 | 1487 |
} |
1480 | 1488 |
|
1481 | 1489 |
static void vga_draw_blank(VGAState *s, int full_update) |
Also available in: Unified diff