Merge pull request #4181 from Cacodemon345/chips_69000_black_cursor_64x64_fix
C&T 69000: Fix black cursor on Red Hat Linux 8
This commit is contained in:
@@ -2287,6 +2287,35 @@ chips_69000_vblank_start(svga_t *svga)
|
||||
chips_69000_interrupt(chips);
|
||||
}
|
||||
|
||||
static void
|
||||
chips_69000_hwcursor_draw_64x64(svga_t *svga, int displine)
|
||||
{
|
||||
chips_69000_t *chips = (chips_69000_t *) svga->priv;
|
||||
uint64_t dat[2];
|
||||
int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff;
|
||||
|
||||
if (svga->interlace && svga->hwcursor_oddeven)
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
|
||||
dat[1] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr]));
|
||||
dat[0] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
|
||||
for (uint8_t x = 0; x < 64; x++) {
|
||||
if (!(dat[1] & (1ULL << 63)))
|
||||
svga->monitor->target_buffer->line[displine][(offset + svga->x_add) & 2047] = (dat[0] & (1ULL << 63)) ? svga_lookup_lut_ram(svga, chips->cursor_pallook[5]) : svga_lookup_lut_ram(svga, chips->cursor_pallook[4]);
|
||||
else if (dat[0] & (1ULL << 63))
|
||||
svga->monitor->target_buffer->line[displine][(offset + svga->x_add) & 2047] ^= 0xffffff;
|
||||
|
||||
offset++;
|
||||
dat[0] <<= 1;
|
||||
dat[1] <<= 1;
|
||||
}
|
||||
|
||||
if (svga->interlace && !svga->hwcursor_oddeven)
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
}
|
||||
|
||||
static void
|
||||
chips_69000_hwcursor_draw(svga_t *svga, int displine)
|
||||
{
|
||||
@@ -2294,7 +2323,10 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
|
||||
uint64_t dat[2];
|
||||
int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff;
|
||||
|
||||
if (svga->interlace && (chips->ext_regs[0xa0] & 7) == 0b1) {
|
||||
if ((chips->ext_regs[0xa0] & 7) == 0b101)
|
||||
return chips_69000_hwcursor_draw_64x64(svga, displine);
|
||||
|
||||
if (svga->interlace) {
|
||||
dat[1] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr]));
|
||||
dat[0] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
@@ -2315,10 +2347,7 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
|
||||
return;
|
||||
}
|
||||
|
||||
if (svga->interlace && svga->hwcursor_oddeven)
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
|
||||
if ((svga->hwcursor_on & 1) && (chips->ext_regs[0xa0] & 7) == 0b1) {
|
||||
if ((svga->hwcursor_on & 1)) {
|
||||
dat[1] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr - 16]));
|
||||
dat[0] = bswap64(*(uint64_t *) (&svga->vram[(svga->hwcursor_latch.addr - 16) + 8]));
|
||||
dat[1] <<= 32ULL;
|
||||
@@ -2329,10 +2358,8 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
|
||||
dat[0] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
}
|
||||
switch (chips->ext_regs[0xa0] & 7) {
|
||||
case 0b1:
|
||||
case 0b101:
|
||||
for (uint8_t x = 0; x < (((chips->ext_regs[0xa0] & 7) == 0b1) ? 32 : 64); x++) {
|
||||
|
||||
for (uint8_t x = 0; x < 32; x++) {
|
||||
if (!(dat[1] & (1ULL << 63)))
|
||||
svga->monitor->target_buffer->line[displine & 2047][(offset + svga->x_add) & 2047] = (dat[0] & (1ULL << 63)) ? svga_lookup_lut_ram(svga, chips->cursor_pallook[5]) : svga_lookup_lut_ram(svga, chips->cursor_pallook[4]);
|
||||
else if (dat[0] & (1ULL << 63))
|
||||
@@ -2342,14 +2369,6 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
|
||||
dat[0] <<= 1;
|
||||
dat[1] <<= 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (svga->interlace && !svga->hwcursor_oddeven)
|
||||
svga->hwcursor_latch.addr += 16;
|
||||
}
|
||||
|
||||
static float
|
||||
|
Reference in New Issue
Block a user