[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 06/16] sm501: Implement negated destination raster oper
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 06/16] sm501: Implement negated destination raster operation mode |
Date: |
Mon, 9 Jul 2018 17:43:40 +1000 |
From: Sebastian Bauer <address@hidden>
Add support for the negated destination operation mode. This is used e.g.
by AmigaOS for the INVERSEVID drawing mode. With this change, the cursor
in the shell and non-immediate window adjustment are working now.
Signed-off-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/display/sm501.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index d4878f01c0..0b44d95169 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -705,6 +705,8 @@ static void sm501_2d_operation(SM501State *s)
uint32_t color = s->twoD_foreground;
int format_flags = (s->twoD_stretch >> 20) & 0x3;
int addressing = (s->twoD_stretch >> 16) & 0xF;
+ int rop_mode = (s->twoD_control >> 15) & 0x1; /* 1 for rop2, else rop3 */
+ int rop = s->twoD_control & 0xFF;
/* get frame buffer info */
uint8_t *src = s->local_mem + (s->twoD_source_base & 0x03FFFFFF);
@@ -729,6 +731,8 @@ static void sm501_2d_operation(SM501State *s)
int y, x, index_d, index_s; \
for (y = 0; y < operation_height; y++) { \
for (x = 0; x < operation_width; x++) { \
+ _pixel_type val; \
+ \
if (rtl) { \
index_s = ((src_y - y) * src_width + src_x - x) * _bpp; \
index_d = ((dst_y - y) * dst_width + dst_x - x) * _bpp; \
@@ -736,7 +740,13 @@ static void sm501_2d_operation(SM501State *s)
index_s = ((src_y + y) * src_width + src_x + x) * _bpp; \
index_d = ((dst_y + y) * dst_width + dst_x + x) * _bpp; \
} \
- *(_pixel_type *)&dst[index_d] = *(_pixel_type *)&src[index_s];\
+ if (rop_mode == 1 && rop == 5) { \
+ /* Invert dest */ \
+ val = ~*(_pixel_type *)&dst[index_d]; \
+ } else { \
+ val = *(_pixel_type *)&src[index_s]; \
+ } \
+ *(_pixel_type *)&dst[index_d] = val; \
} \
} \
}
--
2.17.1
- [Qemu-ppc] [PULL 00/16] ppc-for-3.0 queue 20180709, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 04/16] sm501: Perform a full update after palette change, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 02/16] spapr/vio: quiet down the "irq" property accessors, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 05/16] sm501: Use values from the pitch register for 2D operations, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 12/16] ppc: fix default VGA display for PReP machines, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 03/16] sm501: Implement i2c part for reading monitor EDID, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 06/16] sm501: Implement negated destination raster operation mode,
David Gibson <=
- [Qemu-ppc] [PULL 13/16] sam460ex: Update u-boot-sam460ex firmware, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 01/16] ppc: fix default VGA display for Mac machines, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 09/16] sm501: Set updated region dirty after 2D operation, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 07/16] sm501: Log unimplemented raster operation modes, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 11/16] target/ppc: fix build on ppc64 host, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 10/16] ppc440_uc: Fix a copy/paste error, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 14/16] sam460ex: Check for errors from libfdt functions, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 16/16] sam460ex: Make sam460ex_load_device_tree() handle all errors internally, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 08/16] sm501: Fix support for non-zero frame buffer start address, David Gibson, 2018/07/09
- [Qemu-ppc] [PULL 15/16] sam460ex: Don't check for errors from qemu_fdt_*(), David Gibson, 2018/07/09