From 87cf281035a60ae18f544e88c20370fb0d0d57ce Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 26 Jul 2022 22:32:01 +0200 Subject: [PATCH] DECpc LPV fixes and implementation of the on-board S3 805 with the AT&T 490 RAMDAC, fixes #2349. --- src/include/86box/video.h | 1 + src/machine/m_at_386dx_486.c | 7 +++++-- src/machine/machine_table.c | 4 ++-- src/video/vid_s3.c | 36 +++++++++++++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/include/86box/video.h b/src/include/86box/video.h index 1216257bc..8aa52daa0 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -441,6 +441,7 @@ extern const device_t s3_metheus_86c928_isa_device; extern const device_t s3_metheus_86c928_vlb_device; extern const device_t s3_spea_mercury_lite_86c928_pci_device; extern const device_t s3_spea_mirage_86c801_isa_device; +extern const device_t s3_86c805_onboard_vlb_device; extern const device_t s3_spea_mirage_86c805_vlb_device; extern const device_t s3_mirocrystal_8s_805_vlb_device; extern const device_t s3_mirocrystal_10sd_805_vlb_device; diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 72e8eaa6a..7baa85ed3 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -441,11 +441,14 @@ machine_at_decpclpv_init(const machine_t *model) machine_at_common_init(model); device_add(&sis_85c461_device); + + if (gfxcard == VID_INTERNAL) + device_add(&s3_86c805_onboard_vlb_device); + /* TODO: Phoenix MultiKey KBC */ device_add(&keyboard_ps2_ami_pci_device); device_add(&ide_isa_2ch_device); - device_add(&fdc37c663_device); - /* TODO: On-board S3 805 with AT&T 490 RAM DAC. */ + device_add(&fdc37c663_ide_device); return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6ece57fdf..7194ca2d9 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -4721,7 +4721,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE_DUAL, /* No MACHINE_VIDEO yet, because on-board video is not yet implemented. */ + .flags = MACHINE_IDE_DUAL | MACHINE_VIDEO, .ram = { .min = 1024, .max = 32768, @@ -4731,7 +4731,7 @@ const machine_t machines[] = { .kbc = KBC_UNKNOWN, .kbc_p1 = 0, .gpio = 0, - .device = NULL, + .device = &s3_86c805_onboard_vlb_device, .vid_device = NULL }, /* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */ diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 6887c0b51..b6a1af232 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -107,7 +107,8 @@ enum S3_MIROCRYSTAL8S_805, S3_NUMBER9_9FX_531, S3_NUMBER9_9FX_771, - S3_SPEA_MERCURY_LITE_PCI + S3_SPEA_MERCURY_LITE_PCI, + S3_86C805_ONBOARD }; @@ -6803,6 +6804,11 @@ static void *s3_init(const device_t *info) chip = S3_86C801; video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_s3_86c801); break; + case S3_86C805_ONBOARD: + bios_fn = NULL; + chip = S3_86C805; + video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_s3_86c805); + break; case S3_SPEA_MIRAGE_86C805: bios_fn = ROM_SPEA_MIRAGE_86C805; chip = S3_86C805; @@ -7213,6 +7219,20 @@ static void *s3_init(const device_t *info) svga->getclock = av9194_getclock; break; + case S3_86C805_ONBOARD: + svga->decode_mask = (2 << 20) - 1; + stepping = 0xa0; /*86C801/86C805*/ + s3->id = stepping; + s3->id_ext = stepping; + s3->id_ext_pci = 0; + s3->packed_mmio = 0; + svga->crtc[0x5a] = 0x0a; + + svga->ramdac = device_add(&att490_ramdac_device); + svga->clock_gen = device_add(&av9194_device); + svga->getclock = av9194_getclock; + break; + case S3_PHOENIX_86C801: case S3_PHOENIX_86C805: svga->decode_mask = (2 << 20) - 1; @@ -7818,6 +7838,20 @@ const device_t s3_spea_mirage_86c801_isa_device = { .config = s3_9fx_config }; +const device_t s3_86c805_onboard_vlb_device = { + .name = "S3 86c805 VLB On-Board", + .internal_name = "px_s3_805_onboard_vlb", + .flags = DEVICE_VLB, + .local = S3_86C805_ONBOARD, + .init = s3_init, + .close = s3_close, + .reset = s3_reset, + { .available = NULL }, + .speed_changed = s3_speed_changed, + .force_redraw = s3_force_redraw, + .config = s3_9fx_config +}; + const device_t s3_spea_mirage_86c805_vlb_device = { .name = "S3 86c805 VLB (SPEA Mirage VL)", .internal_name = "px_s3_v7_805_vlb",