2 * QEMU G364 framebuffer Emulator.
4 * Copyright (c) 2007 Hervé Poussineau
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 static void glue(g364fb_draw_graphic
, BPP
)(G364State
*s
, int full_update
)
27 uint8_t *data_display
, *dd
;
29 data_buffer
= s
->vram_buffer
;
30 w_display
= s
->scr_width
* PIXEL_WIDTH
/ 8;
31 data_display
= ds_get_data(s
->ds
);
32 for(i
= 0; i
< s
->scr_height
; i
++) {
34 for (j
= 0; j
< s
->scr_width
; j
++, dd
+= PIXEL_WIDTH
/ 8, data_buffer
++) {
35 uint8_t index
= *data_buffer
;
36 *((glue(glue(uint
, PIXEL_WIDTH
), _t
) *)dd
) = glue(rgb_to_pixel
, BPP
)(
39 s
->palette
[index
][2]);
41 data_display
+= ds_get_linesize(s
->ds
);