From 55b29db14b5b1423c07fe112a982472a439059c3 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 8 Sep 2020 22:06:28 -0300 Subject: [PATCH] Finish M6117 implementation --- src/cpu/cpu.h | 3 +++ src/cpu/cpu_table.c | 12 ++++++++++++ src/include/86box/chipset.h | 2 +- src/include/86box/machine.h | 5 ++++- src/machine/m_at_286_386sx.c | 26 ++++++++++++++++++++++++++ src/machine/machine_table.c | 5 ++++- src/win/Makefile.mingw | 13 ++++++++++++- 7 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 3e104c15e..9ec85a4df 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -138,6 +138,9 @@ extern CPU cpus_i386SX[]; extern CPU cpus_i386DX[]; extern CPU cpus_Am386SX[]; extern CPU cpus_Am386DX[]; +#if defined(DEV_BRANCH) && defined(USE_M6117) +extern CPU cpus_ALiM6117[]; +#endif extern CPU cpus_486SLC[]; extern CPU cpus_486DLC[]; extern CPU cpus_IBM386SLC[]; diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 03d42af0d..f3ed839db 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -211,6 +211,18 @@ CPU cpus_Am386DX[] = { {"", -1, 0, 0, 0, 0, 0, 0, 0,0,0,0, 0} }; + +#if defined(DEV_BRANCH) && defined(USE_M6117) +/* All M6117 timings and edx_reset values assumed. */ +CPU cpus_ALiM6117[] = { + /*i386DX/RapidCAD*/ + {"M6117/66", CPU_386DX, fpus_80386, 66666666, 1, 0x2308, 0, 0, 0, 3,3,3,3, 2}, + {"M6117/80", CPU_386DX, fpus_80386, 80000000, 1, 0x2308, 0, 0, 0, 4,4,3,3, 3}, + {"", -1, 0, 0, 0, 0, 0, 0, 0,0,0,0, 0} +}; +#endif + + CPU cpus_486SLC[] = { /*Cx486SLC*/ {"Cx486SLC/20", CPU_486SLC, fpus_80386, 20000000, 1, 0x400, 0, 0x0000, 0, 4,4,3,3, 3}, diff --git a/src/include/86box/chipset.h b/src/include/86box/chipset.h index 683491c85..71f3508a1 100644 --- a/src/include/86box/chipset.h +++ b/src/include/86box/chipset.h @@ -26,7 +26,7 @@ extern const device_t ali1429_device; #if defined(DEV_BRANCH) && defined(USE_M1489) extern const device_t ali1489_device; #endif -#if defined(DEV_BRANCH) && defined(USE_STPC) +#if defined(DEV_BRANCH) && defined(USE_M6117) extern const device_t ali6117d_device; #endif diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 4f4ca8e35..b095e59b7 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -241,7 +241,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_awardsx_init(const machine_t *); +extern int machine_at_awardsx_init(const machine_t *); +#if defined(DEV_BRANCH) && defined(USE_M6117) +extern int machine_at_pja511m_init(const machine_t *); +#endif #ifdef EMU_DEVICE_H extern const device_t *at_ama932j_get_device(void); diff --git a/src/machine/m_at_286_386sx.c b/src/machine/m_at_286_386sx.c index 41f0650b0..e9f8662b3 100644 --- a/src/machine/m_at_286_386sx.c +++ b/src/machine/m_at_286_386sx.c @@ -36,6 +36,7 @@ #include <86box/hdc.h> #include <86box/sio.h> #include <86box/video.h> +#include <86box/flash.h> #include <86box/machine.h> int @@ -545,3 +546,28 @@ machine_at_awardsx_init(const machine_t *model) return ret; } + + +#if defined(DEV_BRANCH) && defined(USE_M6117) +int +machine_at_pja511m_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear(L"roms/machines/pja511m/2006915102435734.rom", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + device_add_inst(&fdc37c669_device, 1); + //device_add_inst(&fdc37c669_device, 2); /* enable when dual FDC37C669 is implemented */ + device_add(&keyboard_ps2_ami_pci_device); + device_add(&ali6117d_device); + device_add(&sst_flash_29ee010_device); + + return ret; +} +#endif diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index eb8f62d6f..177b6c2ca 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -179,13 +179,16 @@ const machine_t machines[] = { { "[Intel 82335] Shuttle 386SX", "shuttle386sx", MACHINE_TYPE_386SX, {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 8192, 128, 127, machine_at_shuttle386sx_init, NULL }, { "[Intel 82335] ADI 386SX", "adi386sx", MACHINE_TYPE_386SX, {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 8192, 128, 127, machine_at_adi386sx_init, NULL }, { "[OPTi 291] DTK PPM-3333P", "awardsx", MACHINE_TYPE_386SX, {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 1, 16, 1, 127, machine_at_awardsx_init, NULL }, +#if defined(DEV_BRANCH) && defined(USE_M6117) + { "[ALi M6117D] Acrosser PJ-A511M", "pja511m", MACHINE_TYPE_386SX, {{"ALi", cpus_ALiM6117}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_PS2 | MACHINE_HDC, 1, 64, 1, 127, machine_at_pja511m_init, NULL }, +#endif /* 386SX machines which utilize the MCA bus */ { "[MCA] IBM PS/2 model 55SX", "ibmps2_m55sx", MACHINE_TYPE_386SX, {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"IBM",cpus_IBM486SLC},{"", NULL}}, MACHINE_MCA | MACHINE_AT | MACHINE_PS2 | MACHINE_VIDEO, 1, 8, 1, 63, machine_ps2_model_55sx_init, NULL }, /* 386DX machines */ { "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 16384, 128, 127, machine_at_acc386_init, NULL }, - { "[SiS 310] ASUS ISA-386C", "asus386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 16384, 128, 127, machine_at_asus386_init, NULL }, + { "[SiS 310] ASUS ISA-386C", "asus386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 16384, 128, 127, machine_at_asus386_init, NULL }, { "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_VIDEO, 1, 14, 1, 127, machine_at_portableiii386_init, at_cpqiii_get_device }, { "[ISA] Micronics 386 clone", "micronics386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 8192, 128, 127, machine_at_micronics386_init, NULL }, { "[C&T 386] ECS 386/32", "ecs386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 1, 16, 1, 127, machine_at_ecs386_init, NULL }, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index bdcaf3c6b..bd25e6ca4 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -84,6 +84,9 @@ ifeq ($(DEV_BUILD), y) ifndef M1489 M1489 := y endif + ifndef M6117 + M6117 := y + endif ifndef VGAWONDER VGAWONDER := y endif @@ -163,6 +166,9 @@ else ifndef M1489 M1489 := n endif + ifndef M6117 + M6117 := n + endif ifndef VGAWONDER VGAWONDER := n endif @@ -560,7 +566,7 @@ endif ifeq ($(STPC), y) OPTS += -DUSE_STPC -DEVBROBJ += ali6117.o stpc.o +DEVBROBJ += stpc.o endif ifeq ($(M1489), y) @@ -568,6 +574,11 @@ OPTS += -DUSE_M1489 DEVBROBJ += ali1489.o endif +ifeq ($(M6117), y) +OPTS += -DUSE_M6117 +DEVBROBJ += ali6117.o +endif + ifeq ($(596B), y) OPTS += -DUSE_596B endif