static void set_pixel_format(VncState *vs,

                             int bits_per_pixel, int depth,

                             int big_endian_flag, int true_color_flag,

                             int red_max, int green_max, int blue_max,

                             int red_shift, int green_shift, int blue_shift)

{

    if (!true_color_flag) {

        vnc_client_error(vs);

        return;

    }



    vs->clientds = vs->serverds;

    vs->clientds.pf.rmax = red_max;

    count_bits(vs->clientds.pf.rbits, red_max);

    vs->clientds.pf.rshift = red_shift;

    vs->clientds.pf.rmask = red_max << red_shift;

    vs->clientds.pf.gmax = green_max;

    count_bits(vs->clientds.pf.gbits, green_max);

    vs->clientds.pf.gshift = green_shift;

    vs->clientds.pf.gmask = green_max << green_shift;

    vs->clientds.pf.bmax = blue_max;

    count_bits(vs->clientds.pf.bbits, blue_max);

    vs->clientds.pf.bshift = blue_shift;

    vs->clientds.pf.bmask = blue_max << blue_shift;

    vs->clientds.pf.bits_per_pixel = bits_per_pixel;

    vs->clientds.pf.bytes_per_pixel = bits_per_pixel / 8;

    vs->clientds.pf.depth = bits_per_pixel == 32 ? 24 : bits_per_pixel;

    vs->clientds.flags = big_endian_flag ? QEMU_BIG_ENDIAN_FLAG : 0x00;



    set_pixel_conversion(vs);



    vga_hw_invalidate();

    vga_hw_update();

}

static void set_pixel_format(VncState *vs,

                             int bits_per_pixel, int depth,

                             int big_endian_flag, int true_color_flag,

                             int red_max, int green_max, int blue_max,

                             int red_shift, int green_shift, int blue_shift)

{

    if (!true_color_flag) {

        vnc_client_error(vs);

        return;

    }



    vs->clientds = vs->serverds;

    vs->clientds.pf.rmax = red_max;

    count_bits(vs->clientds.pf.rbits, red_max);

    vs->clientds.pf.rshift = red_shift;

    vs->clientds.pf.rmask = red_max << red_shift;

    vs->clientds.pf.gmax = green_max;

    count_bits(vs->clientds.pf.gbits, green_max);

    vs->clientds.pf.gshift = green_shift;

    vs->clientds.pf.gmask = green_max << green_shift;

    vs->clientds.pf.bmax = blue_max;

    count_bits(vs->clientds.pf.bbits, blue_max);

    vs->clientds.pf.bshift = blue_shift;

    vs->clientds.pf.bmask = blue_max << blue_shift;

    vs->clientds.pf.bits_per_pixel = bits_per_pixel;

    vs->clientds.pf.bytes_per_pixel = bits_per_pixel / 8;

    vs->clientds.pf.depth = bits_per_pixel == 32 ? 24 : bits_per_pixel;

    vs->clientds.flags = big_endian_flag ? QEMU_BIG_ENDIAN_FLAG : 0x00;



    set_pixel_conversion(vs);



    vga_hw_invalidate();

    vga_hw_update();

}

    vs->clientds = vs->serverds;
static void FUNC_0(VncState *VAR_0,

                             int VAR_1, int VAR_2,

                             int VAR_3, int VAR_4,

                             int VAR_5, int VAR_6, int VAR_7,

                             int VAR_8, int VAR_9, int VAR_10)

{

    if (!VAR_4) {

        vnc_client_error(VAR_0);

        return;

    }



    VAR_0->clientds = VAR_0->serverds;

    VAR_0->clientds.pf.rmax = VAR_5;

    count_bits(VAR_0->clientds.pf.rbits, VAR_5);

    VAR_0->clientds.pf.rshift = VAR_8;

    VAR_0->clientds.pf.rmask = VAR_5 << VAR_8;

    VAR_0->clientds.pf.gmax = VAR_6;

    count_bits(VAR_0->clientds.pf.gbits, VAR_6);

    VAR_0->clientds.pf.gshift = VAR_9;

    VAR_0->clientds.pf.gmask = VAR_6 << VAR_9;

    VAR_0->clientds.pf.bmax = VAR_7;

    count_bits(VAR_0->clientds.pf.bbits, VAR_7);

    VAR_0->clientds.pf.bshift = VAR_10;

    VAR_0->clientds.pf.bmask = VAR_7 << VAR_10;

    VAR_0->clientds.pf.VAR_1 = VAR_1;

    VAR_0->clientds.pf.bytes_per_pixel = VAR_1 / 8;

    VAR_0->clientds.pf.VAR_2 = VAR_1 == 32 ? 24 : VAR_1;

    VAR_0->clientds.flags = VAR_3 ? QEMU_BIG_ENDIAN_FLAG : 0x00;



    set_pixel_conversion(VAR_0);



    vga_hw_invalidate();

    vga_hw_update();

}

static void FUNC_0(VncState *VAR_0,
int VAR_1, int VAR_2,
int VAR_3, int VAR_4,
int VAR_5, int VAR_6, int VAR_7,
int VAR_8, int VAR_9, int VAR_10)
{ if (!VAR_4) { vnc_client_error(VAR_0); return; } VAR_0->clientds = VAR_0->serverds; VAR_0->clientds.pf.rmax = VAR_5; count_bits(VAR_0->clientds.pf.rbits, VAR_5); VAR_0->clientds.pf.rshift = VAR_8; VAR_0->clientds.pf.rmask = VAR_5 << VAR_8; VAR_0->clientds.pf.gmax = VAR_6; count_bits(VAR_0->clientds.pf.gbits, VAR_6); VAR_0->clientds.pf.gshift = VAR_9; VAR_0->clientds.pf.gmask = VAR_6 << VAR_9; VAR_0->clientds.pf.bmax = VAR_7; count_bits(VAR_0->clientds.pf.bbits, VAR_7); VAR_0->clientds.pf.bshift = VAR_10; VAR_0->clientds.pf.bmask = VAR_7 << VAR_10; VAR_0->clientds.pf.VAR_1 = VAR_1; VAR_0->clientds.pf.bytes_per_pixel = VAR_1 / 8; VAR_0->clientds.pf.VAR_2 = VAR_1 == 32 ? 24 : VAR_1; VAR_0->clientds.flags = VAR_3 ? QEMU_BIG_ENDIAN_FLAG : 0x00; set_pixel_conversion(VAR_0); vga_hw_invalidate(); vga_hw_update(); }