From 028cbe7b4e8a06bfcb7384a76474ed918a28c66e Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 3 Sep 2022 15:55:53 +0600 Subject: [PATCH] NEC V20/V30: Cycle count fixes (#1) * Correct the names of NEC V20/V30 in Settings Make NEC V30 have correct CPU types * Treat NEC V20 as a Intel 8088 variant --- src/cpu/cpu.c | 2 +- src/cpu/cpu_table.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index f91dbdb4d..38bf1d024 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -373,7 +373,7 @@ cpu_set(void) unmask_a20_in_smm = 0; CPUID = cpu_s->cpuid_model; - is8086 = (cpu_s->cpu_type > CPU_8088); + is8086 = (cpu_s->cpu_type > CPU_8088) && !(cpu_s->cpu_type == CPU_V20); 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_V20) || (cpu_s->cpu_type == CPU_V30); is286 = (cpu_s->cpu_type >= CPU_286); diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 6c4311398..97e832ed1 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -137,7 +137,7 @@ const cpu_family_t cpu_families[] = { }, { .package = CPU_PKG_8088, .manufacturer = "NEC", - .name = "NEC V20", + .name = "V20", .internal_name = "necv20", .cpus = (const CPU[]) { {"5", CPU_V20, fpus_8088, 5000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, @@ -167,14 +167,14 @@ const cpu_family_t cpu_families[] = { }, { .package = CPU_PKG_186, .manufacturer = "NEC", - .name = "NEC V30", + .name = "V30", .internal_name = "necv30", .cpus = (const CPU[]) { - {"5", CPU_V20, fpus_80186, 5000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"8", CPU_V20, fpus_80186, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"10", CPU_V20, fpus_80186, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"12", CPU_V20, fpus_80186, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, - {"16", CPU_V20, fpus_80186, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, + {"5", CPU_V30, fpus_80186, 5000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"8", CPU_V30, fpus_80186, 8000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"10", CPU_V30, fpus_80186, 10000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"12", CPU_V30, fpus_80186, 12000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 1}, + {"16", CPU_V30, fpus_80186, 16000000, 1, 5000, 0, 0, 0, 0, 0,0,0,0, 2}, {"", 0} } }, {