Improved 32x32 cursor support.

This commit is contained in:
OBattler
2020-10-18 01:18:46 +02:00
parent 4814c5385a
commit f2938551fa
8 changed files with 10 additions and 10 deletions

View File

@@ -3303,6 +3303,7 @@ static void *mach64_common_init(const device_t *info)
mach64_in, mach64_out,
NULL,
mach64_overlay_draw);
s3->svga.dac_hwcursor.ysize = 64;
if (info->flags & DEVICE_PCI)
mem_mapping_disable(&mach64->bios_rom.mapping);

View File

@@ -170,7 +170,6 @@ bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *
if (ramdac->type >= BT485A)
bt48x_set_bpp(ramdac, svga);
svga->dac_hwcursor.xsize = svga->dac_hwcursor.ysize = (val & 4) ? 64 : 32;
svga->dac_hwcursor.yoff = (svga->dac_hwcursor.ysize == 32) ? 32 : 0;
svga->dac_hwcursor.x = ramdac->hwc_x - svga->dac_hwcursor.xsize;
svga->dac_hwcursor.y = ramdac->hwc_y - svga->dac_hwcursor.ysize;
svga->dac_addr = (svga->dac_addr & 0x00ff) | ((val & 0x03) << 8);

View File

@@ -382,7 +382,6 @@ gd54xx_out(uint16_t addr, uint8_t val, void *p)
((val & CIRRUS_CURSOR_LARGE) && (svga->crtc[0x27] >= CIRRUS_ID_CLGD5422)) ? 64 : 32;
else
svga->hwcursor.xsize = 32;
svga->hwcursor.yoff = (svga->hwcursor.ysize == 32) ? 32 : 0;
if ((svga->seqregs[0x12] & CIRRUS_CURSOR_LARGE) && (svga->crtc[0x27] >= CIRRUS_ID_CLGD5422))
svga->hwcursor.addr = ((gd54xx->vram_size - 0x4000) + ((svga->seqregs[0x13] & 0x3c) * 256));
@@ -3208,8 +3207,7 @@ static void
io_sethandler(0x03c0, 0x0020, gd54xx_in, NULL, NULL, gd54xx_out, NULL, NULL, gd54xx);
svga->hwcursor.yoff = 32;
svga->hwcursor.xoff = 0;
svga->hwcursor.yoff = svga->hwcursor.xoff = 0;
if (id >= CIRRUS_ID_CLGD5420) {
gd54xx->vclk_n[0] = 0x4a;

View File

@@ -1297,6 +1297,7 @@ void *et4000w32p_init(const device_t *info)
et4000w32p_in, et4000w32p_out,
et4000w32p_hwcursor_draw,
NULL);
s3->svga.hwcursor.ysize = 64;
et4000->svga.ramdac = device_add(&stg_ramdac_device);

View File

@@ -4336,6 +4336,7 @@ static void *s3_init(const device_t *info)
NULL);
}
}
s3->svga.hwcursor.ysize = 64;
if (chip == S3_VISION964)
svga->dac_hwcursor_draw = bt48x_hwcursor_draw;

View File

@@ -3668,6 +3668,7 @@ static void *s3_virge_init(const device_t *info)
s3_virge_in, s3_virge_out,
s3_virge_hwcursor_draw,
s3_virge_overlay_draw);
s3->svga.hwcursor.ysize = 64;
virge->pci = !!(info->flags & DEVICE_PCI);

View File

@@ -615,24 +615,24 @@ svga_poll(void *p)
if (!svga->linepos) {
if (svga->displine == svga->hwcursor_latch.y && svga->hwcursor_latch.ena) {
svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff;
svga->hwcursor_on = svga->hwcursor.ysize - svga->hwcursor_latch.yoff;
svga->hwcursor_oddeven = 0;
}
if (svga->displine == (svga->hwcursor_latch.y + 1) && svga->hwcursor_latch.ena &&
svga->interlace) {
svga->hwcursor_on = 64 - (svga->hwcursor_latch.yoff + 1);
svga->hwcursor_on = svga->hwcursor.ysize - (svga->hwcursor_latch.yoff + 1);
svga->hwcursor_oddeven = 1;
}
if (svga->displine == svga->dac_hwcursor_latch.y && svga->dac_hwcursor_latch.ena) {
svga->dac_hwcursor_on = 64 - svga->dac_hwcursor_latch.yoff;
svga->dac_hwcursor_on = svga->dac_wcursor.ysize - svga->dac_hwcursor_latch.yoff;
svga->dac_hwcursor_oddeven = 0;
}
if (svga->displine == (svga->dac_hwcursor_latch.y + 1) && svga->dac_hwcursor_latch.ena &&
svga->interlace) {
svga->dac_hwcursor_on = 64 - (svga->dac_hwcursor_latch.yoff + 1);
svga->dac_hwcursor_on = svga->dac_hwcursor.ysize - (svga->dac_hwcursor_latch.yoff + 1);
svga->dac_hwcursor_oddeven = 1;
}

View File

@@ -388,7 +388,7 @@ void tgui_out(uint16_t addr, uint8_t val, void *p)
svga->hwcursor.x = (svga->crtc[0x40] | (svga->crtc[0x41] << 8)) & 0x7ff;
svga->hwcursor.y = (svga->crtc[0x42] | (svga->crtc[0x43] << 8)) & 0x7ff;
svga->hwcursor.xoff = svga->crtc[0x46] & 0x3f;
svga->hwcursor.yoff = (svga->crtc[0x47] & 0x3f) + ((svga->hwcursor.ysize == 32) ? 32 : 0);
svga->hwcursor.yoff = svga->crtc[0x47] & 0x3f;
svga->hwcursor.addr = (svga->crtc[0x44] << 10) | ((svga->crtc[0x45] & 0x7) << 18) | (svga->hwcursor.yoff * 8);
}
break;
@@ -399,7 +399,6 @@ void tgui_out(uint16_t addr, uint8_t val, void *p)
svga->hwcursor.ena = val & 0x80;
svga->hwcursor.xsize = (val & 1) ? 64 : 32;
svga->hwcursor.ysize = (val & 1) ? 64 : 32;
svga->hwcursor.yoff = (svga->crtc[0x47] & 0x3f) + ((svga->hwcursor.ysize == 32) ? 32 : 0);
}
break;
}