Add initial Mazovia 1016 emulation

This commit is contained in:
Adrian Siekierka
2024-12-22 13:52:25 +01:00
parent 8f25851406
commit eb25bccf1e
7 changed files with 128 additions and 26 deletions

View File

@@ -240,13 +240,13 @@ cpu_io(int bits, int out, uint16_t port)
int old_cycles = cycles; int old_cycles = cycles;
if (out) { if (out) {
wait(4, 1); wait(is_mazovia ? 5 : 4, 1);
if (bits == 16) { if (bits == 16) {
if (is8086 && !(port & 1)) { if (is8086 && !(port & 1)) {
old_cycles = cycles; old_cycles = cycles;
outw(port, AX); outw(port, AX);
} else { } else {
wait(4, 1); wait(is_mazovia ? 5 : 4, 1);
old_cycles = cycles; old_cycles = cycles;
outb(port++, AL); outb(port++, AL);
outb(port, AH); outb(port, AH);
@@ -256,13 +256,13 @@ cpu_io(int bits, int out, uint16_t port)
outb(port, AL); outb(port, AL);
} }
} else { } else {
wait(4, 1); wait(is_mazovia ? 5 : 4, 1);
if (bits == 16) { if (bits == 16) {
if (is8086 && !(port & 1)) { if (is8086 && !(port & 1)) {
old_cycles = cycles; old_cycles = cycles;
AX = inw(port); AX = inw(port);
} else { } else {
wait(4, 1); wait(is_mazovia ? 5 : 4, 1);
old_cycles = cycles; old_cycles = cycles;
AL = inb(port++); AL = inb(port++);
AH = inb(port); AH = inb(port);

View File

@@ -203,6 +203,7 @@ int cpu_override_interpreter;
int CPUID; int CPUID;
int is186; int is186;
int is_mazovia;
int is_nec; int is_nec;
int is286; int is286;
int is386; int is386;
@@ -517,6 +518,7 @@ cpu_set(void)
CPUID = cpu_s->cpuid_model; CPUID = cpu_s->cpuid_model;
is8086 = (cpu_s->cpu_type > CPU_8088) && (cpu_s->cpu_type != CPU_V20) && (cpu_s->cpu_type != CPU_188); is8086 = (cpu_s->cpu_type > CPU_8088) && (cpu_s->cpu_type != CPU_V20) && (cpu_s->cpu_type != CPU_188);
is_mazovia = (cpu_s->cpu_type == CPU_8086_MAZOVIA);
is_nec = (cpu_s->cpu_type == CPU_V20) || (cpu_s->cpu_type == CPU_V30); is_nec = (cpu_s->cpu_type == CPU_V20) || (cpu_s->cpu_type == CPU_V30);
is186 = (cpu_s->cpu_type == CPU_186) || (cpu_s->cpu_type == CPU_188) || (cpu_s->cpu_type == CPU_V20) || (cpu_s->cpu_type == CPU_V30); is186 = (cpu_s->cpu_type == CPU_186) || (cpu_s->cpu_type == CPU_188) || (cpu_s->cpu_type == CPU_V20) || (cpu_s->cpu_type == CPU_V30);
is286 = (cpu_s->cpu_type >= CPU_286); is286 = (cpu_s->cpu_type >= CPU_286);
@@ -767,6 +769,7 @@ cpu_set(void)
switch (cpu_s->cpu_type) { switch (cpu_s->cpu_type) {
case CPU_8088: case CPU_8088:
case CPU_8086: case CPU_8086:
case CPU_8086_MAZOVIA:
break; break;
case CPU_V20: case CPU_V20:

View File

@@ -35,6 +35,7 @@ enum {
enum { enum {
CPU_8088 = 1, /* 808x class CPUs */ CPU_8088 = 1, /* 808x class CPUs */
CPU_8086, CPU_8086,
CPU_8086_MAZOVIA,
CPU_V20, /* NEC 808x class CPUs */ CPU_V20, /* NEC 808x class CPUs */
CPU_V30, CPU_V30,
CPU_188, /* 18x class CPUs */ CPU_188, /* 18x class CPUs */
@@ -87,28 +88,29 @@ enum {
CPU_PKG_8088 = (1 << 0), CPU_PKG_8088 = (1 << 0),
CPU_PKG_8088_EUROPC = (1 << 1), CPU_PKG_8088_EUROPC = (1 << 1),
CPU_PKG_8086 = (1 << 2), CPU_PKG_8086 = (1 << 2),
CPU_PKG_188 = (1 << 3), CPU_PKG_8086_MAZOVIA = (1 << 3),
CPU_PKG_186 = (1 << 4), CPU_PKG_188 = (1 << 4),
CPU_PKG_286 = (1 << 5), CPU_PKG_186 = (1 << 5),
CPU_PKG_386SX = (1 << 6), CPU_PKG_286 = (1 << 6),
CPU_PKG_386DX = (1 << 7), CPU_PKG_386SX = (1 << 7),
CPU_PKG_386DX_DESKPRO386 = (1 << 8), CPU_PKG_386DX = (1 << 8),
CPU_PKG_M6117 = (1 << 9), CPU_PKG_386DX_DESKPRO386 = (1 << 9),
CPU_PKG_386SLC_IBM = (1 << 10), CPU_PKG_M6117 = (1 << 10),
CPU_PKG_486SLC = (1 << 11), CPU_PKG_386SLC_IBM = (1 << 11),
CPU_PKG_486SLC_IBM = (1 << 12), CPU_PKG_486SLC = (1 << 12),
CPU_PKG_486BL = (1 << 13), CPU_PKG_486SLC_IBM = (1 << 13),
CPU_PKG_486DLC = (1 << 14), CPU_PKG_486BL = (1 << 14),
CPU_PKG_SOCKET1 = (1 << 15), CPU_PKG_486DLC = (1 << 15),
CPU_PKG_SOCKET3 = (1 << 16), CPU_PKG_SOCKET1 = (1 << 16),
CPU_PKG_SOCKET3_PC330 = (1 << 17), CPU_PKG_SOCKET3 = (1 << 17),
CPU_PKG_STPC = (1 << 18), CPU_PKG_SOCKET3_PC330 = (1 << 18),
CPU_PKG_SOCKET4 = (1 << 19), CPU_PKG_STPC = (1 << 19),
CPU_PKG_SOCKET5_7 = (1 << 20), CPU_PKG_SOCKET4 = (1 << 20),
CPU_PKG_SOCKET8 = (1 << 21), CPU_PKG_SOCKET5_7 = (1 << 21),
CPU_PKG_SLOT1 = (1 << 22), CPU_PKG_SOCKET8 = (1 << 22),
CPU_PKG_SLOT2 = (1 << 23), CPU_PKG_SLOT1 = (1 << 23),
CPU_PKG_SOCKET370 = (1 << 24) CPU_PKG_SLOT2 = (1 << 24),
CPU_PKG_SOCKET370 = (1 << 25)
}; };
#define CPU_SUPPORTS_DYNAREC 1 #define CPU_SUPPORTS_DYNAREC 1
@@ -518,6 +520,7 @@ extern int is_p6;
extern int is_cxsmm; extern int is_cxsmm;
extern int hascache; extern int hascache;
extern int isibm486; extern int isibm486;
extern int is_mazovia;
extern int is_nec; extern int is_nec;
extern int is_rapidcad; extern int is_rapidcad;
extern int hasfpu; extern int hasfpu;

View File

@@ -373,6 +373,32 @@ const cpu_family_t cpu_families[] = {
{ .name = "", 0 } { .name = "", 0 }
} }
}, },
{
.package = CPU_PKG_8086_MAZOVIA,
.manufacturer = "Kyiv Research Institute of Microdevices",
.name = "K1810VM86",
.internal_name = "8086_mazovia",
.cpus = (const CPU[]) {
{
.name = "4.77",
.cpu_type = CPU_8086_MAZOVIA,
.fpus = fpus_8088,
.rspeed = 4772728,
.multi = 1,
.voltage = 5000,
.edx_reset = 0,
.cpuid_model = 0,
.cyrix_id = 0,
.cpu_flags = CPU_ALTERNATE_XTAL,
.mem_read_cycles = 0,
.mem_write_cycles = 0,
.cache_read_cycles = 0,
.cache_write_cycles = 0,
.atclk_div = 1
},
{ .name = "", 0 }
}
},
{ {
.package = CPU_PKG_188, .package = CPU_PKG_188,
.manufacturer = "Intel", .manufacturer = "Intel",

View File

@@ -939,6 +939,7 @@ extern int machine_xt_iskra3104_init(const machine_t *);
extern int machine_xt_pravetz16_imko4_init(const machine_t *); extern int machine_xt_pravetz16_imko4_init(const machine_t *);
extern int machine_xt_pravetz16s_cpu12p_init(const machine_t *); extern int machine_xt_pravetz16s_cpu12p_init(const machine_t *);
extern int machine_xt_micoms_xl7turbo_init(const machine_t *); extern int machine_xt_micoms_xl7turbo_init(const machine_t *);
extern int machine_xt_maz1016_init(const machine_t *);
/* m_xt_compaq.c */ /* m_xt_compaq.c */
extern int machine_xt_compaq_deskpro_init(const machine_t *); extern int machine_xt_compaq_deskpro_init(const machine_t *);

View File

@@ -19,6 +19,7 @@
#include <86box/machine.h> #include <86box/machine.h>
#include <86box/chipset.h> #include <86box/chipset.h>
#include <86box/port_6x.h> #include <86box/port_6x.h>
#include <86box/video.h>
extern const device_t vendex_xt_rtc_onboard_device; extern const device_t vendex_xt_rtc_onboard_device;
@@ -330,6 +331,35 @@ machine_xt_iskra3104_init(const machine_t *model)
return ret; return ret;
} }
int
machine_xt_maz1016_init(const machine_t *model)
{
int ret;
ret = bios_load_interleaved("roms/machines/maz1016/e1.bin",
"roms/machines/maz1016/e4.bin",
0x000fc000, 49152, 0);
if (ret) {
bios_load_aux_interleaved("roms/machines/maz1016/e2.bin",
"roms/machines/maz1016/e5.bin",
0x000f8000, 16384, 0);
bios_load_aux_interleaved("roms/machines/maz1016/e3.bin",
"roms/machines/maz1016/e6b.bin",
0x000f4000, 16384, 0);
}
if (bios_only || !ret)
return ret;
loadfont("roms/machines/maz1016/crt-8.bin", 0);
machine_xt_clone_init(model, 0);
return ret;
}
int int
machine_xt_pravetz16_imko4_init(const machine_t *model) machine_xt_pravetz16_imko4_init(const machine_t *model)
{ {

View File

@@ -2283,6 +2283,45 @@ const machine_t machines[] = {
.snd_device = NULL, .snd_device = NULL,
.net_device = NULL .net_device = NULL
}, },
{
.name = "[8086] Mazovia 1016",
.internal_name = "maz1016",
.type = MACHINE_TYPE_8086,
.chipset = MACHINE_CHIPSET_DISCRETE,
.init = machine_xt_maz1016_init,
.p1_handler = NULL,
.gpio_handler = NULL,
.available_flag = MACHINE_AVAILABLE,
.gpio_acpi_handler = NULL,
.cpu = {
.package = CPU_PKG_8086_MAZOVIA,
.block = CPU_BLOCK_NONE,
.min_bus = 0,
.max_bus = 0,
.min_voltage = 0,
.max_voltage = 0,
.min_multi = 0,
.max_multi = 0
},
.bus_flags = MACHINE_PC,
.flags = MACHINE_FLAGS_NONE,
.ram = {
.min = 256,
.max = 640,
.step = 384
},
.nvrmask = 0,
.kbc_device = &keyboard_xtclone_device,
.kbc_p1 = 0xff,
.gpio = 0xffffffff,
.gpio_acpi = 0xffffffff,
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.snd_device = NULL,
.net_device = NULL
},
{ {
.name = "[8086] Olivetti M21/24/24SP", .name = "[8086] Olivetti M21/24/24SP",
.internal_name = "m24", .internal_name = "m24",