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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 static void glue(g364fb_draw_graphic
, BPP
)(G364State
*s
, int full_update
)
26 uint8_t *data_display
, *dd
;
28 data_buffer
= s
->vram_buffer
;
29 w_display
= s
->scr_width
* PIXEL_WIDTH
/ 8;
30 data_display
= ds_get_data(s
->ds
);
31 for(i
= 0; i
< s
->scr_height
; i
++) {
33 for (j
= 0; j
< s
->scr_width
; j
++, dd
+= PIXEL_WIDTH
/ 8, data_buffer
++) {
34 uint8_t index
= *data_buffer
;
35 *((glue(glue(uint
, PIXEL_WIDTH
), _t
) *)dd
) = glue(rgb_to_pixel
, BPP
)(
38 s
->palette
[index
][2]);
40 data_display
+= ds_get_linesize(s
->ds
);