00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 static void
00026 glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
00027 uint8_t *dst,const uint8_t *src,
00028 int dstpitch,int srcpitch,
00029 int bltwidth,int bltheight)
00030 {
00031 int x,y;
00032 dstpitch -= bltwidth;
00033 srcpitch -= bltwidth;
00034
00035 if (dstpitch < 0 || srcpitch < 0) {
00036
00037 return;
00038 }
00039
00040 for (y = 0; y < bltheight; y++) {
00041 for (x = 0; x < bltwidth; x++) {
00042 ROP_OP(*dst, *src);
00043 dst++;
00044 src++;
00045 }
00046 dst += dstpitch;
00047 src += srcpitch;
00048 }
00049 }
00050
00051 static void
00052 glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(CirrusVGAState *s,
00053 uint8_t *dst,const uint8_t *src,
00054 int dstpitch,int srcpitch,
00055 int bltwidth,int bltheight)
00056 {
00057 int x,y;
00058 dstpitch += bltwidth;
00059 srcpitch += bltwidth;
00060 for (y = 0; y < bltheight; y++) {
00061 for (x = 0; x < bltwidth; x++) {
00062 ROP_OP(*dst, *src);
00063 dst--;
00064 src--;
00065 }
00066 dst += dstpitch;
00067 src += srcpitch;
00068 }
00069 }
00070
00071 static void
00072 glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
00073 uint8_t *dst,const uint8_t *src,
00074 int dstpitch,int srcpitch,
00075 int bltwidth,int bltheight)
00076 {
00077 int x,y;
00078 uint8_t p;
00079 dstpitch -= bltwidth;
00080 srcpitch -= bltwidth;
00081 for (y = 0; y < bltheight; y++) {
00082 for (x = 0; x < bltwidth; x++) {
00083 p = *dst;
00084 ROP_OP(p, *src);
00085 if (p != s->gr[0x34]) *dst = p;
00086 dst++;
00087 src++;
00088 }
00089 dst += dstpitch;
00090 src += srcpitch;
00091 }
00092 }
00093
00094 static void
00095 glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_8)(CirrusVGAState *s,
00096 uint8_t *dst,const uint8_t *src,
00097 int dstpitch,int srcpitch,
00098 int bltwidth,int bltheight)
00099 {
00100 int x,y;
00101 uint8_t p;
00102 dstpitch += bltwidth;
00103 srcpitch += bltwidth;
00104 for (y = 0; y < bltheight; y++) {
00105 for (x = 0; x < bltwidth; x++) {
00106 p = *dst;
00107 ROP_OP(p, *src);
00108 if (p != s->gr[0x34]) *dst = p;
00109 dst--;
00110 src--;
00111 }
00112 dst += dstpitch;
00113 src += srcpitch;
00114 }
00115 }
00116
00117 static void
00118 glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
00119 uint8_t *dst,const uint8_t *src,
00120 int dstpitch,int srcpitch,
00121 int bltwidth,int bltheight)
00122 {
00123 int x,y;
00124 uint8_t p1, p2;
00125 dstpitch -= bltwidth;
00126 srcpitch -= bltwidth;
00127 for (y = 0; y < bltheight; y++) {
00128 for (x = 0; x < bltwidth; x+=2) {
00129 p1 = *dst;
00130 p2 = *(dst+1);
00131 ROP_OP(p1, *src);
00132 ROP_OP(p2, *(src+1));
00133 if ((p1 != s->gr[0x34]) || (p2 != s->gr[0x35])) {
00134 *dst = p1;
00135 *(dst+1) = p2;
00136 }
00137 dst+=2;
00138 src+=2;
00139 }
00140 dst += dstpitch;
00141 src += srcpitch;
00142 }
00143 }
00144
00145 static void
00146 glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16)(CirrusVGAState *s,
00147 uint8_t *dst,const uint8_t *src,
00148 int dstpitch,int srcpitch,
00149 int bltwidth,int bltheight)
00150 {
00151 int x,y;
00152 uint8_t p1, p2;
00153 dstpitch += bltwidth;
00154 srcpitch += bltwidth;
00155 for (y = 0; y < bltheight; y++) {
00156 for (x = 0; x < bltwidth; x+=2) {
00157 p1 = *(dst-1);
00158 p2 = *dst;
00159 ROP_OP(p1, *(src-1));
00160 ROP_OP(p2, *src);
00161 if ((p1 != s->gr[0x34]) || (p2 != s->gr[0x35])) {
00162 *(dst-1) = p1;
00163 *dst = p2;
00164 }
00165 dst-=2;
00166 src-=2;
00167 }
00168 dst += dstpitch;
00169 src += srcpitch;
00170 }
00171 }
00172
00173 #define DEPTH 8
00174 #include "cirrus_vga_rop2.h"
00175
00176 #define DEPTH 16
00177 #include "cirrus_vga_rop2.h"
00178
00179 #define DEPTH 24
00180 #include "cirrus_vga_rop2.h"
00181
00182 #define DEPTH 32
00183 #include "cirrus_vga_rop2.h"
00184
00185 #undef ROP_NAME
00186 #undef ROP_OP