diff --git a/src/cdrom/cdrom_mitsumi.c b/src/cdrom/cdrom_mitsumi.c index 7ef8a04b2..e27faab94 100644 --- a/src/cdrom/cdrom_mitsumi.c +++ b/src/cdrom/cdrom_mitsumi.c @@ -459,7 +459,7 @@ mitsumi_cdrom_close(void *priv) const device_t mitsumi_cdrom_device = { .name = "Mitsumi CD-ROM interface", .internal_name = "mcd", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = mitsumi_cdrom_init, .close = mitsumi_cdrom_close, diff --git a/src/chipset/ali6117.c b/src/chipset/ali6117.c index c351a0cfa..707b528b2 100644 --- a/src/chipset/ali6117.c +++ b/src/chipset/ali6117.c @@ -493,7 +493,7 @@ ali6117_init(const device_t *info) const device_t ali1217_device = { .name = "ALi M1217", .internal_name = "ali1217", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x8, .init = ali6117_init, .close = ali6117_close, @@ -507,7 +507,7 @@ const device_t ali1217_device = { const device_t ali6117d_device = { .name = "ALi M6117D", .internal_name = "ali6117d", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x2, .init = ali6117_init, .close = ali6117_close, diff --git a/src/chipset/neat.c b/src/chipset/neat.c index 069fa87e4..d4eb3ec7f 100644 --- a/src/chipset/neat.c +++ b/src/chipset/neat.c @@ -27,14 +27,13 @@ #include #define HAVE_STDARG_H #include <86box/86box.h> +#include "cpu.h" #include <86box/device.h> #include <86box/io.h> #include <86box/mem.h> #include <86box/plat_unused.h> #include <86box/chipset.h> -#define NEAT_DEBUG 0 - #define EMS_MAXPAGE 4 #define EMS_PGSIZE 16384 #define EMS_PGMASK 16383 @@ -263,13 +262,71 @@ neat_log(const char *fmt, ...) # define neat_log(fmt, ...) #endif +static uint8_t +neat_read_ram(uint32_t addr, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) + addreadlookup(mem_logical_addr, addr); + + return ram[addr]; +} + +static uint16_t +neat_read_ramw(uint32_t addr, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) + addreadlookup(mem_logical_addr, addr); + + return *(uint16_t *) &ram[addr]; +} + +static void +neat_write_ram(uint32_t addr, uint8_t val, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) { + addwritelookup(mem_logical_addr, addr); + mem_write_ramb_page(addr, val, &pages[addr >> 12]); + } else + ram[addr] = val; +} + +static void +neat_write_ramw(uint32_t addr, uint16_t val, void *priv) +{ + neat_t *dev = (neat_t *) priv; + + if (dev->regs[REG_RB7] & RB7_EMSEN) + addr += (dev->ems_size << 10); + + if (cpu_use_exec) { + addwritelookup(mem_logical_addr, addr); + mem_write_ramw_page(addr, val, &pages[addr >> 12]); + } else + *(uint16_t *) &ram[addr] = val; +} + /* Read one byte from paged RAM. */ static uint8_t ems_readb(uint32_t addr, void *priv) { ram_page_t *dev = (ram_page_t *) priv; uint8_t ret = 0xff; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif @@ -279,7 +336,9 @@ ems_readb(uint32_t addr, void *priv) if (addr < (mem_size << 10)) ret = *(uint8_t *) &(ram[addr]); +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[R08] %08X -> %08X (%08X): ret = %02X\n", old, addr, (mem_size << 10), ret); +#endif return ret; } @@ -289,7 +348,7 @@ ems_readw(uint32_t addr, void *priv) { ram_page_t *dev = (ram_page_t *) priv; uint16_t ret = 0xffff; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif @@ -299,7 +358,9 @@ ems_readw(uint32_t addr, void *priv) if (addr < (mem_size << 10)) ret = *(uint16_t *) &(ram[addr]); +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[R16] %08X -> %08X (%08X): ret = %04X\n", old, addr, (mem_size << 10), ret); +#endif return ret; } @@ -308,13 +369,15 @@ static void ems_writeb(uint32_t addr, uint8_t val, void *priv) { ram_page_t *dev = (ram_page_t *) priv; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif /* Write the data. */ addr = addr - dev->virt_base + dev->phys_base; +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[W08] %08X -> %08X (%08X): val = %02X\n", old, addr, (mem_size << 10), val); +#endif if (addr < (mem_size << 10)) *(uint8_t *) &(ram[addr]) = val; @@ -325,13 +388,15 @@ static void ems_writew(uint32_t addr, uint16_t val, void *priv) { ram_page_t *dev = (ram_page_t *) priv; -#ifdef ENABLE_NEAT_LOG +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) uint32_t old = addr; #endif /* Write the data. */ addr = addr - dev->virt_base + dev->phys_base; +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 3) neat_log("[W16] %08X -> %08X (%08X): val = %04X\n", old, addr, (mem_size << 10), val); +#endif if (addr < (mem_size << 10)) *(uint16_t *) &(ram[addr]) = val; @@ -446,7 +511,7 @@ ems_recalc(neat_t *dev, ram_page_t *ems) neat_mem_update_state(dev, ems->virt_base, EMS_PGSIZE, MEM_FLAG_EMS, MEM_FMASK_EMS); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT EMS: page %d set to %08lx, %sabled)\n", ems->page, ems->addr - ram, ems->enabled ? "en" : "dis"); #endif @@ -469,7 +534,7 @@ ems_write(uint16_t port, uint8_t val, void *priv) int8_t new_enabled; uint32_t new_phys_base; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: ems_write(%04x, %02x)\n", port, val); #endif @@ -518,6 +583,7 @@ ems_read(uint16_t port, void *priv) switch (port & 0x000f) { case 0x0008: /* page number register */ + case 0x0009: ret = (dev->ems[vpage].phys_base / EMS_PGSIZE) & 0x7f; if (dev->ems[vpage].enabled) ret |= 0x80; @@ -528,7 +594,7 @@ ems_read(uint16_t port, void *priv) neat_log("Port: %04X, ret: %02X\n", port, ret); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: ems_read(%04x) = %02x\n", port, ret); #endif @@ -603,9 +669,11 @@ remap_update(neat_t *dev, uint8_t val) else mem_mapping_set_addr(&ram_low_mapping, 0x00000000, dev->remap_base << 10); - if (dev->remap_base > 1024) + if (dev->remap_base > 1024) { mem_mapping_set_addr(&ram_high_mapping, 0x00100000, (dev->remap_base << 10) - 0x00100000); - else + mem_mapping_set_exec(&ram_high_mapping, &(ram[(val & RB7_EMSEN) ? 0x00100000 : + (0x00100000 + (dev->ems_size << 10))])); + } else mem_mapping_disable(&ram_high_mapping); if (val & RB7_UMAREL) { @@ -625,7 +693,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) uint8_t *reg; int i; -#if NEAT_DEBUG > 2 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: write(%04x, %02x)\n", port, val); #endif @@ -643,7 +711,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) *reg = (*reg & ~RA0_MASK) | val | (RA0_REV_ID << RA0_REV_SH); if ((xval & 0x20) && (val & 0x20)) outb(0x64, 0xfe); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA0=%02x(%02x)\n", val, *reg); #endif break; @@ -651,7 +719,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RA1: val &= RA1_MASK; *reg = (*reg & ~RA1_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA1=%02x(%02x)\n", val, *reg); #endif break; @@ -659,7 +727,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RA2: val &= RA2_MASK; *reg = (*reg & ~RA2_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RA2=%02x(%02x)\n", val, *reg); #endif break; @@ -667,7 +735,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB0: val &= RB0_MASK; *reg = (*reg & ~RB0_MASK) | val | (RB0_REV_ID << RB0_REV_SH); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB0=%02x(%02x)\n", val, *reg); #endif break; @@ -676,7 +744,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB1_MASK; *reg = (*reg & ~RB1_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB1=%02x(%02x)\n", val, *reg); #endif break; @@ -688,7 +756,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) neat_mem_update_state(dev, 0x00080000, 0x00020000, MEM_FLAG_READ | MEM_FLAG_WRITE, MEM_FMASK_SHADOW); else neat_mem_update_state(dev, 0x00080000, 0x00020000, 0x00, MEM_FMASK_SHADOW); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB2=%02x(%02x)\n", val, *reg); #endif break; @@ -697,7 +765,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB3_MASK; *reg = (*reg & ~RB3_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB3=%02x(%02x)\n", val, *reg); #endif break; @@ -706,7 +774,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB4_MASK; *reg = (*reg & ~RB4_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB4=%02x(%02x)\n", val, *reg); #endif break; @@ -715,7 +783,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) val &= RB5_MASK; *reg = (*reg & ~RB5_MASK) | val; shadow_recalc(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB5=%02x(%02x)\n", val, *reg); #endif break; @@ -723,7 +791,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB6: val &= RB6_MASK; *reg = (*reg & ~RB6_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB6=%02x(%02x)\n", val, *reg); #endif break; @@ -742,7 +810,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) if ((xval & RB7_EMSEN) && (val & RB7_EMSEN)) ems_set_handlers(dev); -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB7=%02x(%02x)\n", val, *reg); #endif break; @@ -750,7 +818,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB8: val &= RB8_MASK; *reg = (*reg & ~RB8_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB8=%02x(%02x)\n", val, *reg); #endif break; @@ -758,7 +826,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB9: val &= RB9_MASK; *reg = (*reg & ~RB9_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB9=%02x(%02x)\n", val, *reg); #endif @@ -781,7 +849,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB10: val &= RB10_MASK; *reg = (*reg & ~RB10_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB10=%02x(%02x)\n", val, *reg); #endif @@ -816,7 +884,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) case REG_RB12: val &= RB12_MASK; *reg = (*reg & ~RB12_MASK) | val; -#if NEAT_DEBUG > 1 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: RB12=%02x(%02x)\n", val, *reg); #endif i = (val & RB12_EMSLEN) >> RB12_EMSLEN_SH; @@ -845,7 +913,7 @@ neat_write(uint16_t port, uint8_t val, void *priv) dev->ems_size); } - mem_a20_key = val & RB12_GA20; + mem_a20_key = !(val & RB12_GA20); mem_a20_recalc(); break; @@ -883,7 +951,7 @@ neat_read(uint16_t port, void *priv) break; } -#if NEAT_DEBUG > 2 +#if defined(ENABLE_NEAT_LOG) && (ENABLE_NEAT_LOG == 2) neat_log("NEAT: read(%04x) = %02x\n", port, ret); #endif @@ -908,6 +976,12 @@ neat_init(UNUSED(const device_t *info)) /* Create an instance. */ dev = (neat_t *) calloc(1, sizeof(neat_t)); + if (mem_size > 1024) { + mem_mapping_set_handler(&ram_high_mapping, neat_read_ram, neat_read_ramw, NULL, + neat_write_ram, neat_write_ramw, NULL); + mem_mapping_set_p(&ram_high_mapping, dev); + } + /* Get configured I/O address. */ j = (dev->regs[REG_RB9] & RB9_BASE) >> RB9_BASE_SH; dev->ems_base = 0x0208 + (0x10 * j); diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 808f603b5..0802fa3ac 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -372,7 +372,7 @@ cpu_is_eligible(const cpu_family_t *cpu_family, int cpu, int machine) if (packages & CPU_PKG_SOCKET3) packages |= CPU_PKG_SOCKET1; else if (packages & CPU_PKG_SLOT1) - packages |= CPU_PKG_SOCKET370; + packages |= CPU_PKG_SOCKET370 | CPU_PKG_SOCKET8; /* Package type. */ if (!(cpu_family->package & packages)) diff --git a/src/device.c b/src/device.c index dad583cdc..8b2ddf35e 100644 --- a/src/device.c +++ b/src/device.c @@ -490,7 +490,7 @@ device_get_name(const device_t *dev, int bus, char *name) const char *sbus = NULL; const char *fbus; char *tname; - char pbus[8] = { 0 }; + char pbus[12] = { 0 }; if (dev == NULL) return; @@ -498,14 +498,29 @@ device_get_name(const device_t *dev, int bus, char *name) name[0] = 0x00; if (bus) { - if (dev->flags & DEVICE_ISA) - sbus = (dev->flags & DEVICE_AT) ? "ISA16" : "ISA"; + if ((dev->flags & (DEVICE_SIDECAR | DEVICE_ISA)) == + (DEVICE_SIDECAR | DEVICE_ISA)) + sbus = "ISA/Sidecar"; + else if (dev->flags & DEVICE_SIDECAR) + sbus = "Sidecar"; + else if (dev->flags & DEVICE_XT_KBC) + sbus = "XT KBC"; + else if (dev->flags & DEVICE_ISA16) + sbus = "ISA16"; + else if (dev->flags & DEVICE_AT_KBC) + sbus = "AT KBC"; + else if (dev->flags & DEVICE_PS2_KBC) + sbus = "PS/2 KBC"; + else if (dev->flags & DEVICE_ISA) + sbus = "ISA"; else if (dev->flags & DEVICE_CBUS) sbus = "C-BUS"; else if (dev->flags & DEVICE_PCMCIA) sbus = "PCMCIA"; else if (dev->flags & DEVICE_MCA) sbus = "MCA"; + else if (dev->flags & DEVICE_MCA32) + sbus = "MCA32"; else if (dev->flags & DEVICE_HIL) sbus = "HP HIL"; else if (dev->flags & DEVICE_EISA) @@ -519,7 +534,7 @@ device_get_name(const device_t *dev, int bus, char *name) else if (dev->flags & DEVICE_PCI) sbus = "PCI"; else if (dev->flags & DEVICE_CARDBUS) - sbus = "CARDBUS"; + sbus = "CardBus"; else if (dev->flags & DEVICE_USB) sbus = "USB"; else if (dev->flags & DEVICE_AGP) @@ -780,67 +795,12 @@ device_set_config_mac(const char *str, int val) int device_is_valid(const device_t *device, int mch) { - if (device == NULL) - return 1; + int ret = 1; - if ((device->flags & DEVICE_PCJR) && !machine_has_bus(mch, MACHINE_BUS_PCJR)) - return 0; + if ((device != NULL) && ((device->flags & DEVICE_BUS) != 0)) + ret = machine_has_bus(mch, device->flags & DEVICE_BUS); - if ((device->flags & DEVICE_XTKBC) && machine_has_bus(mch, MACHINE_BUS_ISA16) && !machine_has_bus(mch, MACHINE_BUS_DM_KBC)) - return 0; - - if ((device->flags & DEVICE_AT) && !machine_has_bus(mch, MACHINE_BUS_ISA16)) - return 0; - - if ((device->flags & DEVICE_ATKBC) && !machine_has_bus(mch, MACHINE_BUS_ISA16) && !machine_has_bus(mch, MACHINE_BUS_DM_KBC)) - return 0; - - if ((device->flags & DEVICE_PS2) && !machine_has_bus(mch, MACHINE_BUS_PS2_PORTS)) - return 0; - - if ((device->flags & DEVICE_ISA) && !machine_has_bus(mch, MACHINE_BUS_ISA)) - return 0; - - if ((device->flags & DEVICE_CBUS) && !machine_has_bus(mch, MACHINE_BUS_CBUS)) - return 0; - - if ((device->flags & DEVICE_PCMCIA) && !machine_has_bus(mch, MACHINE_BUS_PCMCIA) && !machine_has_bus(mch, MACHINE_BUS_ISA)) - return 0; - - if ((device->flags & DEVICE_MCA) && !machine_has_bus(mch, MACHINE_BUS_MCA)) - return 0; - - if ((device->flags & DEVICE_HIL) && !machine_has_bus(mch, MACHINE_BUS_HIL)) - return 0; - - if ((device->flags & DEVICE_EISA) && !machine_has_bus(mch, MACHINE_BUS_EISA)) - return 0; - - if ((device->flags & DEVICE_AT32) && !machine_has_bus(mch, MACHINE_BUS_AT32)) - return 0; - - if ((device->flags & DEVICE_OLB) && !machine_has_bus(mch, MACHINE_BUS_OLB)) - return 0; - - if ((device->flags & DEVICE_VLB) && !machine_has_bus(mch, MACHINE_BUS_VLB)) - return 0; - - if ((device->flags & DEVICE_PCI) && !machine_has_bus(mch, MACHINE_BUS_PCI)) - return 0; - - if ((device->flags & DEVICE_CARDBUS) && !machine_has_bus(mch, MACHINE_BUS_CARDBUS) && !machine_has_bus(mch, MACHINE_BUS_PCI)) - return 0; - - if ((device->flags & DEVICE_USB) && !machine_has_bus(mch, MACHINE_BUS_USB)) - return 0; - - if ((device->flags & DEVICE_AGP) && !machine_has_bus(mch, MACHINE_BUS_AGP)) - return 0; - - if ((device->flags & DEVICE_AC97) && !machine_has_bus(mch, MACHINE_BUS_AC97)) - return 0; - - return 1; + return ret; } int diff --git a/src/device/bugger.c b/src/device/bugger.c index 56cac91bc..b56937a43 100644 --- a/src/device/bugger.c +++ b/src/device/bugger.c @@ -346,7 +346,7 @@ bug_close(UNUSED(void *priv)) const device_t bugger_device = { .name = "ISA/PCI Bus Bugger", .internal_name = "bugger", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = bug_init, .close = bug_close, diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index ad1625873..09855a387 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -810,27 +810,18 @@ write_p2(atkbc_t *dev, uint8_t val) if (!(val & 0x01)) { /* Pin 0 selected. */ /* Pin 0 selected. */ kbc_at_log("write_p2(): Pulse reset!\n"); - if (machines[machine].flags & MACHINE_COREBOOT) { - /* The SeaBIOS hard reset code attempts a KBC reset if ACPI RESET_REG - is not available. However, the KBC reset is normally a soft reset, so - SeaBIOS gets caught in a soft reset loop as it tries to hard reset the - machine. Hack around this by making the KBC reset a hard reset only on - coreboot machines. */ - pc_reset_hard(); - } else { - softresetx86(); /* Pulse reset! */ - cpu_set_edx(); - flushmmucache(); - if ((kbc_ven == KBC_VEN_ALI) || !strcmp(machine_get_internal_name(), "spc7700plw")) - smbase = 0x00030000; + softresetx86(); /* Pulse reset! */ + cpu_set_edx(); + flushmmucache(); + if ((kbc_ven == KBC_VEN_ALI) || !strcmp(machine_get_internal_name(), "spc7700plw")) + smbase = 0x00030000; - /* Yes, this is a hack, but until someone gets ahold of the real PCD-2L - and can find out what they actually did to make it boot from FFFFF0 - correctly despite A20 being gated when the CPU is reset, this will - have to do. */ - if ((kbc_ven == KBC_VEN_SIEMENS) || !strcmp(machine_get_internal_name(), "acera1g")) - is486 ? loadcs(0xf000) : loadcs_2386(0xf000); - } + /* Yes, this is a hack, but until someone gets ahold of the real PCD-2L + and can find out what they actually did to make it boot from FFFFF0 + correctly despite A20 being gated when the CPU is reset, this will + have to do. */ + if ((kbc_ven == KBC_VEN_SIEMENS) || !strcmp(machine_get_internal_name(), "acera1g")) + is486 ? loadcs(0xf000) : loadcs_2386(0xf000); } } diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index 589ec7ded..c3cc29b78 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -2216,7 +2216,7 @@ static const device_config_t keyboard_at_config[] = { const device_t keyboard_at_generic_device = { .name = "Standard AT or PS/2 Keyboard", .internal_name = "ps2", - .flags = DEVICE_PS2, + .flags = DEVICE_PS2_KBC, .local = 0, .init = keyboard_at_init, .close = keyboard_at_close, diff --git a/src/device/mouse_ps2.c b/src/device/mouse_ps2.c index 8d98b07ce..79d7afc96 100644 --- a/src/device/mouse_ps2.c +++ b/src/device/mouse_ps2.c @@ -394,7 +394,7 @@ static const device_config_t ps2_config[] = { const device_t mouse_ps2_device = { .name = "PS/2 Mouse", .internal_name = "ps2", - .flags = DEVICE_PS2, + .flags = DEVICE_PS2_KBC, .local = MOUSE_TYPE_PS2, .init = mouse_ps2_init, .close = ps2_close, diff --git a/src/device/serial.c b/src/device/serial.c index 823d07c1f..c25da0070 100644 --- a/src/device/serial.c +++ b/src/device/serial.c @@ -948,7 +948,7 @@ serial_init(const device_t *info) serial_setup(dev, COM4_ADDR, COM4_IRQ); else if (next_inst == 2) serial_setup(dev, COM3_ADDR, COM3_IRQ); - else if ((next_inst == 1) || (info->flags & DEVICE_PCJR)) + else if ((next_inst == 1) || (info->local == SERIAL_8250_PCJR)) serial_setup(dev, COM2_ADDR, COM2_IRQ); else if (next_inst == 0) serial_setup(dev, COM1_ADDR, COM1_IRQ); @@ -1018,7 +1018,7 @@ const device_t ns8250_device = { const device_t ns8250_pcjr_device = { .name = "National Semiconductor 8250(-compatible) UART for PCjr", .internal_name = "ns8250_pcjr", - .flags = DEVICE_PCJR, + .flags = 0, .local = SERIAL_8250_PCJR, .init = serial_init, .close = serial_close, diff --git a/src/device/smbus_ali7101.c b/src/device/smbus_ali7101.c index 3907a065e..49eb44bc6 100644 --- a/src/device/smbus_ali7101.c +++ b/src/device/smbus_ali7101.c @@ -302,7 +302,7 @@ smbus_ali7101_close(void *priv) const device_t ali7101_smbus_device = { .name = "ALi M7101-compatible SMBus Host Controller", .internal_name = "ali7101_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = smbus_ali7101_init, .close = smbus_ali7101_close, diff --git a/src/device/smbus_piix4.c b/src/device/smbus_piix4.c index a9ffcd847..ae37c72c4 100644 --- a/src/device/smbus_piix4.c +++ b/src/device/smbus_piix4.c @@ -386,7 +386,7 @@ smbus_piix4_close(void *priv) const device_t piix4_smbus_device = { .name = "PIIX4-compatible SMBus Host Controller", .internal_name = "piix4_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = SMBUS_PIIX4, .init = smbus_piix4_init, .close = smbus_piix4_close, @@ -400,7 +400,7 @@ const device_t piix4_smbus_device = { const device_t via_smbus_device = { .name = "VIA VT82C686B SMBus Host Controller", .internal_name = "via_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = SMBUS_VIA, .init = smbus_piix4_init, .close = smbus_piix4_close, diff --git a/src/device/smbus_sis5595.c b/src/device/smbus_sis5595.c index 0a24d2355..42d1452ad 100644 --- a/src/device/smbus_sis5595.c +++ b/src/device/smbus_sis5595.c @@ -373,7 +373,7 @@ smbus_sis5595_close(void *priv) const device_t sis5595_smbus_device = { .name = "SiS 5595-compatible SMBus Host Controller", .internal_name = "sis5595_smbus", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = smbus_sis5595_init, .close = smbus_sis5595_close, diff --git a/src/disk/hdc_esdi_at.c b/src/disk/hdc_esdi_at.c index adc39d509..ab24aa6fa 100644 --- a/src/disk/hdc_esdi_at.c +++ b/src/disk/hdc_esdi_at.c @@ -984,7 +984,7 @@ wd1007vse1_available(void) const device_t esdi_at_wd1007vse1_device = { .name = "Western Digital WD1007V-SE1 (ESDI)", .internal_name = "esdi_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = wd1007vse1_init, .close = wd1007vse1_close, diff --git a/src/disk/hdc_ide.c b/src/disk/hdc_ide.c index 3683c8671..b69ddf128 100644 --- a/src/disk/hdc_ide.c +++ b/src/disk/hdc_ide.c @@ -3282,7 +3282,7 @@ mcide_close(void *priv) const device_t ide_isa_device = { .name = "ISA PC/AT IDE Controller", .internal_name = "ide_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_init, .close = ide_close, @@ -3296,7 +3296,7 @@ const device_t ide_isa_device = { const device_t ide_isa_sec_device = { .name = "ISA PC/AT IDE Controller (Secondary)", .internal_name = "ide_isa_sec", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_sec_init, .close = ide_sec_close, @@ -3310,7 +3310,7 @@ const device_t ide_isa_sec_device = { const device_t ide_isa_2ch_device = { .name = "ISA PC/AT IDE Controller (Dual-Channel)", .internal_name = "ide_isa_2ch", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_init, .close = ide_close, @@ -3324,7 +3324,7 @@ const device_t ide_isa_2ch_device = { const device_t ide_vlb_device = { .name = "VLB IDE Controller", .internal_name = "ide_vlb", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 2, .init = ide_init, .close = ide_close, @@ -3338,7 +3338,7 @@ const device_t ide_vlb_device = { const device_t ide_vlb_sec_device = { .name = "VLB IDE Controller (Secondary)", .internal_name = "ide_vlb_sec", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 2, .init = ide_sec_init, .close = ide_sec_close, @@ -3352,7 +3352,7 @@ const device_t ide_vlb_sec_device = { const device_t ide_vlb_2ch_device = { .name = "VLB IDE Controller (Dual-Channel)", .internal_name = "ide_vlb_2ch", - .flags = DEVICE_VLB | DEVICE_AT, + .flags = DEVICE_VLB | DEVICE_ISA16, .local = 3, .init = ide_init, .close = ide_close, @@ -3366,7 +3366,7 @@ const device_t ide_vlb_2ch_device = { const device_t ide_pci_device = { .name = "PCI IDE Controller", .internal_name = "ide_pci", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 4, .init = ide_init, .close = ide_close, @@ -3380,7 +3380,7 @@ const device_t ide_pci_device = { const device_t ide_pci_sec_device = { .name = "PCI IDE Controller (Secondary)", .internal_name = "ide_pci_sec", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 4, .init = ide_sec_init, .close = ide_sec_close, @@ -3394,7 +3394,7 @@ const device_t ide_pci_sec_device = { const device_t ide_pci_2ch_device = { .name = "PCI IDE Controller (Dual-Channel)", .internal_name = "ide_pci_2ch", - .flags = DEVICE_PCI | DEVICE_AT, + .flags = DEVICE_PCI | DEVICE_ISA16, .local = 5, .init = ide_init, .close = ide_close, @@ -3478,7 +3478,7 @@ static const device_config_t ide_qua_config[] = { const device_t ide_ter_device = { .name = "Tertiary IDE Controller", .internal_name = "ide_ter", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_ter_init, .close = ide_ter_close, @@ -3492,7 +3492,7 @@ const device_t ide_ter_device = { const device_t ide_ter_pnp_device = { .name = "Tertiary IDE Controller (Plug and Play only)", .internal_name = "ide_ter_pnp", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_ter_init, .close = ide_ter_close, @@ -3506,7 +3506,7 @@ const device_t ide_ter_pnp_device = { const device_t ide_qua_device = { .name = "Quaternary IDE Controller", .internal_name = "ide_qua", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ide_qua_init, .close = ide_qua_close, @@ -3520,7 +3520,7 @@ const device_t ide_qua_device = { const device_t ide_qua_pnp_device = { .name = "Quaternary IDE Controller (Plug and Play only)", .internal_name = "ide_qua_pnp", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = ide_qua_init, .close = ide_qua_close, diff --git a/src/disk/hdc_st506_at.c b/src/disk/hdc_st506_at.c index eeb242a94..07c57b2ca 100644 --- a/src/disk/hdc_st506_at.c +++ b/src/disk/hdc_st506_at.c @@ -795,7 +795,7 @@ mfm_close(void *priv) const device_t st506_at_wd1003_device = { .name = "WD1003 AT MFM/RLL Controller", .internal_name = "st506_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = mfm_init, .close = mfm_close, diff --git a/src/disk/hdc_xtide.c b/src/disk/hdc_xtide.c index 4c071e596..c18a24c4e 100644 --- a/src/disk/hdc_xtide.c +++ b/src/disk/hdc_xtide.c @@ -312,7 +312,7 @@ const device_t xtide_device = { const device_t xtide_at_device = { .name = "PC/AT XTIDE", .internal_name = "xtide_at", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xtide_at_init, .close = xtide_at_close, @@ -340,7 +340,7 @@ const device_t xtide_acculogic_device = { const device_t xtide_at_ps2_device = { .name = "PS/2 AT XTIDE (1.1.5)", .internal_name = "xtide_at_ps2", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xtide_at_ps2_init, .close = xtide_at_close, diff --git a/src/disk/lba_enhancer.c b/src/disk/lba_enhancer.c index 429611b2d..ef9e167d3 100644 --- a/src/disk/lba_enhancer.c +++ b/src/disk/lba_enhancer.c @@ -88,7 +88,7 @@ static const device_config_t lba_enhancer_config[] = { const device_t lba_enhancer_device = { .name = "Vision Systems LBA Enhancer", .internal_name = "lba_enhancer", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = lba_enhancer_init, .close = lba_enhancer_close, diff --git a/src/include/86box/device.h b/src/include/86box/device.h index d92a387e9..1c3ef1ef3 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -79,29 +79,33 @@ // #define CONFIG_STANDALONE 257 /* not available on the on-board variant */ enum { - DEVICE_PCJR = 2, /* requires an IBM PCjr */ - DEVICE_XTKBC = 4, /* requires an XT-compatible keyboard controller */ - DEVICE_AT = 8, /* requires an AT-compatible system */ - DEVICE_ATKBC = 0x10, /* requires an AT-compatible keyboard controller */ - DEVICE_PS2 = 0x20, /* requires a PS/1 or PS/2 system */ - DEVICE_ISA = 0x40, /* requires the ISA bus */ - DEVICE_CBUS = 0x80, /* requires the C-BUS bus */ - DEVICE_PCMCIA = 0x100, /* requires the PCMCIA bus */ - DEVICE_MCA = 0x200, /* requires the MCA bus */ - DEVICE_HIL = 0x400, /* requires the HP HIL bus */ - DEVICE_EISA = 0x800, /* requires the EISA bus */ - DEVICE_AT32 = 0x1000, /* requires the Mylex AT/32 local bus */ - DEVICE_OLB = 0x2000, /* requires the OPTi local bus */ - DEVICE_VLB = 0x4000, /* requires the VLB bus */ - DEVICE_PCI = 0x8000, /* requires the PCI bus */ - DEVICE_CARDBUS = 0x10000, /* requires the CardBus bus */ - DEVICE_USB = 0x20000, /* requires the USB bus */ - DEVICE_AGP = 0x40000, /* requires the AGP bus */ - DEVICE_AC97 = 0x80000, /* requires the AC'97 bus */ - DEVICE_COM = 0x100000, /* requires a serial port */ - DEVICE_LPT = 0x200000, /* requires a parallel port */ - DEVICE_KBC = 0x400000, /* is a keyboard controller */ - DEVICE_SOFTRESET = 0x800000, /* requires to be reset on soft reset */ + DEVICE_SIDECAR = 2, /* requires an IBM PCjr */ + DEVICE_ISA = 4, /* requires the ISA bus */ + DEVICE_XT_KBC = 8, /* requires an XT-compatible keyboard controller */ + DEVICE_CBUS = 0x10, /* requires the C-BUS bus */ + DEVICE_ISA16 = 0x20, /* requires an AT-compatible system */ + DEVICE_AT_KBC = 0x40, /* requires an AT-compatible keyboard controller */ + DEVICE_MCA = 0x80, /* requires the MCA bus */ + DEVICE_MCA32 = 0x100, /* requires the MCA bus */ + DEVICE_PS2_KBC = 0x200, /* requires a PS/1 or PS/2 system */ + DEVICE_PCMCIA = 0x400, /* requires the PCMCIA bus */ + DEVICE_HIL = 0x800, /* requires the HP HIL bus */ + DEVICE_EISA = 0x1000, /* requires the EISA bus */ + DEVICE_AT32 = 0x2000, /* requires the Mylex AT/32 local bus */ + DEVICE_OLB = 0x4000, /* requires the OPTi local bus */ + DEVICE_VLB = 0x8000, /* requires the VLB bus */ + DEVICE_PCI = 0x10000, /* requires the PCI bus */ + DEVICE_CARDBUS = 0x20000, /* requires the CardBus bus */ + DEVICE_USB = 0x40000, /* requires the USB bus */ + DEVICE_AGP = 0x80000, /* requires the AGP bus */ + DEVICE_AC97 = 0x100000, /* requires the AC'97 bus */ + DEVICE_BUS = 0x1fffff, /* requires a machine bus */ + + DEVICE_COM = 0x200000, /* requires a serial port */ + DEVICE_LPT = 0x400000, /* requires a parallel port */ + + DEVICE_KBC = 0x800000, /* is a keyboard controller */ + DEVICE_SOFTRESET = 0x1000000, /* requires to be reset on soft reset */ DEVICE_ONBOARD = 0x40000000, /* is on-board */ DEVICE_PIT = 0x80000000, /* device is a PIT */ diff --git a/src/include/86box/fdd_86f.h b/src/include/86box/fdd_86f.h index cc8035965..de7bb7dcb 100644 --- a/src/include/86box/fdd_86f.h +++ b/src/include/86box/fdd_86f.h @@ -8,13 +8,11 @@ * * Definitions for the 86F floppy image format. * - * - * * Authors: Miran Grca, * Fred N. van Kempen, * - * Copyright 2016-2019 Miran Grca. - * Copyright 2018-2019 Fred N. van Kempen. + * Copyright 2016-2025 Miran Grca. + * Copyright 2018-2025 Fred N. van Kempen. */ #ifndef EMU_FLOPPY_86F_H #define EMU_FLOPPY_86F_H diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 1ce46de9b..8676fa5f1 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -23,26 +23,25 @@ #define EMU_MACHINE_H /* Machine feature flags. */ -#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ +#define MACHINE_BUS_NONE 0x00000000 /* sys has no bus */ /* Feature flags for BUS'es. */ -#define MACHINE_BUS_ISA 0x00000001 /* sys has ISA bus */ -#define MACHINE_BUS_CASSETTE 0x00000002 /* sys has cassette port */ -#define MACHINE_BUS_CARTRIDGE 0x00000004 /* sys has two cartridge bays */ -#define MACHINE_BUS_PCJR 0x00000008 /* sys has PCjr sidecar bus */ -#define MACHINE_BUS_DM_KBC 0x00000010 /* system has keyboard controller that supports - both XT and AT keyboards */ +#define MACHINE_BUS_CASSETTE 0x00000001 /* sys has cassette port */ +#define MACHINE_BUS_SIDECAR 0x00000002 /* sys has PCjr sidecar bus */ +#define MACHINE_BUS_ISA 0x00000004 /* sys has ISA bus */ +#define MACHINE_BUS_XT_KBD 0x00000008 /* sys has an XT keyboard port */ +#define MACHINE_BUS_CBUS 0x00000010 /* sys has C-BUS bus */ #define MACHINE_BUS_ISA16 0x00000020 /* sys has ISA16 bus - PC/AT architecture */ -#define MACHINE_BUS_CBUS 0x00000040 /* sys has C-BUS bus */ -#define MACHINE_BUS_PCMCIA 0x00000080 /* sys has PCMCIA bus */ -#define MACHINE_BUS_PS2_LATCH 0x00000100 /* system has PS/2 keyboard controller IRQ latch */ +#define MACHINE_BUS_AT_KBD 0x00000040 /* sys has an AT keyboard port */ +#define MACHINE_BUS_MCA 0x00000080 /* sys has MCA bus */ +#define MACHINE_BUS_MCA32 0x00000100 /* sys has MCA32 bus */ #define MACHINE_BUS_PS2_PORTS 0x00000200 /* system has PS/2 keyboard and mouse ports */ -#define MACHINE_BUS_PS2 (MACHINE_BUS_PS2_LATCH | MACHINE_BUS_PS2_PORTS) -#define MACHINE_BUS_HIL 0x00000400 /* system has HP HIL keyboard and mouse ports */ -#define MACHINE_BUS_EISA 0x00000800 /* sys has EISA bus */ -#define MACHINE_BUS_AT32 0x00001000 /* sys has Mylex AT/32 local bus */ -#define MACHINE_BUS_OLB 0x00002000 /* sys has OPTi local bus */ -#define MACHINE_BUS_VLB 0x00004000 /* sys has VL bus */ -#define MACHINE_BUS_MCA 0x00008000 /* sys has MCA bus */ +#define MACHINE_BUS_PS2 MACHINE_BUS_PS2_PORTS +#define MACHINE_BUS_PCMCIA 0x00000400 /* sys has PCMCIA bus */ +#define MACHINE_BUS_HIL 0x00000800 /* system has HP HIL keyboard and mouse ports */ +#define MACHINE_BUS_EISA 0x00001000 /* sys has EISA bus */ +#define MACHINE_BUS_AT32 0x00002000 /* sys has Mylex AT/32 local bus */ +#define MACHINE_BUS_OLB 0x00004000 /* sys has OPTi local bus */ +#define MACHINE_BUS_VLB 0x00008000 /* sys has VL bus */ #define MACHINE_BUS_PCI 0x00010000 /* sys has PCI bus */ #define MACHINE_BUS_CARDBUS 0x00020000 /* sys has CardBus bus */ #define MACHINE_BUS_USB 0x00040000 /* sys has USB bus */ @@ -50,7 +49,6 @@ #define MACHINE_BUS_AC97 0x00100000 /* sys has AC97 bus (ACR/AMR/CNR slot) */ /* Aliases. */ #define MACHINE_CASSETTE (MACHINE_BUS_CASSETTE) /* sys has cassette port */ -#define MACHINE_CARTRIDGE (MACHINE_BUS_CARTRIDGE) /* sys has two cartridge bays */ /* Combined flags. */ #define MACHINE_PC (MACHINE_BUS_ISA) /* sys is PC/XT-compatible (ISA) */ #define MACHINE_AT (MACHINE_BUS_ISA | MACHINE_BUS_ISA16) /* sys is AT-compatible (ISA + ISA16) */ @@ -69,18 +67,18 @@ #define MACHINE_AGP (MACHINE_BUS_AGP | MACHINE_PCI) /* sys is AT-compatible with AGP */ #define MACHINE_AGP98 (MACHINE_BUS_AGP | MACHINE_PCI98) /* sys is NEC PC-98x1 series with AGP (did that even exist?) */ -#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */ -#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_CARTRIDGE) /* sys is PCjr */ -#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */ -#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */ -#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */ -#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */ -#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */ -#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */ -#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */ -#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */ -#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */ -#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */ +#define MACHINE_PC5150 (MACHINE_PC | MACHINE_CASSETTE) /* sys is IBM PC 5150 */ +#define MACHINE_PCJR (MACHINE_PC | MACHINE_CASSETTE | MACHINE_BUS_SIDECAR) /* sys is PCjr */ +#define MACHINE_PS2 (MACHINE_AT | MACHINE_BUS_PS2) /* sys is PS/2 */ +#define MACHINE_PS2_MCA (MACHINE_MCA | MACHINE_BUS_PS2) /* sys is MCA PS/2 */ +#define MACHINE_PS2_VLB (MACHINE_VLB | MACHINE_BUS_PS2) /* sys is VLB PS/2 */ +#define MACHINE_PS2_PCI (MACHINE_PCI | MACHINE_BUS_PS2) /* sys is PCI PS/2 */ +#define MACHINE_PS2_PCIV (MACHINE_PCIV | MACHINE_BUS_PS2) /* sys is VLB/PCI PS/2 */ +#define MACHINE_PS2_AGP (MACHINE_AGP | MACHINE_BUS_PS2) /* sys is AGP PS/2 */ +#define MACHINE_PS2_A97 (MACHINE_PS2_AGP | MACHINE_BUS_AC97) /* sys is AGP/AC97 PS/2 */ +#define MACHINE_PS2_NOISA (MACHINE_PS2_AGP & ~MACHINE_AT) /* sys is AGP PS/2 without ISA */ +#define MACHINE_PS2_PCIONLY (MACHINE_PS2_NOISA & ~MACHINE_BUS_AGP) /* sys is PCI PS/2 without ISA */ +#define MACHINE_PS2_NOI97 (MACHINE_PS2_A97 & ~MACHINE_AT) /* sys is AGP/AC97 PS/2 without ISA */ /* Feature flags for miscellaneous internal devices. */ #define MACHINE_FLAGS_NONE 0x00000000 /* sys has no int devices */ #define MACHINE_SOFTFLOAT_ONLY 0x00000001 /* sys requires SoftFloat FPU */ @@ -93,7 +91,8 @@ #define MACHINE_LPT_PRI 0x00000080 /* sys has int pri LPT */ #define MACHINE_LPT_SEC 0x00000100 /* sys has int sec LPT */ #define MACHINE_LPT_TER 0x00000200 /* sys has int ter LPT */ -#define MACHINE_LPT_QUA 0x00000400 /* sys has int qua LPT */ +#define MACHINE_PS2_KBC 0x00000400 /* sys has a PS/2 keyboard controller */ + /* this is separate from having PS/2 ports */ #define MACHINE_UART_PRI 0x00000800 /* sys has int pri UART */ #define MACHINE_UART_SEC 0x00001000 /* sys has int sec UART */ #define MACHINE_UART_TER 0x00002000 /* sys has int ter UART */ @@ -106,7 +105,7 @@ #define MACHINE_APM 0x00080000 /* sys has APM */ #define MACHINE_ACPI 0x00100000 /* sys has ACPI */ #define MACHINE_HWM 0x00200000 /* sys has hw monitor */ -#define MACHINE_COREBOOT 0x00400000 /* sys has coreboot BIOS */ +#define MACHINE_CARTRIDGE 0x00400000 /* sys has cartridge bays */ /* Feature flags for internal storage controllers. */ #define MACHINE_MFM 0x00800000 /* sys has int MFM/RLL */ #define MACHINE_XTA 0x01000000 /* sys has int XTA */ diff --git a/src/ioapic.c b/src/ioapic.c index b5ca4c7a7..ea0811f91 100644 --- a/src/ioapic.c +++ b/src/ioapic.c @@ -117,7 +117,7 @@ ioapic_init(UNUSED(const device_t *info)) const device_t ioapic_device = { .name = "I/O Advanced Programmable Interrupt Controller", .internal_name = "ioapic", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = ioapic_init, .close = ioapic_close, diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index cb2a04d07..24cb88f09 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -626,9 +626,9 @@ machine_at_cmdsl386sx16_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_ide_init(model); + machine_at_common_init(model); - device_add(&keyboard_at_device); + device_add(&keyboard_ps2_device); if (fdc_current[0] == FDC_INTERNAL) device_add(&fdc_at_device); diff --git a/src/machine/m_ps1_hdc.c b/src/machine/m_ps1_hdc.c index d407953b4..18792ded7 100644 --- a/src/machine/m_ps1_hdc.c +++ b/src/machine/m_ps1_hdc.c @@ -1380,7 +1380,7 @@ ps1_hdc_close(void *priv) const device_t ps1_hdc_device = { .name = "PS/1 2011 Fixed Disk Controller", .internal_name = "ps1_hdc", - .flags = DEVICE_ISA | DEVICE_PS2, + .flags = DEVICE_ISA, .local = 0, .init = ps1_hdc_init, .close = ps1_hdc_close, diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index e55d9b494..cb6bc964e 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -4688,7 +4688,7 @@ const machine_t machines[] = { .max_multi = 0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE, + .flags = MACHINE_FLAGS_NONE, .ram = { .min = 1024, .max = 8192, @@ -8257,8 +8257,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -8337,8 +8337,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 261120, @@ -8539,8 +8539,8 @@ const machine_t machines[] = { .min_multi = 0, .max_multi = 0 }, - .bus_flags = MACHINE_PCI | MACHINE_BUS_PS2_LATCH, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_IDE_DUAL | MACHINE_APM, .ram = { .min = 1024, .max = 131072, @@ -9198,8 +9198,8 @@ const machine_t machines[] = { .min_multi = MACHINE_MULTIPLIER_FIXED, .max_multi = MACHINE_MULTIPLIER_FIXED }, - .bus_flags = MACHINE_BUS_PS2_LATCH | MACHINE_PCI, - .flags = MACHINE_APM, + .bus_flags = MACHINE_PCI, + .flags = MACHINE_PS2_KBC | MACHINE_APM, .ram = { .min = 2048, .max = 196608, @@ -15278,7 +15278,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SLOT1, - .block = CPU_BLOCK_NONE, + .block = CPU_BLOCK(CPU_PENTIUMPRO), .min_bus = 66666667, .max_bus = 150000000, .min_voltage = 1300, @@ -16163,7 +16163,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SLOT1, - .block = CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), + .block = CPU_BLOCK(CPU_PENTIUMPRO, CPU_PENTIUM2, CPU_CYRIX3S), .min_bus = 0, .max_bus = 66666667, .min_voltage = 0, @@ -16507,19 +16507,39 @@ machine_get_nvrmask(int m) int machine_has_flags(int m, int flags) { - return (machines[m].flags & flags); + int ret = machines[m].flags & flags; + + /* Can't have PS/2 ports with an AT KBC. */ + if ((flags & MACHINE_PS2_KBC) && + (machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_PS2_KBC; + + return ret; } int machine_has_bus(int m, int bus_flags) { - return (machines[m].bus_flags & bus_flags); + int ret = machines[m].bus_flags & bus_flags; + + /* TODO: Move the KBD flags to the machine table! */ + if ((bus_flags & MACHINE_BUS_XT_KBD) && + !(machines[m].bus_flags & MACHINE_BUS_ISA16) && + !(machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_BUS_XT_KBD; + + if ((bus_flags & MACHINE_BUS_AT_KBD) && + (IS_AT(m)) && + !(machines[m].bus_flags & MACHINE_BUS_PS2_PORTS)) + ret |= MACHINE_BUS_AT_KBD; + + return ret; } int machine_has_cartridge(int m) { - return (machine_has_bus(m, MACHINE_CARTRIDGE) ? 1 : 0); + return (machine_has_flags(m, MACHINE_CARTRIDGE) ? 1 : 0); } int diff --git a/src/machine_status.c b/src/machine_status.c index 16976fa83..3eb2762bc 100644 --- a/src/machine_status.c +++ b/src/machine_status.c @@ -45,11 +45,13 @@ machine_status_init(void) machine_status.mo[i].active = false; } + for (size_t i = 0; i < 2; i++) + machine_status.cartridge[i].empty = (strlen(cart_fns[i]) == 0); + machine_status.cassette.empty = (strlen(cassette_fname) == 0); - for (size_t i = 0; i < HDD_BUS_USB; i++) { + for (size_t i = 0; i < HDD_BUS_USB; i++) machine_status.hdd[i].active = false; - } for (size_t i = 0; i < NET_CARD_MAX; i++) { machine_status.net[i].active = false; diff --git a/src/mem/row.c b/src/mem/row.c index 633d0e31a..c3e10841f 100644 --- a/src/mem/row.c +++ b/src/mem/row.c @@ -336,7 +336,7 @@ row_init(const device_t *info) device_t row_device = { .name = "DRAM Rows", .internal_name = "dram_rows", - .flags = DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0000, .init = row_init, .close = row_close, diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index dd3a12047..71e5c2ca7 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -1714,7 +1714,7 @@ const device_t ne1000_compat_device = { const device_t ne2000_device = { .name = "Novell NE2000", .internal_name = "novell_ne2k", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_NE2000, .init = nic_init, .close = nic_close, @@ -1728,7 +1728,7 @@ const device_t ne2000_device = { const device_t ne2000_compat_device = { .name = "NE2000 Compatible", .internal_name = "ne2k", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_NE2000_COMPAT, .init = nic_init, .close = nic_close, @@ -1770,7 +1770,7 @@ const device_t ethernext_mc_device = { const device_t rtl8019as_pnp_device = { .name = "Realtek RTL8019AS", .internal_name = "ne2kpnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_RTL8019AS_PNP, .init = nic_init, .close = nic_close, @@ -1784,7 +1784,7 @@ const device_t rtl8019as_pnp_device = { const device_t de220p_device = { .name = "D-Link DE-220P", .internal_name = "de220p", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = NE2K_DE220P, .init = nic_init, .close = nic_close, diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index 3272033cf..b13fd8438 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -2922,7 +2922,7 @@ pcnet_init(const device_t *info) dev->is_pci = !!(info->flags & DEVICE_PCI); dev->is_vlb = !!(info->flags & DEVICE_VLB); - dev->is_isa = !!(info->flags & (DEVICE_ISA | DEVICE_AT)); + dev->is_isa = !!(info->flags & (DEVICE_ISA16)); if (dev->is_pci || dev->is_vlb) dev->transfer_size = 4; @@ -3231,7 +3231,7 @@ static const device_config_t pcnet_vlb_config[] = { const device_t pcnet_am79c960_device = { .name = "AMD PCnet-ISA", .internal_name = "pcnetisa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C960, .init = pcnet_init, .close = pcnet_close, @@ -3245,7 +3245,7 @@ const device_t pcnet_am79c960_device = { const device_t pcnet_am79c960_eb_device = { .name = "Racal Interlan EtherBlaster", .internal_name = "pcnetracal", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C960_EB, .init = pcnet_init, .close = pcnet_close, @@ -3273,7 +3273,7 @@ const device_t pcnet_am79c960_vlb_device = { const device_t pcnet_am79c961_device = { .name = "AMD PCnet-ISA+", .internal_name = "pcnetisaplus", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = DEV_AM79C961, .init = pcnet_init, .close = pcnet_close, diff --git a/src/nvr_at.c b/src/nvr_at.c index 147795f8e..bde80b434 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -1219,7 +1219,7 @@ nvr_at_close(void *priv) const device_t at_nvr_old_device = { .name = "PC/AT NVRAM (No century)", .internal_name = "at_nvr_old", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = nvr_at_init, .close = nvr_at_close, @@ -1233,7 +1233,7 @@ const device_t at_nvr_old_device = { const device_t at_nvr_device = { .name = "PC/AT NVRAM", .internal_name = "at_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1247,7 +1247,7 @@ const device_t at_nvr_device = { const device_t at_mb_nvr_device = { .name = "PC/AT NVRAM", .internal_name = "at_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x40 | 0x20 | 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1261,7 +1261,7 @@ const device_t at_mb_nvr_device = { const device_t ps_nvr_device = { .name = "PS/1 or PS/2 NVRAM", .internal_name = "ps_nvr", - .flags = DEVICE_PS2, + .flags = DEVICE_ISA16, .local = 2, .init = nvr_at_init, .close = nvr_at_close, @@ -1275,7 +1275,7 @@ const device_t ps_nvr_device = { const device_t amstrad_nvr_device = { .name = "Amstrad NVRAM", .internal_name = "amstrad_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 3, .init = nvr_at_init, .close = nvr_at_close, @@ -1289,7 +1289,7 @@ const device_t amstrad_nvr_device = { const device_t ibmat_nvr_device = { .name = "IBM AT NVRAM", .internal_name = "ibmat_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 4, .init = nvr_at_init, .close = nvr_at_close, @@ -1303,7 +1303,7 @@ const device_t ibmat_nvr_device = { const device_t piix4_nvr_device = { .name = "Intel PIIX4 PC/AT NVRAM", .internal_name = "piix4_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 1, .init = nvr_at_init, .close = nvr_at_close, @@ -1317,7 +1317,7 @@ const device_t piix4_nvr_device = { const device_t ps_no_nmi_nvr_device = { .name = "PS/1 or PS/2 NVRAM (No NMI)", .internal_name = "ps1_nvr", - .flags = DEVICE_PS2, + .flags = DEVICE_ISA16, .local = 0x10 | 2, .init = nvr_at_init, .close = nvr_at_close, @@ -1331,7 +1331,7 @@ const device_t ps_no_nmi_nvr_device = { const device_t amstrad_no_nmi_nvr_device = { .name = "Amstrad NVRAM (No NMI)", .internal_name = "amstrad_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 3, .init = nvr_at_init, .close = nvr_at_close, @@ -1345,7 +1345,7 @@ const device_t amstrad_no_nmi_nvr_device = { const device_t ami_1992_nvr_device = { .name = "AMI Color 1992 PC/AT NVRAM", .internal_name = "ami_1992_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 4, .init = nvr_at_init, .close = nvr_at_close, @@ -1359,7 +1359,7 @@ const device_t ami_1992_nvr_device = { const device_t ami_1994_nvr_device = { .name = "AMI WinBIOS 1994 PC/AT NVRAM", .internal_name = "ami_1994_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 5, .init = nvr_at_init, .close = nvr_at_close, @@ -1373,7 +1373,7 @@ const device_t ami_1994_nvr_device = { const device_t ami_1995_nvr_device = { .name = "AMI WinBIOS 1995 PC/AT NVRAM", .internal_name = "ami_1995_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 6, .init = nvr_at_init, .close = nvr_at_close, @@ -1387,7 +1387,7 @@ const device_t ami_1995_nvr_device = { const device_t via_nvr_device = { .name = "VIA PC/AT NVRAM", .internal_name = "via_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x10 | 7, .init = nvr_at_init, .close = nvr_at_close, @@ -1401,7 +1401,7 @@ const device_t via_nvr_device = { const device_t p6rp4_nvr_device = { .name = "ASUS P/I-P6RP4 PC/AT NVRAM", .internal_name = "p6rp4_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 32, .init = nvr_at_init, .close = nvr_at_close, @@ -1415,7 +1415,7 @@ const device_t p6rp4_nvr_device = { const device_t amstrad_megapc_nvr_device = { .name = "Amstrad MegaPC NVRAM", .internal_name = "amstrad_megapc_nvr", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 36, .init = nvr_at_init, .close = nvr_at_close, diff --git a/src/pic.c b/src/pic.c index 7f6eda40d..cf17e8205 100644 --- a/src/pic.c +++ b/src/pic.c @@ -629,7 +629,7 @@ pic_reset_hard(void) /* The situation is as follows: There is a giant mess when it comes to these latches on real hardware, to the point that there's even boards with board-level latched that get used in place of the latches on the chipset, therefore, I'm just doing this here for the sake of simplicity. */ - if (machine_has_bus(machine, MACHINE_BUS_PS2_LATCH)) { + if (machine_has_flags(machine, MACHINE_PS2_KBC)) { pic_kbd_latch(0x01); pic_mouse_latch(0x01); } else { diff --git a/src/scsi/scsi_aha154x.c b/src/scsi/scsi_aha154x.c index 4f3d1d1e7..7c887e28b 100644 --- a/src/scsi/scsi_aha154x.c +++ b/src/scsi/scsi_aha154x.c @@ -1473,7 +1473,7 @@ static const device_config_t aha_154xcp_config[] = { const device_t aha154xa_device = { .name = "Adaptec AHA-154xA", .internal_name = "aha154xa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xA, .init = aha_init, .close = x54x_close, @@ -1487,7 +1487,7 @@ const device_t aha154xa_device = { const device_t aha154xb_device = { .name = "Adaptec AHA-154xB", .internal_name = "aha154xb", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xB, .init = aha_init, .close = x54x_close, @@ -1501,7 +1501,7 @@ const device_t aha154xb_device = { const device_t aha154xc_device = { .name = "Adaptec AHA-154xC", .internal_name = "aha154xc", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xC, .init = aha_init, .close = x54x_close, @@ -1515,7 +1515,7 @@ const device_t aha154xc_device = { const device_t aha154xcf_device = { .name = "Adaptec AHA-154xCF", .internal_name = "aha154xcf", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xCF, .init = aha_init, .close = x54x_close, @@ -1529,7 +1529,7 @@ const device_t aha154xcf_device = { const device_t aha154xcp_device = { .name = "Adaptec AHA-154xCP", .internal_name = "aha154xcp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = AHA_154xCP, .init = aha_init, .close = aha1542cp_close, diff --git a/src/scsi/scsi_buslogic.c b/src/scsi/scsi_buslogic.c index c4745e2df..9fe34380b 100644 --- a/src/scsi/scsi_buslogic.c +++ b/src/scsi/scsi_buslogic.c @@ -1872,7 +1872,7 @@ static const device_config_t BT958D_Config[] = { const device_t buslogic_542b_device = { .name = "BusLogic BT-542B ISA", .internal_name = "bt542b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_542B_1991_12_14, .init = buslogic_init, .close = x54x_close, @@ -1886,7 +1886,7 @@ const device_t buslogic_542b_device = { const device_t buslogic_545s_device = { .name = "BusLogic BT-545S ISA", .internal_name = "bt545s", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_545S_1992_10_05, .init = buslogic_init, .close = x54x_close, @@ -1900,7 +1900,7 @@ const device_t buslogic_545s_device = { const device_t buslogic_542bh_device = { .name = "BusLogic BT-542BH ISA", .internal_name = "bt542bh", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_542BH_1993_05_23, .init = buslogic_init, .close = x54x_close, @@ -1914,7 +1914,7 @@ const device_t buslogic_542bh_device = { const device_t buslogic_545c_device = { .name = "BusLogic BT-545C ISA", .internal_name = "bt545c", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CHIP_BUSLOGIC_ISA_545C_1994_12_01, .init = buslogic_init, .close = x54x_close, diff --git a/src/sound/snd_azt2316a.c b/src/sound/snd_azt2316a.c index ea682a82c..76bf1b24f 100644 --- a/src/sound/snd_azt2316a.c +++ b/src/sound/snd_azt2316a.c @@ -1557,7 +1557,7 @@ static const device_config_t azt2316a_config[] = { const device_t azt2316a_device = { .name = "Aztech Sound Galaxy Pro 16 AB (Washington)", .internal_name = "azt2316a", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_SUBTYPE_CLONE_AZT2316A_0X11, .init = azt_init, .close = azt_close, @@ -1571,7 +1571,7 @@ const device_t azt2316a_device = { const device_t azt1605_device = { .name = "Aztech Sound Galaxy Nova 16 Extra (Clinton)", .internal_name = "azt1605", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_SUBTYPE_CLONE_AZT1605_0X0C, .init = azt_init, .close = azt_close, diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index f5458eaf0..17ea48dd3 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -1061,7 +1061,7 @@ cs423x_speed_changed(void *priv) const device_t cs4235_device = { .name = "Crystal CS4235", .internal_name = "cs4235", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4235, .init = cs423x_init, .close = cs423x_close, @@ -1075,7 +1075,7 @@ const device_t cs4235_device = { const device_t cs4235_onboard_device = { .name = "Crystal CS4235 (On-Board)", .internal_name = "cs4235_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4235 | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1089,7 +1089,7 @@ const device_t cs4235_onboard_device = { const device_t cs4236_onboard_device = { .name = "Crystal CS4236 (On-Board)", .internal_name = "cs4236_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236 | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1103,7 +1103,7 @@ const device_t cs4236_onboard_device = { const device_t cs4236b_device = { .name = "Crystal CS4236B", .internal_name = "cs4236b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236B, .init = cs423x_init, .close = cs423x_close, @@ -1117,7 +1117,7 @@ const device_t cs4236b_device = { const device_t cs4236b_onboard_device = { .name = "Crystal CS4236B", .internal_name = "cs4236b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4236B | CRYSTAL_NOEEPROM, .init = cs423x_init, .close = cs423x_close, @@ -1131,7 +1131,7 @@ const device_t cs4236b_onboard_device = { const device_t cs4237b_device = { .name = "Crystal CS4237B", .internal_name = "cs4237b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4237B, .init = cs423x_init, .close = cs423x_close, @@ -1145,7 +1145,7 @@ const device_t cs4237b_device = { const device_t cs4238b_device = { .name = "Crystal CS4238B", .internal_name = "cs4238b", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = CRYSTAL_CS4238B, .init = cs423x_init, .close = cs423x_close, diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index f2651c72f..43638473c 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -1500,7 +1500,7 @@ static const device_config_t gus_config[] = { const device_t gus_device = { .name = "Gravis UltraSound", .internal_name = "gus", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = gus_init, .close = gus_close, diff --git a/src/sound/snd_optimc.c b/src/sound/snd_optimc.c index d5c01dbaf..d0b05741a 100644 --- a/src/sound/snd_optimc.c +++ b/src/sound/snd_optimc.c @@ -484,7 +484,7 @@ static const device_config_t optimc_config[] = { const device_t acermagic_s20_device = { .name = "AcerMagic S20", .internal_name = "acermagic_s20", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0xE3 | OPTIMC_CS4231, .init = optimc_init, .close = optimc_close, @@ -498,7 +498,7 @@ const device_t acermagic_s20_device = { const device_t mirosound_pcm10_device = { .name = "miroSOUND PCM10", .internal_name = "mirosound_pcm10", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0xE3 | OPTIMC_OPL4, .init = optimc_init, .close = optimc_close, diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index ddb135357..353f9a3d5 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -2453,7 +2453,7 @@ const device_t pasplus_device = { const device_t pas16_device = { .name = "Pro Audio Spectrum 16", .internal_name = "pas16", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0f, .init = pas16_init, .close = pas16_close, @@ -2467,7 +2467,7 @@ const device_t pas16_device = { const device_t pas16d_device = { .name = "Pro Audio Spectrum 16D", .internal_name = "pas16d", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x0c, .init = pas16_init, .close = pas16_close, diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index ca233b252..4f8b8a0bd 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -5476,7 +5476,7 @@ const device_t sb_pro_mcv_device = { const device_t sb_pro_compat_device = { .name = "Sound Blaster Pro (Compatibility)", .internal_name = "sbpro_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_pro_compat_init, .close = sb_close, @@ -5490,7 +5490,7 @@ const device_t sb_pro_compat_device = { const device_t sb_16_device = { .name = "Sound Blaster 16", .internal_name = "sb16", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF262, .init = sb_16_init, .close = sb_close, @@ -5504,7 +5504,7 @@ const device_t sb_16_device = { const device_t sb_vibra16c_onboard_device = { .name = "Sound Blaster ViBRA 16C (On-Board)", .internal_name = "sb_vibra16c_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16C, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5518,7 +5518,7 @@ const device_t sb_vibra16c_onboard_device = { const device_t sb_vibra16c_device = { .name = "Sound Blaster ViBRA 16C", .internal_name = "sb_vibra16c", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16C, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5532,7 +5532,7 @@ const device_t sb_vibra16c_device = { const device_t sb_vibra16cl_onboard_device = { .name = "Sound Blaster ViBRA 16CL (On-Board)", .internal_name = "sb_vibra16cl_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16CL, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5546,7 +5546,7 @@ const device_t sb_vibra16cl_onboard_device = { const device_t sb_vibra16cl_device = { .name = "Sound Blaster ViBRA 16CL", .internal_name = "sb_vibra16cl", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16CL, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5560,7 +5560,7 @@ const device_t sb_vibra16cl_device = { const device_t sb_vibra16s_onboard_device = { .name = "Sound Blaster ViBRA 16S (On-Board)", .internal_name = "sb_vibra16s_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, @@ -5574,7 +5574,7 @@ const device_t sb_vibra16s_onboard_device = { const device_t sb_vibra16s_device = { .name = "Sound Blaster ViBRA 16S", .internal_name = "sb_vibra16s", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = FM_YMF289B, .init = sb_16_init, .close = sb_close, @@ -5588,7 +5588,7 @@ const device_t sb_vibra16s_device = { const device_t sb_vibra16xv_onboard_device = { .name = "Sound Blaster ViBRA 16XV (On-Board)", .internal_name = "sb_vibra16xv_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16XV, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5602,7 +5602,7 @@ const device_t sb_vibra16xv_onboard_device = { const device_t sb_vibra16xv_device = { .name = "Sound Blaster ViBRA 16XV", .internal_name = "sb_vibra16xv", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_VIBRA16XV, .init = sb_vibra16_pnp_init, .close = sb_close, @@ -5630,7 +5630,7 @@ const device_t sb_16_reply_mca_device = { const device_t sb_16_pnp_device = { .name = "Sound Blaster 16 PnP", .internal_name = "sb16_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_16_PNP_NOIDE, .init = sb_16_pnp_init, .close = sb_close, @@ -5644,7 +5644,7 @@ const device_t sb_16_pnp_device = { const device_t sb_16_pnp_ide_device = { .name = "Sound Blaster 16 PnP (IDE)", .internal_name = "sb16_pnp_ide", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_16_PNP_IDE, .init = sb_16_pnp_init, .close = sb_close, @@ -5658,7 +5658,7 @@ const device_t sb_16_pnp_ide_device = { const device_t sb_16_compat_device = { .name = "Sound Blaster 16 (Compatibility)", .internal_name = "sb16_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 1, .init = sb_16_compat_init, .close = sb_close, @@ -5672,7 +5672,7 @@ const device_t sb_16_compat_device = { const device_t sb_16_compat_nompu_device = { .name = "Sound Blaster 16 (Compatibility - MPU-401 Off)", .internal_name = "sb16_compat", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_16_compat_init, .close = sb_close, @@ -5686,7 +5686,7 @@ const device_t sb_16_compat_nompu_device = { const device_t sb_goldfinch_device = { .name = "Creative EMU8000 PnP (Goldfinch)", .internal_name = "sb_goldfinch", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_goldfinch_init, .close = sb_goldfinch_close, @@ -5700,7 +5700,7 @@ const device_t sb_goldfinch_device = { const device_t sb_32_pnp_device = { .name = "Sound Blaster 32 PnP", .internal_name = "sb32_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_32_PNP, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5714,7 +5714,7 @@ const device_t sb_32_pnp_device = { const device_t sb_awe32_device = { .name = "Sound Blaster AWE32", .internal_name = "sbawe32", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = sb_awe32_init, .close = sb_awe32_close, @@ -5728,7 +5728,7 @@ const device_t sb_awe32_device = { const device_t sb_awe32_pnp_device = { .name = "Sound Blaster AWE32 PnP", .internal_name = "sbawe32_pnp", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE32_PNP, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5742,7 +5742,7 @@ const device_t sb_awe32_pnp_device = { const device_t sb_awe64_value_device = { .name = "Sound Blaster AWE64 Value", .internal_name = "sbawe64_value", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_VALUE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5756,7 +5756,7 @@ const device_t sb_awe64_value_device = { const device_t sb_awe64_device = { .name = "Sound Blaster AWE64", .internal_name = "sbawe64", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_NOIDE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5770,7 +5770,7 @@ const device_t sb_awe64_device = { const device_t sb_awe64_ide_device = { .name = "Sound Blaster AWE64 (IDE)", .internal_name = "sbawe64_ide", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_IDE, .init = sb_awe32_pnp_init, .close = sb_awe32_close, @@ -5784,7 +5784,7 @@ const device_t sb_awe64_ide_device = { const device_t sb_awe64_gold_device = { .name = "Sound Blaster AWE64 Gold", .internal_name = "sbawe64_gold", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = SB_AWE64_GOLD, .init = sb_awe32_pnp_init, .close = sb_awe32_close, diff --git a/src/sound/snd_wss.c b/src/sound/snd_wss.c index c55e5f57b..874638a80 100644 --- a/src/sound/snd_wss.c +++ b/src/sound/snd_wss.c @@ -279,7 +279,7 @@ static const device_config_t wss_config[] = { const device_t wss_device = { .name = "Windows Sound System", .internal_name = "wss", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = wss_init, .close = wss_close, diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 09b054895..379772820 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -4072,7 +4072,7 @@ static const device_config_t mca_ext8514_config[] = { const device_t gen8514_isa_device = { .name = "IBM 8514/A clone (ISA)", .internal_name = "8514_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = 0, .init = ibm8514_init, .close = ibm8514_close, diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 9b7a67f31..2df7782ff 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -4595,7 +4595,7 @@ mach64gx_init(const device_t *info) { mach64_t *mach64 = mach64_common_init(info); - if (info->flags & DEVICE_ISA) + if (info->flags & DEVICE_ISA16) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_mach64_isa); else if (info->flags & DEVICE_PCI) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_mach64_pci); @@ -4617,7 +4617,7 @@ mach64gx_init(const device_t *info) mach64->config_stat0 |= 6; /*VLB, 256Kx16 DRAM*/ ati_eeprom_load(&mach64->eeprom, "mach64_vlb.nvr", 1); rom_init(&mach64->bios_rom, BIOS_VLB_ROM_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); - } else if (info->flags & DEVICE_ISA) { + } else if (info->flags & DEVICE_ISA16) { mach64->config_stat0 |= 0; /*ISA 16-bit, 256k16 DRAM*/ ati_eeprom_load(&mach64->eeprom, "mach64.nvr", 1); rom_init(&mach64->bios_rom, BIOS_ISA_ROM_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); @@ -4752,7 +4752,7 @@ static const device_config_t mach64vt2_config[] = { const device_t mach64gx_isa_device = { .name = "ATI Mach64GX ISA", .internal_name = "mach64gx_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = 0, .init = mach64gx_init, .close = mach64_close, diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 19f51bd9d..21d9b21d8 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -4382,7 +4382,7 @@ gd54xx_init(const device_t *info) rom_init_interleaved(&gd54xx->bios_rom, BIOS_GD5428_BOCA_ISA_PATH_1, BIOS_GD5428_BOCA_ISA_PATH_2, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); - if (info->flags & DEVICE_ISA) + if ((info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16)) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_gd54xx_isa); else if (info->flags & DEVICE_PCI) video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_gd54xx_pci); @@ -4887,7 +4887,7 @@ const device_t gd5402_isa_device = { const device_t gd5402_onboard_device = { .name = "Cirrus Logic GD5402 (ISA) (ACUMOS AVGA2) (On-Board)", .internal_name = "cl_gd5402_onboard", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5402 | 0x200, .init = gd54xx_init, .close = gd54xx_close, @@ -4901,7 +4901,7 @@ const device_t gd5402_onboard_device = { const device_t gd5420_isa_device = { .name = "Cirrus Logic GD5420 (ISA)", .internal_name = "cl_gd5420_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5420, .init = gd54xx_init, .close = gd54xx_close, @@ -4915,7 +4915,7 @@ const device_t gd5420_isa_device = { const device_t gd5422_isa_device = { .name = "Cirrus Logic GD5422 (ISA)", .internal_name = "cl_gd5422_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5422, .init = gd54xx_init, .close = gd54xx_close, @@ -4943,7 +4943,7 @@ const device_t gd5424_vlb_device = { const device_t gd5426_isa_device = { .name = "Cirrus Logic GD5426 (ISA)", .internal_name = "cl_gd5426_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5426, .init = gd54xx_init, .close = gd54xx_close, @@ -4958,7 +4958,7 @@ const device_t gd5426_isa_device = { const device_t gd5426_diamond_speedstar_pro_a1_isa_device = { .name = "Cirrus Logic GD5426 (ISA) (Diamond SpeedStar Pro Rev. A1)", .internal_name = "cl_gd5426_diamond_a1_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5426 | 0x100, .init = gd54xx_init, .close = gd54xx_close, @@ -5000,7 +5000,7 @@ const device_t gd5426_onboard_device = { const device_t gd5428_isa_device = { .name = "Cirrus Logic GD5428 (ISA)", .internal_name = "cl_gd5428_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428, .init = gd54xx_init, .close = gd54xx_close, @@ -5043,7 +5043,7 @@ const device_t gd5428_diamond_speedstar_pro_b1_vlb_device = { const device_t gd5428_boca_isa_device = { .name = "Cirrus Logic GD5428 (ISA) (BOCA Research 4610)", .internal_name = "cl_gd5428_boca_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428 | 0x100, .init = gd54xx_init, .close = gd54xx_close, @@ -5085,7 +5085,7 @@ const device_t gd5426_mca_device = { const device_t gd5428_onboard_device = { .name = "Cirrus Logic GD5428 (ISA) (On-Board)", .internal_name = "cl_gd5428_onboard", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5428, .init = gd54xx_init, .close = gd54xx_close, @@ -5113,7 +5113,7 @@ const device_t gd5428_vlb_onboard_device = { const device_t gd5429_isa_device = { .name = "Cirrus Logic GD5429 (ISA)", .internal_name = "cl_gd5429_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5429, .init = gd54xx_init, .close = gd54xx_close, @@ -5212,7 +5212,7 @@ const device_t gd5430_onboard_pci_device = { const device_t gd5434_isa_device = { .name = "Cirrus Logic GD5434 (ISA)", .internal_name = "cl_gd5434_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5434, .init = gd54xx_init, .close = gd54xx_close, @@ -5227,7 +5227,7 @@ const device_t gd5434_isa_device = { const device_t gd5434_diamond_speedstar_64_a3_isa_device = { .name = "Cirrus Logic GD5434 (ISA) (Diamond SpeedStar 64 Rev. A3)", .internal_name = "cl_gd5434_diamond_a3_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = CIRRUS_ID_CLGD5434 | 0x100, .init = gd54xx_init, .close = gd54xx_close, diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 6ff34cbb1..246decb9c 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -2964,7 +2964,7 @@ static const device_config_t et4000w32p_config[] = { const device_t et4000w32_device = { .name = "Tseng Labs ET4000/w32 ISA", .internal_name = "et4000w32", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32, .init = et4000w32p_init, .close = et4000w32p_close, @@ -2978,7 +2978,7 @@ const device_t et4000w32_device = { const device_t et4000w32_onboard_device = { .name = "Tseng Labs ET4000/w32 (ISA) (On-Board)", .internal_name = "et4000w32_onboard", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32, .init = et4000w32p_init, .close = et4000w32p_close, @@ -2992,7 +2992,7 @@ const device_t et4000w32_onboard_device = { const device_t et4000w32i_isa_device = { .name = "Tseng Labs ET4000/w32i Rev. B ISA", .internal_name = "et4000w32i", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = ET4000W32I, .init = et4000w32p_init, .close = et4000w32p_close, diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index ce756f7d8..b650cb53b 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -1604,7 +1604,7 @@ ht216_init(const device_t *info, uint32_t mem_size, int has_rom) mem_mapping_disable(&ht216->linear_mapping); ht216->id = info->local; - ht216->isabus = (info->flags & DEVICE_ISA); + ht216->isabus = (info->flags & DEVICE_ISA) || (info->flags & DEVICE_ISA16); ht216->mca = (info->flags & DEVICE_MCA); io_sethandler(0x03c0, 0x0020, ht216_in, NULL, NULL, ht216_out, NULL, NULL, ht216); @@ -1819,7 +1819,7 @@ const device_t ht216_32_standalone_device = { const device_t radius_svga_multiview_isa_device = { .name = "Radius SVGA Multiview ISA (HT209)", .internal_name = "radius_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0x7152, /*HT209*/ .init = radius_svga_multiview_init, .close = ht216_close, diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index aecc898c4..769cd0001 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -10667,7 +10667,7 @@ static const device_config_t s3_standard_config2[] = { const device_t s3_orchid_86c911_isa_device = { .name = "S3 86c911 ISA (Orchid Fahrenheit 1280)", .internal_name = "orchid_s3_911", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_ORCHID_86C911, .init = s3_init, .close = s3_close, @@ -10681,7 +10681,7 @@ const device_t s3_orchid_86c911_isa_device = { const device_t s3_diamond_stealth_vram_isa_device = { .name = "S3 86c911 ISA (Diamond Stealth VRAM)", .internal_name = "stealthvram_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_DIAMOND_STEALTH_VRAM, .init = s3_init, .close = s3_close, @@ -10695,7 +10695,7 @@ const device_t s3_diamond_stealth_vram_isa_device = { const device_t s3_ami_86c924_isa_device = { .name = "S3 86c924 ISA (AMI)", .internal_name = "ami_s3_924", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_AMI_86C924, .init = s3_init, .close = s3_close, @@ -10709,7 +10709,7 @@ const device_t s3_ami_86c924_isa_device = { const device_t s3_spea_mirage_86c801_isa_device = { .name = "S3 86c801 ISA (SPEA Mirage ISA)", .internal_name = "px_s3_v7_801_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_SPEA_MIRAGE_86C801, .init = s3_init, .close = s3_close, @@ -10779,7 +10779,7 @@ const device_t s3_mirocrystal_10sd_805_vlb_device = { const device_t s3_phoenix_86c801_isa_device = { .name = "S3 86c801 ISA (Phoenix)", .internal_name = "px_86c801_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_PHOENIX_86C801, .init = s3_init, .close = s3_close, @@ -10807,7 +10807,7 @@ const device_t s3_phoenix_86c805_vlb_device = { const device_t s3_metheus_86c928_isa_device = { .name = "S3 86c928 ISA (Metheus Premier 928)", .internal_name = "metheus928_isa", - .flags = DEVICE_AT | DEVICE_ISA, + .flags = DEVICE_ISA16, .local = S3_METHEUS_86C928, .init = s3_init, .close = s3_close, diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index e68e4c1a0..7c674e00a 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1528,7 +1528,11 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, svga->translate_address = NULL; svga->ksc5601_english_font_type = 0; - if ((info->flags & DEVICE_PCI) || (info->flags & DEVICE_VLB) || (info->flags & DEVICE_MCA)) { + /* TODO: Move DEVICE_MCA to 16-bit once the device flags have been appropriately corrected. */ + if ((info->flags & DEVICE_MCA) || (info->flags & DEVICE_MCA32) || + (info->flags & DEVICE_EISA) || (info->flags & DEVICE_AT32) || + (info->flags & DEVICE_OLB) || (info->flags & DEVICE_VLB) || + (info->flags & DEVICE_PCI) || (info->flags & DEVICE_AGP)) { svga->read = svga_read; svga->readw = svga_readw; svga->readl = svga_readl; @@ -1539,7 +1543,8 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, svga_read, svga_readw, svga_readl, svga_write, svga_writew, svga_writel, NULL, MEM_MAPPING_EXTERNAL, svga); - } else if ((info->flags & DEVICE_ISA) && (info->flags & DEVICE_AT)) { + /* The chances of ever seeing a C-BUS (S)VGA card are approximately zero, but you never know. */ + } else if ((info->flags & DEVICE_CBUS) || (info->flags & DEVICE_ISA16)) { svga->read = svga_read; svga->readw = svga_readw; svga->readl = NULL; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index a469330af..2cc20044a 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -3815,7 +3815,7 @@ const device_t xga_device = { const device_t xga_isa_device = { .name = "XGA (ISA)", .internal_name = "xga_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = xga_init, .close = xga_close, @@ -3829,7 +3829,7 @@ const device_t xga_isa_device = { const device_t inmos_isa_device = { .name = "INMOS XGA (ISA)", .internal_name = "inmos_xga_isa", - .flags = DEVICE_ISA | DEVICE_AT, + .flags = DEVICE_ISA16, .local = 0, .init = svga_xga_init, .close = xga_close,