VirtualBox

Changeset 32811 in vbox


Ignore:
Timestamp:
Sep 29, 2010 11:00:03 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66263
Message:

VGA: Proper visible width calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r32807 r32811  
    21912191{
    21922192    int y1, y2, y, update, page_min, page_max, linesize, y_start, double_scan;
    2193     int width, height, shift_control, line_offset, page0, page1, bwidth;
     2193    int width, height, shift_control, line_offset, page0, page1, bwidth, bits;
    21942194    int disp_width, multi_run;
    21952195    uint8_t *d;
     
    22232223            v = VGA_DRAW_LINE4;
    22242224        }
     2225        bits = 4;
    22252226    } else if (shift_control == 1) {
    22262227        full_update |= update_palette16(s);
     
    22312232            v = VGA_DRAW_LINE2;
    22322233        }
     2234        bits = 4;
    22332235    } else {
    22342236        switch(s->get_bpp(s)) {
     
    22372239            full_update |= update_palette256(s);
    22382240            v = VGA_DRAW_LINE8D2;
     2241            bits = 4;
    22392242            break;
    22402243        case 8:
    22412244            full_update |= update_palette256(s);
    22422245            v = VGA_DRAW_LINE8;
     2246            bits = 8;
    22432247            break;
    22442248        case 15:
    22452249            v = VGA_DRAW_LINE15;
     2250            bits = 16;
    22462251            break;
    22472252        case 16:
    22482253            v = VGA_DRAW_LINE16;
     2254            bits = 16;
    22492255            break;
    22502256        case 24:
    22512257            v = VGA_DRAW_LINE24;
     2258            bits = 24;
    22522259            break;
    22532260        case 32:
    22542261            v = VGA_DRAW_LINE32;
     2262            bits = 32;
    22552263            break;
    22562264        }
     
    22992307    bwidth = width * 4;
    23002308#else /* VBOX */
    2301     /* The width of VRAM scanline. */
    2302     bwidth = s->line_offset;
    2303     /* In some cases the variable is not yet set, probably due to incomplete
    2304      * programming of the virtual hardware ports. Just return.
    2305      */
    2306     if (bwidth == 0) return VINF_SUCCESS;
     2309    bwidth = (width * bits + 7) / 8;    /* The visible width of a scanline. */
    23072310#endif /* VBOX */
    23082311    y_start = -1;
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