5 #include "../../../config_file/config_file.h"
7 #include "../../../gpio/gpio.h"
11 extern uint32_t rtg_address[8];
12 extern uint32_t rtg_address_adj[8];
13 extern uint8_t *rtg_mem; // FIXME
14 extern uint16_t rtg_display_format;
15 extern uint16_t rtg_user[8];
16 extern uint16_t rtg_x[8], rtg_y[8];
18 extern uint8_t realtime_graphics_debug;
20 void rtg_fillrect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t color, uint16_t pitch, uint16_t format, uint8_t mask) {
22 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (x << format) + (y * pitch)];
25 for (int xs = 0; xs < w; xs++) {
26 dptr[xs] = color & 0xFF;
31 color = htobe16((color & 0xFFFF));
32 uint16_t *ptr = (uint16_t *)dptr;
33 for (int xs = 0; xs < w; xs++) {
39 color = htobe32(color);
40 uint32_t *ptr = (uint32_t *)dptr;
41 for (int xs = 0; xs < w; xs++) {
47 for (int ys = 1; ys < h; ys++) {
49 memcpy(dptr, (void *)(size_t)(dptr - pitch), (w << format));
53 void rtg_invertrect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t pitch, uint16_t format, uint8_t mask) {
55 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (x << format) + (y * pitch)];
56 for (int ys = 1; ys < h; ys++) {
59 for (int xs = 0; xs < w; xs++) {
65 for (int xs = 0; xs < w; xs++) {
66 ((uint16_t *)dptr)[xs] = ~((uint16_t *)dptr)[xs];
71 for (int xs = 0; xs < w; xs++) {
72 ((uint32_t *)dptr)[xs] = ~((uint32_t *)dptr)[xs];
81 void rtg_blitrect(uint16_t x, uint16_t y, uint16_t dx, uint16_t dy, uint16_t w, uint16_t h, uint16_t pitch, uint16_t format, uint8_t mask) {
83 uint8_t *sptr = &rtg_mem[rtg_address_adj[0] + (x << format) + (y * pitch)];
84 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (dx << format) + (dy * pitch)];
86 uint32_t xdir = 1, pitchstep = pitch;
90 sptr += ((h - 1) * pitch);
91 dptr += ((h - 1) * pitch);
97 for (int ys = 0; ys < h; ys++) {
99 memcpy(dptr, sptr, w << format);
101 memmove(dptr, sptr, w << format);
107 void rtg_blitrect_nomask_complete(uint16_t sx, uint16_t sy, uint16_t dx, uint16_t dy, uint16_t w, uint16_t h, uint16_t srcpitch, uint16_t dstpitch, uint32_t src_addr, uint32_t dst_addr, uint16_t format, uint8_t minterm) {
109 uint8_t *sptr = &rtg_mem[src_addr - (PIGFX_RTG_BASE + PIGFX_REG_SIZE) + (sx << format) + (sy * srcpitch)];
110 uint8_t *dptr = &rtg_mem[dst_addr - (PIGFX_RTG_BASE + PIGFX_REG_SIZE) + (dx << format) + (dy * dstpitch)];
112 uint32_t xdir = 1, src_pitchstep = srcpitch, dst_pitchstep = dstpitch;
114 if (src_addr == dst_addr) {
116 src_pitchstep = -srcpitch;
117 sptr += ((h - 1) * srcpitch);
118 dst_pitchstep = -dstpitch;
119 dptr += ((h - 1) * dstpitch);
126 for (int ys = 0; ys < h; ys++) {
128 memcpy(dptr, sptr, w << format);
130 memmove(dptr, sptr, w << format);
131 sptr += src_pitchstep;
132 dptr += dst_pitchstep;
136 extern struct emulator_config *cfg;
138 void rtg_blittemplate(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t src_addr, uint32_t fgcol, uint32_t bgcol, uint16_t pitch, uint16_t t_pitch, uint16_t format, uint16_t offset_x, uint8_t mask, uint8_t draw_mode) {
141 uint8_t *dptr = &rtg_mem[rtg_address_adj[1] + (x << format) + (y * pitch)];
142 uint8_t *sptr = NULL;
143 uint8_t cur_bit = 0, base_bit = 0, cur_byte = 0;
144 uint8_t invert = (draw_mode & DRAWMODE_INVERSVID);
149 tmpl_x = offset_x / 8;
150 cur_bit = base_bit = (0x80 >> (offset_x % 8));
152 if (realtime_graphics_debug) {
153 printf("DEBUG: BlitTemplate - %d, %d (%dx%d)\n", x, y, w, h);
154 printf("Src: %.8X (%.8X)\n", src_addr, rtg_address_adj[0]);
155 printf("Dest: %.8X (%.8X)\n", rtg_address[1], rtg_address_adj[1]);
156 printf("pitch: %d t_pitch: %d format: %d\n", pitch, t_pitch, format);
157 printf("offset_x: %d mask: %.2X draw_mode: %d\n", offset_x, mask, draw_mode);
160 uint32_t fg_color[3] = {
162 htobe16((fgcol & 0xFFFF)),
165 uint32_t bg_color[3] = {
167 htobe16((bgcol & 0xFFFF)),
171 if (src_addr >= (PIGFX_RTG_BASE + PIGFX_REG_SIZE)) {
172 sptr = &rtg_mem[src_addr - (PIGFX_RTG_BASE + PIGFX_REG_SIZE)];
173 if (realtime_graphics_debug) {
174 printf("Origin: %.8X\n", rtg_address[2]);
175 printf("Grabbing data from RTG memory.\nData:\n");
176 for (int i = 0; i < h; i++) {
177 for (int j = 0; j < t_pitch; j++) {
178 printf("%.2X", sptr[j + (i * t_pitch)]);
183 printf("Data available at origin:\n");
184 for (int i = 0; i < h; i++) {
185 for (int j = 0; j < w; j++) {
186 printf("%.2X", read8(rtg_address[2] + j + (i * t_pitch)));
194 int i = get_mapped_item_by_address(cfg, src_addr);
196 sptr = &cfg->map_data[i][src_addr - cfg->map_offset[i]];
197 if (realtime_graphics_debug) {
198 printf("Grabbing data from maping %d - offset %.8X\nData:\n", i, src_addr - cfg->map_offset[i]);
199 for (int i = 0; i < h; i++) {
200 for (int j = 0; j < t_pitch; j++) {
201 printf("%.2X", sptr[j + (i * t_pitch)]);
208 printf("BlitTemplate: Failed to find mapped range for address %.8X\n", src_addr);
215 for (uint16_t ys = 0; ys < h; ys++) {
216 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
218 for (int xs = 0; xs < w; xs++) {
219 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
220 SET_RTG_PIXELS(&dptr[xs << format], fg_color[format], format);
224 while (cur_bit > 0 && xs < w) {
225 if (cur_byte & cur_bit) {
226 SET_RTG_PIXEL(&dptr[xs << format], fg_color[format], format);
240 for (uint16_t ys = 0; ys < h; ys++) {
241 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
243 for (int xs = 0; xs < w; xs++) {
244 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
245 SET_RTG_PIXELS2_COND(&dptr[xs << format], fg_color[format], bg_color[format], format);
249 while (cur_bit > 0 && xs < w) {
250 if (cur_byte & cur_bit) {
251 SET_RTG_PIXEL(&dptr[xs << format], fg_color[format], format);
254 SET_RTG_PIXEL(&dptr[xs << format], bg_color[format], format);
267 case DRAWMODE_COMPLEMENT:
268 for (uint16_t ys = 0; ys < h; ys++) {
269 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
271 for (int xs = 0; xs < w; xs++) {
272 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
273 INVERT_RTG_PIXELS(&dptr[xs << format], format)
277 while (cur_bit > 0 && xs < w) {
278 if (cur_byte & cur_bit) {
279 INVERT_RTG_PIXEL(&dptr[xs << format], format)
295 void rtg_blitpattern(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t src_addr, uint32_t fgcol, uint32_t bgcol, uint16_t pitch, uint16_t format, uint16_t offset_x, uint16_t offset_y, uint8_t mask, uint8_t draw_mode, uint8_t loop_rows) {
298 uint8_t *dptr = &rtg_mem[rtg_address_adj[1] + (x << format) + (y * pitch)];
299 uint8_t *sptr = NULL, *sptr_base = NULL;
300 uint8_t cur_bit = 0, base_bit = 0, cur_byte = 0;
301 uint8_t invert = (draw_mode & DRAWMODE_INVERSVID);
306 tmpl_x = (offset_x / 8) % 2;
307 cur_bit = base_bit = (0x80 >> (offset_x % 8));
309 uint32_t fg_color[3] = {
311 htobe16((fgcol & 0xFFFF)),
314 uint32_t bg_color[3] = {
316 htobe16((bgcol & 0xFFFF)),
321 if (src_addr >= (PIGFX_RTG_BASE + PIGFX_REG_SIZE))
322 sptr = &rtg_mem[src_addr - (PIGFX_RTG_BASE + PIGFX_REG_SIZE)];
324 int i = get_mapped_item_by_address(cfg, src_addr);
326 sptr = &cfg->map_data[i][src_addr - cfg->map_offset[i]];
329 printf("BlitPattern: Failed to find mapped range for address %.8X\n", src_addr);
335 sptr += (offset_y % loop_rows) * 2;
339 for (uint16_t ys = 0; ys < h; ys++) {
340 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
342 for (int xs = 0; xs < w; xs++) {
343 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
344 SET_RTG_PIXELS(&dptr[xs << format], fg_color[format], format);
348 while (cur_bit > 0 && xs < w) {
349 if (cur_byte & cur_bit) {
350 SET_RTG_PIXEL(&dptr[xs << format], fg_color[format], format);
364 for (uint16_t ys = 0; ys < h; ys++) {
365 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
367 for (int xs = 0; xs < w; xs++) {
368 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
369 SET_RTG_PIXELS2_COND(&dptr[xs << format], fg_color[format], bg_color[format], format);
373 while (cur_bit > 0 && xs < w) {
374 if (cur_byte & cur_bit) {
375 SET_RTG_PIXEL(&dptr[xs << format], fg_color[format], format);
378 SET_RTG_PIXEL(&dptr[xs << format], bg_color[format], format);
391 case DRAWMODE_COMPLEMENT:
392 for (uint16_t ys = 0; ys < h; ys++) {
393 cur_byte = (invert) ? sptr[tmpl_x] ^ 0xFF : sptr[tmpl_x];
395 for (int xs = 0; xs < w; xs++) {
396 if (w >= 8 && cur_bit == 0x80 && xs < w - 8) {
397 INVERT_RTG_PIXELS(&dptr[xs << format], format)
401 while (cur_bit > 0 && xs < w) {
402 if (cur_byte & cur_bit) {
403 INVERT_RTG_PIXEL(&dptr[xs << format], format)
419 void rtg_drawline_solid(int16_t x1_, int16_t y1_, int16_t x2_, int16_t y2_, uint16_t len, uint32_t fgcol, uint16_t pitch, uint16_t format) {
420 int16_t x1 = x1_, y1 = y1_;
421 int16_t x2 = x1_ + x2_, y2 = y1 + y2_;
423 uint32_t fg_color[3] = {
425 htobe16((fgcol & 0xFFFF)),
429 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (y1 * pitch)];
431 int32_t line_step = pitch;
434 int16_t dx, dy, dx_abs, dy_abs, ix, iy, x = x1;
448 SET_RTG_PIXEL(&dptr[x << format], fg_color[format], format);
450 if (dx_abs >= dy_abs) {
451 if (!len) len = dx_abs;
452 for (uint16_t i = 0; i < len; i++) {
460 SET_RTG_PIXEL(&dptr[x << format], fg_color[format], format);
464 if (!len) len = dy_abs;
465 for (uint16_t i = 0; i < len; i++) {
473 SET_RTG_PIXEL(&dptr[x << format], fg_color[format], format);
478 #define DRAW_LINE_PIXEL \
479 if (pattern & cur_bit) { \
480 if (invert) { INVERT_RTG_PIXEL(&dptr[x << format], format) } \
482 if (mask == 0xFF || format != RTGFMT_8BIT) { SET_RTG_PIXEL(&dptr[x << format], fg_color[format], format); } \
483 else { SET_RTG_PIXEL_MASK(&dptr[x << format], fg_color[format], format); } \
486 else if (draw_mode == DRAWMODE_JAM2) { \
487 if (invert) { INVERT_RTG_PIXEL(&dptr[x << format], format) } \
489 if (mask == 0xFF || format != RTGFMT_8BIT) { SET_RTG_PIXEL(&dptr[x << format], bg_color[format], format); } \
490 else { SET_RTG_PIXEL_MASK(&dptr[x << format], bg_color[format], format); } \
493 if ((cur_bit >>= 1) == 0) \
496 void rtg_drawline (int16_t x1_, int16_t y1_, int16_t x2_, int16_t y2_, uint16_t len, uint16_t pattern, uint16_t pattern_offset, uint32_t fgcol, uint32_t bgcol, uint16_t pitch, uint16_t format, uint8_t mask, uint8_t draw_mode) {
497 if (pattern_offset) {}
499 int16_t x1 = x1_, y1 = y1_;
500 int16_t x2 = x1_ + x2_, y2 = y1 + y2_;
501 uint16_t cur_bit = 0x8000;
502 uint32_t color_mask = 0xFFFF0000;
505 uint32_t fg_color[3] = {
507 htobe16((fgcol & 0xFFFF)),
510 uint32_t bg_color[3] = {
512 htobe16((bgcol & 0xFFFF)),
516 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (y1 * pitch)];
518 int32_t line_step = pitch;
521 int16_t dx, dy, dx_abs, dy_abs, ix, iy, x = x1;
535 if (draw_mode & DRAWMODE_INVERSVID)
537 if (draw_mode & DRAWMODE_COMPLEMENT) {
544 if (dx_abs >= dy_abs) {
545 if (!len) len = dx_abs;
546 for (uint16_t i = 0; i < len; i++) {
558 if (!len) len = dy_abs;
559 for (uint16_t i = 0; i < len; i++) {
572 #define HANDLE_MINTERM_PIXEL_8(s, d, f) \
576 SET_RTG_PIXEL_MASK(&d, s, f); break; \
577 case MINTERM_ONLYDST: \
578 d = d & ~(s); break; \
579 case MINTERM_NOTSRC: \
580 SET_RTG_PIXEL_MASK(&d, s, f); break; \
581 case MINTERM_ONLYSRC: \
583 SET_RTG_PIXEL_MASK(&d, s, f); break; \
584 case MINTERM_INVERT: \
589 s = ~(d & ~(s)) & mask; \
590 SET_RTG_PIXEL_MASK(&d, s, f); break; \
593 SET_RTG_PIXEL_MASK(&d, s, f); break; \
595 d ^= (s & mask); break; \
596 case MINTERM_DST: /* This one does nothing. */ \
598 case MINTERM_NOTONLYSRC: \
599 d |= (s & mask); break; \
601 SET_RTG_PIXEL_MASK(&d, s, f); break; \
602 case MINTERM_NOTONLYDST: \
603 s = ~(d & s) & mask; \
604 SET_RTG_PIXEL_MASK(&d, s, f); break; \
606 d |= (s & mask); break; \
610 #define DECODE_PLANAR_PIXEL(a) \
612 case 8: if (layer_mask & 0x80 && bmp_data[(plane_size * 7) + cur_byte] & cur_bit) a |= 0x80; \
613 case 7: if (layer_mask & 0x40 && bmp_data[(plane_size * 6) + cur_byte] & cur_bit) a |= 0x40; \
614 case 6: if (layer_mask & 0x20 && bmp_data[(plane_size * 5) + cur_byte] & cur_bit) a |= 0x20; \
615 case 5: if (layer_mask & 0x10 && bmp_data[(plane_size * 4) + cur_byte] & cur_bit) a |= 0x10; \
616 case 4: if (layer_mask & 0x08 && bmp_data[(plane_size * 3) + cur_byte] & cur_bit) a |= 0x08; \
617 case 3: if (layer_mask & 0x04 && bmp_data[(plane_size * 2) + cur_byte] & cur_bit) a |= 0x04; \
618 case 2: if (layer_mask & 0x02 && bmp_data[plane_size + cur_byte] & cur_bit) a |= 0x02; \
619 case 1: if (layer_mask & 0x01 && bmp_data[cur_byte] & cur_bit) a |= 0x01; \
623 #define DECODE_INVERTED_PLANAR_PIXEL(a) \
625 case 8: if (layer_mask & 0x80 && (bmp_data[(plane_size * 7) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x80; \
626 case 7: if (layer_mask & 0x40 && (bmp_data[(plane_size * 6) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x40; \
627 case 6: if (layer_mask & 0x20 && (bmp_data[(plane_size * 5) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x20; \
628 case 5: if (layer_mask & 0x10 && (bmp_data[(plane_size * 4) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x10; \
629 case 4: if (layer_mask & 0x08 && (bmp_data[(plane_size * 3) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x08; \
630 case 3: if (layer_mask & 0x04 && (bmp_data[(plane_size * 2) + cur_byte] ^ 0xFF) & cur_bit) a |= 0x04; \
631 case 2: if (layer_mask & 0x02 && (bmp_data[plane_size + cur_byte] ^ 0xFF) & cur_bit) a |= 0x02; \
632 case 1: if (layer_mask & 0x01 && (bmp_data[cur_byte] ^ 0xFF) & cur_bit) a |= 0x01; \
636 void rtg_p2c (int16_t sx, int16_t sy, int16_t dx, int16_t dy, int16_t w, int16_t h, uint8_t draw_mode, uint8_t planes, uint8_t mask, uint8_t layer_mask, uint16_t src_line_pitch, uint8_t *bmp_data_src) {
637 uint16_t pitch = rtg_x[3];
638 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (dy * pitch)];
640 uint8_t cur_bit, base_bit, base_byte;
641 uint16_t cur_byte = 0, u8_fg = 0;
642 uint32_t color_mask = 0xFFFFFFFF;
644 uint32_t plane_size = src_line_pitch * h;
645 uint8_t *bmp_data = bmp_data_src;
647 cur_bit = base_bit = (0x80 >> (sx % 8));
648 cur_byte = base_byte = ((sx / 8) % src_line_pitch);
650 if (realtime_graphics_debug) {
651 printf("P2C: %d,%d - %d,%d (%dx%d) %d, %.2X\n", sx, sy, dx, dy, w, h, planes, layer_mask);
652 printf("Mask: %.2X Minterm: %.2X\n", mask, draw_mode);
653 printf("Pitch: %d Src Pitch: %d (!!!: %.4X)\n", pitch, src_line_pitch, rtg_user[0]);
654 printf("Curbyte: %d Curbit: %d\n", cur_byte, cur_bit);
655 printf("Plane size: %d Total size: %d (%X)\n", plane_size, plane_size * planes, plane_size * planes);
656 printf("Source: %.8X - %.8X\n", rtg_address[1], rtg_address_adj[1]);
657 printf("Target: %.8X - %.8X\n", rtg_address[0], rtg_address_adj[0]);
660 printf("Grabbing data from RTG memory.\nData:\n");
661 for (int i = 0; i < h; i++) {
662 for (int k = 0; k < planes; k++) {
663 for (int j = 0; j < src_line_pitch; j++) {
664 printf("%.2X", bmp_data_src[j + (i * src_line_pitch) + (plane_size * k)]);
672 for (int16_t line_y = 0; line_y < h; line_y++) {
673 for (int16_t x = dx; x < dx + w; x++) {
675 if (draw_mode & 0x01) {
676 DECODE_INVERTED_PLANAR_PIXEL(u8_fg)
679 DECODE_PLANAR_PIXEL(u8_fg)
682 if (mask == 0xFF && (draw_mode == MINTERM_SRC || draw_mode == MINTERM_NOTSRC)) {
687 //HANDLE_MINTERM_PIXEL_8(u8_fg, ((uint8_t *)dptr)[x]);
688 HANDLE_MINTERM_PIXEL_8(u8_fg, dptr[x], rtg_display_format);
691 if ((cur_bit >>= 1) == 0) {
694 cur_byte %= src_line_pitch;
699 if ((line_y + sy + 1) % h)
700 bmp_data += src_line_pitch;
702 bmp_data = bmp_data_src;
704 cur_byte = base_byte;
708 //void rtg_p2c_broken(int16_t sx, int16_t sy, int16_t dx, int16_t dy, int16_t w, int16_t h, uint16_t pitch, uint8_t mask, uint8_t minterm, uint8_t depth, uint16_t planemask_) {
709 /*uint8_t *planeptr_src = &rtg_mem[rtg_address_adj[1]];
710 uint8_t *dptr = &rtg_mem[rtg_address_adj[0] + (dy * pitch)];
712 uint8_t cur_bit, base_bit, base_byte;
713 uint16_t cur_byte = 0;//, color = 0;
714 uint16_t srcpitch = rtg_user[1];
715 uint32_t plane_size = srcpitch * rtg_y[3];
716 uint32_t color_mask = 0x00FFFFFF;
719 uint8_t planemask = planemask_ & 0xFF;
720 uint8_t planemask_0 = (planemask_ >> 8);
722 cur_bit = base_bit = (0x80 >> (sx % 8));
723 cur_byte = base_byte = ((sx / 8) % srcpitch);
725 planeptr_src += (srcpitch * sy);
727 if (realtime_graphics_debug) {
728 uint8_t *sptr = NULL;
730 printf("P2C: %d,%d - %d,%d (%dx%d) %d, %.4X\n", sx, sy, dx, dy, w, h, depth, planemask_);
731 printf("Mask: %.2X Minterm: %.2X\n", mask, minterm);
732 printf("Pitch: %d Src Pitch: %d (!!!: %d)\n", pitch, srcpitch, rtg_user[1]);
733 printf("Curbyte: %d Curbit: %d\n", cur_byte, cur_bit);
734 printf("Plane size: %d Total size: %d (%X)\n", plane_size, plane_size * depth, plane_size * depth);
735 printf("Source: %.8X - %.8X\n", rtg_address[1], rtg_address_adj[1]);
736 printf("Target: %.8X - %.8X\n", rtg_address[0], rtg_address_adj[0]);
739 printf("Origin: %.8X\n", rtg_address[2]);
740 printf("Grabbing data from RTG memory.\nData:\n");
741 for (int i = 0; i < h; i++) {
742 for (int k = 0; k < depth; k++) {
743 for (int j = 0; j < srcpitch; j++) {
744 printf("%.2X", planeptr_src[j + (i * srcpitch) + (plane_size * k)]);
751 printf("Data available at origin:\n");
752 for (int i = 0; i < h; i++) {
753 for (int k = 0; k < depth; k++) {
754 for (int j = 0; j < srcpitch; j++) {
755 printf("%.2X", read8(rtg_address[2] + j + (i * srcpitch) + (plane_size * k)));
764 for (int16_t line_y = 0; line_y < h; line_y++) {
765 for (int16_t xs = dx; xs < dx + w; xs++) {
767 if (minterm & 0x01) {
768 //printf("Decode inverted planar pixel.\n");
769 DECODE_INVERTED_PLANAR_PIXEL(color, planeptr_src);
772 //printf("Decode planar pixel.\n");
773 DECODE_PLANAR_PIXEL(color, planeptr_src);
776 if (mask == 0xFF && (minterm == MINTERM_SRC || minterm == MINTERM_NOTSRC)) {
777 dptr[xs << rtg_display_format] = color;
781 //printf("Place pixel.\n");
782 HANDLE_MINTERM_PIXEL_8(color, dptr[xs << rtg_display_format], rtg_display_format);
785 if ((cur_bit >>= 1) == 0) {
788 cur_byte %= srcpitch;
792 //if (line_y + sy + 1 == rtg_y[3])
793 //planeptr_src = &rtg_mem[rtg_address_adj[1]];// + (srcpitch * sy);
795 planeptr_src += srcpitch;
797 cur_byte = base_byte;