Fixed S3 and ViRGE hardware cursor clipping, fixes #1733.

This commit is contained in:
OBattler
2021-09-25 14:21:43 +02:00
parent 73cac00119
commit 52e7b9b772
2 changed files with 10 additions and 10 deletions

View File

@@ -1846,11 +1846,11 @@ s3_hwcursor_draw(svga_t *svga, int displine)
if (svga->crtc[0x55] & 0x10) {
/*X11*/
for (xx = 0; xx < 16; xx++) {
if (offset >= svga->hwcursor_latch.x) {
if (offset >= 0) {
if (dat[0] & 0x8000)
buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg;
}
offset++;
dat[0] <<= shift;
dat[1] <<= shift;
@@ -1858,16 +1858,16 @@ s3_hwcursor_draw(svga_t *svga, int displine)
} else {
/*Windows*/
for (xx = 0; xx < width; xx++) {
if (offset >= svga->hwcursor_latch.x) {
if (offset >= 0) {
if (!(dat[0] & 0x8000))
buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg;
else if (dat[1] & 0x8000)
buffer32->line[displine][offset + svga->x_add] ^= 0xffffff;
}
offset++;
dat[0] <<= shift;
dat[1] <<= shift;
}
offset++;
dat[0] <<= shift;
dat[1] <<= shift;
}
}
svga->hwcursor_latch.addr += 4;

View File

@@ -3316,7 +3316,7 @@ static void s3_virge_hwcursor_draw(svga_t *svga, int displine)
/*X11*/
for (xx = 0; xx < 16; xx++)
{
if (offset >= svga->hwcursor_latch.x)
if (offset >= 0)
{
if (dat[0] & 0x8000)
buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg;
@@ -3332,7 +3332,7 @@ static void s3_virge_hwcursor_draw(svga_t *svga, int displine)
/*Windows*/
for (xx = 0; xx < 16; xx++)
{
if (offset >= svga->hwcursor_latch.x)
if (offset >= 0)
{
if (!(dat[0] & 0x8000))
buffer32->line[displine][offset + svga->x_add] = (dat[1] & 0x8000) ? fg : bg;