Added a version of the Winbond W83787F Super I/O chip with IDE enabled by default, fixes IDE on the Flytech 386.

This commit is contained in:
OBattler
2021-06-03 23:15:34 +02:00
parent 2f761da6fb
commit 368c92780a
3 changed files with 24 additions and 2 deletions

View File

@@ -67,6 +67,7 @@ extern const device_t um8669f_device;
extern const device_t via_vt82c686_sio_device;
extern const device_t w83787f_device;
extern const device_t w83787f_ide_device;
extern const device_t w83787f_ide_en_device;
extern const device_t w83787f_ide_sec_device;
extern const device_t w83877f_device;
extern const device_t w83877f_president_device;

View File

@@ -644,7 +644,7 @@ machine_at_flytech386_init(const machine_t *model)
machine_at_common_init(model);
device_add(&ali1217_device);
device_add(&w83787f_ide_device);
device_add(&w83787f_ide_en_device);
device_add(&keyboard_ps2_device);
if (gfxcard == VID_INTERNAL)

View File

@@ -78,7 +78,8 @@ typedef struct {
uint16_t reg_init;
int locked, rw_locked,
cur_reg,
key, ide_function;
key, ide_function,
ide_start;
fdc_t *fdc;
serial_t *uart[2];
} w83787f_t;
@@ -260,6 +261,7 @@ w83787f_write(uint16_t port, uint8_t val, void *priv)
switch (dev->cur_reg) {
case 0:
pclog("REG 00: %02X\n", val);
if ((valxor & 0xc0) && (HAS_IDE_FUNCTIONALITY))
w83787f_ide_handler(dev);
if (valxor & 0x30)
@@ -376,6 +378,14 @@ w83787f_reset(w83787f_t *dev)
ide_set_base(0, 0x1f0);
ide_set_side(0, 0x3f6);
}
if (dev->ide_start) {
dev->regs[0x00] &= 0x7f;
if (dev->ide_function & 0x20)
ide_sec_enable();
else
ide_pri_enable();
}
} else
dev->regs[0x00] = 0xd0;
@@ -426,6 +436,8 @@ w83787f_init(const device_t *info)
if ((dev->ide_function & 0x30) == 0x10)
device_add(&ide_isa_device);
dev->ide_start = !!(info->local & 0x40);
dev->reg_init = info->local & 0x0f;
w83787f_reset(dev);
@@ -451,6 +463,15 @@ const device_t w83787f_ide_device = {
NULL
};
const device_t w83787f_ide_en_device = {
"Winbond W83787F/IF Super I/O (With IDE Enabled)",
0,
0x59,
w83787f_init, w83787f_close, NULL,
{ NULL }, NULL, NULL,
NULL
};
const device_t w83787f_ide_sec_device = {
"Winbond W83787F/IF Super I/O (With Secondary IDE)",
0,