From 1d41f99dcfcce92268408f4f9d3e71f3422d45bd Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 28 Dec 2019 05:50:22 +0100 Subject: [PATCH 1/3] Fixed the ATi Mach64 hardware cursor. --- src/video/vid_ati_mach64.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index d8fe8b8ef..03f7309f3 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -2798,14 +2798,14 @@ void mach64_hwcursor_draw(svga_t *svga, int displine) 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; dat >>= 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; + 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; dat >>= 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; + 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; dat >>= 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; + 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; dat >>= 2; offset += 4; } From 8cad1a3c4c9320102113e21e66dbab89b474f911 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 28 Dec 2019 05:50:55 +0100 Subject: [PATCH 2/3] Fixed the Tandy 320x200x4 modes. --- src/machine/m_tandy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/machine/m_tandy.c b/src/machine/m_tandy.c index e4eb3fbd3..3dbc65748 100644 --- a/src/machine/m_tandy.c +++ b/src/machine/m_tandy.c @@ -8,7 +8,7 @@ * * Emulation of Tandy models 1000, 1000HX and 1000SL2. * - * Version: @(#)m_tandy.c 1.0.10 2019/10/20 + * Version: @(#)m_tandy.c 1.0.11 2019/12/28 * * Authors: Sarah Walker, * Miran Grca, @@ -74,11 +74,7 @@ typedef struct { int crtcreg; int array_index; -#if 0 - uint8_t array[32]; -#else uint8_t array[256]; -#endif int memctrl; uint8_t mode, col; uint8_t stat; @@ -95,13 +91,13 @@ typedef struct { int con, coff, cursoron, blink; - int vsynctime; + int vsynctime; int vadj; uint16_t ma, maback; uint64_t dispontime, dispofftime; - pc_timer_t timer; + pc_timer_t timer; int firstline, lastline; @@ -857,8 +853,8 @@ vid_poll(void *priv) } } } else if (! (vid->mode & 16)) { - cols[0] = (vid->col & 15) | 16; - col = (vid->col & 16) ? 24 : 16; + cols[0] = (vid->col & 15); + col = (vid->col & 16) ? 8 : 0; if (vid->mode & 4) { cols[1] = col | 3; cols[2] = col | 4; @@ -872,6 +868,10 @@ vid_poll(void *priv) cols[2] = col | 4; cols[3] = col | 6; } + cols[0] = vid->array[(cols[0] & vid->array[1]) + 16] + 16; + cols[1] = vid->array[(cols[1] & vid->array[1]) + 16] + 16; + cols[2] = vid->array[(cols[2] & vid->array[1]) + 16] + 16; + cols[3] = vid->array[(cols[3] & vid->array[1]) + 16] + 16; for (x = 0; x < vid->crtc[1]; x++) { dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) | vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1]; From f12d9c14db02e8761ea2028cc84d29796ee0b4dd Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 28 Dec 2019 05:51:22 +0100 Subject: [PATCH 3/3] Ported the (S)VGA linear read latch fix from PCem. --- src/video/vid_svga.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 5de05c59e..a07764f12 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -11,7 +11,7 @@ * This is intended to be used by another SVGA driver, * and not as a card in it's own right. * - * Version: @(#)vid_svga.c 1.0.39 2019/12/03 + * Version: @(#)vid_svga.c 1.0.40 2019/12/28 * * Authors: Sarah Walker, * Miran Grca, @@ -1119,31 +1119,21 @@ svga_read_common(uint32_t addr, uint8_t linear, void *p) addr &= svga->decode_mask; /* standard VGA latched access */ - if (linear) { - if (addr >= svga->vram_max) - return 0xff; - - addr &= svga->vram_mask; + if (latch_addr >= svga->vram_max) { + for (i = 0; i < count; i++) + svga->latch.b[i] = 0xff; + } else { + latch_addr &= svga->vram_mask; for (i = 0; i < count; i++) - svga->latch.b[i] = svga->vram[addr | i]; - } else { - if (latch_addr >= svga->vram_max) { - for (i = 0; i < count; i++) - svga->latch.b[i] = 0xff; - } else { - latch_addr &= svga->vram_mask; - - for (i = 0; i < count; i++) - svga->latch.b[i] = svga->vram[latch_addr | i]; - } - - if (addr >= svga->vram_max) - return 0xff; - - addr &= svga->vram_mask; + svga->latch.b[i] = svga->vram[latch_addr | i]; } + if (addr >= svga->vram_max) + return 0xff; + + addr &= svga->vram_mask; + if (svga->readmode) { temp = 0xff;