Statistics
| Branch: | Revision:

root / hw / cirrus_vga_rop.h @ 3df3f6fd

History | View | Annotate | Download (2.4 kB)

1 a5082316 bellard
/*
2 a5082316 bellard
 * QEMU Cirrus CLGD 54xx VGA Emulator.
3 a5082316 bellard
 * 
4 a5082316 bellard
 * Copyright (c) 2004 Fabrice Bellard
5 a5082316 bellard
 * 
6 a5082316 bellard
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 a5082316 bellard
 * of this software and associated documentation files (the "Software"), to deal
8 a5082316 bellard
 * in the Software without restriction, including without limitation the rights
9 a5082316 bellard
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 a5082316 bellard
 * copies of the Software, and to permit persons to whom the Software is
11 a5082316 bellard
 * furnished to do so, subject to the following conditions:
12 a5082316 bellard
 *
13 a5082316 bellard
 * The above copyright notice and this permission notice shall be included in
14 a5082316 bellard
 * all copies or substantial portions of the Software.
15 a5082316 bellard
 *
16 a5082316 bellard
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 a5082316 bellard
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 a5082316 bellard
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 a5082316 bellard
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 a5082316 bellard
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 a5082316 bellard
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 a5082316 bellard
 * THE SOFTWARE.
23 a5082316 bellard
 */
24 a5082316 bellard
25 a5082316 bellard
static void
26 a5082316 bellard
glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
27 a5082316 bellard
                             uint8_t *dst,const uint8_t *src,
28 a5082316 bellard
                             int dstpitch,int srcpitch,
29 a5082316 bellard
                             int bltwidth,int bltheight)
30 a5082316 bellard
{
31 a5082316 bellard
    int x,y;
32 a5082316 bellard
    dstpitch -= bltwidth;
33 a5082316 bellard
    srcpitch -= bltwidth;
34 a5082316 bellard
    for (y = 0; y < bltheight; y++) {
35 a5082316 bellard
        for (x = 0; x < bltwidth; x++) {
36 a5082316 bellard
            ROP_OP(*dst, *src);
37 a5082316 bellard
            dst++;
38 a5082316 bellard
            src++;
39 a5082316 bellard
        }
40 a5082316 bellard
        dst += dstpitch;
41 a5082316 bellard
        src += srcpitch;
42 a5082316 bellard
    }
43 a5082316 bellard
}
44 a5082316 bellard
45 a5082316 bellard
static void
46 a5082316 bellard
glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(CirrusVGAState *s,
47 a5082316 bellard
                                        uint8_t *dst,const uint8_t *src,
48 a5082316 bellard
                                        int dstpitch,int srcpitch,
49 a5082316 bellard
                                        int bltwidth,int bltheight)
50 a5082316 bellard
{
51 a5082316 bellard
    int x,y;
52 a5082316 bellard
    dstpitch += bltwidth;
53 a5082316 bellard
    srcpitch += bltwidth;
54 a5082316 bellard
    for (y = 0; y < bltheight; y++) {
55 a5082316 bellard
        for (x = 0; x < bltwidth; x++) {
56 a5082316 bellard
            ROP_OP(*dst, *src);
57 a5082316 bellard
            dst--;
58 a5082316 bellard
            src--;
59 a5082316 bellard
        }
60 a5082316 bellard
        dst += dstpitch;
61 a5082316 bellard
        src += srcpitch;
62 a5082316 bellard
    }
63 a5082316 bellard
}
64 a5082316 bellard
65 a5082316 bellard
#define DEPTH 8
66 a5082316 bellard
#include "cirrus_vga_rop2.h"
67 a5082316 bellard
68 a5082316 bellard
#define DEPTH 16
69 a5082316 bellard
#include "cirrus_vga_rop2.h"
70 a5082316 bellard
71 a5082316 bellard
#define DEPTH 24
72 a5082316 bellard
#include "cirrus_vga_rop2.h"
73 a5082316 bellard
74 a5082316 bellard
#define DEPTH 32
75 a5082316 bellard
#include "cirrus_vga_rop2.h"
76 a5082316 bellard
77 a5082316 bellard
#undef ROP_NAME
78 a5082316 bellard
#undef ROP_OP