Revision 0e1f5a0c hw/vga.c

b/hw/vga.c
1151 1151

  
1152 1152
static inline int get_depth_index(DisplayState *s)
1153 1153
{
1154
    switch(s->depth) {
1154
    switch(ds_get_bits_per_pixel(s)) {
1155 1155
    default:
1156 1156
    case 8:
1157 1157
        return 0;
......
1279 1279
        cw = 9;
1280 1280
    if (s->sr[1] & 0x08)
1281 1281
        cw = 16; /* NOTE: no 18 pixel wide */
1282
    x_incr = cw * ((s->ds->depth + 7) >> 3);
1282
    x_incr = cw * ((ds_get_bits_per_pixel(s->ds) + 7) >> 3);
1283 1283
    width = (s->cr[0x01] + 1);
1284 1284
    if (s->cr[0x06] == 100) {
1285 1285
        /* ugly hack for CGA 160x100x16 - explain me the logic */
......
1329 1329
        vga_draw_glyph8 = vga_draw_glyph8_table[depth_index];
1330 1330
    vga_draw_glyph9 = vga_draw_glyph9_table[depth_index];
1331 1331

  
1332
    dest = s->ds->data;
1333
    linesize = s->ds->linesize;
1332
    dest = ds_get_data(s->ds);
1333
    linesize = ds_get_linesize(s->ds);
1334 1334
    ch_attr_ptr = s->last_ch_attr;
1335 1335
    for(cy = 0; cy < height; cy++) {
1336 1336
        d1 = dest;
......
1663 1663
    y_start = -1;
1664 1664
    page_min = 0x7fffffff;
1665 1665
    page_max = -1;
1666
    d = s->ds->data;
1667
    linesize = s->ds->linesize;
1666
    d = ds_get_data(s->ds);
1667
    linesize = ds_get_linesize(s->ds);
1668 1668
    y1 = 0;
1669 1669
    for(y = 0; y < height; y++) {
1670 1670
        addr = addr1;
......
1743 1743
        return;
1744 1744
    if (s->last_scr_width <= 0 || s->last_scr_height <= 0)
1745 1745
        return;
1746
    if (s->ds->depth == 8)
1746
    if (ds_get_bits_per_pixel(s->ds) == 8)
1747 1747
        val = s->rgb_to_pixel(0, 0, 0);
1748 1748
    else
1749 1749
        val = 0;
1750
    w = s->last_scr_width * ((s->ds->depth + 7) >> 3);
1751
    d = s->ds->data;
1750
    w = s->last_scr_width * ((ds_get_bits_per_pixel(s->ds) + 7) >> 3);
1751
    d = ds_get_data(s->ds);
1752 1752
    for(i = 0; i < s->last_scr_height; i++) {
1753 1753
        memset(d, val, w);
1754
        d += s->ds->linesize;
1754
        d += ds_get_linesize(s->ds);
1755 1755
    }
1756 1756
    dpy_update(s->ds, 0, 0,
1757 1757
               s->last_scr_width, s->last_scr_height);
......
1766 1766
    VGAState *s = (VGAState *)opaque;
1767 1767
    int full_update, graphic_mode;
1768 1768

  
1769
    if (s->ds->depth == 0) {
1769
    if (ds_get_bits_per_pixel(s->ds) == 0) {
1770 1770
        /* nothing to do */
1771 1771
    } else {
1772 1772
        s->rgb_to_pixel =
......
2455 2455
    s->graphic_mode = -1;
2456 2456
    vga_update_display(s);
2457 2457

  
2458
    if (ds->data) {
2459
        ppm_save(filename, ds->data, vga_save_w, vga_save_h,
2460
                 s->ds->linesize);
2461
        qemu_free(ds->data);
2458
    if (ds_get_data(ds)) {
2459
        ppm_save(filename, ds_get_data(ds), vga_save_w, vga_save_h,
2460
                 ds_get_linesize(s->ds));
2461
        qemu_free(ds_get_data(ds));
2462 2462
    }
2463 2463
    s->ds = saved_ds;
2464 2464
}

Also available in: Unified diff