diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 9aac75d6a..7276ae087 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -35,6 +35,7 @@ #include <86box/rom.h> #include <86box/fdd.h> #include <86box/fdc.h> +#include <86box/fdc_ext.h> #include <86box/hdc.h> #include <86box/sio.h> #include <86box/serial.h> @@ -671,50 +672,9 @@ machine_at_pja511m_init(const machine_t *model) } #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 + * - soft-reboot after saving CMOS settings/pressing ctrl-alt-del produces an 8042 error */ int machine_at_ncrpc8_init(const machine_t *model) @@ -730,14 +690,23 @@ machine_at_ncrpc8_init(const machine_t *model) machine_at_common_init(model); device_add(&keyboard_at_ncr_device); - device_add(&fdc_at_device); + mem_remap_top(384); + + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); return ret; } +const device_t * +at_ncr3302_get_device(void) +{ + return ¶dise_pvga1a_ncr3302_device; +} + /* * Current bugs: - * - ctrl-alt-del produces an 8042 error + * - soft-reboot after saving CMOS settings/pressing ctrl-alt-del produces an 8042 error */ int machine_at_ncr3302_init(const machine_t *model) @@ -758,10 +727,226 @@ machine_at_ncr3302_init(const machine_t *model) machine_at_common_ide_init(model); device_add(&neat_device); device_add(&keyboard_at_ncr_device); - device_add(&fdc_at_device); + + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); if (gfxcard == VID_INTERNAL) - device_add(¶dise_pvga1a_device); + device_add(¶dise_pvga1a_ncr3302_device); return ret; } + + +/* + * Current bugs: + * - soft-reboot after saving CMOS settings/pressing ctrl-alt-del produces an 8042 error + */ +int +machine_at_ncrpc916sx_init(const machine_t *model) +{ + int ret; + + ret = bios_load_interleaved(L"roms/machines/ncr_pc916sx/ncr_386sx_u46-17_7.3.bin", + L"roms/machines/ncr_pc916sx/ncr_386sx_u12-19_7.3.bin", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + device_add(&keyboard_at_ncr_device); + mem_remap_top(384); + + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); + + + return ret; +} + +/* + * Current bugs: + * - no EMS management due to missing chipset implementation (custom ASIC) + */ +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_olivetti_device); + + if (fdc_type == FDC_INTERNAL) + device_add(&fdc_at_device); + + device_add(&olivetti_m290_registers_device); + + return ret; +} + + +/* + * Current bugs: + * - no EMS management due to missing chipset implementation (unidentified chip) + */ +int +machine_at_olim290s_init(const machine_t *model) +{ + int ret; + + ret = bios_load_interleaved(L"roms/machines/olivetti_m290s/286-olivetti-m203-low.bin", + L"roms/machines/olivetti_m290s/286-olivetti-m203-high.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + /* replace with correct chipset implementation */ + mem_remap_top(384); + + device_add(&keyboard_ps2_olivetti_device); + device_add(&fdc_at_device); + + /* should use custom BIOS */ + if (gfxcard == VID_INTERNAL) + device_add(¶dise_pvga1a_device); + + return ret; +} + +const device_t * +at_m300_08_get_device(void) +{ + return &oti067_m300_device; +} + +int +machine_at_olim300_08_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/olivetti_m300_08/BIOS.ROM", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + device_add(&opti283_device); + device_add(&keyboard_ps2_olivetti_device); + device_add(&pc87310_ide_device); + + if (gfxcard == VID_INTERNAL) + device_add(&oti067_m300_device); + + return ret; +} + +/* Almost identical to M300-08, save for CPU speed, VRAM, and BIOS identification string */ +int +machine_at_olim300_15_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/olivetti_m300_15/BIOS.ROM", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + device_add(&opti283_device); + device_add(&keyboard_ps2_olivetti_device); + device_add(&pc87310_ide_device); + + /* Stock VRAM is maxed out, so no need to expose video card config */ + if (gfxcard == VID_INTERNAL) + device_add(&oti067_m300_device); + + return ret; +} + + +/* + * Current bugs: + * - soft-reboot causes a fatal error + * - BIOS complains about FPU if not installed, pressing F1 allows to continue booting. + * - BIOS throws a cache memory error (since L2 cache is not implemented yet), pressing F1 allows to continue booting. + * - no shadow memory due to missing chipset implementation (custom ASIC) + */ +//todo: check if fdc can be disabled +int +machine_at_olim300_10_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/olivetti_m300_10/BIOS.ROM", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + /* replace with correct chipset implementation */ + mem_remap_top(384); + + device_add(&keyboard_ps2_olivetti_device); + /* fdc should be dp8473, however it does not work. Instead, standard AT fdc works. */ + device_add(&fdc_at_device); + + /* should be a PVGA1B/WD90C00 with custom BIOS */ + if (gfxcard == VID_INTERNAL) + device_add(¶dise_wd90c11_device); + + + return ret; +} + +/* + * Current bugs: + * - soft-reboot causes a fatal error + * - BIOS complains about FPU if not installed, pressing F1 allows to continue booting. + * - no shadow memory due to missing chipset implementation (custom ASIC) + */ +int +machine_at_olim300_05_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/olivetti_m300_05/BIOS.ROM", + 0x000f0000, 65536, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_ide_init(model); + + /* replace with correct chipset implementation */ + mem_remap_top(384); + + device_add(&keyboard_ps2_olivetti_device); + /* fdc should be dp8473, however it does not work. Instead, standard AT fdc works. */ + device_add(&fdc_at_device); + + /* should be a PVGA1B/WD90C00 with custom BIOS */ + if (gfxcard == VID_INTERNAL) + device_add(¶dise_wd90c11_device); + + + return ret; +} + +