Merge pull request #4179 from 86Box/tc1995

Some temporary video changes regarding the horizontal display.
This commit is contained in:
Miran Grča
2024-02-20 18:45:54 +01:00
committed by GitHub
3 changed files with 52 additions and 81 deletions

View File

@@ -3214,7 +3214,6 @@ s3_recalctimings(svga_t *svga)
}
svga->hdisp = svga->hdisp_old;
svga->ma_latch |= (s3->ma_ext << 16);
if (s3->chip >= S3_86C928) {
@@ -3222,7 +3221,7 @@ s3_recalctimings(svga_t *svga)
svga->htotal |= 0x100;
if (svga->crtc[0x5d] & 0x02) {
svga->hdisp_time |= 0x100;
svga->hdisp |= 0x100 * svga->dots_per_clock;
svga->hdisp |= (0x100 * svga->dots_per_clock);
}
if (svga->crtc[0x5e] & 0x01)
svga->vtotal |= 0x400;
@@ -3442,8 +3441,13 @@ s3_recalctimings(svga_t *svga)
break;
case S3_VISION968:
switch (s3->card_type) {
case S3_PHOENIX_VISION968:
case S3_MIROVIDEO40SV_ERGO_968:
if (svga->hdisp == 832)
svga->hdisp -= 32;
break;
case S3_NUMBER9_9FX_771:
case S3_PHOENIX_VISION968:
case S3_SPEA_MERCURY_P64V:
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
if (svga->hdisp == 832)
@@ -3619,8 +3623,13 @@ s3_recalctimings(svga_t *svga)
break;
case S3_VISION968:
switch (s3->card_type) {
case S3_MIROVIDEO40SV_ERGO_968:
if (svga->hdisp == 832)
svga->hdisp -= 32;
break;
case S3_NUMBER9_9FX_771:
case S3_PHOENIX_VISION968:
case S3_SPEA_MERCURY_P64V:
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
/* TODO: Is this still needed? */
@@ -3801,8 +3810,13 @@ s3_recalctimings(svga_t *svga)
break;
case S3_VISION968:
switch (s3->card_type) {
case S3_MIROVIDEO40SV_ERGO_968:
if (svga->hdisp == 832)
svga->hdisp -= 32;
break;
case S3_NUMBER9_9FX_771:
case S3_PHOENIX_VISION968:
case S3_SPEA_MERCURY_P64V:
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
/* TODO: Is this still needed? */
@@ -4003,8 +4017,13 @@ s3_recalctimings(svga_t *svga)
break;
case S3_VISION968:
switch (s3->card_type) {
case S3_MIROVIDEO40SV_ERGO_968:
if (svga->hdisp == 832)
svga->hdisp -= 32;
break;
case S3_NUMBER9_9FX_771:
case S3_PHOENIX_VISION968:
case S3_SPEA_MERCURY_P64V:
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
/* TODO: Is this still needed? */
@@ -4165,7 +4184,7 @@ s3_trio64v_recalctimings(svga_t *svga)
if ((svga->crtc[0x33] & 0x20) || ((svga->crtc[0x67] & 0xc) == 0xc)) {
/* The S3 version of the Cirrus' special blanking mode, with identical behavior. */
svga->hblankstart = (((svga->crtc[0x5d] & 0x02) >> 1) << 8) + svga->crtc[1]/* +
((svga->crtc[3] >> 5) & 3) + 1*/;
((svga->crtc[3] >> 5) & 3)*/;
svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/;
svga->monitor->mon_overscan_y = 0;

View File

@@ -794,8 +794,8 @@ svga_recalctimings(svga_t *svga)
uint32_t eff_mask = (svga->hblank_end_val & ~0x0000003f) ? svga->hblank_end_mask : 0x0000003f;
svga->hblank_sub = 0;
svga_log("Blank: %04i-%04i, Total: %04i, Mask: %02X\n", svga->hblankstart, svga->hblank_end_val,
svga->htotal, eff_mask);
svga_log("HDISP=%d, CRTC1+1=%d, Blank: %04i-%04i, Total: %04i, Mask: %02X, ADJ_DOT=%04i.\n", svga->hdisp, svga->crtc[1] + 1, svga->hblankstart, svga->hblank_end_val,
svga->htotal, eff_mask, adj_dot);
while (adj_dot < (svga->htotal << 1)) {
if (dot == svga->htotal)
@@ -804,6 +804,7 @@ svga_recalctimings(svga_t *svga)
if (adj_dot >= svga->htotal)
svga->hblank_sub++;
svga_log("Loop: adjdot=%d, htotal=%d, dotmask=%02x, hblankendvalmask=%02x, blankendval=%02x.\n", adj_dot, svga->htotal, dot & eff_mask, svga->hblank_end_val & eff_mask, svga->hblank_end_val);
if ((dot & eff_mask) == (svga->hblank_end_val & eff_mask))
break;
@@ -812,32 +813,34 @@ svga_recalctimings(svga_t *svga)
}
svga->hdisp -= (svga->hblank_sub * svga->dots_per_clock);
}
if (ibm8514_active && (svga->dev8514 != NULL)) {
if (dev->on[0] || dev->on[1]) {
uint32_t dot8514 = dev->h_blankstart;
uint32_t adj_dot8514 = dev->h_blankstart;
uint32_t eff_mask8514 = 0x0000003f;
dev->hblank_sub = 0;
#ifdef TBD
if (ibm8514_active && (svga->dev8514 != NULL)) {
if (dev->on[0] || dev->on[1]) {
uint32_t dot8514 = dev->h_blankstart;
uint32_t adj_dot8514 = dev->h_blankstart;
uint32_t eff_mask8514 = 0x0000003f;
dev->hblank_sub = 0;
while (adj_dot8514 < (dev->h_total << 1)) {
if (dot8514 == dev->h_total)
dot = 0;
while (adj_dot8514 < (dev->h_total << 1)) {
if (dot8514 == dev->h_total)
dot8514 = 0;
if (adj_dot8514 >= dev->h_total)
dev->hblank_sub++;
if (adj_dot8514 >= dev->h_total)
dev->hblank_sub++;
if ((dot8514 & eff_mask8514) == (dev->h_blank_end_val & eff_mask8514))
break;
if ((dot8514 & eff_mask8514) == (dev->h_blank_end_val & eff_mask8514))
break;
dot8514++;
adj_dot8514++;
}
dev->h_disp -= dev->hblank_sub;
dot8514++;
adj_dot8514++;
}
dev->h_disp -= dev->hblank_sub;
}
}
#endif
if (svga->hdisp >= 2048)
svga->monitor->mon_overscan_x = 0;

View File

@@ -65,7 +65,7 @@ typedef struct tvp3026_ramdac_t {
static void
tvp3026_set_bpp(tvp3026_ramdac_t *ramdac, svga_t *svga)
{
if ((ramdac->true_color & 0x80) == 0x80) {
if (ramdac->true_color & 0x80) {
if (ramdac->mcr & 0x08)
svga->bpp = 8;
else
@@ -514,67 +514,16 @@ tvp3026_recalctimings(void *priv, svga_t *svga)
{
const tvp3026_ramdac_t *ramdac = (tvp3026_ramdac_t *) priv;
svga->interlace = (ramdac->ccr & 0x40);
svga->interlace = !!(ramdac->ccr & 0x40);
/* TODO: Figure out gamma correction for 15/16 bpp color. */
svga->lut_map = !!(svga->bpp >= 15 && (ramdac->true_color & 0xf0) != 0x00);
switch (ramdac->mcr) {
case 0x41:
case 0x4a:
case 0x61:
pclog("MCR=0x%02x, truecolor=0x%02x, crtc1=0x%02x, MCLK=0x%02x, ClockSel=%x.\n", ramdac->mcr, ramdac->true_color, svga->crtc[1] + 1, ramdac->mclk & 0x7f, ramdac->clock_sel);
if (!(ramdac->clock_sel & 0x70)) {
if (ramdac->mcr != 0x98) {
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
break;
case 0x42:
case 0x4b:
case 0x62:
svga->hdisp <<= 2;
svga->dots_per_clock <<= 2;
break;
case 0x43:
case 0x4c:
case 0x63:
svga->hdisp <<= 3;
svga->dots_per_clock <<= 3;
break;
case 0x44:
case 0x64:
svga->hdisp <<= 4;
svga->dots_per_clock <<= 4;
break;
case 0x5b:
switch (ramdac->true_color) {
case 0x16:
case 0x17:
svga->hdisp = (svga->hdisp << 2) / 3;
svga->dots_per_clock = (svga->dots_per_clock << 2) / 3;
break;
case 0x1e:
case 0x1f:
svga->hdisp = (svga->hdisp * 5) >> 2;
svga->dots_per_clock = (svga->dots_per_clock * 5) >> 2;
break;
}
break;
case 0x5c:
switch (ramdac->true_color) {
case 0x06:
case 0x07:
svga->hdisp <<= 1;
svga->dots_per_clock <<= 1;
break;
case 0x16:
case 0x17:
svga->hdisp = (svga->hdisp << 3) / 3;
svga->dots_per_clock = (svga->dots_per_clock << 3) / 3;
break;
case 0x1e:
case 0x1f:
svga->hdisp = (svga->hdisp * 5) >> 1;
svga->dots_per_clock = (svga->dots_per_clock * 5) >> 1;
break;
}
break;
}
}
}