Changeset 34024 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 12, 2010 9:47:37 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67690
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r34014 r34024 1479 1479 typedef void vga_draw_glyph8_func(uint8_t *d, int linesize, 1480 1480 const uint8_t *font_ptr, int h, 1481 uint32_t fgcol, uint32_t bgcol); 1481 uint32_t fgcol, uint32_t bgcol, 1482 int dscan); 1482 1483 typedef void vga_draw_glyph9_func(uint8_t *d, int linesize, 1483 1484 const uint8_t *font_ptr, int h, … … 1721 1722 * Text mode update 1722 1723 * Missing: 1723 * - double scan1724 * - double width1725 1724 * - underline 1726 1725 * - flashing … … 1734 1733 uint8_t *d1, *d, *src, *s1, *dest, *cursor_ptr; 1735 1734 const uint8_t *font_ptr, *font_base[2]; 1736 int dup9, line_offset, depth_index ;1735 int dup9, line_offset, depth_index, dscan; 1737 1736 uint32_t *palette; 1738 1737 uint32_t *ch_attr_ptr; … … 1768 1767 line_offset = s->line_offset; 1769 1768 s1 = s->CTX_SUFF(vram_ptr) + (s->start_addr * 8); /** @todo r=bird: Add comment why we do *8 instead of *4, it's not so obvious... */ 1769 1770 /* double scanning - not for 9-wide modes */ 1771 dscan = (s->cr[9] >> 7) & 1; 1770 1772 1771 1773 /* total width & height */ … … 1841 1843 cx_min_upd = width; 1842 1844 1843 for(cy = 0; cy < height; cy ++) {1845 for(cy = 0; cy < height; cy = cy + (1 << dscan)) { 1844 1846 d1 = dest; 1845 1847 src = s1; … … 1868 1870 if (cw != 9) { 1869 1871 vga_draw_glyph8(d1, linesize, 1870 font_ptr, cheight, fgcol, bgcol );1872 font_ptr, cheight, fgcol, bgcol, dscan); 1871 1873 } else { 1872 1874 dup9 = 0; … … 1887 1889 if (line_last >= line_start && line_start < cheight) { 1888 1890 h = line_last - line_start + 1; 1889 d = d1 + linesize * line_start;1891 d = d1 + (linesize * line_start << dscan); 1890 1892 if (cw != 9) { 1891 1893 vga_draw_glyph8(d, linesize, 1892 cursor_glyph, h, fgcol, bgcol );1894 cursor_glyph, h, fgcol, bgcol, dscan); 1893 1895 } else { 1894 1896 vga_draw_glyph9(d, linesize, … … 1918 1920 cx_min_upd = width; 1919 1921 } 1920 dest += linesize * cheight ;1922 dest += linesize * cheight << dscan; 1921 1923 s1 += line_offset; 1922 1924 } … … 4099 4101 { 4100 4102 PVGASTATE s = PDMINS_2_DATA(pDevIns, PVGASTATE); 4101 int is_graph ;4103 int is_graph, double_scan; 4102 4104 int w, h, char_height, char_dots; 4103 4105 int val, vfreq_hz, hfreq_hz; … … 4107 4109 is_graph = s->gr[6] & 1; 4108 4110 char_dots = (s->sr[0x01] & 1) ? 8 : 9; 4111 double_scan = s->cr[9] >> 7; 4109 4112 pHlp->pfnPrintf(pHlp, "pixel clock: %s\n", clocks[(s->msr >> 2) & 3]); 4110 pHlp->pfnPrintf(pHlp, "double scanning %s\n", s->cr[9] & 0x80? "on" : "off");4113 pHlp->pfnPrintf(pHlp, "double scanning %s\n", double_scan ? "on" : "off"); 4111 4114 pHlp->pfnPrintf(pHlp, "double clocking %s\n", s->sr[1] & 0x08 ? "on" : "off"); 4112 4115 val = s->cr[0] + 5; … … 4127 4130 char_height = val; 4128 4131 pHlp->pfnPrintf(pHlp, "char height %d\n", val); 4129 pHlp->pfnPrintf(pHlp, "text mode %dx%d\n", w / char_dots, h / char_height);4132 pHlp->pfnPrintf(pHlp, "text mode %dx%d\n", w / char_dots, h / (char_height << double_scan)); 4130 4133 } 4131 4134 if (s->fRealRetrace) … … 4176 4179 uint32_t uCharHeight; 4177 4180 uint32_t uLines; 4181 uint32_t uDblScan; 4178 4182 4179 4183 vga_get_offsets(pThis, &cbLine, &offStart, &uLineCompareIgn); … … 4183 4187 uVDisp = pThis->cr[0x12] + ((pThis->cr[7] & 2) << 7) + ((pThis->cr[7] & 0x40) << 4) + 1; 4184 4188 uCharHeight = (pThis->cr[9] & 0x1f) + 1; 4185 uLines = uVDisp / uCharHeight; 4189 uDblScan = pThis->cr[9] >> 7; 4190 uLines = uVDisp / (uCharHeight << uDblScan); 4186 4191 if (uLines < 25) 4187 4192 uLines = 25; -
trunk/src/VBox/Devices/Graphics/DevVGATmpl.h
r33974 r34024 59 59 int font_data, 60 60 uint32_t xorcol, 61 uint32_t bgcol) 61 uint32_t bgcol, 62 int dscan, 63 int linesize) 62 64 { 63 65 #if BPP == 1 64 66 ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol; 65 67 ((uint32_t *)d)[1] = (dmask16[(font_data >> 0) & 0xf] & xorcol) ^ bgcol; 68 if (dscan) { 69 uint8_t *c = d + linesize; 70 ((uint32_t *)c)[0] = ((uint32_t *)d)[0]; 71 ((uint32_t *)c)[1] = ((uint32_t *)d)[1]; 72 } 66 73 #elif BPP == 2 67 74 ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol; … … 69 76 ((uint32_t *)d)[2] = (dmask4[(font_data >> 2) & 3] & xorcol) ^ bgcol; 70 77 ((uint32_t *)d)[3] = (dmask4[(font_data >> 0) & 3] & xorcol) ^ bgcol; 78 if (dscan) 79 memcpy(d + linesize, d, 4 * sizeof(uint32_t)); 71 80 #else 72 81 ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol; … … 78 87 ((uint32_t *)d)[6] = (-((font_data >> 1) & 1) & xorcol) ^ bgcol; 79 88 ((uint32_t *)d)[7] = (-((font_data >> 0) & 1) & xorcol) ^ bgcol; 89 if (dscan) 90 memcpy(d + linesize, d, 8 * sizeof(uint32_t)); 80 91 #endif 81 92 } … … 83 94 static void glue(vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize, 84 95 const uint8_t *font_ptr, int h, 85 uint32_t fgcol, uint32_t bgcol )96 uint32_t fgcol, uint32_t bgcol, int dscan) 86 97 { 87 98 uint32_t xorcol; … … 91 102 do { 92 103 font_data = font_ptr[0]; 93 glue(vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol );104 glue(vga_draw_glyph_line_, DEPTH)(d, font_data, xorcol, bgcol, dscan, linesize); 94 105 font_ptr += 4; 95 d += linesize ;106 d += linesize << dscan; 96 107 } while (--h); 97 108 } … … 99 110 static void glue(vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize, 100 111 const uint8_t *font_ptr, int h, 101 uint32_t fgcol, uint32_t bgcol )112 uint32_t fgcol, uint32_t bgcol, int dscan) 102 113 { 103 114 uint32_t xorcol; … … 109 120 glue(vga_draw_glyph_line_, DEPTH)(d, 110 121 expand4to8[font_data >> 4], 111 xorcol, bgcol );122 xorcol, bgcol, dscan, linesize); 112 123 glue(vga_draw_glyph_line_, DEPTH)(d + 8 * BPP, 113 124 expand4to8[font_data & 0x0f], 114 xorcol, bgcol );125 xorcol, bgcol, dscan, linesize); 115 126 font_ptr += 4; 116 d += linesize ;127 d += linesize << dscan; 117 128 } while (--h); 118 129 }
Note:
See TracChangeset
for help on using the changeset viewer.