More S3-related bug fixes.

This commit is contained in:
OBattler
2018-09-20 18:03:07 +02:00
parent 56517cff03
commit 55afa5e2ac
2 changed files with 53 additions and 62 deletions

View File

@@ -8,7 +8,7 @@
*
* S3 emulation.
*
* Version: @(#)vid_s3.c 1.0.14 2018/09/20
* Version: @(#)vid_s3.c 1.0.15 2018/09/20
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1215,7 +1215,11 @@ uint8_t s3_in(uint16_t addr, void *p)
case 0x2d: return 0x88; /*Extended chip ID*/
case 0x2e: return s3->id_ext; /*New chip ID*/
case 0x2f: return 0; /*Revision level*/
case 0x30: return s3->id; /*Chip ID*/
case 0x30:
if (s3->chip == S3_VISION868)
return 0xe1; /*Vision868 hardwires it to E1h*/
else
return s3->id; /*Chip ID*/
case 0x31: return (svga->crtc[0x31] & 0xcf) | ((s3->ma_ext & 3) << 4);
case 0x35: return (svga->crtc[0x35] & 0xf0) | (s3->bank & 0xf);
case 0x45: s3->hwc_col_stack_pos = 0; break;
@@ -1346,9 +1350,18 @@ void s3_updatemapping(s3_t *s3)
s3->linear_size = 0x200000;
break;
case 3: /*8mb*/
switch (s3->chip) {
case S3_TRIO32:
case S3_TRIO64:
case S3_VISION868:
s3->linear_size = 0x400000;
break;
default:
s3->linear_size = 0x800000;
break;
}
break;
}
s3->linear_base &= ~(s3->linear_size - 1);
if (s3->linear_base == 0xa0000)
{
@@ -1365,18 +1378,21 @@ void s3_updatemapping(s3_t *s3)
else
mem_mapping_disable(&s3->linear_mapping);
if (svga->crtc[0x53] & 0x10) /*Memory mapped IO*/
{
/* Memory mapped I/O. */
if (svga->crtc[0x53] & 0x10) {
/* Old MMIO. */
mem_mapping_disable(&svga->mapping);
mem_mapping_enable(&s3->mmio_mapping);
}
else
mem_mapping_disable(&s3->mmio_mapping);
if ((svga->crtc[0x53] & 0x08) && s3->chip == S3_VISION868) /*New MMIO*/
/* New MMIO. */
if ((svga->crtc[0x53] & 0x08) && (s3->chip == S3_VISION868))
mem_mapping_set_addr(&s3->new_mmio_mapping, s3->linear_base + 0x1000000, 0x10000);
else
mem_mapping_disable(&s3->new_mmio_mapping);
} else {
mem_mapping_disable(&s3->mmio_mapping);
mem_mapping_disable(&s3->new_mmio_mapping);
}
}
static float s3_trio64_getclock(int clock, void *p)
@@ -2843,7 +2859,7 @@ static void *s3_init(const device_t *info)
svga->vram_mask = (4 << 20) - 1;
svga->vram_max = 4 << 20;
break;
case 8: /*4MB*/
case 8: /*8MB*/
svga->vram_mask = (8 << 20) - 1;
svga->vram_max = 8 << 20;
break;
@@ -3088,33 +3104,6 @@ static const device_config_t s3_config[] =
}
};
static const device_config_t s3_vision868_config[] =
{
{
"memory", "Memory size", CONFIG_SELECTION, "", 4,
{
{
"1 MB", 1
},
{
"2 MB", 2
},
{
"4 MB", 4
},
{
"8 MB", 8
},
{
""
}
}
},
{
"", "", -1
}
};
const device_t s3_bahamas64_vlb_device =
{
"Paradise Bahamas 64 (S3 Vision864) VLB",
@@ -3154,7 +3143,7 @@ const device_t s3_expertcolor_vlb_device =
s3_expertcolor_dsv3868p_cf55_available,
s3_speed_changed,
s3_force_redraw,
s3_vision868_config
s3_config
};
const device_t s3_expertcolor_pci_device =
@@ -3168,7 +3157,7 @@ const device_t s3_expertcolor_pci_device =
s3_expertcolor_dsv3868p_cf55_available,
s3_speed_changed,
s3_force_redraw,
s3_vision868_config
s3_config
};
const device_t s3_9fx_vlb_device =

View File

@@ -8,7 +8,7 @@
*
* S3 ViRGE emulation.
*
* Version: @(#)vid_s3_virge.c 1.0.13 2018/09/19
* Version: @(#)vid_s3_virge.c 1.0.14 2018/09/20
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -764,21 +764,23 @@ static void s3_virge_updatemapping(virge_t *virge)
}
s3_virge_log("Memory mapped IO %02X\n", svga->crtc[0x53] & 0x18);
if (svga->crtc[0x53] & 0x10) /*Old MMIO*/
{
/* Memory mapped I/O. */
/* Old MMIO. */
if (svga->crtc[0x53] & 0x10) {
if (svga->crtc[0x53] & 0x20)
mem_mapping_set_addr(&virge->mmio_mapping, 0xb8000, 0x8000);
else
mem_mapping_set_addr(&virge->mmio_mapping, 0xa0000, 0x10000);
}
else
} else
mem_mapping_disable(&virge->mmio_mapping);
if (svga->crtc[0x53] & 0x08) /*New MMIO*/
/* New MMIO. */
if ((svga->crtc[0x53] & 0x18) == 0x18) /*New MMIO*/
mem_mapping_set_addr(&virge->new_mmio_mapping, virge->linear_base + 0x1000000, 0x10000);
else
mem_mapping_disable(&virge->new_mmio_mapping);
}
static void s3_virge_vblank_start(svga_t *svga)