Changeset 38803 in vbox
- Timestamp:
- Sep 20, 2011 12:07:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r37770 r38803 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 45 45 *******************************************************************************/ 46 46 47 /* WARNING!!! All defines that affe tcVGAState should be placed to DevVGA.h !!!47 /* WARNING!!! All defines that affect VGAState should be placed to DevVGA.h !!! 48 48 * NEVER place them here as this would lead to VGAState inconsistency 49 49 * across different .cpp files !!! … … 109 109 #include <VBox/vmm/pgm.h> 110 110 #ifdef IN_RING3 111 # include <iprt/alloc.h>112 # include <iprt/ctype.h>111 # include <iprt/alloc.h> 112 # include <iprt/ctype.h> 113 113 #endif /* IN_RING3 */ 114 114 #include <iprt/assert.h> … … 1505 1505 1506 1506 /* return true if the palette was modified */ 1507 static int update_palette16(VGAState *s) 1508 { 1509 int full_update, i; 1507 static bool update_palette16(VGAState *s) 1508 { 1509 bool full_update = false; 1510 int i; 1510 1511 uint32_t v, col, *palette; 1511 1512 1512 full_update = 0;1513 1513 palette = s->last_palette; 1514 1514 for(i = 0; i < 16; i++) { … … 1523 1523 c6_to_8(s->palette[v + 2])); 1524 1524 if (col != palette[i]) { 1525 full_update = 1;1525 full_update = true; 1526 1526 palette[i] = col; 1527 1527 } … … 1531 1531 1532 1532 /* return true if the palette was modified */ 1533 static int update_palette256(VGAState *s) 1534 { 1535 int full_update, i; 1533 static bool update_palette256(VGAState *s) 1534 { 1535 bool full_update = false; 1536 int i; 1536 1537 uint32_t v, col, *palette; 1537 1538 int wide_dac; 1538 1539 1539 full_update = 0;1540 1540 palette = s->last_palette; 1541 1541 v = 0; … … 1552 1552 c6_to_8(s->palette[v + 2])); 1553 1553 if (col != palette[i]) { 1554 full_update = 1;1554 full_update = true; 1555 1555 palette[i] = col; 1556 1556 } … … 1597 1597 1598 1598 /* update start_addr and line_offset. Return TRUE if modified */ 1599 static intupdate_basic_params(VGAState *s)1600 { 1601 int full_update;1599 static bool update_basic_params(VGAState *s) 1600 { 1601 bool full_update = false; 1602 1602 uint32_t start_addr, line_offset, line_compare; 1603 1604 full_update = 0;1605 1603 1606 1604 s->get_offsets(s, &line_offset, &start_addr, &line_compare); … … 1612 1610 s->start_addr = start_addr; 1613 1611 s->line_compare = line_compare; 1614 full_update = 1;1612 full_update = true; 1615 1613 } 1616 1614 return full_update; … … 1678 1676 * - flashing 1679 1677 */ 1680 static int vga_draw_text(VGAState *s, intfull_update, bool fFailOnResize, bool reset_dirty)1678 static int vga_draw_text(VGAState *s, bool full_update, bool fFailOnResize, bool reset_dirty) 1681 1679 { 1682 1680 int cx, cy, cheight, cw, ch, cattr, height, width, ch_attr; … … 1700 1698 if (offset != s->font_offsets[0]) { 1701 1699 s->font_offsets[0] = offset; 1702 full_update = 1;1700 full_update = true; 1703 1701 } 1704 1702 font_base[0] = s->CTX_SUFF(vram_ptr) + offset; … … 1708 1706 if (offset != s->font_offsets[1]) { 1709 1707 s->font_offsets[1] = offset; 1710 full_update = 1;1708 full_update = true; 1711 1709 } 1712 1710 if (s->plane_updated & (1 << 2)) { … … 1714 1712 indicates the font may have been modified */ 1715 1713 s->plane_updated = 0; 1716 full_update = 1;1714 full_update = true; 1717 1715 } 1718 1716 full_update |= update_basic_params(s); … … 1762 1760 s->last_ch = cheight; 1763 1761 s->last_cw = cw; 1764 full_update = 1;1762 full_update = true; 1765 1763 if (rc == VINF_VGA_RESIZE_IN_PROGRESS) 1766 1764 return rc; … … 2060 2058 * graphic modes 2061 2059 */ 2062 static int vga_draw_graphic(VGAState *s, intfull_update, bool fFailOnResize, bool reset_dirty)2063 { 2064 int y1, y2, y, update,page_min, page_max, linesize, y_start, double_scan;2060 static int vga_draw_graphic(VGAState *s, bool full_update, bool fFailOnResize, bool reset_dirty) 2061 { 2062 int y1, y2, y, page_min, page_max, linesize, y_start, double_scan; 2065 2063 int width, height, shift_control, line_offset, page0, page1, bwidth, bits; 2066 2064 int disp_width, multi_run; … … 2068 2066 uint32_t v, addr1, addr; 2069 2067 vga_draw_line_func *vga_draw_line; 2070 int offsets_changed; 2071 2072 offsets_changed = update_basic_params(s); 2068 2069 bool offsets_changed = update_basic_params(s); 2073 2070 2074 2071 full_update |= offsets_changed; … … 2082 2079 if (shift_control != s->shift_control || 2083 2080 double_scan != s->double_scan) { 2084 full_update = 1;2081 full_update = true; 2085 2082 s->shift_control = shift_control; 2086 2083 s->double_scan = double_scan; … … 2149 2146 if (rc != VINF_SUCCESS) /* Return any rc, particularly VINF_VGA_RESIZE_IN_PROGRESS, to the caller. */ 2150 2147 return rc; 2151 full_update = 1;2148 full_update = true; 2152 2149 } 2153 2150 vga_draw_line = vga_draw_line_table[v * 4 + get_depth_index(s->pDrv->cBits)]; … … 2184 2181 page0 = addr & TARGET_PAGE_MASK; 2185 2182 page1 = (addr + bwidth - 1) & TARGET_PAGE_MASK; 2186 update = full_update | vga_is_dirty(s, page0) | vga_is_dirty(s, page1);2183 bool update = full_update | vga_is_dirty(s, page0) | vga_is_dirty(s, page1); 2187 2184 if (page1 - page0 > TARGET_PAGE_SIZE) { 2188 2185 /* if wide line, can use another page */ … … 2276 2273 { 2277 2274 int rc = VINF_SUCCESS; 2278 int full_update,graphic_mode;2275 int graphic_mode; 2279 2276 2280 2277 if (s->pDrv->cBits == 0) { … … 2343 2340 } 2344 2341 2345 full_update = 0;2346 2342 if (!(s->ar_index & 0x20) || (s->sr[0x01] & 0x20)) { 2347 2343 graphic_mode = GMODE_BLANK; … … 2349 2345 graphic_mode = s->gr[6] & 1; 2350 2346 } 2351 if (graphic_mode != s->graphic_mode) { 2347 bool full_update = graphic_mode != s->graphic_mode; 2348 if (full_update) { 2352 2349 s->graphic_mode = graphic_mode; 2353 full_update = 1;2354 2350 } 2355 2351 switch(graphic_mode) { … … 4897 4893 4898 4894 cbPixelSrc = (s->get_bpp(s) + 7) / 8; 4899 s->get_offsets 4895 s->get_offsets(s, &cbLineSrc, &u32OffsetSrc, &u32Dummy); 4900 4896 4901 4897 /* Assume that rendering is performed only on visible part of VRAM.
Note:
See TracChangeset
for help on using the changeset viewer.