static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,

                struct vmsvga_cursor_definition_s *c)

{

    QEMUCursor *qc;

    int i, pixels;



    qc = cursor_alloc(c->width, c->height);

    qc->hot_x = c->hot_x;

    qc->hot_y = c->hot_y;

    switch (c->bpp) {

    case 1:

        cursor_set_mono(qc, 0xffffff, 0x000000, (void*)c->image,

                        1, (void*)c->mask);

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/mono");

#endif

        break;

    case 32:

        /* fill alpha channel from mask, set color to zero */

        cursor_set_mono(qc, 0x000000, 0x000000, (void*)c->mask,

                        1, (void*)c->mask);

        /* add in rgb values */

        pixels = c->width * c->height;

        for (i = 0; i < pixels; i++) {

            qc->data[i] |= c->image[i] & 0xffffff;

        }

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/32bit");

#endif

        break;

    default:

        fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n",

                __FUNCTION__, c->bpp);

        cursor_put(qc);

        qc = cursor_builtin_left_ptr();

    }



    dpy_cursor_define(s->vga.ds, qc);

    cursor_put(qc);

}

static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,

                struct vmsvga_cursor_definition_s *c)

{

    QEMUCursor *qc;

    int i, pixels;



    qc = cursor_alloc(c->width, c->height);

    qc->hot_x = c->hot_x;

    qc->hot_y = c->hot_y;

    switch (c->bpp) {

    case 1:

        cursor_set_mono(qc, 0xffffff, 0x000000, (void*)c->image,

                        1, (void*)c->mask);

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/mono");

#endif

        break;

    case 32:

        

        cursor_set_mono(qc, 0x000000, 0x000000, (void*)c->mask,

                        1, (void*)c->mask);

        

        pixels = c->width * c->height;

        for (i = 0; i < pixels; i++) {

            qc->data[i] |= c->image[i] & 0xffffff;

        }

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/32bit");

#endif

        break;

    default:

        fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n",

                __FUNCTION__, c->bpp);

        cursor_put(qc);

        qc = cursor_builtin_left_ptr();

    }



    dpy_cursor_define(s->vga.ds, qc);

    cursor_put(qc);

}

static inline void FUNC_0(struct vmsvga_state_s *VAR_0,

                struct vmsvga_cursor_definition_s *VAR_1)

{

    QEMUCursor *qc;

    int VAR_2, VAR_3;



    qc = cursor_alloc(VAR_1->width, VAR_1->height);

    qc->hot_x = VAR_1->hot_x;

    qc->hot_y = VAR_1->hot_y;

    switch (VAR_1->bpp) {

    case 1:

        cursor_set_mono(qc, 0xffffff, 0x000000, (void*)VAR_1->image,

                        1, (void*)VAR_1->mask);

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/mono");

#endif

        break;

    case 32:

        

        cursor_set_mono(qc, 0x000000, 0x000000, (void*)VAR_1->mask,

                        1, (void*)VAR_1->mask);

        

        VAR_3 = VAR_1->width * VAR_1->height;

        for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

            qc->data[VAR_2] |= VAR_1->image[VAR_2] & 0xffffff;

        }

#ifdef DEBUG

        cursor_print_ascii_art(qc, "vmware/32bit");

#endif

        break;

    default:

        fprintf(stderr, "%VAR_0: unhandled bpp %d, using fallback cursor\n",

                __FUNCTION__, VAR_1->bpp);

        cursor_put(qc);

        qc = cursor_builtin_left_ptr();

    }



    dpy_cursor_define(VAR_0->vga.ds, qc);

    cursor_put(qc);

}

static inline void FUNC_0(struct vmsvga_state_s *VAR_0,
struct vmsvga_cursor_definition_s *VAR_1)
{ QEMUCursor *qc; int VAR_2, VAR_3; qc = cursor_alloc(VAR_1->width, VAR_1->height); qc->hot_x = VAR_1->hot_x; qc->hot_y = VAR_1->hot_y; switch (VAR_1->bpp) { case 1:
cursor_set_mono(qc, 0xffffff, 0x000000, (void*)VAR_1->image,
1, (void*)VAR_1->mask); #ifdef DEBUG
cursor_print_ascii_art(qc, "vmware/mono"); #endif
break; case 32:
cursor_set_mono(qc, 0x000000, 0x000000, (void*)VAR_1->mask,
1, (void*)VAR_1->mask); VAR_3 = VAR_1->width * VAR_1->height; for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { qc->data[VAR_2] |= VAR_1->image[VAR_2] & 0xffffff; } #ifdef DEBUG
cursor_print_ascii_art(qc, "vmware/32bit"); #endif
break; default:
fprintf(stderr, "%VAR_0: unhandled bpp %d, using fallback cursor\n",
__FUNCTION__, VAR_1->bpp); cursor_put(qc); qc = cursor_builtin_left_ptr(); } dpy_cursor_define(VAR_0->vga.ds, qc); cursor_put(qc); }