Skip to content

Commit d646efc

Browse files
committed
Fix hardware cursor in interlaced modes
Report 1280*1024 Dual Scan STN Color Panel for now
1 parent da3203a commit d646efc

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

src/video/vid_c&t_69000.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ chips_69000_read_flat_panel(chips_69000_t* chips)
209209
return 0;
210210
case 1:
211211
return 1;
212+
case 0x10:
213+
return 1;
212214
default:
213215
return chips->flat_panel_regs[chips->flat_panel_index];
214216
}
@@ -1425,7 +1427,7 @@ chips_69000_read_ext_reg(chips_69000_t* chips)
14251427
val = 0x3;
14261428
break;
14271429
case 0x71:
1428-
val = 0x0;
1430+
val = 0b01101000;
14291431
break;
14301432
case 0xD0:
14311433
val |= 1;
@@ -2186,29 +2188,26 @@ chips_69000_hwcursor_draw(svga_t *svga, int displine)
21862188
uint64_t dat[2];
21872189
int offset = svga->hwcursor_latch.x - svga->hwcursor_latch.xoff;
21882190

2189-
#if 0
2190-
if ((chips->ext_regs[0xA0] & 7) == 1) {
2191-
uint32_t evenline = svga->hwcursor_latch.cur_ysize - ((svga->hwcursor_on) & ~1) >> 1;
2192-
uint32_t dat_32[2];
2193-
2194-
dat_32[1] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr + (((displine - svga->hwcursor_latch.y) & 1) ? 4 : 0)]));
2195-
dat_32[0] = bswap32(*(uint32_t *) (&svga->vram[svga->hwcursor_latch.addr + 8 + (((displine - svga->hwcursor_latch.y) & 1) ? 4 : 0)]));
2196-
svga->hwcursor_latch.addr = svga->hwcursor.addr + (evenline * 16);
2197-
2191+
if (svga->interlace && (chips->ext_regs[0xa0] & 7) == 0b1) {
2192+
dat[1] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr]));
2193+
dat[0] = bswap64(*(uint64_t *) (&svga->vram[svga->hwcursor_latch.addr + 8]));
2194+
svga->hwcursor_latch.addr += 16;
2195+
if (svga->hwcursor_oddeven) {
2196+
dat[1] <<= 32ULL;
2197+
dat[0] <<= 32ULL;
2198+
}
21982199
for (uint8_t x = 0; x < 32; x++) {
2199-
if (!(dat_32[1] & (1ULL << 31)))
2200-
svga->monitor->target_buffer->line[displine][offset + svga->x_add] = (dat_32[0] & (1ULL << 31)) ? svga_lookup_lut_ram(svga, chips->cursor_pallook[4]) : svga_lookup_lut_ram(svga, chips->cursor_pallook[5]);
2201-
else if (dat_32[0] & (1ULL << 31))
2202-
svga->monitor->target_buffer->line[displine][offset + svga->x_add] ^= 0xffffff;
2200+
if (!(dat[1] & (1ULL << 63)))
2201+
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]);
2202+
else if (dat[0] & (1ULL << 63))
2203+
svga->monitor->target_buffer->line[displine & 2047][(offset + svga->x_add) & 2047] ^= 0xffffff;
22032204

22042205
offset++;
2205-
dat_32[0] <<= 1;
2206-
dat_32[1] <<= 1;
2206+
dat[0] <<= 1;
2207+
dat[1] <<= 1;
22072208
}
2208-
22092209
return;
22102210
}
2211-
#endif
22122211

22132212
if (svga->interlace && svga->hwcursor_oddeven)
22142213
svga->hwcursor_latch.addr += 16;
@@ -2339,8 +2338,6 @@ chips_69000_init(const device_t *info)
23392338

23402339
chips->flat_panel_regs[0x01] = 1;
23412340

2342-
sizeof(struct chips_69000_bitblt_t);
2343-
23442341
return chips;
23452342
}
23462343

0 commit comments

Comments
 (0)