Changeset 67857 in vbox
- Timestamp:
- Jul 7, 2017 3:01:51 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116813
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r67795 r67857 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1779 1779 }; 1780 1780 1781 static const uint8_t empty_glyph[32 * 4] = { 0 }; 1782 1781 1783 /* 1782 1784 * Text mode update 1783 1785 * Missing: 1784 1786 * - underline 1785 * - flashing1786 1787 */ 1787 1788 static int vga_draw_text(PVGASTATE pThis, bool full_update, bool fFailOnResize, bool reset_dirty, … … 1799 1800 vga_draw_glyph8_func *vga_draw_glyph8; 1800 1801 vga_draw_glyph9_func *vga_draw_glyph9; 1802 uint64_t time_ns; 1803 bool blink_on, chr_blink_flip, cur_blink_flip; 1804 bool blink_enabled, blink_do_redraw; 1801 1805 1802 1806 full_update |= update_palette16(pThis); … … 1824 1828 full_update = true; 1825 1829 } 1826 full_update |= update_basic_params(pThis) ;1830 full_update |= update_basic_params(pThis) | 1; //@TODO! do not commit!! 1827 1831 1828 1832 line_offset = pThis->line_offset; … … 1904 1908 cx_min_upd = width; 1905 1909 1910 /* Figure out if we're in the visible period of the blink cycle. */ 1911 time_ns = PDMDevHlpTMTimeVirtGetNano(VGASTATE2DEVINS(pThis)); 1912 blink_on = (time_ns % VGA_BLINK_PERIOD_FULL) < VGA_BLINK_PERIOD_ON; 1913 chr_blink_flip = false; 1914 cur_blink_flip = false; 1915 if (pThis->last_chr_blink != blink_on) 1916 { 1917 /* Currently cursor and characters blink at the same rate, but they might not. */ 1918 pThis->last_chr_blink = blink_on; 1919 pThis->last_cur_blink = blink_on; 1920 chr_blink_flip = true; 1921 cur_blink_flip = true; 1922 } 1923 blink_enabled = !!(pThis->ar[0x10] & 0x08); /* Attribute controller blink enable. */ 1924 1906 1925 for(cy = 0; cy < (height - dscan); cy = cy + (1 << dscan)) { 1907 1926 d1 = dest; … … 1911 1930 for(cx = 0; cx < width; cx++) { 1912 1931 ch_attr = *(uint16_t *)src; 1913 if (full_update || ch_attr != (int)*ch_attr_ptr || src == cursor_ptr) { 1932 /* Figure out if character needs redrawing due to blink state change. */ 1933 blink_do_redraw = blink_enabled && chr_blink_flip && (ch_attr & 0x80); 1934 if (full_update || ch_attr != (int)*ch_attr_ptr || blink_do_redraw || (src == cursor_ptr && cur_blink_flip)) { 1914 1935 if (cx < cx_min) 1915 1936 cx_min = cx; … … 1929 1950 bgcol = palette[cattr >> 4]; 1930 1951 fgcol = palette[cattr & 0x0f]; 1952 1953 if (blink_enabled && (cattr & 0x80)) 1954 { 1955 bgcol = palette[(cattr >> 4) & 7]; 1956 if (!blink_on) 1957 font_ptr = empty_glyph; 1958 } 1959 1931 1960 if (cw != 9) { 1932 1961 if (pThis->fRenderVRAM) … … 1944 1973 !(pThis->cr[0x0a] & 0x20)) { 1945 1974 int line_start, line_last, h; 1946 uint64_t time_ns;1947 1975 1948 1976 /* draw the cursor if within the visible period */ 1949 time_ns = PDMDevHlpTMTimeVirtGetNano(VGASTATE2DEVINS(pThis)); 1950 if (time_ns % VGA_BLINK_PERIOD_FULL < VGA_BLINK_PERIOD_ON) { 1977 if (blink_on) { 1951 1978 line_start = pThis->cr[0x0a] & 0x1f; 1952 1979 line_last = pThis->cr[0x0b] & 0x1f; -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r67766 r67857 264 264 uint32_t last_scr_width, last_scr_height; /* in pixels */ 265 265 uint32_t last_bpp; 266 uint8_t cursor_start, cursor_end, padding3[2]; 266 uint8_t cursor_start, cursor_end; 267 bool last_cur_blink, last_chr_blink; 267 268 uint32_t cursor_offset; 268 269 /* hardware mouse cursor support */
Note:
See TracChangeset
for help on using the changeset viewer.