mirror of
https://github.com/86Box/86Box.git
synced 2026-02-26 14:03:16 -07:00
Merge branch 'master' into pc98x1
This commit is contained in:
@@ -17,7 +17,7 @@ add_library(chipset OBJECT 82c100.c acc2168.c cs8230.c ali1429.c ali1435.c ali14
|
||||
ali1531.c ali1541.c ali1543.c ali1621.c ali6117.c ali1409.c headland.c ims8848.c intel_82335.c
|
||||
compaq_386.c contaq_82c59x.c cs4031.c intel_420ex.c intel_4x0.c intel_i450kx.c
|
||||
intel_sio.c intel_piix.c ../ioapic.c neat.c opti283.c opti291.c opti391.c opti495.c
|
||||
opti602.c opti822.c opti895.c opti5x7.c scamp.c scat.c sis_85c310.c sis_85c4xx.c
|
||||
opti499.c opti602.c opti822.c opti895.c opti5x7.c scamp.c scat.c sis_85c310.c sis_85c4xx.c
|
||||
sis_85c496.c sis_85c50x.c sis_5511.c sis_5571.c sis_5581.c sis_5591.c sis_5600.c
|
||||
sis_5511_h2p.c sis_5571_h2p.c sis_5581_h2p.c sis_5591_h2p.c sis_5600_h2p.c
|
||||
sis_5513_p2i.c sis_5513_ide.c sis_5572_usb.c sis_5595_pmu.c sis_55xx.c via_vt82c49x.c
|
||||
|
||||
@@ -746,6 +746,25 @@ compaq_386_init(UNUSED(const device_t *info))
|
||||
return dev;
|
||||
}
|
||||
|
||||
static void
|
||||
compaq_genoa_outw(uint16_t port, uint16_t val, void *priv)
|
||||
{
|
||||
if (port == 0x0c02) {
|
||||
if (val)
|
||||
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
else
|
||||
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
compaq_genoa_init(UNUSED(const device_t *info))
|
||||
{
|
||||
io_sethandler(0x0c02, 3, NULL, NULL, NULL, NULL, compaq_genoa_outw, NULL, ram);
|
||||
|
||||
return ram;
|
||||
}
|
||||
|
||||
const device_t compaq_386_device = {
|
||||
.name = "Compaq 386 Memory Control",
|
||||
.internal_name = "compaq_386",
|
||||
@@ -759,3 +778,17 @@ const device_t compaq_386_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t compaq_genoa_device = {
|
||||
.name = "Compaq Genoa Memory Control",
|
||||
.internal_name = "compaq_genoa",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = compaq_genoa_init,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
@@ -54,10 +54,34 @@ typedef struct mem_remapping_t {
|
||||
} mem_remapping_t;
|
||||
|
||||
typedef struct opti391_t {
|
||||
uint8_t type;
|
||||
uint8_t reg_base;
|
||||
uint8_t min_reg;
|
||||
uint8_t max_reg;
|
||||
|
||||
uint16_t shadowed;
|
||||
uint16_t old_start;
|
||||
|
||||
uint8_t index;
|
||||
uint8_t regs[256];
|
||||
} opti391_t;
|
||||
|
||||
static void
|
||||
opti391_recalcremap(opti391_t *dev)
|
||||
{
|
||||
if (dev->type < 2) {
|
||||
if ((mem_size > 8192) || (dev->shadowed & 0x0ff0) ||
|
||||
!(dev->regs[0x01] & 0x0f) || !(dev->regs[0x01] & 0x10)) {
|
||||
mem_remap_top_ex(0, dev->old_start);
|
||||
dev->old_start = 1024;
|
||||
} else {
|
||||
mem_remap_top_ex(0, dev->old_start);
|
||||
dev->old_start = (dev->regs[0x01] & 0x0f) * 1024;
|
||||
mem_remap_top_ex(-256, dev->old_start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
opti391_shadow_recalc(opti391_t *dev)
|
||||
{
|
||||
@@ -70,24 +94,25 @@ opti391_shadow_recalc(opti391_t *dev)
|
||||
shadowbios = shadowbios_write = 0;
|
||||
|
||||
/* F0000-FFFFF */
|
||||
sh_enable = !(dev->regs[0x22] & 0x80);
|
||||
sh_enable = (dev->regs[0x02] & 0x80);
|
||||
if (sh_enable)
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
|
||||
dev->shadowed |= 0xf000;
|
||||
|
||||
sh_write_internal = (dev->regs[0x26] & 0x40);
|
||||
sh_write_internal = (dev->regs[0x06] & 0x40);
|
||||
/* D0000-EFFFF */
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
base = 0xd0000 + (i << 14);
|
||||
if (base >= 0xe0000) {
|
||||
sh_master = (dev->regs[0x22] & 0x40);
|
||||
sh_wp = (dev->regs[0x22] & 0x10);
|
||||
sh_master = (dev->regs[0x02] & 0x40);
|
||||
sh_wp = (dev->regs[0x02] & 0x10);
|
||||
} else {
|
||||
sh_master = (dev->regs[0x22] & 0x20);
|
||||
sh_wp = (dev->regs[0x22] & 0x08);
|
||||
sh_master = (dev->regs[0x02] & 0x20);
|
||||
sh_wp = (dev->regs[0x02] & 0x08);
|
||||
}
|
||||
sh_enable = dev->regs[0x23] & (1 << i);
|
||||
sh_enable = dev->regs[0x03] & (1 << i);
|
||||
|
||||
if (sh_master) {
|
||||
if (sh_enable) {
|
||||
@@ -95,22 +120,29 @@ opti391_shadow_recalc(opti391_t *dev)
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
|
||||
else
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
} else if (sh_write_internal)
|
||||
dev->shadowed |= (1 << (i + 4));
|
||||
} else if (sh_write_internal) {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
dev->shadowed |= (1 << (i + 4));
|
||||
} else {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
} else if (sh_write_internal)
|
||||
dev->shadowed &= ~(1 << (i + 4));
|
||||
}
|
||||
} else if (sh_write_internal) {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
dev->shadowed |= (1 << (i + 4));
|
||||
} else {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
dev->shadowed &= ~(1 << (i + 4));
|
||||
}
|
||||
}
|
||||
|
||||
/* C0000-CFFFF */
|
||||
sh_master = !(dev->regs[0x26] & 0x10);
|
||||
sh_wp = (dev->regs[0x26] & 0x20);
|
||||
sh_master = (dev->regs[0x06] & 0x10); /* OPTi 391 datasheet erratum! */
|
||||
sh_wp = (dev->regs[0x06] & 0x20);
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
base = 0xc0000 + (i << 14);
|
||||
sh_enable = dev->regs[0x26] & (1 << i);
|
||||
sh_enable = dev->regs[0x06] & (1 << i);
|
||||
|
||||
if (sh_master) {
|
||||
if (sh_enable) {
|
||||
@@ -118,15 +150,24 @@ opti391_shadow_recalc(opti391_t *dev)
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
|
||||
else
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
} else if (sh_write_internal)
|
||||
dev->shadowed |= (1 << i);
|
||||
} else if (sh_write_internal) {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
dev->shadowed |= (1 << i);
|
||||
} else {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
} else if (sh_write_internal)
|
||||
dev->shadowed &= ~(1 << i);
|
||||
}
|
||||
} else if (sh_write_internal) {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
dev->shadowed |= (1 << i);
|
||||
} else {
|
||||
mem_set_mem_state_both(base, 0x4000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
dev->shadowed &= ~(1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
opti391_recalcremap(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -134,6 +175,8 @@ opti391_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
opti391_t *dev = (opti391_t *) priv;
|
||||
|
||||
opti391_log("[W] %04X = %02X\n", addr, val);
|
||||
|
||||
switch (addr) {
|
||||
case 0x22:
|
||||
dev->index = val;
|
||||
@@ -142,26 +185,76 @@ opti391_write(uint16_t addr, uint8_t val, void *priv)
|
||||
case 0x24:
|
||||
opti391_log("OPTi 391: dev->regs[%02x] = %02x\n", dev->index, val);
|
||||
|
||||
switch (dev->index) {
|
||||
case 0x20:
|
||||
dev->regs[dev->index] = (dev->regs[dev->index] & 0xc0) | (val & 0x3f);
|
||||
if ((dev->index <= 0x01) && (dev->type < 2)) switch (dev->index) {
|
||||
case 0x00:
|
||||
if (!(dev->regs[0x10] & 0x20) && (val & 0x20)) {
|
||||
softresetx86(); /* Pulse reset! */
|
||||
cpu_set_edx();
|
||||
flushmmucache();
|
||||
}
|
||||
dev->regs[dev->index + 0x10] = val;
|
||||
break;
|
||||
|
||||
case 0x21:
|
||||
case 0x24:
|
||||
case 0x25:
|
||||
case 0x27:
|
||||
case 0x28:
|
||||
case 0x29:
|
||||
case 0x2a:
|
||||
case 0x2b:
|
||||
dev->regs[dev->index] = val;
|
||||
case 0x01:
|
||||
dev->regs[dev->index + 0x10] = val;
|
||||
reset_on_hlt = !!(val & 0x02);
|
||||
break;
|
||||
} else switch (dev->index - dev->reg_base) {
|
||||
case 0x00:
|
||||
if (dev->type == 2) {
|
||||
reset_on_hlt = !!(val & 0x02);
|
||||
if (!(dev->regs[dev->index - dev->reg_base] & 0x01) && (val & 0x01)) {
|
||||
softresetx86(); /* Pulse reset! */
|
||||
cpu_set_edx();
|
||||
flushmmucache();
|
||||
}
|
||||
dev->regs[dev->index - dev->reg_base] =
|
||||
(dev->regs[dev->index - dev->reg_base] & 0xc0) | (val & 0x3f);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
case 0x26:
|
||||
dev->regs[dev->index] = val;
|
||||
case 0x01:
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
if (dev->type == 2) {
|
||||
cpu_cache_ext_enabled = !!(dev->regs[0x01] & 0x10);
|
||||
cpu_update_waitstates();
|
||||
} else
|
||||
opti391_recalcremap(dev);
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
case 0x05:
|
||||
case 0x09:
|
||||
case 0x0a:
|
||||
case 0x0b:
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
if (dev->type < 2) {
|
||||
mem_a20_alt = val & 0x08;
|
||||
mem_a20_recalc();
|
||||
}
|
||||
break;
|
||||
case 0x08:
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
if (dev->type < 2) {
|
||||
cpu_cache_ext_enabled = !!(dev->regs[0x02] & 0x40);
|
||||
cpu_update_waitstates();
|
||||
}
|
||||
break;
|
||||
case 0x0c:
|
||||
case 0x0d:
|
||||
if (dev->type < 2)
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
case 0x03:
|
||||
case 0x06:
|
||||
pclog("Write %02X: %02X\n", dev->index - dev->reg_base, val);
|
||||
dev->regs[dev->index - dev->reg_base] = val;
|
||||
opti391_shadow_recalc(dev);
|
||||
break;
|
||||
|
||||
@@ -181,8 +274,14 @@ opti391_read(uint16_t addr, void *priv)
|
||||
const opti391_t *dev = (opti391_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
if (addr == 0x24)
|
||||
ret = dev->regs[dev->index];
|
||||
if (addr == 0x24) {
|
||||
if ((dev->index <= 0x01) && (dev->type < 2))
|
||||
ret = dev->regs[dev->index + 0x10];
|
||||
else if ((dev->index >= dev->min_reg) && (dev->index <= dev->max_reg))
|
||||
ret = dev->regs[dev->index - dev->reg_base];
|
||||
}
|
||||
|
||||
opti391_log("[R] %04X = %02X\n", addr, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -196,32 +295,68 @@ opti391_close(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
opti391_init(UNUSED(const device_t *info))
|
||||
opti391_init(const device_t *info)
|
||||
{
|
||||
opti391_t *dev = (opti391_t *) malloc(sizeof(opti391_t));
|
||||
memset(dev, 0x00, sizeof(opti391_t));
|
||||
opti391_t *dev = (opti391_t *) calloc(1, sizeof(opti391_t));
|
||||
|
||||
io_sethandler(0x0022, 0x0001, opti391_read, NULL, NULL, opti391_write, NULL, NULL, dev);
|
||||
io_sethandler(0x0024, 0x0001, opti391_read, NULL, NULL, opti391_write, NULL, NULL, dev);
|
||||
|
||||
dev->regs[0x21] = 0x84;
|
||||
dev->regs[0x24] = 0x07;
|
||||
dev->regs[0x25] = 0xf0;
|
||||
dev->regs[0x26] = 0x30;
|
||||
dev->regs[0x27] = 0x91;
|
||||
dev->regs[0x28] = 0x80;
|
||||
dev->regs[0x29] = 0x10;
|
||||
dev->regs[0x2a] = 0x80;
|
||||
dev->regs[0x2b] = 0x10;
|
||||
dev->type = info->local;
|
||||
|
||||
if (info->local == 2) {
|
||||
dev->reg_base = 0x20;
|
||||
dev->min_reg = 0x20;
|
||||
dev->max_reg = 0x2b;
|
||||
|
||||
dev->regs[0x02] = 0x84;
|
||||
dev->regs[0x04] = 0x07;
|
||||
dev->regs[0x05] = 0xf0;
|
||||
dev->regs[0x06] = 0x30;
|
||||
dev->regs[0x07] = 0x91;
|
||||
dev->regs[0x08] = 0x80;
|
||||
dev->regs[0x09] = 0x10;
|
||||
dev->regs[0x0a] = 0x80;
|
||||
dev->regs[0x0b] = 0x10;
|
||||
} else {
|
||||
dev->reg_base = 0x0f;
|
||||
dev->min_reg = 0x10;
|
||||
dev->max_reg = 0x1c;
|
||||
|
||||
dev->regs[0x01] = 0x01;
|
||||
dev->regs[0x02] = 0xe0;
|
||||
if (info->local == 1)
|
||||
/* Guess due to no OPTi 48x datasheet. */
|
||||
dev->regs[0x04] = 0x07;
|
||||
else
|
||||
dev->regs[0x04] = 0x77;
|
||||
dev->regs[0x05] = 0x60;
|
||||
dev->regs[0x06] = 0x10;
|
||||
dev->regs[0x07] = 0x50;
|
||||
if (info->local == 1) {
|
||||
/* Guess due to no OPTi 48x datasheet. */
|
||||
dev->regs[0x09] = 0x80; /* Non-Cacheable Block 1 */
|
||||
dev->regs[0x0b] = 0x80; /* Non-Cacheable Block 2 */
|
||||
dev->regs[0x0d] = 0x91; /* Cacheable Area */
|
||||
} else {
|
||||
dev->regs[0x09] = 0xe0; /* Non-Cacheable Block 1 */
|
||||
dev->regs[0x0b] = 0x10; /* Non-Cacheable Block 2 */
|
||||
dev->regs[0x0d] = 0x80; /* Cacheable Area */
|
||||
}
|
||||
dev->regs[0x0a] = 0x10;
|
||||
dev->regs[0x0c] = 0x10;
|
||||
}
|
||||
|
||||
dev->old_start = 1024;
|
||||
|
||||
opti391_shadow_recalc(dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
const device_t opti391_device = {
|
||||
.name = "OPTi 82C391",
|
||||
.internal_name = "opti391",
|
||||
const device_t opti381_device = {
|
||||
.name = "OPTi 82C381",
|
||||
.internal_name = "opti381",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = opti391_init,
|
||||
@@ -232,3 +367,31 @@ const device_t opti391_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t opti481_device = {
|
||||
.name = "OPTi 82C481",
|
||||
.internal_name = "opti481",
|
||||
.flags = 0,
|
||||
.local = 1,
|
||||
.init = opti391_init,
|
||||
.close = opti391_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t opti391_device = {
|
||||
.name = "OPTi 82C391",
|
||||
.internal_name = "opti391",
|
||||
.flags = 0,
|
||||
.local = 2,
|
||||
.init = opti391_init,
|
||||
.close = opti391_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ opti499_recalc(opti499_t *dev)
|
||||
shflags = MEM_READ_INTERNAL;
|
||||
shflags |= (dev->regs[0x22] & ((base >= 0xe0000) ? 0x08 : 0x10)) ? MEM_WRITE_DISABLED : MEM_WRITE_INTERNAL;
|
||||
} else {
|
||||
if (dev->regs[0x2d] && (1 << ((i >> 1) + 2)))
|
||||
if (dev->regs[0x2d] & (1 << ((i >> 1) + 2)))
|
||||
shflags = MEM_READ_EXTANY | MEM_WRITE_EXTANY;
|
||||
else
|
||||
shflags = MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL;
|
||||
@@ -101,13 +101,13 @@ opti499_recalc(opti499_t *dev)
|
||||
shflags |= (dev->regs[0x26] & 0x20) ? MEM_WRITE_DISABLED : MEM_WRITE_INTERNAL;
|
||||
} else {
|
||||
if (dev->regs[0x26] & 0x40) {
|
||||
if (dev->regs[0x2d] && (1 << (i >> 1)))
|
||||
if (dev->regs[0x2d] & (1 << (i >> 1)))
|
||||
shflags = MEM_READ_EXTANY;
|
||||
else
|
||||
shflags = MEM_READ_EXTERNAL;
|
||||
shflags |= (dev->regs[0x26] & 0x20) ? MEM_WRITE_DISABLED : MEM_WRITE_INTERNAL;
|
||||
} else {
|
||||
if (dev->regs[0x2d] && (1 << (i >> 1)))
|
||||
if (dev->regs[0x2d] & (1 << (i >> 1)))
|
||||
shflags = MEM_READ_EXTANY | MEM_WRITE_EXTANY;
|
||||
else
|
||||
shflags = MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL;
|
||||
@@ -226,8 +226,6 @@ opti499_reset(void *priv)
|
||||
cpu_update_waitstates();
|
||||
|
||||
opti499_recalc(dev);
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
20
src/config.c
20
src/config.c
@@ -792,9 +792,9 @@ load_storage_controllers(void)
|
||||
p = ini_section_get_string(cat, "fdc", NULL);
|
||||
#if 1
|
||||
if (p != NULL)
|
||||
fdc_type = fdc_card_get_from_internal_name(p);
|
||||
fdc_current[0] = fdc_card_get_from_internal_name(p);
|
||||
else
|
||||
fdc_type = FDC_INTERNAL;
|
||||
fdc_current[0] = FDC_INTERNAL;
|
||||
#else
|
||||
if (p == NULL) {
|
||||
if (machine_has_flags(machine, MACHINE_FDC)) {
|
||||
@@ -807,7 +807,7 @@ load_storage_controllers(void)
|
||||
free_p = 1;
|
||||
}
|
||||
|
||||
fdc_type = fdc_card_get_from_internal_name(p);
|
||||
fdc_current[0] = fdc_card_get_from_internal_name(p);
|
||||
|
||||
if (free_p) {
|
||||
free(p);
|
||||
@@ -829,15 +829,15 @@ load_storage_controllers(void)
|
||||
}
|
||||
/* Migrate renamed and merged cards. */
|
||||
if (!strcmp(p, "xtide_plus")) {
|
||||
hdc_current = hdc_get_from_internal_name("xtide");
|
||||
hdc_current[0] = hdc_get_from_internal_name("xtide");
|
||||
migration_cat = ini_find_or_create_section(config, "PC/XT XTIDE");
|
||||
ini_section_set_string(migration_cat, "bios", "xt_plus");
|
||||
} else if (!strcmp(p, "xtide_at_386")) {
|
||||
hdc_current = hdc_get_from_internal_name("xtide_at");
|
||||
hdc_current[0] = hdc_get_from_internal_name("xtide_at");
|
||||
migration_cat = ini_find_or_create_section(config, "PC/AT XTIDE");
|
||||
ini_section_set_string(migration_cat, "bios", "at_386");
|
||||
} else
|
||||
hdc_current = hdc_get_from_internal_name(p);
|
||||
hdc_current[0] = hdc_get_from_internal_name(p);
|
||||
|
||||
if (free_p) {
|
||||
free(p);
|
||||
@@ -1631,7 +1631,7 @@ config_load(void)
|
||||
video_fullscreen_first = 1;
|
||||
video_fullscreen_scale = 1;
|
||||
time_sync = TIME_SYNC_ENABLED;
|
||||
hdc_current = hdc_get_from_internal_name("none");
|
||||
hdc_current[0] = hdc_get_from_internal_name("none");
|
||||
|
||||
com_ports[0].enabled = 1;
|
||||
com_ports[1].enabled = 1;
|
||||
@@ -2296,14 +2296,14 @@ save_storage_controllers(void)
|
||||
scsi_card_get_internal_name(scsi_card_current[c]));
|
||||
}
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
ini_section_delete_var(cat, "fdc");
|
||||
else
|
||||
ini_section_set_string(cat, "fdc",
|
||||
fdc_card_get_internal_name(fdc_type));
|
||||
fdc_card_get_internal_name(fdc_current[0]));
|
||||
|
||||
ini_section_set_string(cat, "hdc",
|
||||
hdc_get_internal_name(hdc_current));
|
||||
hdc_get_internal_name(hdc_current[0]));
|
||||
|
||||
if (cdrom_interface_current == 0)
|
||||
ini_section_delete_var(cat, "cdrom_interface");
|
||||
|
||||
@@ -422,6 +422,14 @@ kbc_delay_to_ob(atkbc_t *dev, uint8_t val, uint8_t channel, uint8_t stat_hi)
|
||||
dev->stat_hi = stat_hi;
|
||||
dev->pending = 1;
|
||||
dev->state = STATE_KBC_DELAY_OUT;
|
||||
|
||||
if (dev->is_asic && (channel == 0) && (dev->status & STAT_OFULL)) {
|
||||
/* Expedite the sending to the output buffer to prevent the wrong
|
||||
data from being accidentally read. */
|
||||
kbc_send_to_ob(dev, dev->val, dev->channel, dev->stat_hi);
|
||||
dev->state = STATE_MAIN_IBF;
|
||||
dev->pending = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void kbc_at_process_cmd(void *priv);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdd.h>
|
||||
|
||||
int hdc_current;
|
||||
int hdc_current[HDC_MAX] = { 0, 0 };
|
||||
|
||||
#ifdef ENABLE_HDC_LOG
|
||||
int hdc_do_log = ENABLE_HDC_LOG;
|
||||
@@ -101,11 +101,11 @@ void
|
||||
hdc_reset(void)
|
||||
{
|
||||
hdc_log("HDC: reset(current=%d, internal=%d)\n",
|
||||
hdc_current, (machines[machine].flags & MACHINE_HDC) ? 1 : 0);
|
||||
hdc_current[0], (machines[machine].flags & MACHINE_HDC) ? 1 : 0);
|
||||
|
||||
/* If we have a valid controller, add its device. */
|
||||
if (hdc_current > HDC_INTERNAL)
|
||||
device_add(controllers[hdc_current].device);
|
||||
if (hdc_current[0] > HDC_INTERNAL)
|
||||
device_add(controllers[hdc_current[0]].device);
|
||||
|
||||
/* Now, add the tertiary and/or quaternary IDE controllers. */
|
||||
if (ide_ter_enabled)
|
||||
|
||||
@@ -77,7 +77,7 @@ int lastbyte = 0;
|
||||
int floppymodified[4];
|
||||
int floppyrate[4];
|
||||
|
||||
int fdc_type = 0;
|
||||
int fdc_current[FDC_MAX] = { 0, 0 };
|
||||
|
||||
#ifdef ENABLE_FDC_LOG
|
||||
int fdc_do_log = ENABLE_FDC_LOG;
|
||||
@@ -162,8 +162,8 @@ fdc_card_get_from_internal_name(char *s)
|
||||
void
|
||||
fdc_card_init(void)
|
||||
{
|
||||
if ((fdc_type > FDC_INTERNAL) && fdc_cards[fdc_type].device)
|
||||
device_add_inst(fdc_cards[fdc_type].device, 0);
|
||||
if ((fdc_current[0] > FDC_INTERNAL) && fdc_cards[fdc_current[0]].device)
|
||||
device_add_inst(fdc_cards[fdc_current[0]].device, 0);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
|
||||
@@ -39,6 +39,7 @@ extern const device_t amd640_device;
|
||||
|
||||
/* Compaq */
|
||||
extern const device_t compaq_386_device;
|
||||
extern const device_t compaq_genoa_device;
|
||||
|
||||
/* Contaq/Cypress */
|
||||
extern const device_t contaq_82c596a_device;
|
||||
@@ -110,8 +111,12 @@ extern const device_t ioapic_device;
|
||||
/* OPTi */
|
||||
extern const device_t opti283_device;
|
||||
extern const device_t opti291_device;
|
||||
extern const device_t opti381_device;
|
||||
extern const device_t opti391_device;
|
||||
extern const device_t opti481_device;
|
||||
extern const device_t opti493_device;
|
||||
extern const device_t opti495_device;
|
||||
extern const device_t opti499_device;
|
||||
extern const device_t opti601_device;
|
||||
extern const device_t opti602_device;
|
||||
extern const device_t opti802g_device;
|
||||
|
||||
@@ -113,8 +113,8 @@ typedef struct config_t {
|
||||
# endif
|
||||
|
||||
/* Other peripherals category */
|
||||
int fdc_type; /* Floppy disk controller type */
|
||||
int hdc_current; /* Hard disk controller type */
|
||||
int fdc_current[FDC_MAX]; /* Floppy disk controller type */
|
||||
int hdc_current[HDC_MAX]; /* Hard disk controller type */
|
||||
int hdc; /* Hard disk controller */
|
||||
int scsi_card; /* SCSI controller */
|
||||
int ide_ter_enabled; /* Tertiary IDE controller enabled */
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#ifndef EMU_FDC_H
|
||||
#define EMU_FDC_H
|
||||
|
||||
extern int fdc_type;
|
||||
|
||||
#define FDC_PRIMARY_ADDR 0x03f0
|
||||
#define FDC_PRIMARY_IRQ 6
|
||||
#define FDC_PRIMARY_DMA 2
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#ifndef EMU_FDC_EXT_H
|
||||
#define EMU_FDC_EXT_H
|
||||
|
||||
extern int fdc_type;
|
||||
#define FDC_MAX 2
|
||||
|
||||
extern int fdc_current[FDC_MAX];
|
||||
|
||||
/* Controller types. */
|
||||
#define FDC_NONE 0
|
||||
@@ -42,4 +44,4 @@ extern const device_t *fdc_card_getdevice(int card);
|
||||
extern int fdc_card_has_config(int card);
|
||||
extern int fdc_card_available(int card);
|
||||
|
||||
#endif /*EMU_FDC_H*/
|
||||
#endif /*EMU_FDC_EXT_H*/
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#define HDC_NONE 0
|
||||
#define HDC_INTERNAL 1
|
||||
|
||||
extern int hdc_current;
|
||||
#define HDC_MAX 2
|
||||
|
||||
extern int hdc_current[HDC_MAX];
|
||||
|
||||
extern const device_t st506_xt_xebec_device; /* st506_xt_xebec */
|
||||
extern const device_t st506_xt_wdxt_gen_device; /* st506_xt_wdxt_gen */
|
||||
|
||||
@@ -232,6 +232,9 @@ enum {
|
||||
MACHINE_CHIPSET_INTEL_440GX,
|
||||
MACHINE_CHIPSET_OPTI_283,
|
||||
MACHINE_CHIPSET_OPTI_291,
|
||||
MACHINE_CHIPSET_OPTI_381,
|
||||
MACHINE_CHIPSET_OPTI_391,
|
||||
MACHINE_CHIPSET_OPTI_481,
|
||||
MACHINE_CHIPSET_OPTI_493,
|
||||
MACHINE_CHIPSET_OPTI_495,
|
||||
MACHINE_CHIPSET_OPTI_499,
|
||||
@@ -274,6 +277,7 @@ enum {
|
||||
MACHINE_CHIPSET_VLSI_VL82C481,
|
||||
MACHINE_CHIPSET_VLSI_VL82C486,
|
||||
MACHINE_CHIPSET_WD76C10,
|
||||
MACHINE_CHIPSET_ZYMOS_POACH,
|
||||
MACHINE_CHIPSET_MAX
|
||||
};
|
||||
|
||||
@@ -442,6 +446,7 @@ extern int machine_at_ibmxt286_init(const machine_t *);
|
||||
|
||||
extern int machine_at_siemens_init(const machine_t *); // Siemens PCD-2L. N82330 discrete machine. It segfaults in some places
|
||||
|
||||
extern int machine_at_wellamerastar_init(const machine_t *); // Wells American A*Star with custom award BIOS
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPEN_AT)
|
||||
extern int machine_at_openat_init(const machine_t *);
|
||||
#endif
|
||||
@@ -498,6 +503,14 @@ extern int machine_at_awardsx_init(const machine_t *);
|
||||
extern int machine_at_pc916sx_init(const machine_t *);
|
||||
|
||||
/* m_at_386dx_486.c */
|
||||
/* Note to jriwanek: When merging this into my branch, please make
|
||||
sure this appear here (and in the .c file) in the order and position
|
||||
in which they appear in the machine table. */
|
||||
extern int machine_at_dataexpert386wb_init(const machine_t *);
|
||||
extern int machine_at_genoa486_init(const machine_t *);
|
||||
extern int machine_at_ga486l_init(const machine_t *);
|
||||
extern int machine_at_cougar_init(const machine_t *);
|
||||
|
||||
extern int machine_at_acc386_init(const machine_t *);
|
||||
extern int machine_at_asus386_init(const machine_t *);
|
||||
extern int machine_at_ecs386_init(const machine_t *);
|
||||
|
||||
@@ -451,6 +451,7 @@ extern void mem_a20_recalc(void);
|
||||
extern void mem_init(void);
|
||||
extern void mem_close(void);
|
||||
extern void mem_reset(void);
|
||||
extern void mem_remap_top_ex(int kb, uint32_t start);
|
||||
extern void mem_remap_top(int kb);
|
||||
|
||||
extern void umc_smram_recalc(uint32_t start, int set);
|
||||
|
||||
@@ -105,7 +105,7 @@ machine_at_ibm_common_init(const machine_t *model)
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
@@ -252,12 +252,29 @@ machine_at_siemens_init(const machine_t *model)
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_wellamerastar_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/wellamerastar/W_3.031_L.BIN",
|
||||
"roms/machines/wellamerastar/W_3.031_H.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_ibm_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPEN_AT)
|
||||
int
|
||||
machine_at_openat_init(const machine_t *model)
|
||||
|
||||
@@ -59,7 +59,7 @@ machine_at_mr286_init(const machine_t *model)
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -70,7 +70,7 @@ machine_at_headland_common_init(int type)
|
||||
{
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if ((type != 2) && (fdc_type == FDC_INTERNAL))
|
||||
if ((type != 2) && (fdc_current[0] == FDC_INTERNAL))
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (type == 2)
|
||||
@@ -137,7 +137,7 @@ machine_at_quadt286_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&headland_gc10x_device);
|
||||
@@ -160,7 +160,7 @@ machine_at_quadt386sx_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&headland_gc10x_device);
|
||||
@@ -183,7 +183,7 @@ machine_at_neat_init(const machine_t *model)
|
||||
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -204,7 +204,7 @@ machine_at_neat_ami_init(const machine_t *model)
|
||||
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
@@ -226,7 +226,7 @@ machine_at_px286_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&neat_device);
|
||||
@@ -248,7 +248,7 @@ machine_at_micronics386_init(const machine_t *model)
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -284,7 +284,7 @@ machine_at_scatsx_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&scat_sx_device);
|
||||
@@ -303,7 +303,7 @@ machine_at_award286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
@@ -324,7 +324,7 @@ machine_at_gdc212m_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
@@ -365,7 +365,7 @@ machine_at_senor_scat286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -386,7 +386,7 @@ machine_at_super286c_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&neat_device);
|
||||
@@ -407,7 +407,7 @@ machine_at_super286tr_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -426,7 +426,7 @@ machine_at_spc4200p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
@@ -448,7 +448,7 @@ machine_at_spc4216p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 1, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -471,7 +471,7 @@ machine_at_spc4620p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 1, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
@@ -508,7 +508,7 @@ machine_at_deskmaster286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
@@ -533,7 +533,7 @@ machine_at_shuttle386sx_init(const machine_t *model)
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -557,7 +557,7 @@ machine_at_adi386sx_init(const machine_t *model)
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -603,7 +603,7 @@ machine_at_cmdsl386sx16_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&neat_device);
|
||||
@@ -624,7 +624,7 @@ machine_at_scamp_common_init(const machine_t *model, int is_ps2)
|
||||
else
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&vlsi_scamp_device);
|
||||
@@ -699,7 +699,7 @@ machine_at_awardsx_init(const machine_t *model)
|
||||
|
||||
device_add(&opti291_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -718,7 +718,7 @@ machine_at_acer100t_init(const machine_t *model)
|
||||
|
||||
machine_at_ps2_ide_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ali1409_device);
|
||||
@@ -896,7 +896,7 @@ machine_at_pc8_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -921,7 +921,7 @@ machine_at_3302_init(const machine_t *model)
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
@@ -953,7 +953,7 @@ machine_at_pc916sx_init(const machine_t *model)
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -975,7 +975,7 @@ machine_at_m290_init(const machine_t *model)
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
device_add(&port_6x_olivetti_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&olivetti_eva_device);
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <86box/sio.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/port_92.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/scsi_ncr53c8xx.h>
|
||||
@@ -63,7 +64,7 @@ machine_at_acc386_init(const machine_t *model)
|
||||
device_add(&acc2168_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -84,7 +85,7 @@ machine_at_asus386_init(const machine_t *model)
|
||||
device_add(&rabbit_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -104,7 +105,7 @@ machine_at_tandy4000_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -117,7 +118,7 @@ machine_at_sis401_common_init(const machine_t *model)
|
||||
device_add(&sis_85c401_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
@@ -168,7 +169,7 @@ machine_at_av4_init(const machine_t *model)
|
||||
device_add(&sis_85c460_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -192,7 +193,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -213,7 +214,7 @@ machine_at_ecs386_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&cs8230_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
@@ -236,7 +237,7 @@ machine_at_spc6000a_init(const machine_t *model)
|
||||
machine_at_common_init_ex(model, 1);
|
||||
device_add(&cs8230_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
@@ -259,7 +260,7 @@ machine_at_ecs386v_init(const machine_t *model)
|
||||
device_add(&ali1429_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -281,7 +282,7 @@ machine_at_rycleopardlx_init(const machine_t *model)
|
||||
device_add(&opti283_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -303,7 +304,7 @@ machine_at_486vchd_init(const machine_t *model)
|
||||
device_add(&via_vt82c49x_device);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -324,7 +325,7 @@ machine_at_cs4031_init(const machine_t *model)
|
||||
device_add(&cs4031_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -448,7 +449,7 @@ machine_at_acerv10_init(const machine_t *model)
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -492,7 +493,7 @@ machine_at_ali1429_common_init(const machine_t *model, int is_green)
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
@@ -545,7 +546,7 @@ machine_at_opti495_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -560,7 +561,7 @@ machine_at_opti495_ami_common_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
@@ -612,7 +613,7 @@ machine_at_exp4349_init(const machine_t *model)
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
return ret;
|
||||
}
|
||||
@@ -630,7 +631,7 @@ machine_at_403tg_common_init(const machine_t *model, int nvr_hack)
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
@@ -801,7 +802,7 @@ machine_at_sis_85c471_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&sis_85c471_device);
|
||||
@@ -920,7 +921,7 @@ machine_at_pci400ca_init(const machine_t *model)
|
||||
device_add(&i420tx_device);
|
||||
device_add(&ncr53c810_onboard_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -956,7 +957,7 @@ machine_at_greenb_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&contaq_82c597_device);
|
||||
@@ -979,7 +980,7 @@ machine_at_4gpv5_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&contaq_82c596a_device);
|
||||
@@ -1417,7 +1418,7 @@ machine_at_pci400cb_init(const machine_t *model)
|
||||
|
||||
device_add(&ims8848_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -1446,7 +1447,7 @@ machine_at_g486ip_init(const machine_t *model)
|
||||
|
||||
device_add(&ims8848_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -1506,7 +1507,7 @@ machine_at_486ap4_init(const machine_t *model)
|
||||
pci_register_slot(0x0c, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 0c = Slot 4 */
|
||||
device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&i420ex_device);
|
||||
@@ -1986,7 +1987,7 @@ machine_at_atc1415_init(const machine_t *model)
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -2247,7 +2248,7 @@ machine_at_ecsal486_init(const machine_t *model)
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -2290,9 +2291,100 @@ machine_at_atc1762_init(const machine_t *model)
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_dataexpert386wb_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/dataexpert386wb/st0386-wb-ver2-0-618f078c738cb397184464.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti391_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_genoa486_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/genoa486/AMI486.BIO",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&compaq_genoa_device);
|
||||
device_add(&port_92_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_ga486l_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ga486l/ga-486l_bios.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&opti381_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_cougar_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/cougar/COUGRMRB.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_vlb_device);
|
||||
|
||||
device_add(&opti499_device);
|
||||
device_add(&fdc37c665_ide_pri_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ machine_at_cmdpc_init(const machine_t *model)
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
cmd_uart = device_add(&ns8250_device);
|
||||
|
||||
@@ -779,7 +779,7 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
{
|
||||
compaq_machine_type = type;
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (type < COMPAQ_PORTABLEIII386) {
|
||||
@@ -798,7 +798,7 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII:
|
||||
if (hdc_current == HDC_INTERNAL)
|
||||
if (hdc_current[0] == HDC_INTERNAL)
|
||||
device_add(&ide_isa_device);
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&compaq_plasma_device);
|
||||
@@ -806,7 +806,7 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII386:
|
||||
if (hdc_current == HDC_INTERNAL)
|
||||
if (hdc_current[0] == HDC_INTERNAL)
|
||||
device_add(&ide_isa_device);
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&compaq_plasma_device);
|
||||
|
||||
@@ -293,7 +293,7 @@ machine_at_award_common_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
@@ -402,7 +402,7 @@ machine_at_p5vl_init(const machine_t *model)
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -345,7 +345,8 @@ machine_at_pt2000_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
/* Should be VIA, but we do not emulate that yet. */
|
||||
device_add(&keyboard_ps2_holtek_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87332_398_device);
|
||||
@@ -370,7 +371,7 @@ machine_at_pat54pv_init(const machine_t *model)
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -400,7 +401,7 @@ machine_at_hot543_init(const machine_t *model)
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -815,7 +815,7 @@ machine_at_t3100e_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_at_toshiba_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL) {
|
||||
if (fdc_current[0] == FDC_INTERNAL) {
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ machine_elt_init(const machine_t *model)
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL) {
|
||||
|
||||
@@ -660,7 +660,7 @@ europc_boot(UNUSED(const device_t *info))
|
||||
*
|
||||
* We only do this if we have not configured another one.
|
||||
*/
|
||||
if (hdc_current == HDC_INTERNAL)
|
||||
if (hdc_current[0] == HDC_INTERNAL)
|
||||
(void) device_add(&xta_hd20_device);
|
||||
|
||||
return sys;
|
||||
|
||||
@@ -353,7 +353,7 @@ ps1_setup(int model)
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current == HDC_INTERNAL) {
|
||||
if (hdc_current[0] == HDC_INTERNAL) {
|
||||
priv = device_add(&ps1_hdc_device);
|
||||
|
||||
ps1_hdc_inform(priv, &ps->ps1_91);
|
||||
|
||||
@@ -179,7 +179,7 @@ ps2_isa_setup(int model, int cpu_type)
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current == HDC_INTERNAL) {
|
||||
if (hdc_current[0] == HDC_INTERNAL) {
|
||||
priv = device_add(&ps1_hdc_device);
|
||||
ps1_hdc_inform(priv, &ps2->ps2_91);
|
||||
}
|
||||
|
||||
@@ -1395,7 +1395,7 @@ machine_ps2_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
dma16_init();
|
||||
|
||||
@@ -1738,7 +1738,7 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
|
||||
device_add(&keyboard_tandy_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
@@ -88,13 +88,13 @@ machine_v86p_init(const machine_t *model)
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&f82c425_video_device);
|
||||
|
||||
if (hdc_current <= HDC_INTERNAL)
|
||||
if (hdc_current[0] <= HDC_INTERNAL)
|
||||
device_add(&st506_xt_victor_v86p_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -25,7 +25,7 @@ extern const device_t vendex_xt_rtc_onboard_device;
|
||||
static void
|
||||
machine_xt_common_init(const machine_t *model, int fixed_floppy)
|
||||
{
|
||||
if ((fdc_type == FDC_INTERNAL) || fixed_floppy)
|
||||
if ((fdc_current[0] == FDC_INTERNAL) || fixed_floppy)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
@@ -53,7 +53,7 @@ machine_xt_compaq_deskpro_init(const machine_t *model)
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
standalone_gameport_type = &gameport_device;
|
||||
@@ -80,7 +80,7 @@ machine_xt_compaq_portable_init(const machine_t *model)
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
if (joystick_type)
|
||||
|
||||
@@ -147,7 +147,7 @@ machine_xt_laserxt_common_init(const machine_t *model,int is_lxt3)
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
@@ -591,7 +591,7 @@ m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
* bit 7 - use BIOS HD on mainboard (on) / on controller (off)
|
||||
* bit 6 - use OCG/CGA display adapter (on) / other display adapter (off)
|
||||
*/
|
||||
ret = (hdc_current == HDC_INTERNAL) ? 0x00 : 0x80;
|
||||
ret = (hdc_current[0] == HDC_INTERNAL) ? 0x00 : 0x80;
|
||||
ret |= video_is_cga() ? 0x40 : 0x00;
|
||||
|
||||
m24_kbd_adddata(ret);
|
||||
@@ -2219,7 +2219,7 @@ m24_read(uint16_t port, UNUSED(void *priv))
|
||||
"Reserved for HDU", same as for Switch 3 */
|
||||
|
||||
/* Switch 3 - Disable internal BIOS HD */
|
||||
if (hdc_current != HDC_INTERNAL)
|
||||
if (hdc_current[0] != HDC_INTERNAL)
|
||||
ret |= 0x4;
|
||||
|
||||
/* Switch 2 - Set fast startup */
|
||||
@@ -2317,7 +2317,7 @@ machine_xt_m24_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
/* On-board FDC can be disabled only on M24SP */
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
/* Address 66-67 = mainboard dip-switch settings */
|
||||
@@ -2349,7 +2349,7 @@ machine_xt_m24_init(const machine_t *model)
|
||||
m24_kbd_init(m24_kbd);
|
||||
device_add_ex(&m24_kbd_device, m24_kbd);
|
||||
|
||||
if (hdc_current == HDC_INTERNAL)
|
||||
if (hdc_current[0] == HDC_INTERNAL)
|
||||
device_add(&st506_xt_wd1002a_wx1_nobios_device);
|
||||
|
||||
return ret;
|
||||
@@ -2393,7 +2393,7 @@ machine_xt_m240_init(const machine_t *model)
|
||||
m24_kbd_init(m24_kbd);
|
||||
device_add_ex(&m24_kbd_device, m24_kbd);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device); /* io.c logs clearly show it using port 3F7 */
|
||||
|
||||
if (joystick_type)
|
||||
@@ -2409,7 +2409,7 @@ machine_xt_m240_init(const machine_t *model)
|
||||
|
||||
mm58274_init(nvr, model->nvrmask + 1);
|
||||
|
||||
if (hdc_current == HDC_INTERNAL)
|
||||
if (hdc_current[0] == HDC_INTERNAL)
|
||||
device_add(&st506_xt_wd1002a_wx1_nobios_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -969,7 +969,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&t1200_video_device);
|
||||
|
||||
if (hdc_current <= HDC_INTERNAL)
|
||||
if (hdc_current[0] <= HDC_INTERNAL)
|
||||
device_add(&st506_xt_toshiba_t1200_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -201,7 +201,7 @@ machine_xt_xi8088_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_ps2_xi8088_device);
|
||||
|
||||
@@ -140,7 +140,7 @@ machine_xt_z184_init(const machine_t *model)
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
@@ -170,7 +170,7 @@ machine_xt_z151_init(const machine_t *model)
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
return ret;
|
||||
@@ -193,7 +193,7 @@ machine_xt_z159_init(const machine_t *model)
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
/* parallel port is on the memory board */
|
||||
|
||||
@@ -126,6 +126,9 @@ const machine_filter_t machine_chipsets[] = {
|
||||
{ "Intel 440GX", MACHINE_CHIPSET_INTEL_440GX },
|
||||
{ "OPTi 283", MACHINE_CHIPSET_OPTI_283 },
|
||||
{ "OPTi 291", MACHINE_CHIPSET_OPTI_291 },
|
||||
{ "OPTi 381", MACHINE_CHIPSET_OPTI_381 },
|
||||
{ "OPTi 391", MACHINE_CHIPSET_OPTI_391 },
|
||||
{ "OPTi 481", MACHINE_CHIPSET_OPTI_481 },
|
||||
{ "OPTi 493", MACHINE_CHIPSET_OPTI_493 },
|
||||
{ "OPTi 495", MACHINE_CHIPSET_OPTI_495 },
|
||||
{ "OPTi 499", MACHINE_CHIPSET_OPTI_499 },
|
||||
@@ -2921,6 +2924,46 @@ const machine_t machines[] = {
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Has Chips & Technologies KBC firmware. */
|
||||
{
|
||||
.name = "[ISA] Wells American A*Star ",
|
||||
.internal_name = "wellamerastar",
|
||||
.type = MACHINE_TYPE_286,
|
||||
.chipset = MACHINE_CHIPSET_DISCRETE,
|
||||
.init = machine_at_wellamerastar_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
.gpio_acpi_handler = NULL,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_286,
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 6000000,
|
||||
.max_bus = 14000000,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_AT,
|
||||
.flags = MACHINE_FLAGS_NONE,
|
||||
.ram = {
|
||||
.min = 512,
|
||||
.max = 1024,
|
||||
.step = 512
|
||||
},
|
||||
.nvrmask = 63,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
#if defined(DEV_BRANCH) && defined(USE_OLIVETTI)
|
||||
/* Has Olivetti KBC firmware. */
|
||||
{
|
||||
@@ -5221,6 +5264,46 @@ const machine_t machines[] = {
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Has AMIKey 'F' KBC firmware. */
|
||||
{
|
||||
.name = "[OPTi 391] DataExpert 386WB",
|
||||
.internal_name = "dataexpert386wb",
|
||||
.type = MACHINE_TYPE_386DX,
|
||||
.chipset = MACHINE_CHIPSET_OPTI_391,
|
||||
.init = machine_at_dataexpert386wb_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
.gpio_acpi_handler = NULL,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_386DX, /* Actual machine only supports 386DXes */
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 0,
|
||||
.max_bus = 0,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_AT,
|
||||
.flags = MACHINE_FLAGS_NONE,
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 32768,
|
||||
.step = 1024
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* The board has a "ASII KB-100" which I was not able to find any information about,
|
||||
but the BIOS sends commands C9 without a parameter and D5, both of which are
|
||||
@@ -5550,6 +5633,86 @@ const machine_t machines[] = {
|
||||
},
|
||||
|
||||
/* 486 machines - Socket 1 */
|
||||
/* Has AMI KF KBC firmware. */
|
||||
{
|
||||
.name = "[ZyMOS Poach] Genoa Unknown 486",
|
||||
.internal_name = "genoa486",
|
||||
.type = MACHINE_TYPE_486,
|
||||
.chipset = MACHINE_CHIPSET_ZYMOS_POACH,
|
||||
.init = machine_at_genoa486_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
.gpio_acpi_handler = NULL,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_SOCKET1,
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 0,
|
||||
.max_bus = 0,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_AT,
|
||||
.flags = MACHINE_APM,
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 65536,
|
||||
.step = 1024
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Has AMI KF KBC firmware. */
|
||||
{
|
||||
.name = "[OPTi 381] Gigabyte GA-486L",
|
||||
.internal_name = "ga486l",
|
||||
.type = MACHINE_TYPE_486,
|
||||
.chipset = MACHINE_CHIPSET_OPTI_381,
|
||||
.init = machine_at_ga486l_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
.gpio_acpi_handler = NULL,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_SOCKET1,
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 0,
|
||||
.max_bus = 0,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_AT,
|
||||
.flags = MACHINE_APM,
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 16384,
|
||||
.step = 1024
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Has JetKey 5 KBC Firmware which looks like it is a clone of AMIKey type F.
|
||||
It also has those Ex commands also seen on the VIA VT82C42N (the BIOS
|
||||
supposedly sends command EF.
|
||||
@@ -6204,6 +6367,46 @@ const machine_t machines[] = {
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Has AMIKey-2 'H' KBC firmware. */
|
||||
{
|
||||
.name = "[OPTi 499] Alaris COUGAR 486BL",
|
||||
.internal_name = "cougar",
|
||||
.type = MACHINE_TYPE_486_S2,
|
||||
.chipset = MACHINE_CHIPSET_OPTI_499,
|
||||
.init = machine_at_cougar_init,
|
||||
.p1_handler = NULL,
|
||||
.gpio_handler = NULL,
|
||||
.available_flag = MACHINE_AVAILABLE,
|
||||
.gpio_acpi_handler = NULL,
|
||||
.cpu = {
|
||||
.package = CPU_PKG_SOCKET3,
|
||||
.block = CPU_BLOCK_NONE,
|
||||
.min_bus = 0,
|
||||
.max_bus = 0,
|
||||
.min_voltage = 0,
|
||||
.max_voltage = 0,
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_VLB,
|
||||
.flags = MACHINE_APM,
|
||||
.ram = {
|
||||
.min = 1024,
|
||||
.max = 65536,
|
||||
.step = 1024
|
||||
},
|
||||
.nvrmask = 127,
|
||||
.kbc_device = NULL,
|
||||
.kbc_p1 = 0xff,
|
||||
.gpio = 0xffffffff,
|
||||
.gpio_acpi = 0xffffffff,
|
||||
.device = NULL,
|
||||
.fdc_device = NULL,
|
||||
.sio_device = NULL,
|
||||
.vid_device = NULL,
|
||||
.snd_device = NULL,
|
||||
.net_device = NULL
|
||||
},
|
||||
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
|
||||
{
|
||||
.name = "[SiS 461] DEC DECpc LPV",
|
||||
|
||||
@@ -2968,10 +2968,9 @@ umc_smram_recalc(uint32_t start, int set)
|
||||
}
|
||||
|
||||
void
|
||||
mem_remap_top(int kb)
|
||||
mem_remap_top_ex(int kb, uint32_t start)
|
||||
{
|
||||
uint32_t c;
|
||||
uint32_t start = (mem_size >= 1024) ? mem_size : 1024;
|
||||
int offset;
|
||||
int size = mem_size - 640;
|
||||
int set = 1;
|
||||
@@ -3097,6 +3096,12 @@ mem_remap_top(int kb)
|
||||
flushmmucache();
|
||||
}
|
||||
|
||||
void
|
||||
mem_remap_top(int kb)
|
||||
{
|
||||
mem_remap_top_ex(kb, (mem_size >= 1024) ? mem_size : 1024);
|
||||
}
|
||||
|
||||
void
|
||||
mem_reset_page_blocks(void)
|
||||
{
|
||||
|
||||
@@ -294,7 +294,7 @@ MachineStatus::iterateFDD(const std::function<void(int)> &cb)
|
||||
void
|
||||
MachineStatus::iterateCDROM(const std::function<void(int)> &cb)
|
||||
{
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
|
||||
for (size_t i = 0; i < CDROM_NUM; i++) {
|
||||
/* Could be Internal or External IDE.. */
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && !hasIDE() &&
|
||||
@@ -317,7 +317,7 @@ MachineStatus::iterateCDROM(const std::function<void(int)> &cb)
|
||||
void
|
||||
MachineStatus::iterateZIP(const std::function<void(int)> &cb)
|
||||
{
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
|
||||
for (size_t i = 0; i < ZIP_NUM; i++) {
|
||||
/* Could be Internal or External IDE.. */
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && !hasIDE() &&
|
||||
@@ -338,7 +338,7 @@ MachineStatus::iterateZIP(const std::function<void(int)> &cb)
|
||||
void
|
||||
MachineStatus::iterateMO(const std::function<void(int)> &cb)
|
||||
{
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
|
||||
for (size_t i = 0; i < MO_NUM; i++) {
|
||||
/* Could be Internal or External IDE.. */
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && !hasIDE() &&
|
||||
@@ -602,7 +602,7 @@ MachineStatus::refresh(QStatusBar *sbar)
|
||||
sbar->addWidget(d->net[i].label.get());
|
||||
});
|
||||
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current));
|
||||
auto hdc_name = QString(hdc_get_internal_name(hdc_current[0]));
|
||||
if ((has_mfm || (hdc_name.left(5) == QStringLiteral("st506"))) && (c_mfm > 0)) {
|
||||
d->hdds[HDD_BUS_MFM].label = std::make_unique<QLabel>();
|
||||
d->hdds[HDD_BUS_MFM].setActive(false);
|
||||
|
||||
@@ -56,8 +56,8 @@ SettingsStorageControllers::save()
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxSCSI%1").arg(i + 1));
|
||||
scsi_card_current[i] = cbox->currentData().toInt();
|
||||
}
|
||||
hdc_current = ui->comboBoxHD->currentData().toInt();
|
||||
fdc_type = ui->comboBoxFD->currentData().toInt();
|
||||
hdc_current[0] = ui->comboBoxHD->currentData().toInt();
|
||||
fdc_current[0] = ui->comboBoxFD->currentData().toInt();
|
||||
cdrom_interface_current = ui->comboBoxCDInterface->currentData().toInt();
|
||||
ide_ter_enabled = ui->checkBoxTertiaryIDE->isChecked() ? 1 : 0;
|
||||
ide_qua_enabled = ui->checkBoxQuaternaryIDE->isChecked() ? 1 : 0;
|
||||
@@ -92,7 +92,7 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
|
||||
|
||||
if (device_is_valid(hdc_dev, machineId)) {
|
||||
int row = Models::AddEntry(model, name, c);
|
||||
if (c == hdc_current) {
|
||||
if (c == hdc_current[0]) {
|
||||
selectedRow = row - removeRows;
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
|
||||
|
||||
if (device_is_valid(fdc_dev, machineId)) {
|
||||
int row = Models::AddEntry(model, name, c);
|
||||
if (c == fdc_type) {
|
||||
if (c == fdc_current[0]) {
|
||||
selectedRow = row - removeRows;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
@@ -327,55 +326,17 @@ plat_cdrom_get_audio_sub(UNUSED(uint32_t sector), uint8_t *attr, uint8_t *track,
|
||||
}
|
||||
|
||||
int
|
||||
plat_cdrom_get_sector_size(uint32_t sector)
|
||||
plat_cdrom_get_sector_size(UNUSED(uint32_t sector))
|
||||
{
|
||||
/* Sector size returned by Windows is always a power of two, which is pointless. */
|
||||
return 2352;
|
||||
}
|
||||
long size;
|
||||
DISK_GEOMETRY dgCDROM;
|
||||
|
||||
/* Used EXCLUSIVELY to read raw sectors, not to detect tracks. */
|
||||
static int
|
||||
plat_cdrom_read_scsi_direct(uint32_t sector, uint8_t *buffer)
|
||||
{
|
||||
DWORD unused;
|
||||
int ret;
|
||||
typedef struct SCSI_PASS_THROUGH_DIRECT_BUF {
|
||||
SCSI_PASS_THROUGH_DIRECT spt;
|
||||
ULONG Filler;
|
||||
UCHAR SenseBuf[32];
|
||||
} SCSI_PASS_THROUGH_DIRECT_BUF;
|
||||
plat_cdrom_open();
|
||||
DeviceIoControl(handle, IOCTL_CDROM_GET_DRIVE_GEOMETRY, NULL, 0, &dgCDROM, sizeof(dgCDROM), (LPDWORD)&size, NULL);
|
||||
plat_cdrom_close();
|
||||
|
||||
SCSI_PASS_THROUGH_DIRECT_BUF req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.Filler = 0;
|
||||
req.spt.Length = sizeof(SCSI_PASS_THROUGH_DIRECT);
|
||||
req.spt.CdbLength = 12;
|
||||
req.spt.DataIn = SCSI_IOCTL_DATA_IN;
|
||||
req.spt.SenseInfoOffset = offsetof(SCSI_PASS_THROUGH_DIRECT_BUF, SenseBuf);
|
||||
req.spt.SenseInfoLength = sizeof(req.SenseBuf);
|
||||
req.spt.TimeOutValue = 6;
|
||||
req.spt.DataTransferLength = 2352;
|
||||
req.spt.DataBuffer = buffer;
|
||||
|
||||
/* Fill in the CDB. */
|
||||
req.spt.Cdb[0] = 0xBE; /* READ CD */
|
||||
req.spt.Cdb[1] = 0x00; /* DAP = 0, Any Sector Type. */
|
||||
req.spt.Cdb[2] = (sector & 0xFF000000) >> 24;
|
||||
req.spt.Cdb[3] = (sector & 0xFF0000) >> 16;
|
||||
req.spt.Cdb[4] = (sector & 0xFF00) >> 8;
|
||||
req.spt.Cdb[5] = (sector & 0xFF); /* Starting Logical Block Address. */
|
||||
req.spt.Cdb[6] = 0;
|
||||
req.spt.Cdb[7] = 0;
|
||||
req.spt.Cdb[8] = 1; /* Transfer Length. */
|
||||
req.spt.Cdb[9] = 0xF8; /* 2352 bytes of data (non-subchannel). */
|
||||
req.spt.Cdb[10] = 0; /* No subchannel data. */
|
||||
req.spt.Cdb[11] = 0;
|
||||
|
||||
ret = DeviceIoControl(handle, IOCTL_SCSI_PASS_THROUGH_DIRECT, &req, sizeof(req), &req, sizeof(req), &unused, NULL) && req.spt.DataTransferLength == 2352;
|
||||
|
||||
win_cdrom_ioctl_log("plat_cdrom_read_scsi_direct: ret = %d, req.spt.DataTransferLength = %lu\n", ret, req.spt.DataTransferLength);
|
||||
return ret;
|
||||
win_cdrom_ioctl_log("BytesPerSector=%d\n", dgCDROM.BytesPerSector);
|
||||
return dgCDROM.BytesPerSector;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -390,18 +351,13 @@ plat_cdrom_read_sector(uint8_t *buffer, int raw, uint32_t sector)
|
||||
if (raw) {
|
||||
win_cdrom_ioctl_log("Raw\n");
|
||||
/* Raw */
|
||||
status = plat_cdrom_read_scsi_direct(sector, buffer);
|
||||
if (status) {
|
||||
return 1;
|
||||
} else {
|
||||
RAW_READ_INFO in;
|
||||
in.DiskOffset.LowPart = sector * COOKED_SECTOR_SIZE;
|
||||
in.DiskOffset.HighPart = 0;
|
||||
in.SectorCount = 1;
|
||||
in.TrackMode = CDDA;
|
||||
status = DeviceIoControl(handle, IOCTL_CDROM_RAW_READ, &in, sizeof(in),
|
||||
buffer, buflen, (LPDWORD)&size, NULL);
|
||||
}
|
||||
RAW_READ_INFO in;
|
||||
in.DiskOffset.LowPart = sector * COOKED_SECTOR_SIZE;
|
||||
in.DiskOffset.HighPart = 0;
|
||||
in.SectorCount = 1;
|
||||
in.TrackMode = CDDA;
|
||||
status = DeviceIoControl(handle, IOCTL_CDROM_RAW_READ, &in, sizeof(in),
|
||||
buffer, buflen, (LPDWORD)&size, NULL);
|
||||
} else {
|
||||
win_cdrom_ioctl_log("Cooked\n");
|
||||
/* Cooked */
|
||||
|
||||
@@ -30,7 +30,9 @@
|
||||
#include <86box/isapnp.h>
|
||||
#include <86box/midi.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_ad1848.h>
|
||||
@@ -39,6 +41,8 @@
|
||||
#include <86box/plat_fallthrough.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
#define PNP_ROM_CS4236B "roms/sound/crystal/PNPISA01.BIN"
|
||||
|
||||
#define CRYSTAL_NOEEPROM 0x100
|
||||
|
||||
enum {
|
||||
@@ -58,7 +62,7 @@ static const uint8_t slam_init_key[32] = { 0x96, 0x35, 0x9A, 0xCD, 0xE6, 0xF3, 0
|
||||
0x5E, 0xAF, 0x57, 0x2B, 0x15, 0x8A, 0xC5, 0xE2,
|
||||
0xF1, 0xF8, 0x7C, 0x3E, 0x9F, 0x4F, 0x27, 0x13,
|
||||
0x09, 0x84, 0x42, 0xA1, 0xD0, 0x68, 0x34, 0x1A };
|
||||
static const uint8_t cs4236b_eeprom[] = {
|
||||
static const uint8_t cs4236b_eeprom[8224] = {
|
||||
// clang-format off
|
||||
/* Chip configuration */
|
||||
0x55, 0xbb, /* magic */
|
||||
@@ -74,59 +78,7 @@ static const uint8_t cs4236b_eeprom[] = {
|
||||
0x10, 0x03, /* DMA routing */
|
||||
|
||||
/* PnP resources */
|
||||
0x0e, 0x63, 0x42, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, /* CSC4236, dummy checksum (filled in by isapnp_add_card) */
|
||||
0x0a, 0x10, 0x01, /* PnP version 1.0, vendor version 0.1 */
|
||||
0x82, 0x0e, 0x00, 'C', 'r', 'y', 's', 't', 'a', 'l', ' ', 'C', 'o', 'd', 'e' ,'c', 0x00, /* ANSI identifier */
|
||||
|
||||
0x15, 0x0e, 0x63, 0x00, 0x00, 0x00, /* logical device CSC0000 */
|
||||
0x82, 0x07, 0x00, 'W', 'S', 'S', '/', 'S', 'B', 0x00, /* ANSI identifier */
|
||||
0x31, 0x00, /* start dependent functions, preferred */
|
||||
0x2a, 0x02, 0x28, /* DMA 1, type A, no count by word, count by byte, not bus master, 8-bit only */
|
||||
0x2a, 0x09, 0x28, /* DMA 0/3, type A, no count by word, count by byte, not bus master, 8-bit only */
|
||||
0x22, 0x20, 0x00, /* IRQ 5 */
|
||||
0x47, 0x01, 0x34, 0x05, 0x34, 0x05, 0x04, 0x04, /* I/O 0x534, decodes 16-bit, 4-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x88, 0x03, 0x88, 0x03, 0x08, 0x04, /* I/O 0x388, decodes 16-bit, 8-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x20, 0x02, 0x20, 0x02, 0x20, 0x10, /* I/O 0x220, decodes 16-bit, 32-byte alignment, 16 addresses */
|
||||
0x31, 0x01, /* start dependent functions, acceptable */
|
||||
0x2a, 0x0a, 0x28, /* DMA 1/3, type A, no count by word, count by byte, not bus master, 8-bit only */
|
||||
0x2a, 0x0b, 0x28, /* DMA 0/1/3, type A, no count by word, count by byte, not bus master, 8-bit only */
|
||||
0x22, 0xa0, 0x9a, /* IRQ 5/7/9/11/12/15 */
|
||||
0x47, 0x01, 0x34, 0x05, 0xfc, 0x0f, 0x04, 0x04, /* I/O 0x534-0xFFC, decodes 16-bit, 4-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x88, 0x03, 0x88, 0x03, 0x08, 0x04, /* I/O 0x388, decodes 16-bit, 8-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x20, 0x02, 0x60, 0x02, 0x20, 0x10, /* I/O 0x220-0x260, decodes 16-bit, 32-byte alignment, 16 addresses */
|
||||
0x31, 0x02, /* start dependent functions, sub-optimal */
|
||||
0x2a, 0x0b, 0x28, /* DMA 0/1/3, type A, no count by word, count by byte, not bus master, 8-bit only */
|
||||
0x22, 0xa0, 0x9a, /* IRQ 5/7/9/11/12/15 */
|
||||
0x47, 0x01, 0x34, 0x05, 0xfc, 0x0f, 0x04, 0x04, /* I/O 0x534-0xFFC, decodes 16-bit, 4-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x88, 0x03, 0xf8, 0x03, 0x08, 0x04, /* I/O 0x388-0x3F8, decodes 16-bit, 8-byte alignment, 4 addresses */
|
||||
0x47, 0x01, 0x20, 0x02, 0x00, 0x03, 0x20, 0x10, /* I/O 0x220-0x300, decodes 16-bit, 32-byte alignment, 16 addresses */
|
||||
0x38, /* end dependent functions */
|
||||
|
||||
0x15, 0x0e, 0x63, 0x00, 0x01, 0x00, /* logical device CSC0001 */
|
||||
0x82, 0x05, 0x00, 'G', 'A', 'M', 'E', 0x00, /* ANSI identifier */
|
||||
0x31, 0x00, /* start dependent functions, preferred */
|
||||
0x47, 0x01, 0x00, 0x02, 0x00, 0x02, 0x08, 0x08, /* I/O 0x200, decodes 16-bit, 8-byte alignment, 8 addresses */
|
||||
0x31, 0x01, /* start dependent functions, acceptable */
|
||||
0x47, 0x01, 0x08, 0x02, 0x08, 0x02, 0x08, 0x08, /* I/O 0x208, decodes 16-bit, 8-byte alignment, 8 addresses */
|
||||
0x38, /* end dependent functions */
|
||||
|
||||
0x15, 0x0e, 0x63, 0x00, 0x10, 0x00, /* logical device CSC0010 */
|
||||
0x82, 0x05, 0x00, 'C', 'T', 'R', 'L', 0x00, /* ANSI identifier */
|
||||
0x47, 0x01, 0x20, 0x01, 0xf8, 0x0f, 0x08, 0x08, /* I/O 0x120-0xFF8, decodes 16-bit, 8-byte alignment, 8 addresses */
|
||||
|
||||
0x15, 0x0e, 0x63, 0x00, 0x03, 0x00, /* logical device CSC0003 */
|
||||
0x82, 0x04, 0x00, 'M', 'P', 'U', 0x00, /* ANSI identifier */
|
||||
0x31, 0x00, /* start dependent functions, preferred */
|
||||
0x22, 0x00, 0x02, /* IRQ 9 */
|
||||
0x47, 0x01, 0x30, 0x03, 0x30, 0x03, 0x08, 0x02, /* I/O 0x330, decodes 16-bit, 8-byte alignment, 2 addresses */
|
||||
0x31, 0x01, /* start dependent functions, acceptable */
|
||||
0x22, 0x00, 0x9a, /* IRQ 9/11/12/15 */
|
||||
0x47, 0x01, 0x30, 0x03, 0x60, 0x03, 0x08, 0x02, /* I/O 0x330-0x360, decodes 16-bit, 8-byte alignment, 2 addresses */
|
||||
0x31, 0x02, /* start dependent functions, sub-optimal */
|
||||
0x47, 0x01, 0x30, 0x03, 0xe0, 0x03, 0x08, 0x02, /* I/O 0x330-0x3E0, decodes 16-bit, 8-byte alignment, 2 addresses */
|
||||
0x38, /* end dependent functions */
|
||||
|
||||
0x79, 0x00 /* end tag, dummy checksum (filled in by isapnp_add_card) */
|
||||
0x00
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
@@ -798,6 +750,12 @@ cs423x_init(const device_t *info)
|
||||
/* Load EEPROM contents from template. */
|
||||
memcpy(dev->eeprom_data, cs4236b_eeprom, sizeof(cs4236b_eeprom));
|
||||
|
||||
FILE *fp = rom_fopen(PNP_ROM_CS4236B, "rb");
|
||||
if (fp) {
|
||||
fread(&(dev->eeprom_data[23]), 1, 8201, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
/* Set content size. */
|
||||
dev->eeprom_data[2] = sizeof(cs4236b_eeprom) >> 8;
|
||||
dev->eeprom_data[3] = sizeof(cs4236b_eeprom) & 0xff;
|
||||
@@ -808,6 +766,7 @@ cs423x_init(const device_t *info)
|
||||
dev->eeprom_data[8] = 0x05;
|
||||
dev->eeprom_data[16] = 0x08;
|
||||
dev->eeprom_data[26] = 0x25;
|
||||
dev->eeprom_data[44] = '5';
|
||||
dev->nvr_path = "cs4235.nvr";
|
||||
break;
|
||||
|
||||
@@ -817,11 +776,13 @@ cs423x_init(const device_t *info)
|
||||
|
||||
case CRYSTAL_CS4237B:
|
||||
dev->eeprom_data[26] = 0x37;
|
||||
dev->eeprom_data[44] = '7';
|
||||
dev->nvr_path = "cs4237b.nvr";
|
||||
break;
|
||||
|
||||
case CRYSTAL_CS4238B:
|
||||
dev->eeprom_data[26] = 0x38;
|
||||
dev->eeprom_data[44] = '8';
|
||||
dev->nvr_path = "cs4238b.nvr";
|
||||
break;
|
||||
|
||||
@@ -886,6 +847,12 @@ cs423x_close(void *priv)
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static int
|
||||
cs423x_available(void)
|
||||
{
|
||||
return rom_present(PNP_ROM_CS4236B);
|
||||
}
|
||||
|
||||
static void
|
||||
cs423x_speed_changed(void *priv)
|
||||
{
|
||||
@@ -902,7 +869,7 @@ const device_t cs4235_device = {
|
||||
.init = cs423x_init,
|
||||
.close = cs423x_close,
|
||||
.reset = cs423x_reset,
|
||||
{ .available = NULL },
|
||||
{ .available = cs423x_available },
|
||||
.speed_changed = cs423x_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
@@ -916,7 +883,7 @@ const device_t cs4235_onboard_device = {
|
||||
.init = cs423x_init,
|
||||
.close = cs423x_close,
|
||||
.reset = cs423x_reset,
|
||||
{ .available = NULL },
|
||||
{ .available = cs423x_available },
|
||||
.speed_changed = cs423x_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
@@ -930,7 +897,7 @@ const device_t cs4236b_device = {
|
||||
.init = cs423x_init,
|
||||
.close = cs423x_close,
|
||||
.reset = cs423x_reset,
|
||||
{ .available = NULL },
|
||||
{ .available = cs423x_available },
|
||||
.speed_changed = cs423x_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
@@ -944,7 +911,7 @@ const device_t cs4237b_device = {
|
||||
.init = cs423x_init,
|
||||
.close = cs423x_close,
|
||||
.reset = cs423x_reset,
|
||||
{ .available = NULL },
|
||||
{ .available = cs423x_available },
|
||||
.speed_changed = cs423x_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
@@ -958,7 +925,7 @@ const device_t cs4238b_device = {
|
||||
.init = cs423x_init,
|
||||
.close = cs423x_close,
|
||||
.reset = cs423x_reset,
|
||||
{ .available = NULL },
|
||||
{ .available = cs423x_available },
|
||||
.speed_changed = cs423x_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
|
||||
@@ -221,14 +221,9 @@ sound_card_get_from_internal_name(const char *s)
|
||||
void
|
||||
sound_card_init(void)
|
||||
{
|
||||
if ((sound_card_current[0] > SOUND_INTERNAL) && (sound_cards[sound_card_current[0]].device))
|
||||
device_add_inst(sound_cards[sound_card_current[0]].device, 1);
|
||||
if ((sound_card_current[1] > SOUND_INTERNAL) && (sound_cards[sound_card_current[1]].device))
|
||||
device_add_inst(sound_cards[sound_card_current[1]].device, 2);
|
||||
if ((sound_card_current[2] > SOUND_INTERNAL) && (sound_cards[sound_card_current[2]].device))
|
||||
device_add_inst(sound_cards[sound_card_current[2]].device, 3);
|
||||
if ((sound_card_current[3] > SOUND_INTERNAL) && (sound_cards[sound_card_current[3]].device))
|
||||
device_add_inst(sound_cards[sound_card_current[3]].device, 4);
|
||||
for (uint8_t i = 0; i < SOUND_CARD_MAX; i++)
|
||||
if ((sound_card_current[i] > SOUND_INTERNAL) && (sound_cards[sound_card_current[i]].device))
|
||||
device_add_inst(sound_cards[sound_card_current[i]].device, i + 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user