VirtualBox

Ignore:
Timestamp:
Nov 12, 2010 9:47:37 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67690
Message:

VGA: Added support for double scanned text modes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGATmpl.h

    r33974 r34024  
    5959                                                     int font_data,
    6060                                                     uint32_t xorcol,
    61                                                      uint32_t bgcol)
     61                                                     uint32_t bgcol,
     62                                                     int dscan,
     63                                                     int linesize)
    6264{
    6365#if BPP == 1
    6466        ((uint32_t *)d)[0] = (dmask16[(font_data >> 4)] & xorcol) ^ bgcol;
    6567        ((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        }
    6673#elif BPP == 2
    6774        ((uint32_t *)d)[0] = (dmask4[(font_data >> 6)] & xorcol) ^ bgcol;
     
    6976        ((uint32_t *)d)[2] = (dmask4[(font_data >> 2) & 3] & xorcol) ^ bgcol;
    7077        ((uint32_t *)d)[3] = (dmask4[(font_data >> 0) & 3] & xorcol) ^ bgcol;
     78        if (dscan)
     79            memcpy(d + linesize, d, 4 * sizeof(uint32_t));
    7180#else
    7281        ((uint32_t *)d)[0] = (-((font_data >> 7)) & xorcol) ^ bgcol;
     
    7887        ((uint32_t *)d)[6] = (-((font_data >> 1) & 1) & xorcol) ^ bgcol;
    7988        ((uint32_t *)d)[7] = (-((font_data >> 0) & 1) & xorcol) ^ bgcol;
     89        if (dscan)
     90            memcpy(d + linesize, d, 8 * sizeof(uint32_t));
    8091#endif
    8192}
     
    8394static void glue(vga_draw_glyph8_, DEPTH)(uint8_t *d, int linesize,
    8495                                          const uint8_t *font_ptr, int h,
    85                                           uint32_t fgcol, uint32_t bgcol)
     96                                          uint32_t fgcol, uint32_t bgcol, int dscan)
    8697{
    8798    uint32_t xorcol;
     
    91102    do {
    92103        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);
    94105        font_ptr += 4;
    95         d += linesize;
     106        d += linesize << dscan;
    96107    } while (--h);
    97108}
     
    99110static void glue(vga_draw_glyph16_, DEPTH)(uint8_t *d, int linesize,
    100111                                          const uint8_t *font_ptr, int h,
    101                                           uint32_t fgcol, uint32_t bgcol)
     112                                          uint32_t fgcol, uint32_t bgcol, int dscan)
    102113{
    103114    uint32_t xorcol;
     
    109120        glue(vga_draw_glyph_line_, DEPTH)(d,
    110121                                          expand4to8[font_data >> 4],
    111                                           xorcol, bgcol);
     122                                          xorcol, bgcol, dscan, linesize);
    112123        glue(vga_draw_glyph_line_, DEPTH)(d + 8 * BPP,
    113124                                          expand4to8[font_data & 0x0f],
    114                                           xorcol, bgcol);
     125                                          xorcol, bgcol, dscan, linesize);
    115126        font_ptr += 4;
    116         d += linesize;
     127        d += linesize << dscan;
    117128    } while (--h);
    118129}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette