[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 091/126] hw/display/sm501: Implement more 2D raster operations
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 091/126] hw/display/sm501: Implement more 2D raster operations |
Date: |
Mon, 27 Feb 2023 15:01:38 +0100 |
From: BALATON Zoltan <balaton@eik.bme.hu>
Add simple implementation for two raster operations that are used by
AmigaOS which fixes graphics problems in some programs using these.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reported-by: Rene Engel <ReneEngel80@emailn.de>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id:
<17ef3c59dc7868f75034e9ebe21e2999c8f718d4.1677445307.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/display/sm501.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index bb53499dff..c4c567d977 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -754,7 +754,7 @@ static void sm501_2d_operation(SM501State *s)
}
if ((rop_mode && rop == 0x5) || (!rop_mode && rop == 0x55)) {
- /* Invert dest, is there a way to do this with pixman? */
+ /* DSTINVERT, is there a way to do this with pixman? */
unsigned int x, y, i;
uint8_t *d = s->local_mem + dst_base;
@@ -764,6 +764,34 @@ static void sm501_2d_operation(SM501State *s)
stn_he_p(&d[i], bypp, ~ldn_he_p(&d[i], bypp));
}
}
+ } else if (!rop_mode && rop == 0x99) {
+ /* DSxn, is there a way to do this with pixman? */
+ unsigned int x, y, i, j;
+ uint8_t *sp = s->local_mem + src_base;
+ uint8_t *d = s->local_mem + dst_base;
+
+ for (y = 0; y < height; y++) {
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
+ j = (src_x + (src_y + y) * src_pitch) * bypp;
+ for (x = 0; x < width; x++, i += bypp, j += bypp) {
+ stn_he_p(&d[i], bypp,
+ ~(ldn_he_p(&sp[j], bypp) ^ ldn_he_p(&d[i],
bypp)));
+ }
+ }
+ } else if (!rop_mode && rop == 0xee) {
+ /* SRCPAINT, is there a way to do this with pixman? */
+ unsigned int x, y, i, j;
+ uint8_t *sp = s->local_mem + src_base;
+ uint8_t *d = s->local_mem + dst_base;
+
+ for (y = 0; y < height; y++) {
+ i = (dst_x + (dst_y + y) * dst_pitch) * bypp;
+ j = (src_x + (src_y + y) * src_pitch) * bypp;
+ for (x = 0; x < width; x++, i += bypp, j += bypp) {
+ stn_he_p(&d[i], bypp,
+ ldn_he_p(&sp[j], bypp) | ldn_he_p(&d[i], bypp));
+ }
+ }
} else {
/* Do copy src for unimplemented ops, better than unpainted area */
if ((rop_mode && (rop != 0xc || rop2_source_is_pattern)) ||
--
2.38.1
- [PULL 082/126] hw/usb/ohci: Move a function next to where it is used, (continued)
- [PULL 082/126] hw/usb/ohci: Move a function next to where it is used, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 079/126] hw/usb/ohci: Code style fix comments, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 083/126] hw/usb/ohci: Add trace points for register access, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 084/126] hw/usb/ohci: Fix typo, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 087/126] hw/usb/xhci-nec: Declare QOM macros for NEC_XHCI, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 089/126] hw/display/sm501: Embed OHCI QOM child in chipset, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 086/126] hw/usb/uhci: Replace container_of() by UHCI_GET_CLASS() QOM macro, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 088/126] hw/usb/xhci-nec: Replace container_of() by NEC_XHCI() QOM cast macro, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 090/126] hw/display/sm501: Alias 'dma-offset' QOM property in chipset object, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 085/126] hw/usb/uhci: Declare QOM macros using OBJECT_DECLARE_TYPE(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 091/126] hw/display/sm501: Implement more 2D raster operations,
Philippe Mathieu-Daudé <=
- [PULL 092/126] hw/display/sm501: Add fallbacks to pixman routines, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 093/126] hw/ppc/sam460ex: Correctly set MAL properties, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 094/126] block/vvfat: Remove pointless check of NDEBUG, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 095/126] scripts/checkpatch.pl: Do not allow assert(0), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 096/126] MAINTAINERS: Mark IDE and Floppy as "Odd Fixes", Philippe Mathieu-Daudé, 2023/02/27
- [PULL 099/126] hw/ide/mmio: Use CamelCase for MMIO_IDE state name, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 101/126] hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h', Philippe Mathieu-Daudé, 2023/02/27
- [PULL 103/126] hw/ide/atapi: Restrict 'scsi/constants.h' inclusion, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 098/126] hw/ide/ahci: Trace ncq write command as write instead of read, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 100/126] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h', Philippe Mathieu-Daudé, 2023/02/27