From 698d4ce8a7089be17c32f5f215fdd7a006a81406 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 2 Apr 2021 10:15:27 +0300 Subject: [PATCH 1/4] Minor improvements on the ALi M1217 --- src/chipset/ali1217.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/chipset/ali1217.c b/src/chipset/ali1217.c index 878ed81df..66a9faea1 100644 --- a/src/chipset/ali1217.c +++ b/src/chipset/ali1217.c @@ -33,6 +33,7 @@ #include <86box/port_92.h> #include <86box/chipset.h> +#define ENABLE_ALI1217_LOG 1 #ifdef ENABLE_ALI1217_LOG int ali1217_do_log = ENABLE_ALI1217_LOG; static void @@ -57,18 +58,12 @@ typedef struct int cfg_locked; } ali1217_t; -static void ali1217_shadow_recalc(ali1217_t *dev) +static void ali1217_shadow_recalc(int reg_15, ali1217_t *dev) { for (uint8_t i = 0; i < 4; i++) - { - mem_set_mem_state_both(0xc0000 + (i << 15), 0x8000, ((dev->regs[0x14] & (1 << (i * 2))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[0x14] & (1 << ((i * 2) + 1))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY)); - mem_set_mem_state_both(0xe0000 + (i << 15), 0x8000, ((dev->regs[0x15] & (1 << (i * 2))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[0x15] & (1 << ((i * 2) + 1))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY)); - } + mem_set_mem_state_both((reg_15 ? 0xe0000 : 0xc0000) + (i << 15), 0x8000, ((dev->regs[0x14 + reg_15] & (1 << (i * 2))) ? MEM_READ_INTERNAL : MEM_READ_EXTANY) | ((dev->regs[0x14 + reg_15] & (1 << ((i * 2) + 1))) ? MEM_WRITE_INTERNAL : MEM_WRITE_EXTANY)); - shadowbios = !!(dev->regs[0x15] & 5); - shadowbios_write = !!(dev->regs[0x15] & 0x0a); - - flushmmucache(); + flushmmucache_nopc(); } static void @@ -84,8 +79,7 @@ ali1217_write(uint16_t addr, uint8_t val, void *priv) case 0x23: if (dev->index != 0x13) ali1217_log("ALi M1217: dev->regs[%02x] = %02x\n", dev->index, val); - - if (dev->index == 0x13) + else dev->cfg_locked = !(val == 0xc5); if (!dev->cfg_locked) @@ -93,7 +87,7 @@ ali1217_write(uint16_t addr, uint8_t val, void *priv) dev->regs[dev->index] = val; if ((dev->index == 0x14) || (dev->index == 0x15)) - ali1217_shadow_recalc(dev); + ali1217_shadow_recalc(dev->index & 1, dev); } break; } @@ -104,7 +98,7 @@ ali1217_read(uint16_t addr, void *priv) { ali1217_t *dev = (ali1217_t *)priv; - return !(addr == 0x22) ? dev->regs[dev->index] : dev->index; + return (addr == 0x23) ? dev->regs[dev->index] : 0xff; } static void @@ -134,7 +128,6 @@ ali1217_init(const device_t *info) */ io_sethandler(0x0022, 0x0002, ali1217_read, NULL, NULL, ali1217_write, NULL, NULL, dev); - ali1217_shadow_recalc(dev); return dev; } From 405b613667f68983833fabf647956b34d070cd40 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 2 Apr 2021 10:16:11 +0300 Subject: [PATCH 2/4] Disable logging --- src/chipset/ali1217.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chipset/ali1217.c b/src/chipset/ali1217.c index 66a9faea1..ab05ac0a0 100644 --- a/src/chipset/ali1217.c +++ b/src/chipset/ali1217.c @@ -33,7 +33,7 @@ #include <86box/port_92.h> #include <86box/chipset.h> -#define ENABLE_ALI1217_LOG 1 + #ifdef ENABLE_ALI1217_LOG int ali1217_do_log = ENABLE_ALI1217_LOG; static void From f29cd37b35d30dc28baa7d2493befab785838a7f Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 2 Apr 2021 10:18:51 +0300 Subject: [PATCH 3/4] Minor fix for the UMC HB4 --- src/chipset/umc_hb4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chipset/umc_hb4.c b/src/chipset/umc_hb4.c index 44f2d4c0e..f9371ae5f 100644 --- a/src/chipset/umc_hb4.c +++ b/src/chipset/umc_hb4.c @@ -141,6 +141,8 @@ void hb4_shadow(int cur_addr, hb4_t *dev) mem_set_mem_state_both(0xc8000 + ((i - 2) << 14), 0x4000, (dev->pci_conf[0x54] & (1 << i)) ? (CAN_READ | CAN_WRITE) : DISABLE); mem_set_mem_state_both(0xe0000, 0x20000, CAN_READ | CAN_WRITE); + + flushmmucache_nopc(); } static void From 14600e0ab3ce48c303d8bdcca793a8492f200983 Mon Sep 17 00:00:00 2001 From: Panagiotis <58827426+tiseno100@users.noreply.github.com> Date: Fri, 2 Apr 2021 11:44:41 +0300 Subject: [PATCH 4/4] Fixed VIA Eden's name --- src/cpu/cpu_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu/cpu_table.c b/src/cpu/cpu_table.c index 56685cbf8..407021c0f 100644 --- a/src/cpu/cpu_table.c +++ b/src/cpu/cpu_table.c @@ -970,7 +970,7 @@ const cpu_family_t cpu_families[] = { }, { .package = CPU_PKG_EBGA368, .manufacturer = "VIA", - .name = "Eden(Model 7)", + .name = "Eden Model 7", .internal_name = "c3_eden", .cpus = (const CPU[]) { {"100", CPU_EDEN, fpus_internal, 100000000, 1.5, 2050, 0x673, 0x673, 0, CPU_SUPPORTS_DYNAREC | CPU_FIXED_MULTIPLIER, 9, 9, 4, 4, 12}, /* out of spec */