From 411a64553dc13e871ea1025323acab8b590de9db Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 14 Sep 2021 02:08:11 +0200 Subject: [PATCH] Implemented S3 Cursor Right Addressing. --- src/video/vid_s3.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 8c204b43e..8d2bf363a 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -1886,6 +1886,16 @@ s3_hwcursor_draw(svga_t *svga, int displine) int xx; int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff; uint32_t fg, bg; + uint32_t real_addr; + + if ((svga->bpp == 8) && ((svga->gdcreg[5] & 0x60) >= 0x20) && (svga->crtc[0x45] & 0x10)) { + real_addr = (svga->hwcursor_latch.addr & 0xfffff000); + if ((svga->gdcreg[5] & 0x60) >= 0x40) + real_addr = (real_addr | ((svga->hwcursor_latch.addr & 0x200) << 2)) + 0x200; + else if ((svga->gdcreg[5] & 0x60) == 0x20) + real_addr = (real_addr | ((svga->hwcursor_latch.addr & 0x300) << 2)) + 0x100; + } else + real_addr = svga->hwcursor_latch.addr; switch (svga->bpp) {