Merged various SMC FDC67C6xx Super I/O chips into one file, re-added the UMC88xx 486 chipsets (and four machines for it) based on work by tiseno100 and my own work, various other fixes, and added quite a few machines (including the AOpen AP5VM which now works), also added the remaining ALi M6117 machine (Protech SBC with Award BIOS), and made the Intel Advanced/ATX's on-board S3 Trio64V+ work, as well as the on-board S3 Trio64/V2 of the two Compaq Presarios.

This commit is contained in:
OBattler
2021-08-21 18:19:10 +02:00
parent b0ea9185d0
commit 67367798a7
32 changed files with 1030 additions and 1141 deletions

View File

@@ -73,6 +73,7 @@ enum
S3_METHEUS_86C928,
S3_AMI_86C924,
S3_TRIO64V2_DX,
S3_TRIO64V2_DX_ONBOARD,
S3_PHOENIX_TRIO64VPLUS,
S3_PHOENIX_TRIO64VPLUS_ONBOARD,
S3_DIAMOND_STEALTH_SE,
@@ -2460,8 +2461,14 @@ s3_in(uint16_t addr, void *p)
break;
case 0x3c5:
if (svga->seqaddr >= 0x10 && svga->seqaddr < 0x20)
return svga->seqregs[svga->seqaddr];
if (svga->seqaddr >= 0x10 && svga->seqaddr < 0x20) {
temp = svga->seqregs[svga->seqaddr];
/* This is needed for the Intel Advanced/ATX's built-in S3 Trio64V+ BIOS to not
get stuck in an infinite loop. */
if ((s3->card_type == S3_PHOENIX_TRIO64VPLUS_ONBOARD) && (svga->seqaddr == 0x17))
svga->seqregs[svga->seqaddr] ^= 0x01;
return temp;
}
break;
case 0x3c6: case 0x3c7: case 0x3c8: case 0x3c9:
@@ -5884,6 +5891,11 @@ static void *s3_init(const device_t *info)
chip = S3_TRIO64V2;
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_s3_trio64_pci);
break;
case S3_TRIO64V2_DX_ONBOARD:
bios_fn = NULL;
chip = S3_TRIO64V2;
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_s3_trio64_pci);
break;
default:
free(s3);
return NULL;
@@ -6205,6 +6217,7 @@ static void *s3_init(const device_t *info)
break;
case S3_TRIO64V2_DX:
case S3_TRIO64V2_DX_ONBOARD:
svga->decode_mask = (4 << 20) - 1;
s3->id = 0xe1; /*Trio64V2/DX*/
s3->id_ext = s3->id_ext_pci = 0x01;
@@ -6981,3 +6994,17 @@ const device_t s3_trio64v2_dx_pci_device =
s3_standard_config
};
const device_t s3_trio64v2_dx_onboard_pci_device =
{
"S3 Trio64V2/DX On-Board PCI",
DEVICE_PCI,
S3_TRIO64V2_DX_ONBOARD,
s3_init,
s3_close,
NULL,
{ NULL },
s3_speed_changed,
s3_force_redraw,
s3_standard_config
};

View File

