diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index e63b5175d..159ca6702 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -13,10 +13,12 @@ * Authors: Sarah Walker, * Miran Grca, * Fred N. van Kempen, + * EngiNerd * * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. + * Copyright 2020 EngiNerd. */ #include #include @@ -87,6 +89,7 @@ #define KBC_VEN_ACER 0x1c #define KBC_VEN_INTEL_AMI 0x20 #define KBC_VEN_OLIVETTI 0x24 +#define KBC_VEN_NCR 0x28 #define KBC_VEN_MASK 0x3c @@ -1197,6 +1200,17 @@ write64_generic(void *priv, uint8_t val) dev->input_port = ((dev->input_port + 1) & 3) | (dev->input_port & 0xfc) | (fdd_is_525(current_drive) ? 0x40 : 0x00); + } else if (kbc_ven == KBC_VEN_NCR) { + /* switch settings + * bit 7: keyboard disable + * bit 6: display type (0 color, 1 mono) + * bit 5: power-on default speed (0 high, 1 low) + * bit 4: sense RAM size (0 unsupported, 1 512k on system board) + * bits 0-3: unused + */ + add_to_kbc_queue_front(dev, (dev->input_port | fixed_bits | (video_is_mda() ? 0x40 : 0x00)) & 0xdf); + dev->input_port = ((dev->input_port + 1) & 3) | + (dev->input_port & 0xfc); } else { if (((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_NOREF) && ((dev->flags & KBC_VEN_MASK) != KBC_VEN_INTEL_AMI)) @@ -2277,6 +2291,7 @@ kbd_init(const device_t *info) case KBC_VEN_ACER: case KBC_VEN_GENERIC: case KBC_VEN_OLIVETTI: + case KBC_VEN_NCR: case KBC_VEN_IBM_PS1: case KBC_VEN_XI8088: dev->write64_ven = write64_generic; @@ -2350,6 +2365,16 @@ const device_t keyboard_at_olivetti_device = { { NULL }, NULL, NULL, NULL }; +const device_t keyboard_at_ncr_device = { + "PC/AT Keyboard (NCR)", + 0, + KBC_TYPE_ISA | KBC_VEN_NCR, + kbd_init, + kbd_close, + kbd_reset, + { NULL }, NULL, NULL, NULL +}; + const device_t keyboard_ps2_device = { "PS/2 Keyboard", 0, diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 1f69a5990..0d5b397e6 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -74,6 +74,7 @@ extern const device_t keyboard_at_device; extern const device_t keyboard_at_ami_device; extern const device_t keyboard_at_toshiba_device; extern const device_t keyboard_at_olivetti_device; +extern const device_t keyboard_at_ncr_device; extern const device_t keyboard_ps2_device; extern const device_t keyboard_ps2_ps1_device; extern const device_t keyboard_ps2_ps1_pci_device; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 9f572a5ef..f8dd959b7 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -259,6 +259,10 @@ extern int machine_at_adi386sx_init(const machine_t *); extern int machine_at_commodore_sl386sx_init(const machine_t *); extern int machine_at_wd76c10_init(const machine_t *); +extern int machine_at_olim290_init(const machine_t *); +extern int machine_at_ncrpc8_init(const machine_t *); +extern int machine_at_ncr3302_init(const machine_t *); + extern int machine_at_awardsx_init(const machine_t *); #if defined(DEV_BRANCH) && defined(USE_M6117) extern int machine_at_arb1375_init(const machine_t *); diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 16a21b0e0..b6a40ac4c 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -12,9 +12,11 @@ * * Authors: Sarah Walker, * Miran Grca, + * EngiNerd * * Copyright 2010-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. + * Copyright 2020 EngiNerd. */ #include #include @@ -553,3 +555,98 @@ machine_at_pja511m_init(const machine_t *model) return ret; } #endif + + + +static uint8_t +m290_read(uint16_t port, void *priv) +{ + uint8_t ret = 0x0; + switch (port) { + /* + * port 69: + * dip-switch bank on mainboard (off=1) + * bit 3 - use OCG/CGA display adapter (off) / other display adapter (on) + */ + case 0x69: + if(video_is_cga()) + ret |= 0x8|0x4; + ret |= 0x1|0x2; + } + return (ret); +} + +int +machine_at_olim290_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/olivetti_m290/m290_pep3_1.25.bin", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + device_add(&keyboard_at_device); + device_add(&fdc_at_device); + + io_sethandler(0x069, 1, m290_read, NULL, NULL, NULL, NULL, NULL, NULL); + + return ret; +} + + +/* + * Current bugs: + * - ctrl-alt-del produces an 8042 error + */ +int +machine_at_ncrpc8_init(const machine_t *model) +{ + int ret; + + ret = bios_load_interleaved(L"roms/machines/ncr_pc8/ncr_35117_u127_vers.4-2.bin", + L"roms/machines/ncr_pc8/ncr_35116_u113_vers.4-2.bin", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + device_add(&keyboard_at_ncr_device); + device_add(&fdc_at_device); + + return ret; +} + +/* + * Current bugs: + * - ctrl-alt-del produces an 8042 error + */ +int +machine_at_ncr3302_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/ncr_3302/f000-flex_drive_test.bin", + 0x000f0000, 65536, 0); + + if (ret) { + bios_load_aux_linear(L"roms/machines/ncr_3302/f800-setup_ncr3.5-013190.bin", + 0x000f8000, 32768, 0); + } + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + device_add(&neat_device); + device_add(&keyboard_at_ncr_device); + device_add(&fdc_at_device); + + if (gfxcard == VID_INTERNAL) + device_add(¶dise_pvga1a_device); + + return ret; +} diff --git a/src/machine/m_xt_zenith.c b/src/machine/m_xt_zenith.c index 6e5ac1729..67d09a04a 100644 --- a/src/machine/m_xt_zenith.c +++ b/src/machine/m_xt_zenith.c @@ -14,9 +14,11 @@ * Authors: Sarah Walker, * Miran Grca, * TheCollector1995, + * EngiNerd * * Copyright 2008-2019 Sarah Walker. * Copyright 2016-2019 Miran Grca. + * Copyright 2020 EngiNerd. */ #include #include diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6ada1f11c..294c3f2ea 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -121,7 +121,9 @@ const machine_t machines[] = { { "[ISA] Compaq Portable II", "portableii", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 640, 16384, 128, 127, machine_at_portableii_init, NULL }, { "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_VIDEO, 640, 16384, 128, 127, machine_at_portableiii_init, at_cpqiii_get_device }, { "[ISA] MR 286 clone", "mr286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 512, 16384, 128, 127, machine_at_mr286_init, NULL }, -#if defined(DEV_BRANCH) && defined(USE_OPEN_AT) + { "[ISA] NCR PC8/810/710/3390/3392", "ncr_pc8", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_ncrpc8_init, NULL }, + { "[ISA] Olivetti M290", "olivetti_m290", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 640, 16384, 128, 127, machine_at_olim290_init, NULL }, + #if defined(DEV_BRANCH) && defined(USE_OPEN_AT) { "[ISA] OpenAT", "open_at", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_open_at_init, NULL }, #endif { "[ISA] Phoenix IBM AT", "ibmatpx", MACHINE_TYPE_286, CPU_PKG_286, 0, 6000000, 8000000, 0, 0, 0, 0, MACHINE_AT, 256, 15872, 128, 63, machine_at_ibmatpx_init, NULL }, @@ -131,6 +133,7 @@ const machine_t machines[] = { { "[GC103] Quadtel 286 clone", "quadt286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_quadt286_init, NULL }, { "[GC103] Trigem 286M", "tg286m", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_IDE, 512, 8192, 128, 127, machine_at_tg286m_init, NULL }, { "[NEAT] AMI 286 clone", "ami286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 8192, 128, 127, machine_at_neat_ami_init, NULL }, + { "[NEAT] NCR 3302", "ncr_3302", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_VIDEO, 512, 16384, 128, 127, machine_at_ncr3302_init, NULL }, { "[NEAT] Phoenix 286 clone", "px286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_px286_init, NULL }, { "[SCAT] Award 286 clone", "award286", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_award286_init, NULL }, { "[SCAT] GW-286CT GEAR", "gw286ct", MACHINE_TYPE_286, CPU_PKG_286, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT, 512, 16384, 128, 127, machine_at_gw286ct_init, NULL }, @@ -365,7 +368,7 @@ const machine_t machines[] = { #if defined(DEV_BRANCH) && defined(NO_SIO) { "[i440BX] Fujitsu ErgoPro x365", "ergox365", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 66666667, 100000000, 1800, 3500, 3.5, 5.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 393216, 8192, 511, machine_at_ergox365_init, NULL }, #endif - + /* 440GX */ { "[i440GX] Freeway FW-6400GX", "fw6400gx_s1", MACHINE_TYPE_SLOT1, CPU_PKG_SLOT1, 0, 100000000, 150000000, 1800, 3500, 3.0, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 16384,2080768,16384, 511, machine_at_fw6400gx_init, NULL },