diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c
index 8ed9d188e..dee6395aa 100644
--- a/src/disk/hdc_ide.c
+++ b/src/disk/hdc_ide.c
@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
- * Version: @(#)hdc_ide.c 1.0.47 2018/06/02
+ * Version: @(#)hdc_ide.c 1.0.48 2018/09/15
*
* Authors: Sarah Walker,
* Miran Grca,
@@ -129,7 +129,7 @@ enum
};
#endif
-#define IDE_PCI (PCI && (romset != ROM_PB640))
+#define IDE_PCI (PCI && pio_override)
typedef struct {
@@ -139,6 +139,7 @@ typedef struct {
} ide_board_t;
static ide_board_t *ide_boards[4];
+static int pio_override = 0;
ide_t *ide_drives[IDE_NUM];
int (*ide_bus_master_read)(int channel, uint8_t *data, int transfer_length, void *priv);
@@ -2724,16 +2725,8 @@ secondary_ide_check(void)
}
-/*
- * Initialization of standalone IDE controller instance.
- *
- * Eventually, we should clean up the whole mess by only
- * using const device_t units, with configuration parameters to
- * indicate primary/secondary and all that, rather than
- * keeping a zillion of duplicate functions around.
- */
static void *
-ide_sainit(const device_t *info)
+ide_init(const device_t *info)
{
ide_log("Initializing IDE...\n");
@@ -2746,6 +2739,8 @@ ide_sainit(const device_t *info)
case 8: /* PCI, single-channel */
case 10: /* PCI, dual-channel */
if (!ide_inited) {
+ pio_override = 0;
+
if (!(info->local & 8))
ide_clear_bus_master();
}
@@ -2797,6 +2792,13 @@ ide_sainit(const device_t *info)
}
+void
+ide_enable_pio_override(void)
+{
+ pio_override = 1;
+}
+
+
static void
ide_drive_reset(int d)
{
@@ -2822,7 +2824,7 @@ ide_drive_reset(int d)
/* Reset a standalone IDE unit. */
static void
-ide_sareset(void *p)
+ide_reset(void *p)
{
int d;
@@ -2842,7 +2844,7 @@ ide_sareset(void *p)
/* Close a standalone IDE unit. */
static void
-ide_saclose(void *priv)
+ide_close(void *priv)
{
ide_log("Closing IDE...\n");
@@ -2868,7 +2870,7 @@ const device_t ide_isa_device = {
"ISA PC/AT IDE Controller",
DEVICE_ISA | DEVICE_AT,
0,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2876,7 +2878,7 @@ const device_t ide_isa_2ch_device = {
"ISA PC/AT IDE Controller (Dual-Channel)",
DEVICE_ISA | DEVICE_AT,
2,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2884,7 +2886,7 @@ const device_t ide_isa_2ch_opt_device = {
"ISA PC/AT IDE Controller (Single/Dual)",
DEVICE_ISA | DEVICE_AT,
3,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2892,7 +2894,7 @@ const device_t ide_vlb_device = {
"VLB IDE Controller",
DEVICE_VLB | DEVICE_AT,
4,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2900,7 +2902,7 @@ const device_t ide_vlb_2ch_device = {
"VLB IDE Controller (Dual-Channel)",
DEVICE_VLB | DEVICE_AT,
6,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2908,7 +2910,7 @@ const device_t ide_pci_device = {
"PCI IDE Controller",
DEVICE_PCI | DEVICE_AT,
8,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
@@ -2916,7 +2918,7 @@ const device_t ide_pci_2ch_device = {
"PCI IDE Controller (Dual-Channel)",
DEVICE_PCI | DEVICE_AT,
10,
- ide_sainit, ide_saclose, ide_sareset,
+ ide_init, ide_close, ide_reset,
NULL, NULL, NULL, NULL
};
diff --git a/src/disk/hdc_ide.h b/src/disk/hdc_ide.h
index 7d0dc9c9d..69ede4604 100644
--- a/src/disk/hdc_ide.h
+++ b/src/disk/hdc_ide.h
@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
- * Version: @(#)hdd_ide.h 1.0.10 2018/09/13
+ * Version: @(#)hdd_ide.h 1.0.11 2018/09/15
*
* Authors: Sarah Walker,
* Miran Grca,
@@ -89,5 +89,7 @@ extern int (*ide_bus_master_write)(int channel, uint8_t *data, int transfer_leng
extern void (*ide_bus_master_set_irq)(int channel, void *priv);
extern void *ide_bus_master_priv[2];
+extern void ide_enable_pio_override(void);
+
#endif /*EMU_IDE_H*/
diff --git a/src/machine/m_at_4x0.c b/src/machine/m_at_4x0.c
index 217eaf8a1..3895170dd 100644
--- a/src/machine/m_at_4x0.c
+++ b/src/machine/m_at_4x0.c
@@ -46,12 +46,11 @@ enum
INTEL_430LX,
INTEL_430NX,
INTEL_430FX,
+ INTEL_430FX_PB640,
INTEL_430HX,
-#if defined(DEV_BRANCH) && defined(USE_I686)
- INTEL_430VX,
- INTEL_440FX
-#else
INTEL_430VX
+#if defined(DEV_BRANCH) && defined(USE_I686)
+ ,INTEL_440FX
#endif
};
@@ -108,7 +107,7 @@ i4x0_write(int func, int addr, uint8_t val, void *priv)
case 0x04: /*Command register*/
if (dev->type >= INTEL_430FX) {
- if (romset == ROM_PB640)
+ if (dev->type == INTEL_430FX_PB640)
val &= 0x06;
else
val &= 0x02;
@@ -132,7 +131,7 @@ i4x0_write(int func, int addr, uint8_t val, void *priv)
val |= 0x02;
} else {
val = 0x02;
- if (romset == ROM_PB640)
+ if (dev->type == INTEL_430FX_PB640)
val |= 0x20;
}
break;
@@ -245,8 +244,9 @@ static void
i4x0->regs[0x66] = i4x0->regs[0x67] = 0x02;
break;
case INTEL_430FX:
+ case INTEL_430FX_PB640:
i4x0->regs[0x02] = 0x2d; i4x0->regs[0x03] = 0x12; /*SB82437FX-66*/
- if (romset == ROM_PB640)
+ if (i4x0->type == INTEL_430FX_PB640)
i4x0->regs[0x08] = 0x02; /*???? stepping*/
else
i4x0->regs[0x08] = 0x00; /*A0 stepping*/
@@ -297,7 +297,7 @@ static void
if (i4x0->type == INTEL_440FX)
i4x0->regs[0x06] = 0x80;
#endif
- if ((i4x0->type == INTEL_430FX) && (romset != ROM_PB640))
+ if (i4x0->type == INTEL_430FX)
i4x0->regs[0x07] = 0x82;
#if defined(DEV_BRANCH) && defined(USE_I686)
else if (i4x0->type != INTEL_440FX)
@@ -366,6 +366,21 @@ const device_t i430fx_device =
};
+const device_t i430fx_pb640_device =
+{
+ "Intel SB82437FX-66 (PB640)",
+ DEVICE_PCI,
+ INTEL_430FX_PB640,
+ i4x0_init,
+ i4x0_close,
+ i4x0_reset,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+
const device_t i430hx_device =
{
"Intel 82439HX",
@@ -671,8 +686,9 @@ machine_at_pb640_init(const machine_t *model)
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4);
pci_register_slot(0x07, PCI_CARD_SPECIAL, 0, 0, 0, 0);
- device_add(&i430fx_device);
+ device_add(&i430fx_pb640_device);
device_add(&piix_pb640_device);
+ ide_enable_pio_override();
pc87306_init();
device_add(&intel_flash_bxt_ami_device);
diff --git a/src/machine/m_xt_laserxt.c b/src/machine/m_xt_laserxt.c
index dc58271be..7de664ed6 100644
--- a/src/machine/m_xt_laserxt.c
+++ b/src/machine/m_xt_laserxt.c
@@ -22,13 +22,14 @@ static int laserxt_emspage[4];
static int laserxt_emscontrol[4];
static mem_mapping_t laserxt_ems_mapping[4];
static int laserxt_ems_baseaddr_index = 0;
+static int laserxt_is_lxt3 = 0;
static uint32_t get_laserxt_ems_addr(uint32_t addr)
{
if(laserxt_emspage[(addr >> 14) & 3] & 0x80)
{
- addr = (romset == ROM_LTXT ? 0x70000 + (((mem_size + 64) & 255) << 10) : 0x30000 + (((mem_size + 320) & 511) << 10)) + ((laserxt_emspage[(addr >> 14) & 3] & 0x0F) << 14) + ((laserxt_emspage[(addr >> 14) & 3] & 0x40) << 12) + (addr & 0x3FFF);
+ addr = (!laserxt_is_lxt3 ? 0x70000 + (((mem_size + 64) & 255) << 10) : 0x30000 + (((mem_size + 320) & 511) << 10)) + ((laserxt_emspage[(addr >> 14) & 3] & 0x0F) << 14) + ((laserxt_emspage[(addr >> 14) & 3] & 0x40) << 12) + (addr & 0x3FFF);
}
return addr;
@@ -114,7 +115,7 @@ static uint8_t mem_read_laserxtems(uint32_t addr, void *priv)
}
-static void laserxt_init(void)
+static void laserxt_init(is_lxt3)
{
int i;
@@ -124,7 +125,7 @@ static void laserxt_init(void)
io_sethandler(0x4208, 0x0002, laserxt_read, NULL, NULL, laserxt_write, NULL, NULL, NULL);
io_sethandler(0x8208, 0x0002, laserxt_read, NULL, NULL, laserxt_write, NULL, NULL, NULL);
io_sethandler(0xc208, 0x0002, laserxt_read, NULL, NULL, laserxt_write, NULL, NULL, NULL);
- mem_mapping_set_addr(&ram_low_mapping, 0, romset == ROM_LTXT ? 0x70000 + (((mem_size + 64) & 255) << 10) : 0x30000 + (((mem_size + 320) & 511) << 10));
+ mem_mapping_set_addr(&ram_low_mapping, 0, !is_lxt3 ? 0x70000 + (((mem_size + 64) & 255) << 10) : 0x30000 + (((mem_size + 320) & 511) << 10));
}
for (i = 0; i < 4; i++)
@@ -135,6 +136,7 @@ static void laserxt_init(void)
mem_mapping_disable(&laserxt_ems_mapping[i]);
}
mem_set_mem_state(0x0c0000, 0x40000, MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL);
+ laserxt_is_lxt3 = is_lxt3;
}
@@ -143,7 +145,7 @@ machine_xt_laserxt_init(const machine_t *model)
{
machine_xt_init(model);
- laserxt_init();
+ laserxt_init(0);
}
@@ -160,5 +162,5 @@ machine_xt_lxt3_init(const machine_t *model)
if (joystick_type != 7)
device_add(&gameport_device);
- laserxt_init();
+ laserxt_init(1);
}
diff --git a/src/machine/m_xt_t1000.c b/src/machine/m_xt_t1000.c
index 7a21a1c3d..29149a498 100644
--- a/src/machine/m_xt_t1000.c
+++ b/src/machine/m_xt_t1000.c
@@ -51,7 +51,7 @@
* NOTE: Still need to figure out a way to load/save ConfigSys and
* HardRAM stuff. Needs to be linked in to the NVR code.
*
- * Version: @(#)m_xt_t1000.c 1.0.10 2018/09/15
+ * Version: @(#)m_xt_t1000.c 1.0.11 2018/09/15
*
* Authors: Fred N. van Kempen,
* Miran Grca,
@@ -172,6 +172,7 @@ typedef struct {
fdc_t *fdc;
nvr_t nvr;
+ int is_t1200;
} t1000_t;
@@ -648,7 +649,7 @@ write_ctl(uint16_t addr, uint8_t val, void *priv)
if (sys->sys_ctl[3] == 0x5A) {
t1000_video_options_set((val & 0x20) ? 1 : 0);
t1000_display_set((val & 0x40) ? 0 : 1);
- if (romset == ROM_T1200)
+ if (sys->is_t1200)
t1200_turbo_set((val & 0x80) ? 1 : 0);
}
break;
@@ -656,7 +657,7 @@ write_ctl(uint16_t addr, uint8_t val, void *priv)
/* It looks as if the T1200, like the T3100, can disable
* its builtin video chipset if it detects the presence of
* another video card. */
- case 6: if (romset == ROM_T1200)
+ case 6: if (sys->is_t1200)
{
t1000_video_enable(val & 0x01 ? 0 : 1);
}
@@ -853,6 +854,7 @@ machine_xt_t1000_init(const machine_t *model)
int pg;
memset(&t1000, 0x00, sizeof(t1000));
+ t1000.is_t1200 = 0;
t1000.turbo = 0xff;
t1000.ems_port_index = 7; /* EMS disabled */
@@ -934,6 +936,7 @@ machine_xt_t1200_init(const machine_t *model)
int pg;
memset(&t1000, 0x00, sizeof(t1000));
+ t1000.is_t1200 = 1;
t1000.ems_port_index = 7; /* EMS disabled */
/* Load the T1200 CGA Font ROM. */
diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c
index 856c03291..c2ea40a2a 100644
--- a/src/video/vid_et4000.c
+++ b/src/video/vid_et4000.c
@@ -8,7 +8,7 @@
*
* Emulation of the Tseng Labs ET4000.
*
- * Version: @(#)vid_et4000.c 1.0.16 2018/09/15
+ * Version: @(#)vid_et4000.c 1.0.17 2018/09/15
*
* Authors: Fred N. van Kempen,
* Miran Grca,
@@ -55,9 +55,9 @@
#include "vid_et4000.h"
-#define BIOS_ROM_PATH L"video/tseng/et4000/et4000.bin"
-#define KOREAN_BIOS_ROM_PATH L"video/tseng/et4000/tgkorvga.bin"
-#define KOREAN_FONT_ROM_PATH L"video/tseng/et4000/tg_ksc5601.rom"
+#define BIOS_ROM_PATH L"roms/video/et4000/et4000.bin"
+#define KOREAN_BIOS_ROM_PATH L"roms/video/et4000/tgkorvga.bin"
+#define KOREAN_FONT_ROM_PATH L"roms/video/et4000/tg_ksc5601.rom"
typedef struct {