From 9e119d049716bbac59ed3838df89fad8556d461c Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 29 May 2020 20:23:33 +0200 Subject: [PATCH] Fixed the ATi Mach64 hardware cursor. --- src/video/vid_ati68860_ramdac.c | 24 ++++++++++++------------ src/video/vid_ati_mach64.c | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/video/vid_ati68860_ramdac.c b/src/video/vid_ati68860_ramdac.c index e8fa1862c..b6703a310 100644 --- a/src/video/vid_ati68860_ramdac.c +++ b/src/video/vid_ati68860_ramdac.c @@ -255,25 +255,25 @@ ati68860_hwcursor_draw(svga_t *svga, int displine) uint32_t col0 = ramdac->pallook[0]; uint32_t col1 = ramdac->pallook[1]; - offset = svga->hwcursor_latch.xoff; - for (x = 0; x < 64 - svga->hwcursor_latch.xoff; x += 4) { - dat = svga->vram[svga->hwcursor_latch.addr + (offset >> 2)]; - if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0; - else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF; + offset = svga->dac_hwcursor_latch.xoff; + for (x = 0; x < 64 - svga->dac_hwcursor_latch.xoff; x += 4) { + dat = svga->vram[svga->dac_hwcursor_latch.addr + (offset >> 2)]; + if (!(dat & 2)) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add] = (dat & 1) ? col1 : col0; + else if ((dat & 3) == 3) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add] ^= 0xFFFFFF; dat >>= 2; - if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 1] = (dat & 1) ? col1 : col0; - else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 1] ^= 0xFFFFFF; + if (!(dat & 2)) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 1] = (dat & 1) ? col1 : col0; + else if ((dat & 3) == 3) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 1] ^= 0xFFFFFF; dat >>= 2; - if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 2] = (dat & 1) ? col1 : col0; - else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 2] ^= 0xFFFFFF; + if (!(dat & 2)) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 2] = (dat & 1) ? col1 : col0; + else if ((dat & 3) == 3) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 2] ^= 0xFFFFFF; dat >>= 2; - if (!(dat & 2)) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 3] = (dat & 1) ? col1 : col0; - else if ((dat & 3) == 3) buffer32->line[displine][svga->hwcursor_latch.x + x + svga->x_add + 3] ^= 0xFFFFFF; + if (!(dat & 2)) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 3] = (dat & 1) ? col1 : col0; + else if ((dat & 3) == 3) buffer32->line[displine][svga->dac_hwcursor_latch.x + x + svga->x_add + 3] ^= 0xFFFFFF; dat >>= 2; offset += 4; } - svga->hwcursor_latch.addr += 16; + svga->dac_hwcursor_latch.addr += 16; } diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index e2ad8b649..fd99ac541 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -2276,19 +2276,19 @@ void mach64_ext_writeb(uint32_t addr, uint8_t val, void *p) break; case 0x68: case 0x69: case 0x6a: case 0x6b: WRITE8(addr, mach64->cur_offset, val); - svga->hwcursor.addr = (mach64->cur_offset & 0xfffff) * 8; + svga->dac_hwcursor.addr = (mach64->cur_offset & 0xfffff) * 8; mach64_cursor_dump(mach64); break; case 0x6c: case 0x6d: case 0x6e: case 0x6f: WRITE8(addr, mach64->cur_horz_vert_posn, val); - svga->hwcursor.x = mach64->cur_horz_vert_posn & 0x7ff; - svga->hwcursor.y = (mach64->cur_horz_vert_posn >> 16) & 0x7ff; + svga->dac_hwcursor.x = mach64->cur_horz_vert_posn & 0x7ff; + svga->dac_hwcursor.y = (mach64->cur_horz_vert_posn >> 16) & 0x7ff; mach64_cursor_dump(mach64); break; case 0x70: case 0x71: case 0x72: case 0x73: WRITE8(addr, mach64->cur_horz_vert_off, val); - svga->hwcursor.xoff = mach64->cur_horz_vert_off & 0x3f; - svga->hwcursor.yoff = (mach64->cur_horz_vert_off >> 16) & 0x3f; + svga->dac_hwcursor.xoff = mach64->cur_horz_vert_off & 0x3f; + svga->dac_hwcursor.yoff = (mach64->cur_horz_vert_off >> 16) & 0x3f; mach64_cursor_dump(mach64); break; @@ -2348,7 +2348,7 @@ void mach64_ext_writeb(uint32_t addr, uint8_t val, void *p) WRITE8(addr, mach64->gen_test_cntl, val); ati_eeprom_write(&mach64->eeprom, mach64->gen_test_cntl & 0x10, mach64->gen_test_cntl & 2, mach64->gen_test_cntl & 1); mach64->gen_test_cntl = (mach64->gen_test_cntl & ~8) | (ati_eeprom_read(&mach64->eeprom) ? 8 : 0); - svga->hwcursor.ena = mach64->gen_test_cntl & 0x80; + svga->dac_hwcursor.ena = mach64->gen_test_cntl & 0x80; mach64_cursor_dump(mach64); break;