Skip to content

Commit a0078e6

Browse files
committed
Fix inverted hardware cursor color
1 parent 395941a commit a0078e6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/video/vid_c&t_69000.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,10 @@ chips_69000_setup_bitblt(chips_69000_t* chips)
11571157
}
11581158
return;
11591159
}
1160+
1161+
if (chips->bitblt_running.x_dir == -1 && chips->bitblt_running.bytes_per_pixel == 3) {
1162+
//chips->bitblt_running.actual_destination_width++;
1163+
}
11601164

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

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

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

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

2191-
if (svga->interlace && !svga->hwcursor_oddeven)
2192-
svga->hwcursor_latch.addr += oddaddr ? 8 : 4;
2193-
21942193
return;
21952194
}
21962195
#endif
@@ -2214,7 +2213,7 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
22142213
case 0b101:
22152214
for (uint8_t x = 0; x < (((chips->ext_regs[0xa0] & 7) == 0b1) ? 32 : 64); x++) {
22162215
if (!(dat[1] & (1ULL << 63)))
2217-
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]);
2216+
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]);
22182217
else if (dat[0] & (1ULL << 63))
22192218
svga->monitor->target_buffer->line[displine][offset + svga->x_add] ^= 0xffffff;
22202219

0 commit comments

Comments
 (0)