Skip to content

Commit

Permalink
Fix inverted hardware cursor color
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Feb 8, 2024
1 parent 395941a commit a0078e6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/video/vid_c&t_69000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,10 @@ chips_69000_setup_bitblt(chips_69000_t* chips)
}
return;
}

if (chips->bitblt_running.x_dir == -1 && chips->bitblt_running.bytes_per_pixel == 3) {
//chips->bitblt_running.actual_destination_width++;
}

if (chips->bitblt_running.bitblt.bitblt_control & (1 << 12)) {
uint32_t source_addr = chips->bitblt_running.bitblt.source_addr;
Expand Down Expand Up @@ -2168,14 +2172,12 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)

#if 0
if ((chips->ext_regs[0xA0] & 7) == 1) {
uint32_t oddaddr = (displine - svga->hwcursor_latch.y) & 1;
uint32_t evenline = svga->hwcursor_latch.cur_ysize - ((svga->hwcursor_on) & ~1) >> 1;
uint32_t dat_32[2];
if (svga->interlace && svga->hwcursor_oddeven)
svga->hwcursor_latch.addr += oddaddr ? 8 : 4;

dat_32[1] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr]));
dat_32[0] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
svga->hwcursor_latch.addr += oddaddr ? 4 : 8;
dat_32[1] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr + (((displine - svga->hwcursor_latch.y) & 1) ? 4 : 0)]));
dat_32[0] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr + 8 + (((displine - svga->hwcursor_latch.y) & 1) ? 4 : 0)]));
svga->hwcursor_latch.addr = svga->hwcursor.addr + (evenline * 16);

for (uint8_t x = 0; x < 32; x++) {
if (!(dat_32[1] & (1ULL << 31)))
Expand All @@ -2188,9 +2190,6 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
dat_32[1] <<= 1;
}

if (svga->interlace && !svga->hwcursor_oddeven)
svga->hwcursor_latch.addr += oddaddr ? 8 : 4;

return;
}
#endif
Expand All @@ -2214,7 +2213,7 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
case 0b101:
for (uint8_t x = 0; x < (((chips->ext_regs[0xa0] & 7) == 0b1) ? 32 : 64); x++) {
if (!(dat[1] & (1ULL << 63)))
svga->monitor->target_buffer->line[displine][offset + svga->x_add] = (dat[0] & (1ULL << 63)) ? svga_lookup_lut_ram(svga, chips->cursor_pallook[4]) : svga_lookup_lut_ram(svga, chips->cursor_pallook[5]);
svga->monitor->target_buffer->line[displine][offset + svga->x_add] = (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] ^= 0xffffff;

Expand Down

0 comments on commit a0078e6

Please sign in to comment.