@@ -235,18 +235,9 @@ video_reset_close(void)
}
void
video_reset(int card)
static void
video_prepare(void)
{
/* This is needed to avoid duplicate resets. */
if ((video_get_type() != VIDEO_FLAG_TYPE_NONE) && was_reset)
return;
vid_table_log("VIDEO: reset (gfxcard=%d, internal=%d)\n",
card, (machines[machine].flags & MACHINE_VIDEO)?1:0);
loadfont("roms/video/mda/mda.rom", 0);
/* Reset (deallocate) the video font arrays. */
if (fontdatksc5601) {
free(fontdatksc5601);
@@ -260,14 +251,39 @@ video_reset(int card)
/* Reset the blend. */
herc_blend = 0;
/* Do an inform on the default values, so that that there's some sane values initialized
even if the device init function does not do an inform of its own. */
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_default);
}
void
video_pre_reset(int card)
{
if ((card == VID_NONE) || \
(card == VID_INTERNAL) || (machines[machine].flags & MACHINE_VIDEO_ONLY))
video_prepare();
}
void
video_reset(int card)
{
/* This is needed to avoid duplicate resets. */
if ((video_get_type() != VIDEO_FLAG_TYPE_NONE) && was_reset)
return;
vid_table_log("VIDEO: reset (gfxcard=%d, internal=%d)\n",
card, (machines[machine].flags & MACHINE_VIDEO)?1:0);
loadfont("roms/video/mda/mda.rom", 0);
/* Do not initialize internal cards here. */
if (!(card == VID_NONE) && \
!(card == VID_INTERNAL) && !(machines[machine].flags & MACHINE_VIDEO_ONLY)) {
vid_table_log("VIDEO: initializing '%s'\n", video_cards[card].name);
/* Do an inform on the default values, so that that there's some sane values initialized
even if the device init function does not do an inform of its own. */
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_default);
video_prepare();
/* Initialize the video card. */
device_add(video_cards[card].device);

View File

@@ -88,10 +88,12 @@ enum
{
TGUI_9400CXI = 0,
TGUI_9440,
TGUI_9660,
TGUI_9680
TGUI_9660,
TGUI_9680
};
#define ONBOARD 0x0100
typedef struct tgui_t
{
mem_mapping_t linear_mapping;
@@ -160,6 +162,8 @@ typedef struct tgui_t
volatile int write_blitter;
void *i2c, *ddc;
int has_bios;
} tgui_t;
video_timings_t timing_tgui_vlb = {VIDEO_BUS, 4, 8, 16, 4, 8, 16};
@@ -908,13 +912,13 @@ uint8_t tgui_pci_read(int func, int addr, void *p)
case 0x16: return tgui->mmio_base >> 16;
case 0x17: return tgui->mmio_base >> 24;
case 0x30: return (tgui->pci_regs[0x30] & 0x01); /*BIOS ROM address*/
case 0x31: return 0x00;
case 0x32: return tgui->pci_regs[0x32];
case 0x33: return tgui->pci_regs[0x33];
case 0x3c: return tgui->int_line;
case 0x3d: return PCI_INTA;
case 0x30: return tgui->has_bios ? (tgui->pci_regs[0x30] & 0x01) : 0x00; /*BIOS ROM address*/
case 0x31: return 0x00;
case 0x32: return tgui->has_bios ? tgui->pci_regs[0x32] : 0x00;
case 0x33: return tgui->has_bios ? tgui->pci_regs[0x33] : 0x00;
case 0x3c: return tgui->int_line;
case 0x3d: return PCI_INTA;
}
return 0;
}
@@ -970,23 +974,25 @@ void tgui_pci_write(int func, int addr, uint8_t val, void *p)
tgui->mmio_base = (tgui->mmio_base & 0x00e00000) | (val << 24);
tgui_recalcmapping(tgui);
break;
case 0x30: case 0x32: case 0x33:
tgui->pci_regs[addr] = val;
if (tgui->pci_regs[0x30] & 0x01)
{
uint32_t biosaddr = (tgui->pci_regs[0x32] << 16) | (tgui->pci_regs[0x33] << 24);
mem_mapping_set_addr(&tgui->bios_rom.mapping, biosaddr, 0x8000);
}
else
{
mem_mapping_disable(&tgui->bios_rom.mapping);
}
return;
case 0x3c:
tgui->int_line = val;
return;
case 0x30: case 0x32: case 0x33:
if (tgui->has_bios) {
tgui->pci_regs[addr] = val;
if (tgui->pci_regs[0x30] & 0x01)
{
uint32_t biosaddr = (tgui->pci_regs[0x32] << 16) | (tgui->pci_regs[0x33] << 24);
mem_mapping_set_addr(&tgui->bios_rom.mapping, biosaddr, 0x8000);
}
else
{
mem_mapping_disable(&tgui->bios_rom.mapping);
}
}
return;
case 0x3c:
tgui->int_line = val;
return;
}
}
@@ -2801,16 +2807,15 @@ tgui_mmio_read_l(uint32_t addr, void *p)
static void *tgui_init(const device_t *info)
{
const char *bios_fn;
int type = info->local;
tgui_t *tgui = malloc(sizeof(tgui_t));
svga_t *svga = &tgui->svga;
svga_t *svga = &tgui->svga;
memset(tgui, 0, sizeof(tgui_t));
tgui->vram_size = device_get_config_int("memory") << 20;
tgui->vram_mask = tgui->vram_size - 1;
tgui->type = type;
tgui->type = info->local & 0xff;
tgui->pci = !!(info->flags & DEVICE_PCI);
@@ -2819,7 +2824,7 @@ static void *tgui_init(const device_t *info)
bios_fn = ROM_TGUI_9400CXI;
break;
case TGUI_9440:
bios_fn = ROM_TGUI_9440;
bios_fn = (info->local & ONBOARD) ? NULL : ROM_TGUI_9440;
break;
case TGUI_9660:
case TGUI_9680:
@@ -2830,7 +2835,10 @@ static void *tgui_init(const device_t *info)
return NULL;
}
rom_init(&tgui->bios_rom, (char *) bios_fn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
tgui->has_bios = (bios_fn != NULL);
if (tgui->has_bios)
rom_init(&tgui->bios_rom, (char *) bios_fn, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
if (tgui->pci)
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_tgui_pci);
@@ -2844,33 +2852,39 @@ static void *tgui_init(const device_t *info)
NULL);
if (tgui->type == TGUI_9400CXI)
svga->ramdac = device_add(&tkd8001_ramdac_device);
svga->ramdac = device_add(&tkd8001_ramdac_device);
mem_mapping_add(&tgui->linear_mapping, 0, 0, svga_read_linear, svga_readw_linear, svga_readl_linear, tgui_accel_write_fb_b, tgui_accel_write_fb_w, tgui_accel_write_fb_l, NULL, MEM_MAPPING_EXTERNAL, svga);
mem_mapping_add(&tgui->accel_mapping, 0, 0, tgui_accel_read, tgui_accel_read_w, tgui_accel_read_l, tgui_accel_write, tgui_accel_write_w, tgui_accel_write_l, NULL, MEM_MAPPING_EXTERNAL, tgui);
if (tgui->type >= TGUI_9440)
mem_mapping_add(&tgui->mmio_mapping, 0, 0, tgui_mmio_read, tgui_mmio_read_w, tgui_mmio_read_l, tgui_mmio_write, tgui_mmio_write_w, tgui_mmio_write_l, NULL, MEM_MAPPING_EXTERNAL, tgui);
if (tgui->type >= TGUI_9440)
mem_mapping_add(&tgui->mmio_mapping, 0, 0, tgui_mmio_read, tgui_mmio_read_w, tgui_mmio_read_l, tgui_mmio_write, tgui_mmio_write_w, tgui_mmio_write_l, NULL, MEM_MAPPING_EXTERNAL, tgui);
mem_mapping_disable(&tgui->accel_mapping);
mem_mapping_disable(&tgui->mmio_mapping);
mem_mapping_disable(&tgui->mmio_mapping);
tgui_set_io(tgui);
tgui_set_io(tgui);
if (tgui->pci && (tgui->type >= TGUI_9440))
if (tgui->pci && (tgui->type >= TGUI_9440)) {
if (tgui->has_bios)
tgui->card = pci_add_card(PCI_ADD_VIDEO, tgui_pci_read, tgui_pci_write, tgui);
else
tgui->card = pci_add_card(PCI_ADD_VIDEO | PCI_ADD_STRICT, tgui_pci_read, tgui_pci_write, tgui);
}
tgui->pci_regs[PCI_REG_COMMAND] = 3;
tgui->pci_regs[PCI_REG_COMMAND] = 3;
if (tgui->has_bios) {
tgui->pci_regs[0x30] = 0x00;
tgui->pci_regs[0x32] = 0x0c;
tgui->pci_regs[0x33] = 0x00;
}
if (tgui->type >= TGUI_9440)
svga->packed_chain4 = 1;
if (tgui->type >= TGUI_9660) {
tgui->i2c = i2c_gpio_init("ddc_tgui");
tgui->ddc = ddc_init(i2c_gpio_get_bus(tgui->i2c));
}
if (tgui->type >= TGUI_9440)
svga->packed_chain4 = 1;
if (tgui->type >= TGUI_9660) {
tgui->i2c = i2c_gpio_init("ddc_tgui");
tgui->ddc = ddc_init(i2c_gpio_get_bus(tgui->i2c));
}
return tgui;
}
@@ -3019,6 +3033,20 @@ const device_t tgui9440_pci_device =
tgui9440_config
};
const device_t tgui9440_onboard_pci_device =
{
"Trident TGUI 9440AGi On-Board PCI",
DEVICE_PCI,
TGUI_9440 | ONBOARD,
tgui_init,
tgui_close,
NULL,
{ NULL },
tgui_speed_changed,
tgui_force_redraw,
tgui9440_config
};
const device_t tgui9660_pci_device =
{
"Trident TGUI 9660XGi PCI",